Skip to content

Commit

Permalink
enh: catch up with the new asyncio implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
oesteban committed Aug 10, 2024
1 parent 576bfb9 commit 28e2bf8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mriqc/workflows/functional/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,16 @@ def hmc(name='fMRI_HMC', omp_nthreads=None):

# Apply transforms to other echos
apply_hmc = pe.MapNode(
niu.Function(function=_apply_transforms, input_names=['in_file', 'in_xfm']),
niu.Function(
function=_apply_transforms,
input_names=['in_file', 'in_xfm', 'max_concurrent'],
),
name='apply_hmc',
iterfield=['in_file'],
# NiTransforms is a memory hog, so ensure only one process is running at a time
n_procs=config.environment.cpu_count,
)
apply_hmc.inputs.max_concurrent = 4

# fmt: off
workflow.connect([
Expand Down Expand Up @@ -815,7 +819,7 @@ def _parse_tout(in_file):
return data.mean()


def _apply_transforms(in_file, in_xfm):
def _apply_transforms(in_file, in_xfm, max_concurrent):
from pathlib import Path

from nitransforms.linear import load
Expand All @@ -828,6 +832,7 @@ def _apply_transforms(in_file, in_xfm):
in_file,
dtype_width=4,
serialize_nvols=2,
max_concurrent=max_concurrent,
)
out_file = derive_bids_fname(
in_file,
Expand Down

0 comments on commit 28e2bf8

Please sign in to comment.