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