From 900f472ea62ce313a42f9e932b3dbd88a0a32512 Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 7 Oct 2024 16:39:26 -0500 Subject: [PATCH] test logic to run with different nprocs than the ref files if nprocs is specified --- tools/regression-tests/config_kokkos.yaml | 4 ++-- tools/regression-tests/config_kokkos_openmp.yaml | 4 ++-- tools/regression-tests/run_tests.py | 11 +++++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/regression-tests/config_kokkos.yaml b/tools/regression-tests/config_kokkos.yaml index 88257da5fc..76a142d7d8 100644 --- a/tools/regression-tests/config_kokkos.yaml +++ b/tools/regression-tests/config_kokkos.yaml @@ -1,9 +1,9 @@ --- lmp_binary: "" - nprocs: "4" + nprocs: "2" args: "-cite none -k on g 2 -sf kk -pk kokkos newton on neigh half" mpiexec: "mpirun" - mpiexec_numproc_flag: "--host localhost:4 -np" + mpiexec_numproc_flag: "--host localhost:2 -np" tolerance: PotEng: abs: 1e-4 diff --git a/tools/regression-tests/config_kokkos_openmp.yaml b/tools/regression-tests/config_kokkos_openmp.yaml index faf1fc1655..c3061d2e68 100644 --- a/tools/regression-tests/config_kokkos_openmp.yaml +++ b/tools/regression-tests/config_kokkos_openmp.yaml @@ -1,9 +1,9 @@ --- lmp_binary: "" - nprocs: "4" + nprocs: "2" args: "-cite none -k on t 2 -sf kk -pk kokkos newton on neigh half" mpiexec: "mpirun" - mpiexec_numproc_flag: "--host localhost:4 -np" + mpiexec_numproc_flag: "--host localhost:2 -np" tolerance: PotEng: abs: 1e-4 diff --git a/tools/regression-tests/run_tests.py b/tools/regression-tests/run_tests.py index 8e4f6b041c..afb12b2845 100755 --- a/tools/regression-tests/run_tests.py +++ b/tools/regression-tests/run_tests.py @@ -300,12 +300,15 @@ def iterate(lmp_binary, input_folder, input_list, config, results, progress_file saved_nprocs = config['nprocs'] - # if the maximum number of procs is different from the value in the configuration file - # then override the setting for this particular input script - if max_np != int(config['nprocs']): + # if the nprocs value in the configuration file is empty then use max_np for this particular input script + if config['nprocs'] == "": config['nprocs'] = str(max_np) + else: + # otherwise use the nprocs value in the configuration file (4 for most examples) + logger.info(f" Using nprocs {config['nprocs']} nprocs for {input_test} as specified in the config file.") + logger.info(f" The maximum number of procs in the log files is {max_np}.") - # store the value of nprocs + # store the value of nprocs to name the generated log file nprocs = int(config['nprocs']) # if valgrind is used for mem check, the run command will be