Skip to content

Commit

Permalink
Merge pull request #7 from frheault/limit_executor
Browse files Browse the repository at this point in the history
Copy executor routine from tractoflow
  • Loading branch information
arnaudbore authored Apr 8, 2021
2 parents 3573e08 + ef3928a commit 36b293b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 26 deletions.
54 changes: 28 additions & 26 deletions USAGE
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,34 @@ nextflow run main.nf --input ... [OPTIONAL_ARGUMENTS]

DESCRIPTION

--input=/path/to/[root] Root folder containing multiple subjects

[root]
├── S1
│ ├── *fa.nii.gz
│ └── *tracking.trk
└── S2
└── *

--atlas_config Path to json config file
--atlas_anat Path to reference anatomy of the atlas
--atlas_directory Path of the folder containing all atlases

NOTES

OPTIONAL ARGUMENTS (current value)
--atlas_centroids Folder containing centroids (trk) for future tractometry (Must have the same filename as in the atlas_config)

--multi_parameters Number of executions for the multi-parameters ($multi_parameters)
--minimal_vote_ratio Percentage of the vote to obtain in order to be considered valid ($minimal_vote_ratio)
--wb_clustering_thr List of distance (mm) for QBx whole brain clustreing ($wb_clustering_thr)
--seeds List of random seeds values for the rng ($seeds)
--outlier_alpha Remove spurious streamlines based on shape ($outlier_alpha)

--register_processes Number of processes for registration task ($register_processes).
--rbx_processes Number of processes for bundle recognition task ($rbx_processes).
--input=/path/to/[root] Root folder containing multiple subjects

[root]
├── S1
│ ├── *fa.nii.gz
│ └── *tracking.trk
└── S2
└── *

--atlas_config Path to json config file
--atlas_anat Path to reference anatomy of the atlas
--atlas_directory Path of the folder containing all atlases

NOTES

OPTIONAL ARGUMENTS (current value)
--atlas_centroids Folder containing centroids (trk) for future tractometry (Must have the same filename as in the atlas_config)

--multi_parameters Number of executions for the multi-parameters ($multi_parameters)
--minimal_vote_ratio Percentage of the vote to obtain in order to be considered valid ($minimal_vote_ratio)
--wb_clustering_thr List of distance (mm) for QBx whole brain clustreing ($wb_clustering_thr)
--seeds List of random seeds values for the rng ($seeds)
--outlier_alpha Remove spurious streamlines based on shape ($outlier_alpha)

--register_processes Number of processes for registration task ($register_processes).
--rbx_processes Number of processes for bundle recognition task ($rbx_processes).
--processes The number of parallel processes to launch ($cpu_count).
Only affects the local scheduler.

Use '-C config_file.config' to specify a non-default configuration file.
The '-C config_file.config' must be inserted after the nextflow call
Expand Down
13 changes: 13 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ params {
params.rbx_memory_limit='8 GB'
}

if(params.processes) {
if(params.processes > Runtime.runtime.availableProcessors()) {
throw new RuntimeException("Number of processes higher than available CPUs.")
}
else if(params.processes < 1) {
throw new RuntimeException("When set, number of processes must be >= 1 " +
"and smaller or equal to the number of CPUs.")
}
else {
executor.$local.cpus = params.processes
}
}

singularity.autoMounts = true

profiles {
Expand Down

0 comments on commit 36b293b

Please sign in to comment.