Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate ecflow feedback from NCO - part 1 #564

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions ecf/include/envir-p1.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,16 @@
export job=${job:-$PBS_JOBNAME}
export jobid=${jobid:-$job.$PBS_JOBID}

export RUN_ENVIR=emc
export envir=%ENVIR%
export MACHINE_SITE=%MACHINE_SITE%
export SENDDBN=${SENDDBN:-%SENDDBN:YES%}
export SENDDBN_NTC=${SENDDBN_NTC:-%SENDDBN_NTC:YES%}
if [[ "$envir" == prod && "$SENDDBN" == YES ]]; then
export eval=%EVAL:NO%
if [ $eval == YES ]; then
export SIPHONROOT=${UTILROOT}/para_dbn
else
export SIPHONROOT=/lfs/h1/ops/prod/dbnet_siphon
if [ $eval == YES ]; then export SIPHONROOT=${UTILROOT}/para_dbn
else export SIPHONROOT=/lfs/h1/ops/prod/dbnet_siphon
fi
export SIPHONROOT=${UTILROOT}/fakedbn
if [ "$PARATEST" == YES ]; then export SIPHONROOT=${UTILROOT}/fakedbn; export NODBNFCHK=YES; fi
else
export SIPHONROOT=${UTILROOT}/fakedbn
fi

export DBNROOT=$SIPHONROOT

if [[ ! " prod para test " =~ " ${envir} " && " ops.prod ops.para " =~ " $(whoami) " ]]; then err_exit "ENVIR must be prod, para, or test [envir-p1.h]"; fi
export DATAROOT=/lfs/h2/emc/stmp/Lin.Gan/RUNDIRS/ecfops
export COMROOT=/lfs/h2/emc/ptmp/Lin.Gan/ecfops/com
export COREROOT=/lfs/h2/emc/ptmp/production.core/$jobid
export NWROOT=/lfs/h1/ops/prod
export SENDECF=${SENDECF:-YES}
export SENDCOM=${SENDCOM:-YES}
export KEEPDATA=${KEEPDATA:-%KEEPDATA:NO%}
export TMPDIR=${TMPDIR:-${DATAROOT:?}}
if [ -n "%PDY:%" ]; then
export PDY=${PDY:-%PDY:%}
export CDATE=${PDY}%CYC:%
fi
if [ -n "%COMPATH:%" ]; then export COMPATH=${COMPATH:-%COMPATH:%}; fi
if [ -n "%MAILTO:%" ]; then export MAILTO=${MAILTO:-%MAILTO:%}; fi
if [ -n "%DBNLOG:%" ]; then export DBNLOG=${DBNLOG:-%DBNLOG:%}; fi


60 changes: 0 additions & 60 deletions ecf/include/envir-p3.h

This file was deleted.

82 changes: 48 additions & 34 deletions ecf/include/head.h
Original file line number Diff line number Diff line change
@@ -1,65 +1,77 @@
date
hostname
set -xe # print commands as they are executed and enable signal trapping

export PS4='+ $SECONDS + '
export PS4='+ $SECONDS + '

# Variables needed for communication with ecFlow
export ECF_NAME=%ECF_NAME%
export ECF_HOST=%ECF_LOGHOST%
export ECF_PORT=%ECF_PORT%
export ECF_PASS=%ECF_PASS%
export ECF_TRYNO=%ECF_TRYNO%
export ECF_RID=${ECF_RID:-${PBS_JOBID:-$$}}
export ECF_RID=${ECF_RID:-${PBS_JOBID:-$(hostname -s).$$}}
export ECF_JOB=%ECF_JOB%
export ECF_JOBOUT=%ECF_JOBOUT%
export ecflow_ver=%ecflow_ver%

if [ -d /apps/ops/prod ]; then # On WCOSS2
set +x
echo "Running 'module reset'"
module reset
module load envvar/1.0
module load PrgEnv-intel/8.1.0
module load craype/2.7.8
module load intel/19.1.3.304
set -x
fi

export HOMEgfs=/lfs/h2/emc/global/noscrub/$USER/git/feature-ops-wcoss2
. ${HOMEgfs}/versions/run.ver
export gfs_ver=v16.2
modelhome=%PACKAGEHOME:%
eval "export HOME${model:?'model undefined'}=$modelhome"
eval "versionfile=\$HOME${model}/versions/run.ver"
if [ -f "$versionfile" ]; then . $versionfile ; fi
modelver=$(echo ${modelhome} | perl -pe "s:.*?/${model}\.(v[\d\.a-z]+).*:\1:")
eval "export ${model}_ver=$modelver"

if [ -d /apps/ops/prod ]; then # On WCOSS2
export ECF_ROOT=/apps/ops/prod/nco/core/ecflow.v5.6.0.7
. ${ECF_ROOT}/versions/run.ver
module load prod_util/${prod_util_ver}
module load prod_envir/${prod_envir_ver}
export envir=%ENVIR%
export MACHINE_SITE=%MACHINE_SITE%
export RUN_ENVIR=${RUN_ENVIR:-nco}
export SENDECF=${SENDECF:-YES}
export SENDCOM=${SENDCOM:-YES}
if [ -n "%PDY:%" ]; then export PDY=${PDY:-%PDY:%}; fi
if [ -n "%PARATEST:%" ]; then export PARATEST=${PARATEST:-%PARATEST:%}; fi
if [ -n "%COMPATH:%" ]; then export COMPATH=${COMPATH:-%COMPATH:%}; fi
if [ -n "%MAILTO:%" ]; then export MAILTO=${MAILTO:-%MAILTO:%}; fi
if [ -n "%DBNLOG:%" ]; then export DBNLOG=${DBNLOG:-%DBNLOG:%}; fi
export KEEPDATA=${KEEPDATA:-%KEEPDATA:NO%}
export SENDDBN=${SENDDBN:-%SENDDBN:YES%}
export SENDDBN_NTC=${SENDDBN_NTC:-%SENDDBN_NTC:YES%}

if [ -d /apps/ops/prod ]; then # On WCOSS2
set +x
if [ $(whoami) == ops.para ]; then
module use -a /apps/ops/para/nco/modulefiles/core
fi
echo "Running module load ecflow/$ecflow_ver"
module load ecflow/$ecflow_ver
echo "ecflow module location: $(module display ecflow |& head -2 | tail -1 | sed 's/:$//')"
export ECF_ROOT=/apps/ops/prod/nco/core/ecflow.v5.6.0.7
export ECF_PORT=34326
export ECF_HOST=ddecflow02
export ECF_INCLUDE=/lfs/h2/emc/global/noscrub/$USER/git/feature-ops-wcoss2/ecf/include
export ECF_HOME=/lfs/h2/emc/global/noscrub/$USER/ecflow/submit
export ECF_DATA_ROOT=/lfs/h2/emc/global/noscrub/$USER/ecflow
export ECF_OUTPUTDIR=/lfs/h2/emc/global/noscrub/$USER/ecflow/output
export ECF_COMDIR=/lfs/h2/emc/global/noscrub/$USER/ecflow/submit
export ECF_COMDIR=/lfs/h2/emc/ptmp/$USER/ecflow/submit
ecflow_client --alter change variable ECF_INCLUDE /lfs/h2/emc/global/noscrub/$USER/git/feature-ops-wcoss2/ecf/include /

set -x
. ${ECF_ROOT}/versions/run.ver
set +x
module load prod_util/${prod_util_ver}
module load prod_envir/${prod_envir_ver}
echo "Listing modules from head.h:"
module list
set -x
fi

timeout 300 ecflow_client --init=${ECF_RID}

POST_OUT=/lfs/h2/emc/stmp/$USER/RUNDIRS/ecfops/tmp/posts/ecflow_post_in.$USER.${PBS_JOBID}
mkdir -p /lfs/h2/emc/stmp/$USER/RUNDIRS/ecfops/tmp/posts
echo 'export ECF_NAME=${ECF_NAME}' > $POST_OUT
echo 'export ECF_HOST=${ECF_HOST}' >> $POST_OUT
echo 'export ECF_PORT=${ECF_PORT}' >> $POST_OUT
echo 'export ECF_PASS=${ECF_PASS}' >> $POST_OUT
echo 'export ECF_TRYNO=${ECF_TRYNO}' >> $POST_OUT
echo 'export ECF_RID=${ECF_RID}' >> $POST_OUT
if [[ " ops.prod ops.para " =~ " $(whoami) " ]]; then
POST_OUT=${POST_OUT:-/lfs/h1/ops/%ENVIR%/tmp/posts/ecflow_post_in.${ECF_RID}}
echo 'export ECF_NAME=${ECF_NAME}' > $POST_OUT
echo 'export ECF_HOST=${ECF_HOST}' >> $POST_OUT
echo 'export ECF_PORT=${ECF_PORT}' >> $POST_OUT
echo 'export ECF_PASS=${ECF_PASS}' >> $POST_OUT
echo 'export ECF_TRYNO=${ECF_TRYNO}' >> $POST_OUT
echo 'export ECF_RID=${ECF_RID}' >> $POST_OUT
fi

# Define error handler
ERROR() {
Expand All @@ -71,7 +83,9 @@ ERROR() {
fi
ecflow_client --abort="$msg"
echo $msg
echo "Trap Caught" >>$POST_OUT
if [[ " ops.prod ops.para " =~ " $(whoami) " ]]; then
echo "# Trap Caught" >>$POST_OUT
fi
trap $1; exit $1
}
# Trap all error and exit signals
Expand Down
5 changes: 0 additions & 5 deletions ecf/include/model_ver.h

This file was deleted.

2 changes: 1 addition & 1 deletion ecf/include/tail.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ecflow_client --complete # Notify ecFlow of a normal end
timeout 300 ecflow_client --complete # Notify ecFlow of a normal end
trap 0 # Remove all traps
exit 0 # End the shell