#set -x %manual ###################################################################### # Purpose: Manage the requeue of all mag jobs under the 'mag' # suite. Upon completion the model specific family/task will # auto requeue ###################################################################### ###################################################################### # Job specific troubleshooting instructions: # see generic troubleshoot manual page # ###################################################################### # include manual page below %end if [ -d /opt/modules ]; then . /opt/modules/default/init/bash else . /usrx/local/Modules/default/init/bash fi module load ecflow export ECF_PORT=%ECF_PORT% export ECF_NODE=%ECF_NODE% export ECF_NAME=%ECF_NAME% export ECF_PASS=%ECF_PASS% export ECF_TRYNO=%ECF_TRYNO% export ECF_RID=$$ ecflow_client --init=${ECF_RID} date pythondir=/u/mag.dev/ecfnets/python magout=/u/mag.dev/output/admin export date_now=`date +%%s` err=0 #get list of mag jobs that are complete #modified to look for all jobs include admin type # python ${pythondir}/node_status.py | grep "^\/mag" | grep complete >${magout}/mag_list python ${pythondir}/node_status.py | grep complete >${magout}/mag_list for model in `cat ${magout}/mag_list | awk -F" " '{print $1}'` do echo echo "JOB IS COMPLETE - REQUEUE-ING TASK: $model" echo ecflow_client --requeue force $model export err=$? if [ $err -ne '0' ] then ecflow_client --abort="ecflow_client --force FAILED: $model NOT requeued" exit fi done if [ -s ${magout}/mag_list ] then echo echo "THE FOLLOWING HAVE BEEN REQUEUED:" cat ${magout}/mag_list echo fi rm -f ${magout}/mag_list date if test $err -eq '0' then ecflow_client --complete else ecflow_client --abort fi exit