Skip to content

Commit

Permalink
Revert "Merge pull request #3085 from ESMCI/azamat/threading/dont-set…
Browse files Browse the repository at this point in the history
…-threads-for-mpi-only-runs"

This reverts commit 89fad14, reversing
changes made to 5c43a15.
  • Loading branch information
jgfouca committed Jun 10, 2019
1 parent b0a787b commit 1878414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 2 additions & 8 deletions scripts/lib/CIME/case/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,7 @@ def initialize_derived_attributes(self):
threads_per_core = 1 if (threads_per_node <= max_mpitasks_per_node) else smt_factor
self.cores_per_task = self.thread_count / threads_per_core

if self.get_build_threaded():
os.environ["OMP_NUM_THREADS"] = str(self.thread_count)
elif "OMP_NUM_THREADS" in os.environ:
del os.environ["OMP_NUM_THREADS"]
os.environ["OMP_NUM_THREADS"] = str(self.thread_count)

self.srun_binding = smt_factor*max_mpitasks_per_node / self.tasks_per_node

Expand Down Expand Up @@ -1428,10 +1425,7 @@ def load_env(self, reset=False, job=None, verbose=False):
if not self._is_env_loaded or reset:
if job is None:
job = self.get_primary_job()
if self.get_build_threaded():
os.environ["OMP_NUM_THREADS"] = str(self.thread_count)
elif "OMP_NUM_THREADS" in os.environ:
del os.environ["OMP_NUM_THREADS"]
os.environ["OMP_NUM_THREADS"] = str(self.thread_count)
env_module = self.get_env("mach_specific")
env_module.load_env(self, job=job, verbose=verbose)
self._is_env_loaded = True
Expand Down
5 changes: 1 addition & 4 deletions scripts/lib/CIME/case/case_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ def _run_model_impl(case, lid, skip_pnl=False, da_cycle=0):
model = case.get_value("MODEL")

# Set OMP_NUM_THREADS
if case.get_build_threaded():
os.environ["OMP_NUM_THREADS"] = str(case.thread_count)
elif "OMP_NUM_THREADS" in os.environ:
del os.environ["OMP_NUM_THREADS"]
os.environ["OMP_NUM_THREADS"] = str(case.thread_count)

# Run the model
cmd = case.get_mpirun_cmd(allow_unresolved_envvars=False)
Expand Down

0 comments on commit 1878414

Please sign in to comment.