From 2ce78759499b36b35cfb7da76d46050f5681d8af Mon Sep 17 00:00:00 2001 From: "Edward.Safford" Date: Wed, 17 Nov 2021 14:24:07 +0000 Subject: [PATCH] GSI #228. Port ConMon to wcoss2. This completes #228. --- util/Conventional_Monitor/ConMon_install.pl | 38 ++++++-- .../build_ConMon_cmake.sh | 59 ++++++------ .../data_extract/ush/ConMon_DE.sh | 4 + util/Conventional_Monitor/get_hostname.pl | 4 +- .../image_gen/ush/mk_horz_hist.sh | 12 +++ .../image_gen/ush/mk_time_vert.sh | 19 ++++ .../image_gen/ush/plot_horz.sh | 12 +-- .../image_gen/ush/plot_horz_uv.sh | 12 +-- .../driver/test_jgdas_vcmon_wcoss2.sh | 89 +++++++++++++++++++ util/Conventional_Monitor/parm/ConMon_config | 10 ++- 10 files changed, 199 insertions(+), 60 deletions(-) create mode 100755 util/Conventional_Monitor/nwprod/gdas_conmon/driver/test_jgdas_vcmon_wcoss2.sh diff --git a/util/Conventional_Monitor/ConMon_install.pl b/util/Conventional_Monitor/ConMon_install.pl index 2b1ebd4f9c..c6659cc30f 100755 --- a/util/Conventional_Monitor/ConMon_install.pl +++ b/util/Conventional_Monitor/ConMon_install.pl @@ -18,8 +18,8 @@ my $machine = `/usr/bin/perl ./get_hostname.pl`; my $my_machine="export MY_MACHINE=$machine"; - if( $machine ne "hera" && $machine ne "wcoss" && - $machine ne "wcoss_c" && $machine ne "wcoss_d" ) { + if( $machine ne "hera" && $machine ne "wcoss" && $machine ne "wcoss_c" + && $machine ne "wcoss_d" && $machine ne "wcoss2" ) { die( "ERROR --- Unrecognized machine hostname, $machine. Exiting now...\n" ); } else { @@ -76,6 +76,9 @@ elsif( $machine eq "wcoss_d" ) { $tankdir = "/gpfs/dell2/emc/modeling/noscrub/$user_name/nbns"; } + elsif( $machine eq "wcoss2" ){ + $tankdir = "/lfs/h2/emc/da/noscrub/$user_name/nbns"; + } print "Please specify TANKDIR location for storage of data and image files.\n"; print " Return to accept default location or enter new location now.\n"; @@ -177,6 +180,10 @@ $my_ptmp="export C_PTMP=\${C_PTMP:-/gpfs/dell2/ptmp}"; $my_stmp="export C_STMP=\${C_STMP:-/gpfs/dell2/stmp}"; } + elsif( $machine eq "wcoss2" ){ + $my_ptmp="export MY_PTMP=\${MY_PTMP:-/lfs/h2/emc/ptmp}"; + $my_stmp="export MY_STMP=\${MY_STMP:-/lfs/h2/emc/stmp}"; + } #--------------------------------------- # @@ -235,11 +242,26 @@ print "\n"; - my $account = "export ACCOUNT=\${ACCOUNT:-fv3-cpu}"; - if( $machine ne "hera" ) { - $account = "export ACCOUNT=\${ACCOUNT:-}"; + my $account = "export ACCOUNT=\${ACCOUNT:-}"; + if( $machine eq "hera" ) { + $account = "export ACCOUNT=\${ACCOUNT:-fv3-cpu}"; + } elsif( $machine eq "wcoss2" ){ + $account = "export ACCOUNT=\${ACCOUNT:-GFS-DEV}"; + } + + my $project = "export PROJECT=\${PROJECT:-GDAS-T2O}"; + if( $machine eq "wcoss2" ){ + $project = "export PROJECT=\${PROJECT:-GDAS-DEV}"; + } elsif( $machine ne "wcoss" && $machine ne "cray" && $machine ne "wcoss_d" ) { + $project="export PROJECT="; } + my $job_queue="export JOB_QUEUE="; + if( $machine eq "cray" || $machine eq "wcoss2" ) { + $job_queue="export JOB_QUEUE=\${JOB_QUEUE:-dev}"; + } elsif( $machine eq "wcoss" || $machine eq "wcoss_d" ){ + $job_queue = "export JOB_QUEUE=\${JOB_QUEUE:-dev_shared}"; + } #------------------------------------------------------------ # @@ -256,6 +278,12 @@ elsif( $_ =~ "ACCOUNT=" ) { print $out "$account\n"; } + elsif( $_ =~ "PROJECT=" ) { + print $out "$project\n"; + } + elsif( $_ =~ "JOB_QUEUE=" ) { + print $out "$job_queue\n"; + } elsif( $_ =~ "CONMON_TANKDIR=" ) { print $out "$my_tankdir\n"; } diff --git a/util/Conventional_Monitor/build_ConMon_cmake.sh b/util/Conventional_Monitor/build_ConMon_cmake.sh index f7b6dbe2e1..1ffe92a9ae 100755 --- a/util/Conventional_Monitor/build_ConMon_cmake.sh +++ b/util/Conventional_Monitor/build_ConMon_cmake.sh @@ -39,6 +39,9 @@ elif [[ -d /scratch1 ]] ; then elif [[ -d /work ]]; then . $MODULESHOME/init/sh target=orion +elif [[ -d /lfs && -d /dfs ]]; then + . $MODULESHOME/init/bash + target=wcoss2 else echo "unknown target = $target" exit 9 @@ -66,33 +69,31 @@ fi # Verify this is a supported machine #--------------------------------------------------- -if [[ ${target} = "hera" || ${target} = "wcoss_c" \ - || ${target} = "wcoss_d" || ${target} = "orion" ]]; then - echo Building nwprod executables on ${target} - echo - - - #------------------------------------- - # load modules - #------------------------------------- - if [ $target = wcoss_d ]; then - module purge - module use -a $dir_modules - module load modulefile.ProdGSI.$target - elif [ $target = wcoss -o $target = gaea ]; then - module purge - module load $dir_modules/modulefile.ProdGSI.$target - elif [ $target = hera -o $target = orion ]; then - module purge - module use $dir_modules - module load modulefile.ProdGSI.$target - elif [ $target = cheyenne ]; then - module purge - source $dir_modules/modulefile.ProdGSI.$target - elif [ $target = wcoss_c ]; then - module purge - module load $dir_modules/modulefile.ProdGSI.$target - fi +echo Building nwprod executables on ${target} +echo + + +#------------------------------------- +# load modules +#------------------------------------- +if [ $target = wcoss_d -o $target = wcoss2 ]; then + module purge + module use -a $dir_modules + module load modulefile.ProdGSI.$target +elif [ $target = wcoss -o $target = gaea ]; then + module purge + module load $dir_modules/modulefile.ProdGSI.$target +elif [ $target = hera -o $target = orion ]; then + module purge + module use $dir_modules + module load modulefile.ProdGSI.$target +elif [ $target = cheyenne ]; then + module purge + source $dir_modules/modulefile.ProdGSI.$target +elif [ $target = wcoss_c ]; then + module purge + module load $dir_modules/modulefile.ProdGSI.$target +fi #------------------------------------- @@ -129,10 +130,6 @@ if [[ ${target} = "hera" || ${target} = "wcoss_c" \ cp $file $C_IG_EXEC/. done -else - echo ${machine} is not supported -fi - set +x diff --git a/util/Conventional_Monitor/data_extract/ush/ConMon_DE.sh b/util/Conventional_Monitor/data_extract/ush/ConMon_DE.sh index c60237570e..8869f513cb 100755 --- a/util/Conventional_Monitor/data_extract/ush/ConMon_DE.sh +++ b/util/Conventional_Monitor/data_extract/ush/ConMon_DE.sh @@ -237,6 +237,10 @@ if [ -s $cnvstat -a -s $pgrbf00 -a -s $pgrbf06 ]; then $SUB -A $ACCOUNT --ntasks=1 --time=00:30:00 \ -p service -J ${jobname} -o $C_LOGDIR/DE.${PDY}.${CYC}.log \ ${HOMEgdas_conmon}/jobs/JGDAS_ATMOS_CONMON + + elif [[ $MY_MACHINE = "wcoss2" ]]; then + $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=30:00 -N ${jobname} \ + -l select=1:mem=5000M ${HOMEgdas_conmon}/jobs/JGDAS_ATMOS_CONMON fi else diff --git a/util/Conventional_Monitor/get_hostname.pl b/util/Conventional_Monitor/get_hostname.pl index 8d89277a21..1d6e931621 100755 --- a/util/Conventional_Monitor/get_hostname.pl +++ b/util/Conventional_Monitor/get_hostname.pl @@ -26,7 +26,9 @@ elsif( -d "/scratch1" ) { $machine = "hera"; } - + elsif( -d "/lfs/h2" ) { + $machine = "wcoss2"; + } print "$machine"; diff --git a/util/Conventional_Monitor/image_gen/ush/mk_horz_hist.sh b/util/Conventional_Monitor/image_gen/ush/mk_horz_hist.sh index 63dd2668b9..8114fd1a54 100755 --- a/util/Conventional_Monitor/image_gen/ush/mk_horz_hist.sh +++ b/util/Conventional_Monitor/image_gen/ush/mk_horz_hist.sh @@ -57,6 +57,10 @@ set -ax elif [[ $MY_MACHINE = "hera" ]]; then ${SUB} -A ${ACCOUNT} --ntasks=1 --time=00:20:00 \ -p service -J ${jobname} -o ${logfile} ${plot_hist} + + elif [[ $MY_MACHINE = "wcoss2" ]]; then + $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=30:00 -N ${jobname} \ + -l select=1:mem=500M ${plot_hist} fi @@ -78,6 +82,10 @@ set -ax elif [[ $MY_MACHINE = "hera" ]]; then ${SUB} -A ${ACCOUNT} --ntasks=1 --time=00:20:00 \ -p service -J ${jobname} -o ${logfile} ${plot_horz} + + elif [[ $MY_MACHINE = "wcoss2" ]]; then + $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=30:00 -N ${jobname} \ + -l select=1:mem=500M ${plot_horz} fi @@ -99,6 +107,10 @@ set -ax elif [[ $MY_MACHINE = "hera" ]]; then ${SUB} -A ${ACCOUNT} --ntasks=1 --time=00:20:00 \ -p service -J ${jobname} -o ${logfile} ${plot_horz_uv} + + elif [[ $MY_MACHINE = "wcoss2" ]]; then + $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=30:00 -N ${jobname} \ + -l select=1:mem=500M ${plot_horz_uv} fi diff --git a/util/Conventional_Monitor/image_gen/ush/mk_time_vert.sh b/util/Conventional_Monitor/image_gen/ush/mk_time_vert.sh index d84778f6de..ed465aabb1 100755 --- a/util/Conventional_Monitor/image_gen/ush/mk_time_vert.sh +++ b/util/Conventional_Monitor/image_gen/ush/mk_time_vert.sh @@ -37,6 +37,10 @@ echo "--> mk_time_vert.sh" elif [[ $MY_MACHINE == "hera" ]]; then ${SUB} -A ${ACCOUNT} --ntasks=1 --time=00:15:00 \ -p service -J ${jobname} -o ${logfile} ${pltfile} + + elif [[ $MY_MACHINE = "wcoss2" ]]; then + $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=50:00 -N ${jobname} \ + -l select=1:mem=200M ${pltfile} fi #-------------------------------------------- @@ -72,7 +76,18 @@ echo "--> mk_time_vert.sh" ${SUB} -A ${ACCOUNT} --ntasks=1 --time=${walltime} \ -p service -J ${jobname} -o ${logfile} ${pltfile} + elif [[ $MY_MACHINE = "wcoss2" ]]; then + + if [[ ${type} == "uv" || ${type} == "u" || ${type} == "v" ]]; then + walltime="01:30:00" + else + walltime="50:00" + fi + + $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=${walltime}\ + -N ${jobname} -l select=1:mem=200M ${pltfile} fi + done @@ -102,6 +117,10 @@ echo "--> mk_time_vert.sh" ${SUB} -A ${ACCOUNT} --ntasks=1 --time=${walltime} \ -p service -J ${jobname} -o ${logfile} ${pltfile} + + elif [[ $MY_MACHINE == "wcoss2" ]]; then + $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=50:00 \ + -N ${jobname} -l select=1:mem=500M ${pltfile} fi done diff --git a/util/Conventional_Monitor/image_gen/ush/plot_horz.sh b/util/Conventional_Monitor/image_gen/ush/plot_horz.sh index 4fd59f880b..f85dcd899a 100755 --- a/util/Conventional_Monitor/image_gen/ush/plot_horz.sh +++ b/util/Conventional_Monitor/image_gen/ush/plot_horz.sh @@ -13,8 +13,6 @@ rc=0 - pdy=`echo $PDATE|cut -c1-8` - cyc=`echo $PDATE|cut -c9-10` hh_tankdir=${C_TANKDIR}/${RUN}.${PDY}/${CYC}/conmon/horz_hist export xsize=x800 @@ -184,20 +182,16 @@ $GRADS -blc "run plothorz_${dtype}.gs" - mkdir -p ${C_IMGNDIR}/pngs/horz/${CYC} + outdir=${C_IMGNDIR}/pngs/horz + mkdir -p ${outdir} img_files=`ls *.png` for imgf in $img_files; do newf=`echo $imgf | sed -e "s/\./.${PDATE}./g"` cp $imgf $newf - mv $newf ${C_IMGNDIR}/pngs/horz/. + mv $newf ${outdir}/. done -# if [[ $CONMON_SUFFIX != "v16rt2" ]]; then -# mv -f *.png ${C_IMGNDIR}/pngs/horz/${CYC}/. -# fi - - done ### dtype loop done ### type loop diff --git a/util/Conventional_Monitor/image_gen/ush/plot_horz_uv.sh b/util/Conventional_Monitor/image_gen/ush/plot_horz_uv.sh index 5cefc700ab..7340bf2423 100755 --- a/util/Conventional_Monitor/image_gen/ush/plot_horz_uv.sh +++ b/util/Conventional_Monitor/image_gen/ush/plot_horz_uv.sh @@ -10,8 +10,6 @@ set -ax echo "--> plot_horz_uv.sh" rc=0 - pdy=`echo $PDATE|cut -c1-8` - cyc=`echo $PDATE|cut -c9-10` hh_tankdir=${C_TANKDIR}/${RUN}.${PDY}/${CYC}/conmon/horz_hist export savedir=${hh_tankdir} @@ -175,21 +173,15 @@ set -ax ${GRADS} -blc "run plothorz_${dtype}.gs" - outdir=${C_IMGNDIR}/pngs/horz/${CYC} + outdir=${C_IMGNDIR}/pngs/horz mkdir -p ${outdir} img_files=`ls *.png` for imgf in $img_files; do newf=`echo $imgf | sed -e "s/\./.${PDATE}./g"` - cp $imgf $newf - mv $newf ${C_IMGNDIR}/pngs/horz/. + cp $imgf ${C_IMGNDIR}/pngs/horz/${newf} done - if [[ $CONMON_SUFFIX != "v16rt2" ]]; then - mv -f *.png ${outdir}/. - fi - - done ### dtype loop done ### type loop diff --git a/util/Conventional_Monitor/nwprod/gdas_conmon/driver/test_jgdas_vcmon_wcoss2.sh b/util/Conventional_Monitor/nwprod/gdas_conmon/driver/test_jgdas_vcmon_wcoss2.sh new file mode 100755 index 0000000000..c7b43ece20 --- /dev/null +++ b/util/Conventional_Monitor/nwprod/gdas_conmon/driver/test_jgdas_vcmon_wcoss2.sh @@ -0,0 +1,89 @@ +#!/bin/ksh -l + +#PBS -o gdas_vconmon.out +#PBS -e gdas_vconmon.err +#PBS -N gdas_vconmon +#PBS -q dev +#PBS -l select=1:mem=5000M +#PBS -l walltime=30:00 +#PBS -A GFS-DEV + +set -x + +export PDATE=${PDATE:-2021082318} + + +############################################################# +# Specify versions +############################################################# +export gdas_ver=v16.1.5 +export global_shared_ver=v16.1.5 + +############################################################# +# Load modules +############################################################# +module purge + +module load gcc/11.2.0 +module load intel/19.1.3.304 +module load libjpeg/9c +module load grib_util/1.2.3 + +module load prod_util/2.0.10 +module load util_shared/1.4.0 + +module load cray-mpich/8.1.7 +module load netcdf/4.7.4 + +module list + +############################################################# +# Specify whether the run is production or development +############################################################# +export PDY=`echo $PDATE | cut -c1-8` +export CYC=`echo $PDATE | cut -c9-10` +export job=gdas_conmon.${CYC} +export pid=${pid:-$$} +export jobid=${job}.${pid} +export DATAROOT=/lfs/h1/ops/canned/com/gfs/v16.2 +export COMROOT=/lfs/h2/emc/ptmp/${LOGNAME} + +############################################################# +# WCOSS environment settings +############################################################# +export POE=YES + + +############################################################# +# Set user specific variables +############################################################# +export CONMON_SUFFIX=${CONMON_SUFFIX:-test_conmon} + +export NWTEST=/lfs/h2/emc/da/noscrub/Edward.Safford/git/gsi/GSI/util/Conventional_Monitor/nwprod +export HOMEconmon=${HOMEconmon:-${NWTEST}/conmon_shared} + +export HOMEgdas_conmon=${HOMEgdas_conmon:-${NWTEST}/gdas_conmon} +export HOMEgfs_conmon=${HOMEgdas_conmon} + +export JOBGLOBAL=${HOMEgdas_conmon}/jobs +export C_COM_IN=${C_COM_IN:-${DATAROOT}} + +export C_TANKDIR=${C_TANKDIR:-${COMROOT}/${CONMON_SUFFIX}} +if [[ ! -d $C_TANKDIR ]]; then + mkdir -p ${C_TANKDIR} +fi + +export CONMON_WORK_DIR=${CONMON_WORK_DIR:-/lfs/h2/emc/stmp/$LOGNAME/conmon_${CONMON_SUFFIX}} +if [[ -d $CONMON_WORK_DIR ]]; then + rm -rf ${CONMON_WORK_DIR} +fi +mkdir -p ${CONMON_WORK_DIR} + + +############################################################# +# Execute job +############################################################# +$JOBGLOBAL/JGDAS_ATMOS_CONMON + +exit + diff --git a/util/Conventional_Monitor/parm/ConMon_config b/util/Conventional_Monitor/parm/ConMon_config index 2cd923f86d..fa779dd208 100644 --- a/util/Conventional_Monitor/parm/ConMon_config +++ b/util/Conventional_Monitor/parm/ConMon_config @@ -74,8 +74,6 @@ if [[ $CONMON_CONFIG -ne 1 ]]; then export SUB="bsub" export COMPRESS=gzip export UNCOMPRESS="gunzip -f" - export PROJECT=${PROJECT:-GDAS-DEV} - export JOB_QUEUE=${JOB_QUEUE:-dev_shared} elif [[ $MY_MACHINE = "wcoss_d" ]]; then shell=sh @@ -106,8 +104,6 @@ if [[ $CONMON_CONFIG -ne 1 ]]; then export SUB="bsub" export COMPRESS=/usr/bin/gzip export UNCOMPRESS="/usr/bin/gunzip -f" - export PROJECT=${PROJECT:-GFS-DEV} - export JOB_QUEUE=${JOB_QUEUE:-dev_shared} elif [[ $MY_MACHINE = "hera" ]]; then module use -a /apps/modules/modulefamilies/intel @@ -123,11 +119,17 @@ if [[ $CONMON_CONFIG -ne 1 ]]; then export NDATE=/home/Edward.Safford/bin/ndate export COMPRESS=${COMPRESS:-gzip} export UNCOMPRESS=${UNCOMPRESS:-"gunzip -f"} + + elif [[ $MY_MACHINE = "wcoss2" ]]; then + export COMPRESS=/usr/bin/gzip + export UNCOMPRESS="/usr/bin/gunzip -f" fi export Z="gz" export ACCOUNT=${ACCOUNT:-} + export PROJECT= + export JOB_QUEUE= export C_STMP=${C_STMP:-/gpfs/dell2/stmp} export C_STMP_USER=${C_STMP_USER:-${C_STMP}/${LOGNAME}}