Skip to content

Commit e51b15c

Browse files
authored
Merge Pull Request #2363 from E3SM-Project/scream/tcclevenger/remove_multiple_np_runs_restart_test
Automatically Merged using E3SM Pull Request AutoTester PR Title: Only test np{SCREAM_TEST_MAX_RANKS} for model_restart PR Author: tcclevenger
2 parents f866973 + f2064e8 commit e51b15c

File tree

1 file changed

+32
-41
lines changed
  • components/eamxx/tests/coupled/dynamics_physics/model_restart

1 file changed

+32
-41
lines changed

components/eamxx/tests/coupled/dynamics_physics/model_restart/CMakeLists.txt

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ set (NEED_LIBS cld_fraction shoc p3 scream_rrtmgp rrtmgp ${NETCDF_C} ${dynLibNam
1818
# 3) run for N time steps re-starting from t=N*dt (restarted run)
1919
# We can use the same namelist for all tests, using 3 different input yaml files
2020

21-
# Add _np1 only if we're running also with more than one rank. Otherwise, add nothing
22-
set (TEST_NRANKS ${TEST_RANK_START})
23-
if (TEST_RANK_END GREATER TEST_RANK_START)
24-
list (APPEND TEST_NRANKS ${TEST_RANK_END})
25-
endif()
26-
2721
# Create a single executable for all the 3 runs
2822
CreateUnitTestExec(model_restart model_restart.cpp "${NEED_LIBS}")
2923

@@ -32,41 +26,38 @@ set (ATM_TIME_STEP 300)
3226
set (CASE_T0 2021-10-12-43200)
3327
set (CASE_TN 2021-10-12-43800)
3428

35-
foreach (NRANKS IN ITEMS ${TEST_NRANKS})
36-
37-
# Create the baseline (run all 6 timsteps in a single run)
38-
CreateUnitTestFromExec(model_baseline model_restart
39-
EXE_ARGS "--use-colour no --ekat-test-params ifile=input_baseline.yaml"
40-
MPI_RANKS ${NRANKS}
41-
PROPERTIES FIXTURES_SETUP baseline_run_np${NRANKS})
42-
43-
# Start a simulation, but only run half of the time steps
44-
CreateUnitTestFromExec(model_initial model_restart
45-
EXE_ARGS "--use-colour no --ekat-test-params ifile=input_initial.yaml"
46-
MPI_RANKS ${NRANKS}
47-
PROPERTIES FIXTURES_SETUP initial_run_np${NRANKS}
48-
RESOURCE_LOCK rpointer_file)
49-
50-
# Restart the simulation, and run the second half of the time steps
51-
CreateUnitTestFromExec(model_restart model_restart
52-
EXE_ARGS "--use-colour no --ekat-test-params ifile=input_restarted.yaml"
53-
MPI_RANKS ${NRANKS}
54-
PROPERTIES FIXTURES_REQUIRED initial_run_np${NRANKS}
55-
FIXTURES_SETUP restarted_run_np${NRANKS}
56-
RESOURCE_LOCK rpointer_file)
57-
58-
# Finally, compare the nc outputs generated by the basline and restarted runs
59-
# IMPORTANT: make sure these file names match what baseline/restarted runs produce
60-
set (SRC_FILE model_output_baseline.INSTANT.nsteps_x2.np${NRANKS}.${CASE_T0}.nc)
61-
set (TGT_FILE model_output.INSTANT.nsteps_x2.np${NRANKS}.${CASE_T0}.nc)
62-
63-
add_test (NAME restarted_vs_monolithic_check_np${NRANKS}
64-
COMMAND cmake -P ${CMAKE_BINARY_DIR}/bin/CprncTest.cmake ${SRC_FILE} ${TGT_FILE}
65-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
66-
set_tests_properties (restarted_vs_monolithic_check_np${NRANKS} PROPERTIES
67-
RESOURCE_GROUPS "devices:1"
68-
FIXTURES_REQUIRED "baseline_run_np${NRANKS};restarted_run_np${NRANKS}")
69-
endforeach()
29+
# Create the baseline (run all 6 timsteps in a single run)
30+
CreateUnitTestFromExec(model_baseline model_restart
31+
EXE_ARGS "--use-colour no --ekat-test-params ifile=input_baseline.yaml"
32+
MPI_RANKS ${SCREAM_TEST_MAX_RANKS}
33+
PROPERTIES FIXTURES_SETUP baseline_run_np${SCREAM_TEST_MAX_RANKS})
34+
35+
# Start a simulation, but only run half of the time steps
36+
CreateUnitTestFromExec(model_initial model_restart
37+
EXE_ARGS "--use-colour no --ekat-test-params ifile=input_initial.yaml"
38+
MPI_RANKS ${SCREAM_TEST_MAX_RANKS}
39+
PROPERTIES FIXTURES_SETUP initial_run_np${SCREAM_TEST_MAX_RANKS}
40+
RESOURCE_LOCK rpointer_file)
41+
42+
# Restart the simulation, and run the second half of the time steps
43+
CreateUnitTestFromExec(model_restart model_restart
44+
EXE_ARGS "--use-colour no --ekat-test-params ifile=input_restarted.yaml"
45+
MPI_RANKS ${SCREAM_TEST_MAX_RANKS}
46+
PROPERTIES FIXTURES_REQUIRED initial_run_np${SCREAM_TEST_MAX_RANKS}
47+
FIXTURES_SETUP restarted_run_np${SCREAM_TEST_MAX_RANKS}
48+
RESOURCE_LOCK rpointer_file)
49+
50+
# Finally, compare the nc outputs generated by the basline and restarted runs
51+
# IMPORTANT: make sure these file names match what baseline/restarted runs produce
52+
set (SRC_FILE model_output_baseline.INSTANT.nsteps_x2.np${SCREAM_TEST_MAX_RANKS}.${CASE_T0}.nc)
53+
set (TGT_FILE model_output.INSTANT.nsteps_x2.np${SCREAM_TEST_MAX_RANKS}.${CASE_T0}.nc)
54+
55+
add_test (NAME restarted_vs_monolithic_check_np${SCREAM_TEST_MAX_RANKS}
56+
COMMAND cmake -P ${CMAKE_BINARY_DIR}/bin/CprncTest.cmake ${SRC_FILE} ${TGT_FILE}
57+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
58+
set_tests_properties (restarted_vs_monolithic_check_np${SCREAM_TEST_MAX_RANKS} PROPERTIES
59+
RESOURCE_GROUPS "devices:1"
60+
FIXTURES_REQUIRED "baseline_run_np${SCREAM_TEST_MAX_RANKS};restarted_run_np${SCREAM_TEST_MAX_RANKS}")
7061

7162
# Determine num subcycles needed to keep shoc dt<=300s
7263
set (SHOC_MAX_DT 300)

0 commit comments

Comments
 (0)