Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion petprep/workflows/pet/hmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ def init_pet_hmc_wf(
inputnode.inputs.frame_start_times = frame_start_times
outputnode = pe.Node(niu.IdentityInterface(fields=['xforms', 'petref']), name='outputnode')

robust_template_threads = min(omp_nthreads, 4)
robust_template_mem_gb = min(mem_gb, 16)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the actual memory usage of mri_robust_template? Does it keep usage below 16GB? Note that what you're making here is a claim that the process will consume <=16GB of memory, and nipype will schedule accordingly. There is nothing in nipype that will stop the process from consuming more memory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see - then this will not work as intended, and will depend on the input data. Will need to come up with a smarter way of estimating the memory use of mri_robust_template given the input data, and then ideally simplify the mri_robust_template call e.g. by fixing the reference frame.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but putting the memory aside, but do you think of the changes regarding the processors? I have experienced that this workflow often not run in parallel despite plenty of resources being available.


# Split frames
split = pe.Node(fs.MRIConvert(out_type='niigz', split=True), name='split_frames')

Expand Down Expand Up @@ -313,11 +316,13 @@ def num_files(filelist):
intensity_scaling=True,
average_metric='mean',
args='--cras',
num_threads=omp_nthreads,
num_threads=robust_template_threads,
fixed_timepoint=fixed_frame,
no_iteration=fixed_frame,
),
name='est_robust_hmc',
n_procs=robust_template_threads,
mem_gb=robust_template_mem_gb,
)
if not auto_init_frame:
robust_template.inputs.initial_timepoint = int(initial_frame) + 1
Expand Down