Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cleanup items for wcoss2.
  • Loading branch information
EdwardSafford-NOAA committed Aug 28, 2024
1 parent 7149b8f commit 7884387
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion driver/runObsMon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ case ${MACHINE_ID} in
MODEL=${MODEL}, PDY=${PDY}, cyc=${cyc}, DATAROOT=${DATAROOT}, APRUN_PY=${APRUN_PY}, \
MACHINE_ID=${MACHINE_ID}, ACCOUNT=${ACCOUNT}, JOB_QUEUE=${JOB_QUEUE}, SUB=${SUB}, \
OM_LOGS=${OM_LOGS}, YAML_FILE=${YAML_FILE}, CARTOPY_DATA_DIR=${CARTOPY_DATA_DIR}, \
OM_PLOTS=${OM_PLOTS}" \
OM_PLOTS=${OM_PLOTS}, KEEPDATA=${KEEPDATA}" \
-l select=1:mem=500mb -l walltime=0:05:00 -N ${jobname} ${jobfile}
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion jobs/JMON_PLOT_OBS
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cd ${DATA}
##################################
# Remove workspace when finished
##################################
KEEPDATA=${KEEPDATA:-"NO"}
export KEEPDATA=${KEEPDATA:-"NO"}

################
# Run exscript
Expand Down
22 changes: 13 additions & 9 deletions scripts/exobsmon_plot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,30 @@ if compgen -G "${DATA}/OM_PLOT*.yaml" > /dev/null; then
case ${MACHINE_ID} in
hera|orion|hercules)
# submit plot job
JOBID1=$(${SUB} --account ${ACCOUNT} -n ${ctr} -o ${logfile} -D . -J ${jobname} --time=1:00:00 \
plotjob_id=$(${SUB} --account ${ACCOUNT} -n ${ctr} -o ${logfile} -D . -J ${jobname} --time=1:00:00 \
--mem=80000M --wrap "srun -l --multi-prog ${cmdfile}")

# submit cleanup job to run after plot job
jobname="OM_cleanup"
JOBID1=`echo ${JOBID1} | gawk '{ print $4 }'`
${SUB} --account ${ACCOUNT} -n 1 -o ${logfile_clnup} -D . -J ${jobname} --time=0:10:00 \
-p ${SERVICE_PARTITION} --dependency=afterok:${JOBID1} ${USHobsmon}/om_cleanup.sh
plotjob_id=`echo ${plotjob_id} | gawk '{ print $4 }'`
${SUB} --account ${ACCOUNT} -n 1 -o ${logfile_clnup} -D . -J "OM_cleanup" --time=0:10:00 \
-p ${SERVICE_PARTITION} --dependency=afterok:${plotjob_id} ${USHobsmon}/om_cleanup.sh

;;

wcoss2)
# submit plot job
mem=$((8*${ctr}))
echo "submitting ${jobname} on wcoss2, ctr = $ctr, mem = $mem, cmdfile = ${cmdfile}"

${SUB} -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} \
plotjob_id=$(${SUB} -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} \
-v "PYTHONPATH=${PYTHONPATH}, PATH=${PATH}, HOMEobsmon=${HOMEobsmon}, MODEL=${MODEL}, \
CNTRLobsmon=${CNTRLobsmon}, PARMobsmon=${PARMobsmon}, DATA=${DATA}, CARTOPY_DATA_DIR=${CARTOPY_DATA_DIR}, \
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}, cmdfile=${cmdfile}, ncpus=${ctr}, OM_PLOTS=${OM_PLOTS}" \
-l place=vscatter,select=1:ncpus=${ctr}:mem=${mem}gb:prepost=true,walltime=1:00:00 -N ${jobname} ${USHobsmon}/plot_wcoss2.sh
-l place=vscatter,select=1:ncpus=${ctr}:mem=${mem}gb:prepost=true,walltime=1:00:00 -N ${jobname} ${USHobsmon}/plot_wcoss2.sh)

# submit cleanup job to run after plot job
${SUB} -q $JOB_QUEUE -A $ACCOUNT -o ${logfile_clnup} -e ${logfile_clnup} \
-v "DATA=${DATA}, KEEPDATA=${KEEPDATA}, NET=${NET}, DATAROOT=${DATAROOT}, \
COMOUTplots=${COMOUTplots}, DATA=${DATA}, MACHINE_ID=${MACHINE_ID}" \
-l select=1:mem=500mb,walltime=1:00:00 -W depend=afterok:${plotjob_id} -N "OM_cleanup" ${USHobsmon}/om_cleanup.sh

;;
esac
Expand Down
25 changes: 11 additions & 14 deletions ush/om_cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
#!/bin/bash

# om_cleanup.sh
#
# 1. Sync image files with $COMOUTplots directory
# 2. Conditionally remove temp working space
#

echo "Begin om_cleanup.sh"; echo

img_dirs=`ls -d ./*_plots/`
# ---------------------------------------------
# Sync image files with $COMOUTplots directory
#
img_dirs=`ls -d ${DATA}/*_plots/`
for dir in $img_dirs; do
echo "syncing ${DATA}/${dir} and ${COMOUTplots}/${dir}"
rsync -a ${DATA}/${dir} ${COMOUTplots}/${dir}
echo "syncing ${dir} and ${COMOUTplots}/${dir}"
base_name=$(basename ${dir})
rsync -a ${dir} ${COMOUTplots}/${base_name}
done

if [ ${KEEPDATA} = NO ] ; then
# ---------------------------------------------
# Conditionally remove temp working space
#
if [[ ${KEEPDATA} == "NO" ]]; then
echo; echo "removing temp working space ${DATAROOT}/${NET}"; echo
rm -rf ${DATAROOT}/${NET}
fi

echo "End om_cleanup.sh"; echo

0 comments on commit 7884387

Please sign in to comment.