Skip to content

Commit 31a4952

Browse files
committed
retrieve num_threads from Interface object
1 parent 4fdce5c commit 31a4952

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nipype/pipeline/engine/nodes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ def __init__(self, interface, name, iterables=None, itersource=None,
175175

176176
self._mem_gb = mem_gb
177177
self._n_procs = n_procs
178-
if hasattr(self.inputs, 'num_threads') and self._n_procs is not None:
179-
self.inputs.num_threads = self._n_procs
178+
if hasattr(self._interface.inputs, 'num_threads') and self._n_procs is not None:
179+
self._interface.inputs.num_threads = self._n_procs
180180

181181
if needed_outputs:
182182
self.needed_outputs = sorted(needed_outputs)
@@ -221,8 +221,9 @@ def n_procs(self):
221221
"""Get the estimated number of processes/threads"""
222222
if self._n_procs is not None:
223223
return self._n_procs
224-
elif hasattr(self.inputs, 'num_threads') and isdefined(self.inputs.num_threads):
225-
return self.inputs.num_threads
224+
elif hasattr(self._interface.inputs, 'num_threads') and isdefined(
225+
self._interface.inputs.num_threads):
226+
return self._interface.inputs.num_threads
226227
else:
227228
return 1
228229

0 commit comments

Comments
 (0)