From f1516b9b3ed7295cc4ac4306047fbc0452a72903 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Fri, 7 Jan 2022 12:57:15 +0000 Subject: [PATCH 1/2] update rt_weekly.conf, run_test.sh and tests/cpld_bmark_p7_35d --- tests/rt_weekly.conf | 2 +- tests/run_test.sh | 25 +++++++++++++++++++++++++ tests/tests/cpld_bmark_p7_35d | 8 +++++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/tests/rt_weekly.conf b/tests/rt_weekly.conf index 09d3bcd4bc..5f1d082910 100644 --- a/tests/rt_weekly.conf +++ b/tests/rt_weekly.conf @@ -6,7 +6,7 @@ COMPILE | -DAPP=ATM -DCCPP_SUITES=FV3_GFS_v16,FV3_GFS_v16_nsstNoahmpUGWPv1 -D32B RUN | control_c768 | - wcoss_cray | fv3 | # CPLD Benchmark 35d tests -# The length of forecast is one day for the weekly tests. +# The length of forecast is 5 days for the weekly tests. COMPILE | -DAPP=S2SW -DCCPP_SUITES=FV3_GFS_v16_coupled_nsstNoahmpUGWPv1 | + hera.intel | fv3 | | RUN | cpld_bmark_p7_35d | | fv3 | | 2012010100 RUN | cpld_bmark_p7_35d | | fv3 | | 2012040100 diff --git a/tests/run_test.sh b/tests/run_test.sh index d7bf7b62ca..d80990c52a 100755 --- a/tests/run_test.sh +++ b/tests/run_test.sh @@ -266,5 +266,30 @@ fi echo " $( date +%s )" >> ${LOG_DIR}/job_${JOB_NR}_timestamp.txt +################################################################################ +# Remove RUN_DIRs if they are no longer needed by other tests +################################################################################ +keep_run_dir=false +if [[ ${TEST_NAME} == 'cpld_control_c96_p7' || ${TEST_NAME} == 'cpld_control_c192_p7' ]]; then + keep_run_dir=true +fi +if [[ ${TEST_NAME} == 'cpld_control_c384_p7' || ${TEST_NAME} == 'control' ]]; then + keep_run_dir=true +fi +if [[ ${TEST_NAME} == 'control_stochy' || ${TEST_NAME} == 'control_p7' ]]; then + keep_run_dir=true +fi +if [[ ${TEST_NAME} == 'regional_control' || ${TEST_NAME} == 'rap_control' ]]; then + keep_run_dir=true +fi +if [[ ${TEST_NAME} == 'rap_sfcdiff' || ${TEST_NAME} == 'datm_cdeps_control_cfsr' ]]; then + keep_run_dir=true +fi + +if [[ ${keep_run_dir} == false ]]; then + cd ${RUNDIR_ROOT} + rm -rf ${RUNDIR} +fi + elapsed=$SECONDS echo "Elapsed time $elapsed seconds. Test ${TEST_NAME}" diff --git a/tests/tests/cpld_bmark_p7_35d b/tests/tests/cpld_bmark_p7_35d index 94f84ba967..5eb49e4aee 100644 --- a/tests/tests/cpld_bmark_p7_35d +++ b/tests/tests/cpld_bmark_p7_35d @@ -17,11 +17,17 @@ export SHOUR=00 export SECS=`expr $SHOUR \* 3600` export BMIC=.true. +# length of run is 35 days #export DAYS=35 #export FHMAX=840 -export RESTART_N=`expr ${FHMAX} - ${FHROT}` #export WLCLK=480 +# length of run is 5 days for weekly tests +export DAYS=5 +export FHMAX=120 +export WLCLK=90 +export RESTART_N=`expr ${FHMAX} - ${FHROT}` + export TASKS=1700 export TPN=$TPN_cpl_thrd export INPES=12 From 87be12a95613ef61343605545dc4c04031cb32e5 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Sun, 9 Jan 2022 22:27:34 +0000 Subject: [PATCH 2/2] update rt.sh and run_test.sh --- tests/rt.sh | 14 +++++++++++--- tests/run_test.sh | 32 ++++++++++++-------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/rt.sh b/tests/rt.sh index 172d8110f6..72d7fc4e5c 100755 --- a/tests/rt.sh +++ b/tests/rt.sh @@ -14,12 +14,13 @@ usage() { echo " -c create new baseline results" echo " -e use ecFlow workflow manager" echo " -h display this help" - echo " -k keep run directory" + echo " -k keep run directory after rt.sh is completed" echo " -l runs test specified in " echo " -m compare against new baseline results" echo " -n run single test " echo " -r use Rocoto workflow manager" echo " -w for weekly_test, skip comparing baseline results" + echo " -d delete run direcotries that are not used by other tests" echo set -x exit 1 @@ -411,10 +412,11 @@ KEEP_RUNDIR=false SINGLE_NAME='' TEST_35D=false export skip_check_results=false +export delete_rundir=false TESTS_FILE='rt.conf' -while getopts ":cl:mn:wkreh" opt; do +while getopts ":cl:mn:dwkreh" opt; do case $opt in c) CREATE_BASELINE=true @@ -431,6 +433,9 @@ while getopts ":cl:mn:wkreh" opt; do TESTS_FILE='rt.conf.single' rm -f $TESTS_FILE ;; + d) + export delete_rundir=true + ;; w) export skip_check_results=true ;; @@ -459,6 +464,8 @@ while getopts ":cl:mn:wkreh" opt; do esac done +awk -F "|" '{print $5}' rt.conf | grep "\S" > keep_tests.tmp + if [[ $SINGLE_NAME != '' ]]; then rt_single fi @@ -800,6 +807,7 @@ EOF export LOG_DIR=${LOG_DIR} export DEP_RUN=${DEP_RUN} export skip_check_results=${skip_check_results} + export delete_rundir=${delete_rundir} EOF if [[ $ROCOTO == true ]]; then @@ -864,7 +872,7 @@ else echo ; echo REGRESSION TEST WAS SUCCESSFUL (echo ; echo REGRESSION TEST WAS SUCCESSFUL) >> ${REGRESSIONTEST_LOG} - rm -f fv3_*.x fv3_*.exe modules.fv3_* + rm -f fv3_*.x fv3_*.exe modules.fv3_* keep_tests.tmp [[ ${KEEP_RUNDIR} == false ]] && rm -rf ${RUNDIR_ROOT} [[ ${ROCOTO} == true ]] && rm -f ${ROCOTO_XML} ${ROCOTO_DB} *_lock.db [[ ${TEST_35D} == true ]] && rm -f tests/cpld_bmark*_20* diff --git a/tests/run_test.sh b/tests/run_test.sh index d80990c52a..030ed8588e 100755 --- a/tests/run_test.sh +++ b/tests/run_test.sh @@ -269,26 +269,18 @@ echo " $( date +%s )" >> ${LOG_DIR}/job_${JOB_NR}_timestamp.txt ################################################################################ # Remove RUN_DIRs if they are no longer needed by other tests ################################################################################ -keep_run_dir=false -if [[ ${TEST_NAME} == 'cpld_control_c96_p7' || ${TEST_NAME} == 'cpld_control_c192_p7' ]]; then - keep_run_dir=true -fi -if [[ ${TEST_NAME} == 'cpld_control_c384_p7' || ${TEST_NAME} == 'control' ]]; then - keep_run_dir=true -fi -if [[ ${TEST_NAME} == 'control_stochy' || ${TEST_NAME} == 'control_p7' ]]; then - keep_run_dir=true -fi -if [[ ${TEST_NAME} == 'regional_control' || ${TEST_NAME} == 'rap_control' ]]; then - keep_run_dir=true -fi -if [[ ${TEST_NAME} == 'rap_sfcdiff' || ${TEST_NAME} == 'datm_cdeps_control_cfsr' ]]; then - keep_run_dir=true -fi - -if [[ ${keep_run_dir} == false ]]; then - cd ${RUNDIR_ROOT} - rm -rf ${RUNDIR} +if [[ ${delete_rundir} = true ]]; then + keep_run_dir=false + while read -r line; do + keep_test=$(echo $line| sed -e 's/^ *//' -e 's/ *$//') + if [[ $TEST_NAME == ${keep_test} ]]; then + keep_run_dir=true + fi + done < ${PATHRT}/keep_tests.tmp + + if [[ ${keep_run_dir} == false ]]; then + rm -rf ${RUNDIR} + fi fi elapsed=$SECONDS