#! /bin/csh -f ################################################################################# if ($PHASE == set_batch) then ################################################################################# source ./Tools/ccsm_getenv || exit -1 set maxthrds = 0 @ 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 end set npes_tot = `${CASEROOT}/Tools/taskmaker.pl -sumonly` @ nodes = $npes_tot / $MAX_TASKS_PER_NODE @ tmpValue = $nodes * $MAX_TASKS_PER_NODE if( $tmpValue < $npes_tot ) then @ nodes = $nodes + 1 endif # If tasks must be equivalent to full nodes: @ mpp = $npes_tot ###@ mpp = $nodes * $MAX_TASKS_PER_NODE if ($?TESTMODE) then set file = $CASEROOT/${CASE}.test else set file = $CASEROOT/${CASE}.run endif cat >! $file << EOF1 #! /bin/csh -f #MSUB -V #MSUB -q pbatch ##which queue to use. Options = pdebug, pbatch #MSUB -A ees ##bank (other users will need to change this) #MSUB -l nodes=$nodes ##Number of nodes to use. #MSUB -l walltime=12:00:00 ##How long to run for (users will want to change) #MSUB -l gres=lscratchd ##Specify needed Lustre systems (users might need to change) #MSUB -m be ##Send email when job starts/stops #MSUB -e ${CASE}.err ##File to use for standard error #MSUB -o ${CASE}.out ##File to use for standard out. #MSUB -N ${CASE} ##runname to print for checkjob. # End of options limit coredumpsize 1000000 limit stacksize unlimited setenv SLURM_NPROCS $mpp setenv SLURM_CPUS_PER_TASK 1 EOF1 ################################################################################# else if ($PHASE == set_exe) then ################################################################################# cat >> ${CASEROOT}/${CASE}.run << EOF1 echo " " echo "Here are the environment variables" echo " " env | sort echo " " set sleeptime = 10 echo "Getting ready to sleep for \$sleeptime seconds" sleep \$sleeptime echo "Awakening after \$sleeptime seconds" echo " " cd \$RUNDIR echo "`date` -- CSM EXECUTION BEGINS HERE" if (\$MPILIB != "mpi-serial") then srun \$EXEROOT/cesm.exe >&! ccsm.log.\$LID wait else \$EXEROOT/cesm.exe >&! ccsm.log.\$LID endif echo "`date` -- CSM EXECUTION HAS FINISHED" EOF1 ################################################################################# else if ($PHASE == set_larch) then ################################################################################# #This is a place holder for a long-term archiving script ################################################################################# 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 #################################################################################