Skip to content

Commit

Permalink
Update the test_driver for Casper
Browse files Browse the repository at this point in the history
	modified:   test/system/test_driver.sh
  • Loading branch information
sjsprecious committed Apr 19, 2022
1 parent ffc89c1 commit 8586311
Showing 1 changed file with 74 additions and 2 deletions.
76 changes: 74 additions & 2 deletions test/system/test_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ case $hostname in
mach_workspace="/glade/scratch"

# Check for CESM baseline directory
if [ -n "{$BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then
if [ -n "${BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then
echo "CESM_BASELINE ${BL_TESTDIR} not found. Check BL_TESTDIR for correct tag name."
exit
fi
Expand Down Expand Up @@ -387,6 +387,58 @@ EOF
##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^
;;

##casper
casper* | crhtc* )
submit_script_cime="`pwd -P`/test_driver_casper_cime_${cur_time}.sh"

if [ -z "$CAM_ACCOUNT" ]; then
echo "ERROR: Must set the environment variable CAM_ACCOUNT"
exit 2
fi

if [ -z "$CAM_BATCHQ" ]; then
export CAM_BATCHQ="casper"
fi

# wallclock for run job
wallclock_limit="00:59:00"

if [ $gmake_j = 0 ]; then
gmake_j=36
fi

# run tests on 1 nodes using 18 tasks/node, 2 threads/task
CAM_TASKS=18
CAM_THREADS=2

# change parallel configuration on 1 nodes using 32 tasks, 1 threads/task
CAM_RESTART_TASKS=32
CAM_RESTART_THREADS=1

mach_workspace="/glade/scratch"

# Check for CESM baseline directory
if [ -n "${BL_TESTDIR}" ] && [ ! -d "${BL_TESTDIR}" ]; then
echo "CESM_BASELINE ${BL_TESTDIR} not found. Check BL_TESTDIR for correct tag name."
exit
fi

#-------------------------------------------

cat > ${submit_script_cime} << EOF
#!/bin/bash
#
#PBS -N cime-tests
#PBS -q $CAM_BATCHQ
#PBS -A $CAM_ACCOUNT
#PBS -l walltime=2:00:00
#PBS -l select=1:ncpus=36:mpiprocs=36:mem=300GB
#PBS -j oe
#PBS -V
EOF

##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^
;;

* ) echo "ERROR: machine $hostname not currently supported"; exit 1 ;;
esac
Expand All @@ -405,6 +457,9 @@ fi
if [ "${hostname:0:5}" == "izumi" ]; then
cesm_test_mach="izumi"
fi
if [ "${hostname:0:6}" == "casper" ] || [ "${hostname:0:5}" == "crhtc" ]; then
cesm_test_mach="casper"
fi
if [ -n "${CAM_FC}" ]; then
comp="_${CAM_FC,,}"
fi
Expand Down Expand Up @@ -465,7 +520,12 @@ if [ "${cesm_test_suite}" != "none" -a -n "${cesm_test_mach}" ]; then
fi

## Setup CESM work directory
cesm_testdir=$mach_workspace/$LOGNAME/$test_id
if [ "${hostname:0:6}" == "casper" ] || [ "${hostname:0:5}" == "crhtc" ]; then
## Would fail to compile on Casper with long foler name
cesm_testdir=$mach_workspace/$LOGNAME/$cesm_test
else
cesm_testdir=$mach_workspace/$LOGNAME/$test_id
fi

if [ -e ${cesm_testdir} ]; then
if [ -n "${use_existing}" ]; then
Expand All @@ -491,6 +551,10 @@ if [ "${cesm_test_suite}" != "none" -a -n "${cesm_test_mach}" ]; then
chey* | r* )
testargs="${testargs} --queue ${CAM_BATCHQ} --test-root ${cesm_testdir} --output-root ${cesm_testdir}"
;;
# casper
casper* | crhtc* )
testargs="${testargs} --queue ${CAM_BATCHQ} --test-root ${cesm_testdir} --output-root ${cesm_testdir}"
;;
*)
if $batch; then
testargs="${testargs} --queue ${CAM_BATCHQ} --test-root ${cesm_testdir} --output-root ${cesm_testdir}"
Expand Down Expand Up @@ -585,6 +649,14 @@ if [ "${cesm_test_suite}" != "none" -a -n "${cesm_test_mach}" ]; then
fi
fi

if [ "${hostname:0:6}" == "casper" ] || [ "${hostname:0:5}" == "crhtc" ]; then
echo "cd ${script_dir}" >> ${submit_script_cime}
echo "module load python" >> ${submit_script_cime}
echo './create_test' ${testargs} >> ${submit_script_cime}
chmod u+x ${submit_script_cime}
qsub ${submit_script_cime}
fi

done
fi

Expand Down

0 comments on commit 8586311

Please sign in to comment.