#! /bin/csh -f ################################################################################# if ($PHASE == set_batch) then ################################################################################# source ./Tools/ccsm_getenv || exit -1 ${UTILROOT}/Tools/taskmaker.pl -sumonly set mppsize = `${UTILROOT}/Tools/taskmaker.pl -sumonly` if ( $mppsize % ${MAX_TASKS_PER_NODE} > 0) then @ mppnodes = $mppsize / ${MAX_TASKS_PER_NODE} @ mppnodes = $mppnodes + 1 @ mppsize = $mppnodes * ${MAX_TASKS_PER_NODE} else @ mppnodes = $mppsize / ${MAX_TASKS_PER_NODE} endif set maxthrds = `${UTILROOT}/Tools/taskmaker.pl -maxthrds` set minthrds = $MAX_TASKS_PER_NODE @ n = 0 foreach model ($MODELS) @ n = $n + 1 if ($NTHRDS[$n] > $MAX_TASKS_PER_NODE ) then echo "ERROR, NTHRDS maximum is $MAX_TASKS_PER_NODE" echo "you have set NTHRDS = ( $NTHRDS[$n] ) - must reset" exit 1 endif if ($NTHRDS[$n] > $maxthrds) then set maxthrds = $NTHRDS[$n] endif if ($NTHRDS[$n] < $minthrds) then set minthrds = $NTHRDS[$n] endif end #--- Job name is first fifteen characters of case name --- set jobname = `echo ${CASE} | cut -c1-15` set account_name = "ecse0116" if (-e ~/.ccsm_proj) then set account_name = `head -1 ~/.ccsm_proj` endif set walltime = "01:15:00" if ($CCSM_ESTCOST > 1) set walltime = "01:50:00" if ($CCSM_ESTCOST > 3) set walltime = "05:00:00" if ($?TESTMODE) then set file = $CASEROOT/${CASE}.test else set file = $CASEROOT/${CASE}.run endif cat >! $file << EOF1 #!/bin/csh -f #PBS -A ${account_name} #PBS -N ${jobname} #PBS -l select=${mppnodes}:bigmem=true #PBS -l walltime=${walltime} #PBS -j oe EOF1 ################################################################################# else if ($PHASE == set_exe) then ################################################################################# set maxthrds = `${CASEROOT}/Tools/taskmaker.pl -maxthrds` set myaprun = `${CASEROOT}/Tools/taskmaker.pl -aprun` #gjp check this for archer, as this is what was used for edison and they have #gjp max threads set to twice the number of cores #if ($maxthrds > 1) then set myaprun = "-j 2 $myaprun " #endif cat >> ${CASEROOT}/${CASE}.run << EOF1 sleep 25 cd \$RUNDIR echo "\`date\` -- CSM EXECUTION BEGINS HERE" setenv OMP_NUM_THREADS ${maxthrds} aprun ${myaprun} >&! cesm.log.\$LID wait echo "\`date\` -- CSM EXECUTION HAS FINISHED" EOF1 ################################################################################# else if ($PHASE == set_larch) then ################################################################################# #This is a place holder for a long-term archiving script #Good to report that this has not been set" #echo " Warning: set_larch has not been implemented yet" #but this is commented out to mirror HECToR 1_0_5 installation #what follows, up to else is quoted from edison #set account_name = ` ` #if (-e ~/.ccsm_proj) then # set account_name = `head -1 ~/.ccsm_proj` #endif # #cat >! $CASEROOT/${CASE}.l_archive << EOF1 ##! /bin/csh -f ####PBS -A ${account_name} ##PBS -N ${CASE}.l_archive ##PBS -q regular ##PBS -l walltime=02:00:00 ##PBS -j oe ##PBS -S /bin/csh -V # #cd $CASEROOT #source ./Tools/ccsm_getenv || exit -1 #cd \$DOUT_S_ROOT #$CASEROOT/Tools/lt_archive.sh -m copy_dirs_hsi #exit 0 # #EOF1 #chmod 775 ${CASEROOT}/${CASE}.l_archive ################################################################################# else ################################################################################# echo " PHASE setting of $PHASE is not an accepted value" echo " accepted values are set_batch, set_exe and set_larch" exit 1 ################################################################################# endif #################################################################################