From 60ad63e8ccae812a4628878e1d1291d5301cbb0b Mon Sep 17 00:00:00 2001 From: CGH0S7 <776459475@qq.com> Date: Mon, 30 Mar 2026 21:00:20 +0800 Subject: [PATCH] Isolate TwoPuncture from ABE OMP settings --- AMSS_NCKU_Input.py | 4 ++-- makefile_and_run.py | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/AMSS_NCKU_Input.py b/AMSS_NCKU_Input.py index 4919de6..725a1af 100755 --- a/AMSS_NCKU_Input.py +++ b/AMSS_NCKU_Input.py @@ -16,8 +16,8 @@ import numpy File_directory = "GW150914" ## output file directory Output_directory = "binary_output" ## binary data file directory ## The file directory name should not be too long -MPI_processes = 8 ## number of mpi processes used in the simulation -OMP_Threads = 16 ## number of OpenMP threads used by each MPI process +MPI_processes = 64 ## number of mpi processes used in the simulation +OMP_Threads = 3 ## number of OpenMP threads used by each MPI process GPU_Calculation = "no" ## Use GPU or not ## (prefer "no" in the current version, because the GPU part may have bugs when integrated in this Python interface) diff --git a/makefile_and_run.py b/makefile_and_run.py index 8fc622e..e1d6de2 100755 --- a/makefile_and_run.py +++ b/makefile_and_run.py @@ -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