Changeset 8883
- Timestamp:
- 2017-12-01T18:51:27+01:00 (7 years ago)
- Location:
- branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST
- Files:
-
- 1 deleted
- 2 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/env.sh
r8859 r8883 70 70 ## Source user & (super)computer configurations 71 71 ##-------------------------------------------------------------------------------- 72 . ./cfg/${TRUST_MAIN_ USER}.cfg72 . ./cfg/${TRUST_MAIN_SETUP}.cfg 73 73 . ./cfg/${TRUST_MAIN_HPCC}.cfg 74 74 … … 193 193 ##-------------- 194 194 195 export TRUST_TEST_NAME=${TRUST_MAIN_ USER}'_'${TRUST_MAIN_HPCC}195 export TRUST_TEST_NAME=${TRUST_MAIN_SETUP}'_'${TRUST_MAIN_HPCC} 196 196 export TRUST_TEST_DATE=$( date -u +"%Y%m%d%Z%H%M" ) 197 197 -
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/functions.sh
r8859 r8883 17 17 ## Functions in order of use 18 18 ##-------------------------------------------------------------------------------- 19 20 display_help() { 21 cat ./inc/trusting_help.txt 22 } 19 23 20 24 step() { … … 520 524 521 525 Testing configuration ${TRUST_CFG_NEW} based on ${TRUST_CFG_REF}. 522 User installation ${TRUST_MAIN_ USER}526 User installation ${TRUST_MAIN_SETUP} 523 527 HPC environment ${TRUST_MAIN_HPCC} 524 528 -
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/help.txt
r8859 r8883 1 Usage: ./trusting.sh -u $USER -m $ARCH [OPTIONS]2 ./install_new_branch -u $USER -m $ARCH [OPTIONS]3 1 4 2 ./trusting.sh Launch trusting test on $ARCH machine from $USER installation -
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh
r8834 r8883 15 15 '-d'|'--debug' ) TRUST_FLAG_DEBUG=1 ; shift ;; '-j'|'--job' ) TRUST_COMPILE_NPROC=$2; shift 2;; 16 16 '-m'|'--machine') TRUST_MAIN_HPCC=$2; shift 2;; '-h'|'--help' ) TRUST_FLAG_HELP=1 ; shift ;; 17 '-u'|'--user' ) TRUST_MAIN_ USER=$2; shift 2;; "*" ) TRUST_FLAG_HELP=1 ; shift ;;17 '-u'|'--user' ) TRUST_MAIN_SETUP=$2; shift 2;; "*" ) TRUST_FLAG_HELP=1 ; shift ;; 18 18 esac 19 19 done … … 22 22 ## Initialization (HPC & user environment) 23 23 ##--------------------------------------------------- 24 if [[ ! -e cfg/${TRUST_MAIN_ USER}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg || ${TRUST_FLAG_HELP} -eq 1 ]]; then24 if [[ ! -e cfg/${TRUST_MAIN_SETUP}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg || ${TRUST_FLAG_HELP} -eq 1 ]]; then 25 25 cat ./inc/trusting_help.txt 26 26 … … 28 28 printf "\n\n\033[0;33m" 29 29 printf "At least one configuration (arch or user) file is missing or misspelled:" 30 printf "\t'%s'.cfg\t'%s'.cfg" ${TRUST_MAIN_ USER} ${TRUST_MAIN_HPCC}30 printf "\t'%s'.cfg\t'%s'.cfg" ${TRUST_MAIN_SETUP} ${TRUST_MAIN_HPCC} 31 31 printf "\033[0m" 32 32 fi -
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh
r8859 r8883 2 2 3 3 4 ## Possibility to call from outside 4 5 cd $( dirname $0 ) 5 6 ##--------------------------------------------------------------------------------7 ## Set flags & defaults8 ##--------------------------------------------------------------------------------9 10 6 TRUST_MAIN_DIR=$PWD 11 TRUST_FLAG_HELP='false' 12 TRUST_FLAG_DEBUG='false'; TRUST_FLAG_DEV='false' ; TRUST_FLAG_PROD='false' 13 14 # Revision number of the tool 7 8 ## Tool revision in use 15 9 rev=$( svn info | awk '/Last Changed Rev/ {print $NF}' ) 16 10 17 11 18 12 ##-------------------------------------------------------------------------------- 19 ## Get short or long arguments from command line 20 ##-------------------------------------------------------------------------------- 21 22 while getopts a:b:de:f:j:hm:n:r:t:pu:v:w: arg; do 23 24 case $arg in 25 a) TRUST_IO_FORC_TAR=$OPTARG;; b) TRUST_SVN_BRANCH=$OPTARG;; 26 d) TRUST_FLAG_DEBUG='true' ;; e) TRUST_TEST_MAILING=$OPTARG;; 27 f) TRUST_IO_FORC_PATH=$OPTARG;; j) TRUST_COMPILE_NPROC=$OPTARG;; 28 h) TRUST_FLAG_HELP='true' ;; m) TRUST_MAIN_HPCC=$OPTARG;; 29 n) TRUST_CFG_NEW=$OPTARG;; r) TRUST_CFG_REF=$OPTARG;; 30 t) TRUST_JOB_TIMEOUT=$OPTARG;; p) TRUST_FLAG_PROD='true' ;; 31 u) TRUST_MAIN_USER=$OPTARG;; v) TRUST_SVN_REV=$OPTARG;; 32 w) TRUST_DIR_WORK=$OPTARG;; 33 :) echo 'Arg. needed for '$OPTARG && TRUST_FLAG_HELP='true' ;; 34 *) TRUST_FLAG_HELP='true' ;; 13 ## Flags default 14 ##-------------------------------------------------------------------------------- 15 16 TRUST_FLAG_DEBUG='false'; TRUST_FLAG_DEV='false' 17 TRUST_FLAG_HELP='false' ; TRUST_FLAG_PROD='false' 18 19 20 ##-------------------------------------------------------------------------------- 21 ## Options from command line 22 ##-------------------------------------------------------------------------------- 23 24 while getopts ab:c:de:hj:lm:n:p:r:s:t:u:v:-: shortopt; do 25 26 ## Attempt to maintain consistency with 'makenemo' available options 27 ##o makenemo: a d e h j k m n r s t u v 28 ##o trusting: | | | = = | = = = | | | | 29 30 case $shortopt in 31 ## Mandatory (HPCC environment) 32 'm') TRUST_MAIN_HPCC=$OPTARG ;; 33 34 ## NEMO configuration 35 'n') TRUST_CFG_NEW=$OPTARG ;; 'r') TRUST_CFG_REF=$OPTARG ;; 36 37 ## Compilation 38 'j') TRUST_COMPILE_NPROC=$OPTARG;; 39 40 ## Flags 41 'h') TRUST_FLAG_HELP='true' ;; 42 43 ## Implement long options for specific not to reducing further short possibilites 44 ## https://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options 45 '-') 46 [ $OPTIND -ge 1 ] && optind=$( expr $OPTIND - 1 ) || optind=$OPTIND 47 longopt=${!optind} 48 49 OPTION=${longopt/=[0-9A-Za-z_-]*/}; OPTARG=${longopt/[a-z-]*=/} 50 51 case $OPTION in 52 ## Mandatory (installation environment) 53 '--setup' ) TRUST_MAIN_SETUP=$OPTARG ;; 54 55 ## Alt 'CONFIG' directory for standalone 'TRUST' to check several local branches 56 ##+ (default to ./../CONFIG parent) 57 '--cfgdir' ) TRUST_DIR_WORK=$OPTARG ;; 58 59 ## Local working copy 60 '--branch' ) TRUST_SVN_BRANCH=$OPTARG ;; 61 '--update' ) TRUST_SVN_REV=$OPTARG ;; 62 63 ## Compilation & Computing 64 '--timeout' ) TRUST_JOB_TIMEOUT=$OPTARG ;; 65 66 ## Inputs 67 '--forctar' ) 68 TRUST_IO_FORC_TAR='' 69 70 ## Set but not empty 71 if [ $OPTARG ]; then 72 TRUST_IO_FORC_TAR=$OPTARG 73 else 74 OPTARG='null' 75 fi 76 ;; 77 '--forcpath') TRUST_IO_FORC_PATH=$OPTARG ;; 78 79 ## Mailing 80 '--email' ) TRUST_TEST_MAILING=$OPTARG ;; 81 82 ## Flags (no argument needed) 83 '--dev' ) TRUST_FLAG_DEV='true' ; OPTARG='null';; 84 '--prod' ) TRUST_FLAG_PROD='true' ; OPTARG='null';; 85 '--debug' ) TRUST_FLAG_DEBUG='true'; OPTARG='null';; 86 87 * ) printf "\033[0;31m%s illegal long option %s\033[0m\n" \ 88 $0 $OPTION;; 89 esac 90 91 OPTIND=1; shift ;; 92 93 ## Illegal option 94 '?') TRUST_FLAG_HELP='true' ;; 35 95 esac 36 96 … … 42 102 ##-------------------------------------------------------------------------------- 43 103 44 if [[ ! -e cfg/${TRUST_MAIN_USER}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg \ 45 || ${TRUST_FLAG_HELP} == 'true' ]]; then 46 cat ./inc/trusting_help.txt 104 if [[ ! -e ./cfg/${TRUST_MAIN_SETUP}.cfg || ! -e ./cfg/${TRUST_MAIN_HPCC}.cfg ]]; then 105 106 printf "\nUsage: %s -m arch --setup cfg [OPTIONS]\n" $0 107 printf "\nSee help for options description, %s -h|--help\n" $0 47 108 48 109 ## Color this section to part with help … … 53 114 \nAt least 1 cfg file (arch or user) is missing or misspelled: \ 54 115 '%s.cfg' or '%s.cfg'\n" \ 55 ${TRUST_MAIN_USER} ${TRUST_MAIN_HPCC} 116 ${TRUST_MAIN_SETUP} ${TRUST_MAIN_HPCC} 117 else 118 printf "\033[0m" 119 cat ./inc/help.txt 56 120 fi 57 121 … … 66 130 [ ${TRUST_FLAG_DEBUG} == 'true' ] && set -vx 67 131 68 . ./inc/ trusting.env69 . ./inc/ trusting_func.sh132 . ./inc/env.sh 133 . ./inc/functions.sh 70 134 71 135 fi … … 80 144 81 145 echo 82 if [ -t 0 ]; then cat ./inc/banner.txt; else cat ./inc/banner.html; fi 146 ## Formatting for email (test not in interactive mode) 147 [ ! -t 0 ] && echo '<pre style="font: 2px/1px monospace;">' 148 cat ./inc/banner.txt 149 [ ! -t 0 ] && echo '</pre>' 83 150 echo 84 151 echo '****************************************************************************************************' … … 91 158 printf "\t§ Testing configuration\t\t%s on branch %s\n" \ ${TRUST_CFG_REF} ${TRUST_SVN_BRANCH} 92 159 printf "\t§ (Super)Computer\t\t%s\n" ${TRUST_MAIN_HPCC} 93 printf "\t§ User installation\t\t%s\n\n" ${TRUST_MAIN_ USER}160 printf "\t§ User installation\t\t%s\n\n" ${TRUST_MAIN_SETUP} 94 161 echo 95 162 if [ ${TRUST_TEST_BENCHMARK} ]; then … … 160 227 job_state 161 228 162 printf "Perfs? "229 printf "Perfs?\n" 163 230 job_perfs 164 231
Note: See TracChangeset
for help on using the changeset viewer.