From 44230e85a024a5a754eab25ac0c7f4102002f140 Mon Sep 17 00:00:00 2001 From: Wes Lowrie Date: Thu, 5 Nov 2015 09:43:21 -0800 Subject: [PATCH] small simplification to OMP_NUM_THREADS env variable check. --- src/pyclaw/classic/solver.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pyclaw/classic/solver.py b/src/pyclaw/classic/solver.py index af9b94523..642320912 100644 --- a/src/pyclaw/classic/solver.py +++ b/src/pyclaw/classic/solver.py @@ -613,9 +613,7 @@ def __init__(self, riemann_solver=None, claw_package=None): import os import warnings - if 'OMP_NUM_THREADS' in os.environ: - pass # Using OpenMP - else: + if 'OMP_NUM_THREADS' not in os.environ: warnings.warn("The environment variable 'OMP_NUM_THREADS' is unset. Set this variable to use OpenMP with more than 1 thread (i.e. export OMP_NUM_THREADS=4).") self.nthreads = int(os.environ.get('OMP_NUM_THREADS',1))