Skip to content

Commit 2d325b4

Browse files
committed
Updated OpenMP warning to use the PyClaw logging. This prints to the console and to the log file.
1 parent 44230e8 commit 2d325b4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/pyclaw/classic/solver.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,15 +610,17 @@ def __init__(self, riemann_solver=None, claw_package=None):
610610
self.aux2 = None
611611
self.aux3 = None
612612
self.work = None
613+
self.nthreads = None
614+
615+
super(ClawSolver3D,self).__init__(riemann_solver, claw_package)
613616

614617
import os
615-
import warnings
616618
if 'OMP_NUM_THREADS' not in os.environ:
617-
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).")
619+
self.logger.warn(""""The env variable 'OMP_NUM_THREADS' is unset.
620+
Set this variable to use OpenMP with more
621+
than 1 thread (i.e. export OMP_NUM_THREADS=4).""")
618622
self.nthreads = int(os.environ.get('OMP_NUM_THREADS',1))
619623

620-
super(ClawSolver3D,self).__init__(riemann_solver, claw_package)
621-
622624
# ========== Setup routine =============================
623625
def _allocate_workspace(self,solution):
624626
r"""

0 commit comments

Comments
 (0)