Skip to content

OMP_NUM_THREADS is set default to 1 for all nodes because of AFNI interfaces #1728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bpinsard opened this issue Dec 1, 2016 · 1 comment
Labels

Comments

@bpinsard
Copy link
Contributor

bpinsard commented Dec 1, 2016

I have problem having multi-threaded (numpy MKL) code running on multiple cores when launched through nipype, but not outside nipype.
The faulty line here changes environment variable, thus affecting all other interface, even when submitted through plugin such as SGE:

os.environ['OMP_NUM_THREADS'] = str(self.num_threads)

I temporarily circumvented it, but how should it be changed?

Thanks.

@chrisgorgo
Copy link
Member

Good catch. To contain the change to one interface I would suggest replacing this line with:

self.inputs.environ['OMP_NUM_THREADS'] = str(self.num_threads)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants