Skip to content

Commit 103bf84

Browse files
authored
Merge pull request #1870 from mgxd/fix/omp-threads
fix: contain environmental variable to interface
2 parents 6cd9bb2 + f94a82c commit 103bf84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nipype/interfaces/afni/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,11 @@ def __init__(self, **inputs):
160160
else:
161161
self._output_update()
162162

163+
def _run_interface(self, runtime):
163164
# Update num threads estimate from OMP_NUM_THREADS env var
164165
# Default to 1 if not set
165-
os.environ['OMP_NUM_THREADS'] = str(self.num_threads)
166+
self.inputs.environ['OMP_NUM_THREADS'] = str(self.num_threads)
167+
return super(AFNICommand, self)._run_interface(runtime)
166168

167169
def _output_update(self):
168170
""" i think? updates class private attribute based on instance input

0 commit comments

Comments
 (0)