Use tempdir for output in run_quick.py to improve efficiency with network storage #520
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses issue #[issue_number] by modifying
run_quick.pyto use a temporary directory for the workflow output, improving efficiency when using network drives for storage.Changes
Previously,
run_quick.pyalready used a temporary directory for creating the input BIDS dataset, but wrote workflow output directly to the final output directory. This could cause significant performance degradation when the output directory is on network storage (e.g., NFS, CIFS), as all intermediate files and workflow I/O would traverse the network.Now, the workflow writes to a temporary output directory (a subdirectory within the same
temp_dirused for input), and only the final subject results (hippunfold/sub-{subject}/) are copied to the final output location after successful completion.Key Implementation Details
temp_dir/output/alongside the temporary input BIDS datasethippunfold/sub-{subject}/to the final output directoryExample
Workflow execution (local disk):
Final output (network storage):
Benefits
work/,logs/,.snakemake/)Testing
blackandisortOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.