[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' |
---|
[3520] | 6 | |
---|
[11161] | 7 | # Parse command-line arguments |
---|
| 8 | if [ $# -gt 0 ]; then |
---|
[13790] | 9 | while getopts t:x:cshT option; do |
---|
[11161] | 10 | case $option in |
---|
[12569] | 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 "";; |
---|
[13568] | 20 | t) export SETTE_TEST_CONFIGS=($OPTARG) |
---|
[11161] | 21 | echo "" |
---|
[13568] | 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 |
---|
[11161] | 27 | echo "" ;; |
---|
[13568] | 28 | x) export SETTE_TEST_TYPES=($OPTARG) |
---|
| 29 | ;; |
---|
[13790] | 30 | T) export SETTE_TIMING='yes' |
---|
| 31 | echo "" |
---|
| 32 | echo "ln_timing will be set to true" |
---|
| 33 | echo "";; |
---|
[13568] | 34 | h | *) echo 'sette.sh with no arguments (in this case all configuration will be tested)' |
---|
[12569] | 35 | echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations' |
---|
[13568] | 36 | echo '-x "TEST_type TEST_type ..." to specify particular types of test (RESTART is mandatory)' |
---|
[13790] | 37 | echo '-T to set ln_timing true for all non-AGRIF configurations' |
---|
[12569] | 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 ;; |
---|
[11161] | 40 | esac |
---|
| 41 | done |
---|
| 42 | shift $((OPTIND - 1)) |
---|
[3520] | 43 | fi |
---|
| 44 | |
---|
[11161] | 45 | . ./param.cfg |
---|
[3520] | 46 | |
---|
[13568] | 47 | if [ ${#SETTE_TEST_CONFIGS[@]} -eq 0 ]; then |
---|
| 48 | echo "" |
---|
| 49 | echo "Configurations $TEST_CONFIGS will be tested if they are available" |
---|
| 50 | echo "" |
---|
| 51 | fi |
---|
| 52 | echo "" |
---|
| 53 | echo "Carrying out the following tests: ${TEST_TYPES[@]}" |
---|
| 54 | echo "" |
---|
| 55 | |
---|
[11161] | 56 | # run sette on reference configuration |
---|
[13568] | 57 | . ./sette_reference-configurations.sh |
---|
[11161] | 58 | if [[ $? != 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 |
---|
[3520] | 65 | fi |
---|
| 66 | |
---|
[11161] | 67 | # run sette on test cases |
---|
[13568] | 68 | . ./sette_test-cases.sh |
---|
[11161] | 69 | if [[ $? != 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 |
---|
[3520] | 76 | fi |
---|
| 77 | |
---|
[11161] | 78 | # run sette report |
---|
| 79 | echo "" |
---|
| 80 | echo "-------------------------------------------------------------" |
---|
| 81 | echo "./sette_rpt.sh (script will wait all nemo_sette run are done)" |
---|
| 82 | echo "-------------------------------------------------------------" |
---|
| 83 | echo "" |
---|
| 84 | NRUN=999 |
---|
| 85 | NIT=0 |
---|
| 86 | while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do |
---|
| 87 | nit=$((nit+1)) |
---|
[12569] | 88 | NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) |
---|
[11161] | 89 | if [[ $NRUN -ne 0 ]]; then |
---|
[12569] | 90 | printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...'; |
---|
[11161] | 91 | else |
---|
| 92 | printf "%-50s\n" " " |
---|
[13568] | 93 | . ./sette_rpt.sh |
---|
[11161] | 94 | exit |
---|
| 95 | fi |
---|
| 96 | sleep 10 |
---|
[3520] | 97 | done |
---|
[11161] | 98 | printf "\n" |
---|
| 99 | echo "" |
---|
| 100 | echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests" |
---|
| 101 | echo "" |
---|