From 97579c6e2a0c15eead9d9d206e34ecaeacc9a2e9 Mon Sep 17 00:00:00 2001 From: theos <theo.steininger@ultimanet.de> Date: Sat, 15 Oct 2016 01:52:32 +0200 Subject: [PATCH] Made environmental variable NIFTY_FFTW_THREADS optional. --- rg/nifty_fft.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rg/nifty_fft.py b/rg/nifty_fft.py index 1a5bac234..44dc6e214 100644 --- a/rg/nifty_fft.py +++ b/rg/nifty_fft.py @@ -381,6 +381,11 @@ class _fftw_plan_and_info(object): self.local_node_dimensions, self.offsetQ)) + try: + threads = int(os.environ['NIFTY_FFTW_THREADS']) + except(KeyError): + threads = 1 + self.set_plan( pyfftw.create_mpi_plan( input_shape=self.global_input_shape, @@ -388,7 +393,7 @@ class _fftw_plan_and_info(object): output_dtype=self.output_dtype, direction=self.direction, flags=["FFTW_ESTIMATE"], - threads=int(os.environ['MY_FFTW_THREADS']), + threads=threads, **kwargs) ) -- GitLab