New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
sette.sh in utils/CI/sette_ticket2496 – NEMO

source: utils/CI/sette_ticket2496/sette.sh @ 14227

Last change on this file since 14227 was 13568, checked in by acc, 4 years ago

Added some new controls for SETTE.

SETTE currently carries out several types of tests: restartability, reproducibility, code
corruption (agrif-related) and, in the case of LOCK_EXCHANGE and OVERFLOW, a series of
runs with different physical options. For quick checking, such as is now the default with
a *DEBUG* arch file, a subset of these tests may be appropriate. This commit provides
that possibility by introducing a new command line option to sette.sh. Without arguments
SETTE will carry out all tests labelled as: "RESTART REPRO CORRUPT PHYOPTS". The
explicit equivalent would be:

./sette.sh -x "RESTART REPRO CORRUPT PHYOPTS"

any subset of these is allowed but RESTART is mandatory (since this compiles the code)
and will be prepended if omitted. For example:

./sette.sh

Configurations ORCA2_ICE_PISCES ORCA2_OFF_PISCES AMM12 AGRIF WED025 GYRE_PISCES SAS
ORCA2_ICE_OBS ICE_AGRIF OVERFLOW LOCK_EXCHANGE VORTEX ISOMIP+ will be tested if they
are available

Carrying out the following tests: RESTART REPRO CORRUPT PHYOPTS


Or to test restartability only on one configuration:

./sette.sh -t GYRE_PISCES -x RESTART

Configuration GYRE_PISCES will be tested if it is available

Carrying out the following tests: RESTART


Or trying to test reproducibility on its own will also invoke RESTART:

./sette.sh -t GYRE_PISCES -x REPRO

Configuration GYRE_PISCES will be tested if it is available

Carrying out the following tests: RESTART REPRO


Some subtle changes to the bash scripts have been necessary to achieve
this. Notably, param.cfg is only evaluated by sette.sh and consequently the
sette_reference-configurations.sh and sette_test-cases.sh scripts must now be run within
the same shell as sette.sh. This has been tested but there remains a possibility that
different flavours of bash may behave differently. I will hold off from updating the
svn_external reference for SETTE until this has been confirmed to work elsewhere.

One other change is the addition of an internal setting for USING_EXTRA_HALO which
mimics the USING_ICEBERGS setting within sette_reference-configurations.sh and can be
used to toggle testing with the extra halo.

This commit also introduces a debug arch file for the NOC MOBILIS system. This is an
intel-based system but has a rather dated ifort compiler (17.0.4). The -init=huge
keyword was not introduced until ifort v18. In all other arguments this arch file
matches the set recommened by Seb.

  • Property svn:executable set to *
File size: 3.2 KB
Line 
1#!/bin/sh
2# initialise user dependent variable
3SETTE_DIR=$(cd $(dirname "$0"); pwd)
4MAIN_DIR=$(dirname $SETTE_DIR)
5
6# Parse command-line arguments
7if [ $# -gt 0 ]; then
8  while getopts t:x:csh option; do
9     case $option in
10        c) export SETTE_CLEAN_CONFIGS='yes'
11           export SETTE_SYNC_CONFIGS='yes'
12           echo ""
13           echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation"
14           echo "";;
15        s) export SETTE_SYNC_CONFIGS='yes'
16           echo ""
17           echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration"
18           echo "";;
19        t) export SETTE_TEST_CONFIGS=($OPTARG)
20           echo ""
21           if [ ${#SETTE_TEST_CONFIGS[@]} -gt 1 ]; then
22             echo "Configurations ${SETTE_TEST_CONFIGS[@]} will be tested if they are available"
23           else
24             echo "Configuration ${SETTE_TEST_CONFIGS[@]} will be tested if it is available"
25           fi
26           echo "" ;;
27        x) export SETTE_TEST_TYPES=($OPTARG)
28           ;;
29        h | *) echo 'sette.sh with no arguments (in this case all configuration will be tested)'
30               echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations'
31               echo '-x "TEST_type TEST_type ..." to specify particular types of test (RESTART is mandatory)'
32               echo '-c to clean each configuration'
33               echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;;
34     esac
35  done
36  shift $((OPTIND - 1))
37fi
38
39. ./param.cfg
40
41if [ ${#SETTE_TEST_CONFIGS[@]} -eq 0 ]; then
42   echo ""
43   echo "Configurations $TEST_CONFIGS will be tested if they are available"
44   echo ""
45fi
46echo ""
47echo "Carrying out the following tests: ${TEST_TYPES[@]}"
48echo ""
49
50# run sette on reference configuration
51. ./sette_reference-configurations.sh
52if [[ $? != 0 ]]; then
53   echo ""
54   echo "--------------------------------------------------------------"
55   echo "./sette_cfg-ref.sh didn't finish properly, need investigations"
56   echo "--------------------------------------------------------------"
57   echo ""
58   exit 42
59fi
60
61# run sette on test cases
62. ./sette_test-cases.sh
63if [[ $? != 0 ]]; then
64   echo ""
65   echo "-----------------------------------------------------------------"
66   echo "./sette_test-cases.sh didn't finish properly, need investigations"
67   echo "-----------------------------------------------------------------"
68   echo ""
69   exit 42
70fi
71
72# run sette report
73echo ""
74echo "-------------------------------------------------------------"
75echo "./sette_rpt.sh (script will wait all nemo_sette run are done)"
76echo "-------------------------------------------------------------"
77echo ""
78NRUN=999
79NIT=0
80while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do
81   nit=$((nit+1))
82   NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) 
83   if [[ $NRUN -ne 0 ]]; then
84      printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...';
85   else
86      printf "%-50s\n" " "
87      . ./sette_rpt.sh
88      exit
89   fi
90   sleep 10
91done
92printf "\n"
93echo ""
94echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests"
95echo ""
Note: See TracBrowser for help on using the repository browser.