[11161] | 1 | #!/bin/sh |
---|
| 2 | # initialise user dependent variable |
---|
[3520] | 3 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
[6460] | 4 | MAIN_DIR=$(dirname $SETTE_DIR) |
---|
[13887] | 5 | export SETTE_TIMING='no' |
---|
[14244] | 6 | export NOT_USING_QCO='no' |
---|
[14826] | 7 | export USING_RK3='no' |
---|
| 8 | export USING_ICEBERGS='yes' |
---|
| 9 | export USING_EXTRA_HALO='no' |
---|
| 10 | export USING_TILING='no' |
---|
[3520] | 11 | |
---|
[11161] | 12 | # Parse command-line arguments |
---|
| 13 | if [ $# -gt 0 ]; then |
---|
[14826] | 14 | while getopts n:x:cshTqQtei option; do |
---|
[11161] | 15 | case $option in |
---|
[12569] | 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 "";; |
---|
[14826] | 25 | n) export SETTE_TEST_CONFIGS=($OPTARG) |
---|
[11161] | 26 | echo "" |
---|
[13568] | 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 |
---|
[11161] | 32 | echo "" ;; |
---|
[13568] | 33 | x) export SETTE_TEST_TYPES=($OPTARG) |
---|
| 34 | ;; |
---|
[13790] | 35 | T) export SETTE_TIMING='yes' |
---|
| 36 | echo "" |
---|
| 37 | echo "ln_timing will be set to true" |
---|
| 38 | echo "";; |
---|
[14244] | 39 | q) export NOT_USING_QCO='yes' |
---|
| 40 | echo "" |
---|
| 41 | echo "key_qco and key_linssh will NOT be activated" |
---|
| 42 | echo "";; |
---|
[14826] | 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 "";; |
---|
[13568] | 60 | h | *) echo 'sette.sh with no arguments (in this case all configuration will be tested)' |
---|
[14826] | 61 | echo '-n "CFG1_to_test CFG2_to_test ..." to test some specific configurations' |
---|
[13568] | 62 | echo '-x "TEST_type TEST_type ..." to specify particular types of test (RESTART is mandatory)' |
---|
[13790] | 63 | echo '-T to set ln_timing true for all non-AGRIF configurations' |
---|
[12569] | 64 | echo '-c to clean each configuration' |
---|
[14244] | 65 | echo '-q run without qco environment' |
---|
[14826] | 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)' |
---|
[12569] | 70 | echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;; |
---|
[11161] | 71 | esac |
---|
| 72 | done |
---|
| 73 | shift $((OPTIND - 1)) |
---|
[3520] | 74 | fi |
---|
| 75 | |
---|
[11161] | 76 | . ./param.cfg |
---|
[3520] | 77 | |
---|
[13568] | 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 | |
---|
[11161] | 87 | # run sette on reference configuration |
---|
[13568] | 88 | . ./sette_reference-configurations.sh |
---|
[11161] | 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 |
---|
[3520] | 96 | fi |
---|
| 97 | |
---|
[11161] | 98 | # run sette on test cases |
---|
[13568] | 99 | . ./sette_test-cases.sh |
---|
[11161] | 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 |
---|
[3520] | 107 | fi |
---|
| 108 | |
---|
[11161] | 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)) |
---|
[12569] | 119 | NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) |
---|
[11161] | 120 | if [[ $NRUN -ne 0 ]]; then |
---|
[12569] | 121 | printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...'; |
---|
[11161] | 122 | else |
---|
| 123 | printf "%-50s\n" " " |
---|
[13568] | 124 | . ./sette_rpt.sh |
---|
[11161] | 125 | exit |
---|
| 126 | fi |
---|
| 127 | sleep 10 |
---|
[3520] | 128 | done |
---|
[11161] | 129 | printf "\n" |
---|
| 130 | echo "" |
---|
| 131 | echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" |
---|
| 132 | echo "" |
---|