Skip to content
Merged
Changes from 1 commit
Commits
File filter

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: 5 additions & 2 deletions nipype/interfaces/niftyreg/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ def exists(self):
def _run_interface(self, runtime):
# Update num threads estimate from OMP_NUM_THREADS env var
# Default to 1 if not set
if not isdefined(self.inputs.environ['OMP_NUM_THREADS']):
self.inputs.environ['OMP_NUM_THREADS'] = self.num_threads
omp_key = 'OMP_NUM_THREADS'
if omp_key in os.environ:
Copy link
Contributor

@oesteban oesteban May 10, 2017

Choose a reason for hiding this comment

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

I'd suggest this instead of the if .. else:
self.inputs.environ[omp_key] = os.getenv(omp_key, '%d' % self.num_threads)

self.inputs.environ[omp_key] = os.environ[omp_key]
else:
self.inputs.environ[omp_key] = str(self.num_threads)
return super(NiftyRegCommand, self)._run_interface(runtime)

def _format_arg(self, name, spec, value):
Expand Down