1 | #!/bin/sh |
---|
2 | # initialise user dependent variable |
---|
3 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
4 | MAIN_DIR=$(dirname $SETTE_DIR) |
---|
5 | export SETTE_TIMING='no' |
---|
6 | export NOT_USING_QCO='no' |
---|
7 | export USING_RK3='no' |
---|
8 | export USING_ICEBERGS='yes' |
---|
9 | export USING_EXTRA_HALO='no' |
---|
10 | export USING_TILING='no' |
---|
11 | |
---|
12 | # Parse command-line arguments |
---|
13 | if [ $# -gt 0 ]; then |
---|
14 | while getopts n:x:cshTqQtei option; do |
---|
15 | case $option in |
---|
16 | c) export SETTE_CLEAN_CONFIGS='yes' |
---|
17 | export SETTE_SYNC_CONFIGS='yes' |
---|
18 | echo "" |
---|
19 | echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation" |
---|
20 | echo "";; |
---|
21 | s) export SETTE_SYNC_CONFIGS='yes' |
---|
22 | echo "" |
---|
23 | echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration" |
---|
24 | echo "";; |
---|
25 | n) export SETTE_TEST_CONFIGS=($OPTARG) |
---|
26 | echo "" |
---|
27 | if [ ${#SETTE_TEST_CONFIGS[@]} -gt 1 ]; then |
---|
28 | echo "Configurations ${SETTE_TEST_CONFIGS[@]} will be tested if they are available" |
---|
29 | else |
---|
30 | echo "Configuration ${SETTE_TEST_CONFIGS[@]} will be tested if it is available" |
---|
31 | fi |
---|
32 | echo "" ;; |
---|
33 | x) export SETTE_TEST_TYPES=($OPTARG) |
---|
34 | ;; |
---|
35 | T) export SETTE_TIMING='yes' |
---|
36 | echo "" |
---|
37 | echo "ln_timing will be set to true" |
---|
38 | echo "";; |
---|
39 | q) export NOT_USING_QCO='yes' |
---|
40 | echo "" |
---|
41 | echo "key_qco and key_linssh will NOT be activated" |
---|
42 | echo "";; |
---|
43 | Q) export USING_RK3='no' |
---|
44 | echo "" |
---|
45 | echo "key_qco and key_RK3 will be activated" |
---|
46 | echo "..when they are ready; disabled for now: USING_RK3='no'" |
---|
47 | echo "";; |
---|
48 | t) export USING_TILING='yes' |
---|
49 | echo "" |
---|
50 | echo "ln_tile will be set to true AND nn_hls will be set to 2" |
---|
51 | echo "";; |
---|
52 | e) export USING_EXTRA_HALO='yes' |
---|
53 | echo "" |
---|
54 | echo "nn_hls will be set to 2" |
---|
55 | echo "";; |
---|
56 | i) export USING_ICEBERGS='no' |
---|
57 | echo "" |
---|
58 | echo "ln_icebergs will be set to false" |
---|
59 | echo "";; |
---|
60 | h | *) echo 'sette.sh with no arguments (in this case all configuration will be tested)' |
---|
61 | echo '-n "CFG1_to_test CFG2_to_test ..." to test some specific configurations' |
---|
62 | echo '-x "TEST_type TEST_type ..." to specify particular types of test (RESTART is mandatory)' |
---|
63 | echo '-T to set ln_timing true for all non-AGRIF configurations' |
---|
64 | echo '-c to clean each configuration' |
---|
65 | echo '-q run without qco environment' |
---|
66 | echo '-Q run with key_qco AND key_RK3 (currently disabled)' |
---|
67 | echo '-t activate ln_tile in all tests that support it; also forces nn_hls=2 (default: off)' |
---|
68 | echo '-e activate extended halo (nn_hls=2) in all tests that support it (default: nn_hls=1)' |
---|
69 | echo '-i run without icebergs even in tests that support them (default: on)' |
---|
70 | echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;; |
---|
71 | esac |
---|
72 | done |
---|
73 | shift $((OPTIND - 1)) |
---|
74 | fi |
---|
75 | |
---|
76 | . ./param.cfg |
---|
77 | |
---|
78 | if [ ${#SETTE_TEST_CONFIGS[@]} -eq 0 ]; then |
---|
79 | echo "" |
---|
80 | echo "Configurations $TEST_CONFIGS will be tested if they are available" |
---|
81 | echo "" |
---|
82 | fi |
---|
83 | echo "" |
---|
84 | echo "Carrying out the following tests: ${TEST_TYPES[@]}" |
---|
85 | echo "" |
---|
86 | |
---|
87 | # run sette on reference configuration |
---|
88 | . ./sette_reference-configurations.sh |
---|
89 | if [[ $? != 0 ]]; then |
---|
90 | echo "" |
---|
91 | echo "--------------------------------------------------------------" |
---|
92 | echo "./sette_cfg-ref.sh didn't finish properly, need investigations" |
---|
93 | echo "--------------------------------------------------------------" |
---|
94 | echo "" |
---|
95 | exit 42 |
---|
96 | fi |
---|
97 | |
---|
98 | # run sette on test cases |
---|
99 | . ./sette_test-cases.sh |
---|
100 | if [[ $? != 0 ]]; then |
---|
101 | echo "" |
---|
102 | echo "-----------------------------------------------------------------" |
---|
103 | echo "./sette_test-cases.sh didn't finish properly, need investigations" |
---|
104 | echo "-----------------------------------------------------------------" |
---|
105 | echo "" |
---|
106 | exit 42 |
---|
107 | fi |
---|
108 | |
---|
109 | # run sette report |
---|
110 | echo "" |
---|
111 | echo "-------------------------------------------------------------" |
---|
112 | echo "./sette_rpt.sh (script will wait all nemo_sette run are done)" |
---|
113 | echo "-------------------------------------------------------------" |
---|
114 | echo "" |
---|
115 | NRUN=999 |
---|
116 | NIT=0 |
---|
117 | while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do |
---|
118 | nit=$((nit+1)) |
---|
119 | NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) |
---|
120 | if [[ $NRUN -ne 0 ]]; then |
---|
121 | printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...'; |
---|
122 | else |
---|
123 | printf "%-50s\n" " " |
---|
124 | . ./sette_rpt.sh |
---|
125 | exit |
---|
126 | fi |
---|
127 | sleep 10 |
---|
128 | done |
---|
129 | printf "\n" |
---|
130 | echo "" |
---|
131 | echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" |
---|
132 | echo "" |
---|