From 7a76cbaafd19c96cc6818bf81dddc325d2201ed8 Mon Sep 17 00:00:00 2001 From: CGH0S7 Date: Fri, 16 Jan 2026 10:24:46 +0800 Subject: [PATCH] Add numactl CPU binding to avoid cores 0-3 and 56-59 Bind all computation processes (ABE, ABEGPU, TwoPunctureABE) to CPU cores 4-55 and 60-111 using numactl --physcpubind to prevent interference with system processes on reserved cores. --- makefile_and_run.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/makefile_and_run.py b/makefile_and_run.py index 22e4de2..a814dee 100755 --- a/makefile_and_run.py +++ b/makefile_and_run.py @@ -11,6 +11,10 @@ import AMSS_NCKU_Input as input_data import subprocess +## CPU core binding configuration using numactl +## Avoid cores 0-3 and 56-59, use cores 4-55 and 60-111 +NUMACTL_CPU_BIND = "numactl --physcpubind=4-55,60-111" + ################################################################## @@ -105,10 +109,10 @@ def run_ABE(): ## Define the command to run; cast other values to strings as needed if (input_data.GPU_Calculation == "no"): - mpi_command = "mpirun -np " + str(input_data.MPI_processes) + " ./ABE" + mpi_command = NUMACTL_CPU_BIND + " mpirun -np " + str(input_data.MPI_processes) + " ./ABE" mpi_command_outfile = "ABE_out.log" elif (input_data.GPU_Calculation == "yes"): - mpi_command = "mpirun -np " + str(input_data.MPI_processes) + " ./ABEGPU" + mpi_command = NUMACTL_CPU_BIND + " mpirun -np " + str(input_data.MPI_processes) + " ./ABEGPU" mpi_command_outfile = "ABEGPU_out.log" ## Execute the MPI command and stream output @@ -147,7 +151,7 @@ def run_TwoPunctureABE(): print( ) ## Define the command to run - TwoPuncture_command = "./TwoPunctureABE" + TwoPuncture_command = NUMACTL_CPU_BIND + " ./TwoPunctureABE" TwoPuncture_command_outfile = "TwoPunctureABE_out.log" ## Execute the command with subprocess.Popen and stream output