Isolate TwoPuncture from ABE OMP settings
This commit is contained in:
@@ -55,14 +55,22 @@ NUMACTL_CPU_BIND = get_last_n_cores_per_socket(n=32)
|
||||
BUILD_JOBS = 64
|
||||
|
||||
|
||||
def build_runtime_env():
|
||||
"""Inject OpenMP runtime settings from the Python input file."""
|
||||
def build_abe_runtime_env():
|
||||
"""Inject OpenMP runtime settings only for the main ABE evolution run."""
|
||||
runtime_env = os.environ.copy()
|
||||
omp_threads = max(1, int(getattr(input_data, "OMP_Threads", 1)))
|
||||
runtime_env["OMP_NUM_THREADS"] = str(omp_threads)
|
||||
return runtime_env
|
||||
|
||||
|
||||
def build_twopuncture_runtime_env():
|
||||
"""Let TwoPunctureABE use the runtime default instead of the ABE OMP override."""
|
||||
runtime_env = os.environ.copy()
|
||||
runtime_env.pop("OMP_NUM_THREADS", None)
|
||||
runtime_env.pop("OMP_THREAD_LIMIT", None)
|
||||
return runtime_env
|
||||
|
||||
|
||||
##################################################################
|
||||
|
||||
|
||||
@@ -172,7 +180,7 @@ def run_ABE():
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True,
|
||||
env=build_runtime_env(),
|
||||
env=build_abe_runtime_env(),
|
||||
)
|
||||
|
||||
## Write ABE run output to file while printing to stdout
|
||||
@@ -219,7 +227,7 @@ def run_TwoPunctureABE():
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
text=True,
|
||||
env=build_runtime_env(),
|
||||
env=build_twopuncture_runtime_env(),
|
||||
)
|
||||
|
||||
## Write TwoPunctureABE run output to file while printing to stdout
|
||||
|
||||
Reference in New Issue
Block a user