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

Clean up and update regression test script and related files #202

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion parm/nems.configure.medcmeps_atm_ocn_ice.IN
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ALLCOMP_attributes::
ScalarFieldIdxGridNY = 2
ScalarFieldName = cpl_scalars
start_type = @[RUNTYPE]
case_name = ufs.s2s
case_name = ./RESTART/ufs.s2s
restart_n = @[FV3_RESTART_INTERVAL]
restart_option = nhours
restart_ymd = -999
Expand Down
2 changes: 1 addition & 1 deletion parm/nems.configure.medcmeps_atm_ocn_ice_wav.IN
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ALLCOMP_attributes::
ScalarFieldIdxGridNY = 2
ScalarFieldName = cpl_scalars
start_type = @[RUNTYPE]
case_name = ufs.s2s
case_name = ./RESTART/ufs.s2s
restart_n = @[FV3_RESTART_INTERVAL]
restart_option = nhours
restart_ymd = -999
Expand Down
9 changes: 5 additions & 4 deletions tests/abort_dep_tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
from __future__ import print_function
import ecflow
import re

Expand Down Expand Up @@ -33,7 +34,7 @@ def __check_task(self, node):
task = self.__defs.find_abs_node( self.__suite.get_abs_node_path() + "/" + t)
if task.get_state() == ecflow.State.aborted:
if node.get_state() != ecflow.State.aborted:
print "Will force aborted state for task", node.get_abs_node_path()
print("Will force aborted state for task", node.get_abs_node_path())
self.__ci.force_state(node.get_abs_node_path(), ecflow.State.aborted)

try:
Expand All @@ -48,11 +49,11 @@ def __check_task(self, node):
server_defs = ci.get_defs()

if server_defs == None :
print "The server has no definition"
print("The server has no definition")
exit(1)

traverser = DefsTraverser(server_defs, ci)
traverser.force_abort()

except RuntimeError, e:
print "failed: " + str(e)
except RuntimeError as e:
print("failed: " + str(e))
1 change: 0 additions & 1 deletion tests/default_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,5 @@ export RESTART_SUFFIX=''
export_35d_run ()
{
export CNTL_DIR=""
export CNTLMED_DIR=""
export LIST_FILES=""
}
24 changes: 0 additions & 24 deletions tests/detect_machine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,6 @@ export ACCNR=${ACCNR:-nems}

case $(hostname -f) in

g10a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### gyre 1
g10a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### gyre 2
g14a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### gyre 3
g14a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### gyre 4

t10a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### tide 1
t10a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### tide 2
t14a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### tide 3
t14a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=1;; ### tide 4

g20a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### gyre phase2
g20a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### gyre phase2
g20a3.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### gyre phase2
g21a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### gyre phase2
g21a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### gyre phase2
g21a3.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### gyre phase2

t20a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### tide phase2
t20a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### tide phase2
t20a3.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### tide phase2
t21a1.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### tide phase2
t21a2.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### tide phase2
t21a3.ncep.noaa.gov) MACHINE_ID=wcoss ; export pex=2;; ### tide phase2

llogin1) MACHINE_ID=wcoss_cray ;; ### luna
llogin2) MACHINE_ID=wcoss_cray ;; ### luna
llogin3) MACHINE_ID=wcoss_cray ;; ### luna
Expand Down
3 changes: 1 addition & 2 deletions tests/fv3_conf/cpld_fv3_mom6_cice_atm_flux_run.IN
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ else
cp ../${DEP_RUN}/RESTART/MOM*.nc ./INPUT

# CMEPS restart and pointer files
#cp ${DEP_RUN}/RESTART/ufs.s2s.cpl.r.2016-10-05-00000.nc .
cp ../${DEP_RUN}/ufs.s2s.cpl.r.2016-10-05-00000.nc .
cp ../${DEP_RUN}/RESTART/ufs.s2s.cpl.r.2016-10-05-00000.nc .
RFILE="ufs.s2s.cpl.r.2016-10-05-00000.nc"
ls -1 ${RFILE}>rpointer.cpl

Expand Down
25 changes: 21 additions & 4 deletions tests/head.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,26 @@ ecflow_client --init=$$


# Define a error handler
ERROR() {
handle_error() {
set +e # Clear -e flag, so we don't fail
kill $(jobs -p)
wait # wait for background process to stop

ecflow_client --ping --host=${ECF_HOST} --port=${ECF_PORT}
not_running=$?
if [[ $not_running -eq 0 ]]; then
export ECF_TIMEOUT=5
ecflow_client --abort=error # Notify ecFlow that something went wrong, using 'trap' as the reason
fi
sleep 5
trap 0 # Remove the trap
exit 0 # End the script
}

# Define a signal handler
handle_signal() {
set +e # Clear -e flag, so we don't fail
jobs -l
[[ -z "$(jobs -p)" ]] || kill $(jobs -p)
wait # wait for background process to stop

ecflow_client --ping --host=${ECF_HOST} --port=${ECF_PORT}
Expand All @@ -41,9 +58,9 @@ ERROR() {


# Trap any calls to exit and errors caught by the -e flag
trap ERROR 0
trap handle_error 0

# Trap any signal that may cause the script to fail
trap '{ echo "$0 Killed by a signal"; ERROR ; }' 1 2 3 4 5 6 7 8 10 12 13 15
trap '{ echo "$0 Killed by a signal"; handle_signal ; }' 1 2 3 4 5 6 7 8 10 12 13 15

### head.h end
Loading