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_MPI3_LoopFusion – NEMO

source: utils/CI/sette_MPI3_LoopFusion/sette.sh @ 13938

Last change on this file since 13938 was 13887, checked in by gsamson, 4 years ago

initialize SETTE_TIMING to 'no' when not using '-T' option (otherwise string comparison test fails in sette_reference-configurations.sh and sette_test-cases.sh)

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