Changeset 8834
- Timestamp:
- 2017-11-28T15:01:16+01:00 (7 years ago)
- Location:
- branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting.env
r8826 r8834 2 2 3 3 4 ##-------------------------------------------------------------------------------- 4 5 ## Defaults 5 6 ##-------------------------------------------------------------------------------- 6 7 8 ## Trusting result: 'FAILED' result for 'Unknown error' 9 export TRUST_FLAG_RESULT='FAILED' TRUST_FLAG_ERROR='X' 10 11 ## Locked options from command line (export as of now to environment) 12 ##------------------------------------------------------------------- 13 14 if [ ${TRUST_FLAG_DEBUG} == 'true' ]; then 15 ## debug mode (verbose output and skip XIOS compilation) 16 TRUST_IO_XIOS_MODE='' 17 TRUST_MAIN_STDOUT='1> /dev/null' 18 else 19 ## std mode (merge stdout & stderr to /dev/null, XIOS compilation from scratch) 20 TRUST_IO_XIOS_MODE='--full' 21 TRUST_MAIN_STDOUT='>& /dev/null' 22 fi 23 24 export TRUST_IO_XIOS_MODE TRUST_MAIN_STDOUT 25 26 ## If '-v' arg. has been set, modify default SVN action on working copy 27 if [ ${TRUST_SVN_REV} ]; then 28 29 if [ $( echo ${TRUST_SVN_REV} | grep "HEAD\|up\|update" ) ]; then 30 TRUST_SVN_ACTION='svn update -r HEAD --accept mine-conflict' 31 elif [ $( echo ${TRUST_SVN_REV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) ]; then 32 TRUST_SVN_ACTION='svn update -r '$( echo ${TRUST_SVN_REV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) 33 elif [ $( echo ${TRUST_SVN_REV} | grep -o '[0-9]*' ) ]; then 34 TRUST_SVN_ACTION='svn update -r '$( echo ${TRUST_SVN_REV} | grep -o '[0-9]*' ) 35 fi 36 37 else 38 ## By default, no update on SVN directories 39 TRUST_SVN_ACTION='svn status' 40 fi 41 42 export TRUST_SVN_ACTION 43 44 45 ## Options editable by .cfg files (no export at this time) 46 ##-------------------------------------------------------- 47 48 ## NEMO 'trunk' branch by default 7 49 [ -z "${TRUST_SVN_BRANCH}" ] && TRUST_SVN_BRANCH='trunk' 8 50 9 51 ## Ref. cfg. unset or empty (mandatory) 10 if [ [ -z "${TRUST_CFG_REF}" ]]; then52 if [ -z "${TRUST_CFG_REF}" ]; then 11 53 12 54 ## Default cfg from trunk excepting last stable 13 55 TRUST_CFG_REF='ORCA2_LIM3_PISCES' 14 56 15 if [[ ${TRUST_SVN_BRANCH} && ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE' ]]; then 57 if [[ ${TRUST_SVN_BRANCH} \ 58 && ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE' ]]; then 16 59 TRUST_CFG_REF='ORCA2_LIM_PISCES' 17 60 fi … … 20 63 21 64 65 ##-------------------------------------------------------------------------------- 22 66 ## Source user & (super)computer configurations 23 67 ##-------------------------------------------------------------------------------- … … 26 70 27 71 72 ##-------------------------------------------------------------------------------- 28 73 ## Checking and export environment variables 29 74 ##-------------------------------------------------------------------------------- … … 40 85 ##------------------------------------------ 41 86 42 export TRUST_SVN_REPO='https://forge.ipsl.jussieu.fr /nemo/svn'87 export TRUST_SVN_REPO='https://forge.ipsl.jussieu.fr' 43 88 export TRUST_SVN_CO=( 'ARCH CONFIG NEMO 44 89 EXTERNAL/AGRIF EXTERNAL/fcm EXTERNAL/IOIPSL … … 65 110 [ ${TRUST_CFG_REF} == 'AMM12' ] && TRUST_IO_FORC_TAR='AMM12_v3.7.tar' 66 111 112 ## Update forcing archive for stable 67 113 if [ ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE' ]; then 68 114 TRUST_IO_FORC_TAR='ORCA2_LIM_nemo_v3.6.tar' … … 97 143 ##---------------------- 98 144 145 ## Assuming the sourcing of XIOS arch .env file (modules) for setting 99 146 if [ -z "${TRUST_JOB_ENV}" ]; then 100 147 TRUST_JOB_ENV=${TRUST_IO_XIOS}/arch/arch-${TRUST_MAIN_HPCC}.env … … 103 150 export TRUST_JOB_ENV 104 151 152 ## Default parallel compilation on 4 procs 105 153 [ -z "${TRUST_COMPILE_NPROC}" ] && TRUST_COMPILE_NPROC='4' 106 154 export TRUST_COMPILE_NPROC 107 155 156 ## Not mandatory 108 157 export TRUST_COMPILE_FORTRAN TRUST_COMPILE_MPI TRUST_COMPILE_NETCDF 109 158 159 ## Assuming the job submit script is in './batch', if not 110 160 if [ -z "${TRUST_JOB_SCRIPT}" ]; then 111 161 TRUST_JOB_SCRIPT=${TRUST_MAIN_DIR}/batch/${TRUST_MAIN_HPCC}.sh || get_out A … … 114 164 export TRUST_JOB_SCRIPT 115 165 116 166 ## Mandatory job management cmds (submit, status checking and killing job) 117 167 if [[ -z "${TRUST_JOB_SUBMIT}" || -z "${TRUST_JOB_STATE}" \ 118 168 || -z "${TRUST_JOB_KILL}" ]]; then … … 122 172 export TRUST_JOB_SUBMIT TRUST_JOB_STATE TRUST_JOB_KILL 123 173 174 ## Default test timeout to 3h (pending AND running time) 124 175 [ -z "${TRUST_JOB_TIMEOUT}" ] && TRUST_JOB_TIMEOUT='10800' 125 176 export TRUST_JOB_TIMEOUT 126 177 178 ## Job informations not mandatory 127 179 export TRUST_JOB_INFO TRUST_JOB_TIME TRUST_JOB_RAM_P TRUST_JOB_RAM_V 128 180 -
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh
r8826 r8834 2 2 3 3 4 ##-------------------------------------------------------------------------------- 4 5 ## Messenger filenames 5 6 ##-------------------------------------------------------------------------------- … … 13 14 14 15 16 ##-------------------------------------------------------------------------------- 15 17 ## Functions in order of use 16 ##--------------------------------------------------------------------------------17 18 ##19 18 ##-------------------------------------------------------------------------------- 20 19 … … 30 29 ##-------------------------------------------------------------------------------- 31 30 32 init_files() { 33 echo 'Date' > ${file_date} 34 echo 'Result' > ${file_rslt} 35 echo 'Status' > ${file_stat} 36 echo 'NEMOGCM rev.' > ${file_nemo} 37 echo 'XIOS rev.' > ${file_xios} 38 echo 'Fortran compiler' > ${file_cmpf} 39 echo 'MPI libs' > ${file_lmpi} 40 echo 'NetCDF libs' > ${file_ncdf} 41 echo 'Input files' > ${file_inpt} 42 echo 'Elapsed time' > ${file_time} 43 echo 'Memory (Phy./Virt.)' > ${file_memy} 44 echo 'Comments' > ${file_note} 31 init() { 32 mkdir -p ${TRUST_TEST_DIR} ${TRUST_TEST_BENCHMARK} || get_out B 33 cd ${TRUST_TEST_DIR} 34 echo ${TRUST_TEST_DIR} 35 36 echo 'Date' > ${file_date}; echo 'Result' > ${file_rslt} 37 echo 'Status' > ${file_stat}; echo 'NEMOGCM' > ${file_nemo} 38 echo 'XIOS' > ${file_xios}; echo 'Fortran' > ${file_cmpf} 39 echo 'MPI' > ${file_lmpi}; echo 'NetCDF' > ${file_ncdf} 40 echo 'Inputs' > ${file_inpt}; echo 'Elapsed time' > ${file_time} 41 echo 'RAM (Phy./Virt.)' > ${file_memy}; echo 'Comments' > ${file_note} 45 42 46 43 ## 'FAILED' status with 'Unknown error' by default … … 49 46 echo 'Unknown error' \ 50 47 >> ${file_stat} 51 } 52 53 54 ## 55 ##-------------------------------------------------------------------------------- 56 57 get_date() { 48 58 49 ## UTC time zone for timestamping 59 50 local dat=$( date -ud "${TRUST_TEST_DATE}" +"%F %R %Z" ) … … 72 63 73 64 ## Loop on essential NEMO directories 74 for dir in ${TRUST_SVN_UP} ${TRUST_IO_XIOS}; do 75 76 ## For time being, just get revision from XIOS with no action on directory 77 if [ $dir == ${TRUST_IO_XIOS} ]; then 78 rev_loc=$( svn info $dir | awk '/Last Changed Rev/ {print $NF}' ) 79 echo 'XIOS '${rev_loc} \ 80 >> model.log 81 echo "<a href=\"https://forge.ipsl.jussieu.fr/ioserver/changeset/${rev_loc}\" target=\"_blank\">${rev_loc}</a>" \ 82 >> ${file_xios} 83 continue 84 fi 65 for dir in ${TRUST_SVN_UP}; do 85 66 86 67 echo $dir && ${TRUST_SVN_ACTION} ${TRUST_SVN_NEMOGCM}/$dir || get_out C 87 rev_loc=$( svn info ${TRUST_SVN_NEMOGCM}/$dir \68 rev_loc=$( svn info ${TRUST_SVN_NEMOGCM}/$dir \ 88 69 | awk '/Last Changed Rev/ {print $NF}' ) 89 70 … … 94 75 echo 'NEMOGCM '$rev \ 95 76 >> model.log 96 echo "<a href=\" https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" \77 echo "<a href=\"${TRUST_SVN_REPO}/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" \ 97 78 >> ${file_nemo} 98 79 } 80 99 81 100 82 ## … … 123 105 124 106 ## Cleaning characters string to display proper soft name 125 #str=$( echo $str | sed 's|[/-]||g' )126 107 ver=$( echo $ver | sed 's|[/-]| |g' ) 127 108 … … 130 111 done 131 112 113 sed -n 2p model.log \ 114 >> ${file_cmpf} 132 115 sed -n 3p model.log \ 133 >> ${file_ cmpf}116 >> ${file_lmpi} 134 117 sed -n 4p model.log \ 135 >> ${file_lmpi}136 sed -n 5p model.log \137 118 >> ${file_ncdf} 119 120 cat model.log | awk '{printf "%-20s %s %s\n", $1, $2, $3}' 121 env | sort > env.log 122 } 123 124 125 ## 126 ##-------------------------------------------------------------------------------- 127 128 compile_xios() { 129 cd ${TRUST_IO_XIOS} 130 131 rev=$( svn info | awk '/Last Changed Rev/ {print $NF}' ) 132 echo 'XIOS '$rev \ 133 >> ${TRUST_TEST_DIR}/model.log 134 echo "<a href=\"${TRUST_SVN_REPO}/ioserver/changeset/$rev target=\"_blank\">$rev</a>" \ 135 >> ${TRUST_TEST_DIR}/${file_xios} 136 137 eval " 138 ./make_xios ${TRUST_IO_XIOS_MODE} --arch ${TRUST_MAIN_HPCC} \ 139 --job ${TRUST_COMPILE_NPROC} \ 140 ${TRUST_MAIN_STDOUT} 141 " 142 143 [ ! -e ./lib/libxios.a ] && get_out D || echo 'Success' 144 } 145 146 147 ## 148 ##-------------------------------------------------------------------------------- 149 150 compile_nemo() { 151 cd ${TRUST_SVN_NEMOGCM}/CONFIG 152 153 ## Recompiling from scratch if not in debug mode 154 if [[ -d ${TRUST_CFG_NEW} && ${TRUST_FLAG_DEBUG} == 'false' ]]; then 155 ./makenemo -n ${TRUST_CFG_NEW} clean_config \ 156 > /dev/null <<EOF 157 y 158 EOF 159 fi 160 161 eval " 162 ./makenemo -n ${TRUST_CFG_NEW} -r ${TRUST_CFG_REF} \ 163 -m ${TRUST_MAIN_HPCC} -j ${TRUST_COMPILE_NPROC} \ 164 ${TRUST_CFG_KEY_ADD} ${TRUST_CFG_KEY_DEL} \ 165 ${TRUST_MAIN_STDOUT} 166 " 167 168 [ ! -e ./${TRUST_CFG_NEW}/BLD/bin/nemo.exe ] && get_out E || echo 'Success' 138 169 } 139 170 … … 144 175 get_inputs() { 145 176 # List archive content & extract it by default 146 local inputs_list= $( eval"147 for archive in ${TRUST_IO_FORC_TAR}; do148 tar -tvf ${TRUST_IO_FORC_PATH}/\$archive >> inputs_list.txt;177 local inputs_list=" 178 for archive in \${TRUST_IO_FORC_TAR}; do 179 tar -tvf \${TRUST_IO_FORC_PATH}/\$archive >> inputs_list.txt; 149 180 done 150 " )151 local inputs_get= $( eval"152 for archive in ${TRUST_IO_FORC_TAR}; do153 tar -vxf ${TRUST_IO_FORC_PATH}/\$archive > /dev/null;181 " 182 local inputs_get=" 183 for archive in \${TRUST_IO_FORC_TAR}; do 184 tar -vxf \${TRUST_IO_FORC_PATH}/\$archive > /dev/null; 154 185 done 155 " )156 186 " 187 157 188 ## List & copy files without archive 158 189 if [ -z "${TRUST_IO_FORC_TAR}" ]; then 159 inputs_list=" ls -lh ${TRUST_IO_FORC_PATH}/* >> inputs_list.txt" 160 inputs_get=" \cp ${TRUST_IO_FORC_PATH}/* . " 161 fi 162 163 ${inputs_list}; ${inputs_get} 164 165 # for entry in ${TRUST_IO_FORC_PATH}; do 166 # 167 # If path to file (assuming it is an archive) 168 # if [ -e $entry ]; then 169 # tar -tvf $entry >> inputs_list.txt; 170 # tar -vxf $entry > /dev/null; 171 # If path to directory 172 # elif [ -d $entry ]; then 173 # inputs_list=" ls -lh ${TRUST_IO_FORC_PATH}/* >> inputs_list.txt" 174 # inputs_get=" \cp ${TRUST_IO_FORC_PATH}/* . " 175 # fi 176 177 # done 190 inputs_list=" ls -lh \${TRUST_IO_FORC_PATH}/* >> inputs_list.txt" 191 inputs_get=" \cp \${TRUST_IO_FORC_PATH}/* . " 192 fi 193 194 cd ${TRUST_TEST_DIR} 195 eval ${inputs_list} 196 echo ${inputs_get}; eval ${inputs_get} 178 197 179 198 if [ $( find -name '*.gz' -print -quit ) ]; then 180 199 find . -name '*.gz' -exec gzip -d {} \; 181 200 fi 201 202 cp ${TRUST_SVN_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/cpp_* . 203 find ${TRUST_SVN_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/EXP00 \ 204 -regex '.*\(_cfg\|.in\|opa\|_ref\|.xml\)' \ 205 -exec cp {} . \; 182 206 } 183 207 … … 221 245 [ -n "${files_list}" ] && echo 'Inputs : '${files_list}'differ<br>' \ 222 246 >> temp_${file_note} 247 } 248 249 250 ## 251 ##-------------------------------------------------------------------------------- 252 253 job_submit() { 254 ## Copy the submitting script to testing folder 255 cp ${TRUST_JOB_SCRIPT} ${TRUST_TEST_DIR} 256 257 TRUST_JOB_ID=$( eval ${TRUST_JOB_SUBMIT} ) 258 [ $? -ne 0 ] && get_out G || printf "Success (job ID %s)\n" ${TRUST_JOB_ID} 223 259 } 224 260 … … 257 293 ##-------------------------------------------------------------------------------- 258 294 295 job_perfs() { 296 if [ -n "${TRUST_JOB_TIME}" ]; then 297 298 ## Interest for checking unusual time computation 299 local time_cpu=$( eval ${TRUST_JOB_TIME} ) 300 301 printf "Elapsed time: " 302 echo ${time_cpu} | tee -a ${file_time} 303 304 fi 305 306 if [[ -n "${TRUST_JOB_RAM_P}" && -n "${TRUST_JOB_RAM_V}" ]]; then 307 308 ## Interest for checking unusual memory usage 309 local memory_pmax=$( eval ${TRUST_JOB_RAM_P} ) 310 local memory_vmax=$( eval ${TRUST_JOB_RAM_V} ) 311 312 printf "Memory max usage (physical/virtual): " 313 echo ${memory_pmax}' / '${memory_vmax} | tee -a ${file_memy} 314 fi 315 } 316 317 318 ## 319 ##-------------------------------------------------------------------------------- 320 321 job_state() { 322 if [[ ! -e time.step || $( grep 'E R R O R' ocean.output ) ]]; then 323 get_out H 324 else 325 echo 'Success' ## Must be reviewed 326 fi 327 } 328 329 330 ## 331 ##-------------------------------------------------------------------------------- 332 259 333 diff_results() { 260 334 local file … … 264 338 ## Think of copying initial test ## 265 339 ################################### 340 341 ## Now test is good by default ('OK') 342 TRUST_FLAG_RESULT='OK' 266 343 267 344 ## Simple diff … … 290 367 diff_restarts() { 291 368 local dif filebase filebases ndomain out 292 local files_list='' dif_sum='0' #bcmk='false'369 local files_list='' dif_sum='0' 293 370 294 371 ## Find all restart files to rebuild … … 352 429 fi 353 430 354 } 355 356 357 ## 358 ##-------------------------------------------------------------------------------- 359 360 get_time() { 361 [ -z "${TRUST_JOB_TIME}" ] && return 362 363 ## Interest for checking unusual time computation 364 local time_cpu=$( eval ${TRUST_JOB_TIME} ) 365 366 printf "Elapsed time: " 367 echo ${time_cpu} | tee -a ${file_time} 368 } 369 370 371 ## 372 ##-------------------------------------------------------------------------------- 373 374 get_memy() { 375 [[ -z "${TRUST_JOB_RAM_P}" && -z "${TRUST_JOB_RAM_V}" ]] && return 376 377 ## Interest for checking unusual memory usage 378 local memory_pmax=$( eval ${TRUST_JOB_RAM_P} ) 379 local memory_vmax=$( eval ${TRUST_JOB_RAM_V} ) 380 381 printf "Memory max usage (physical/virtual): " 382 echo ${memory_pmax}' / '${memory_vmax} | tee -a ${file_memy} 431 [ $TRUST_FLAG_RESULT == 'FAILED' ] && get_out L 383 432 } 384 433 … … 428 477 429 478 ## Production mode (-p|--prod) 430 if [ ${TRUST_FLAG_PROD} -eq 1]; then479 if [ ${TRUST_FLAG_PROD} == 'true' ]; then 431 480 432 481 ## Create or append trusting logfile … … 542 591 543 592 ## Save tested configuration if trusting failed in production mode (-p|--prod) 544 if [[ ${TRUST_FLAG_RESULT} == 'FAILED' && ${TRUST_FLAG_PROD} -eq 1]]; then593 if [[ ${TRUST_FLAG_RESULT} == 'FAILED' && ${TRUST_FLAG_PROD} == 'true' ]]; then 545 594 echo 'Creating archive '${TRUST_TEST_BACKUP}' under '${TRUST_TEST_BENCHMARK} 546 595 tar -czf ${TRUST_TEST_BENCHMARK}/${TRUST_TEST_BACKUP} * \ -
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh
r8808 r8834 46 46 printf "\nWhat branch do you want to install in "${TRUST_DIR_WORK}" for trusting test ? " 47 47 echo 'Enter 0 to abort' 48 select branch in 'trunk' $( svn ls ${TRUST_SVN_REPO}/ branches/2015 | tr -d / | sort -r ); do48 select branch in 'trunk' $( svn ls ${TRUST_SVN_REPO}/nemo/svn/branches/2015 | tr -d / | sort -r ); do 49 49 50 50 if [ $REPLY -eq 0 ]; then exit 1; else export TRUST_SVN_BRANCH=$branch; fi … … 74 74 75 75 if [ $elmt == 'TOOLS/maketools' ]; then 76 svn co -q ${TRUST_SVN_REPO}/ ${svn_bran}/NEMOGCM/TOOLS --depth empty76 svn co -q ${TRUST_SVN_REPO}/nemo/svn/${svn_bran}/NEMOGCM/TOOLS --depth empty 77 77 svn up -q $elmt 78 78 else 79 svn co -q ${TRUST_SVN_REPO}/ ${svn_bran}/NEMOGCM/$elmt $elmt79 svn co -q ${TRUST_SVN_REPO}/nemo/svn/${svn_bran}/NEMOGCM/$elmt $elmt 80 80 fi 81 81 -
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh
r8826 r8834 4 4 cd $( dirname $0 ) 5 5 6 ##-------------------------------------------------------------------------------- 6 7 ## Set flags & defaults 7 8 ##-------------------------------------------------------------------------------- … … 9 10 TRUST_MAIN_DIR=$PWD 10 11 11 TRUST_FLAG_DEBUG=0; TRUST_FLAG_PROD=0; TRUST_FLAG_HELP=0 12 TRUST_FLAG_RESULT='FAILED'; TRUST_FLAG_ERROR=0 12 TRUST_FLAG_DEBUG='false' ; TRUST_FLAG_HELP='false' ; TRUST_FLAG_PROD='false' 13 13 14 ## No update on SVN directories & 'FAILED' result for 'Unknown error' )15 TRUST_SVN_ACTION='svn status'16 17 xios_mode='--full'; stdout_redir='>&'18 14 rev=$( svn info | awk '(NR == 9) {print $NF}' ) 19 15 20 16 21 ## Get options (replacing initials settings) 17 ##-------------------------------------------------------------------------------- 18 ## Get arguments from command line 22 19 ##-------------------------------------------------------------------------------- 23 20 24 while [ $# -ne 0 ]; do21 while getopts a:b:de:f:j:hm:n:r:t:pu:v:w: arg; do 25 22 26 case $1 in 27 '-a'|'--archive') TRUST_IO_FORC_TAR=$2; shift 2;; '-b'|'--branch' ) TRUST_SVN_BRANCH=$2; shift 2;; 28 '-d'|'--debug' ) TRUST_FLAG_DEBUG=1 ; shift ;; '-e'|'--email' ) TRUST_TEST_MAILING=$2; shift 2;; 29 '-f'|'--forcdir') TRUST_IO_FORC_PATH=$2; shift 2;; '-j'|'--job' ) TRUST_COMPILE_NPROC=$2; shift 2;; 30 '-h'|'--help' ) TRUST_FLAG_HELP=1 ; shift ;; '-m'|'--machine') TRUST_MAIN_HPCC=$2; shift 2;; 31 '-n'|'--newconf') TRUST_CFG_NEW=$2; shift 2;; '-r'|'--refconf') TRUST_CFG_REF=$2; shift 2;; 32 '-t'|'--time' ) TRUST_JOB_TIMEOUT=$2; shift 2;; '-p'|'--prod' ) TRUST_FLAG_PROD=1 ; shift ;; 33 '-u'|'--user' ) TRUST_MAIN_USER=$2; shift 2;; '-v'|'--version') TRUST_SVN_REV=$2; shift 2;; 34 '-w'|'--workdir') TRUST_DIR_WORK=$2; shift 2;; "*" ) TRUST_FLAG_HELP=1 ; shift ;; 23 case $arg in 24 a) TRUST_IO_FORC_TAR=$OPTARG;; b) TRUST_SVN_BRANCH=$OPTARG;; 25 d) TRUST_FLAG_DEBUG='true' ;; e) TRUST_TEST_MAILING=$OPTARG;; 26 f) TRUST_IO_FORC_PATH=$OPTARG;; j) TRUST_COMPILE_NPROC=$OPTARG;; 27 h) TRUST_FLAG_HELP='true' ;; m) TRUST_MAIN_HPCC=$OPTARG;; 28 n) TRUST_CFG_NEW=$OPTARG;; r) TRUST_CFG_REF=$OPTARG;; 29 t) TRUST_JOB_TIMEOUT=$OPTARG;; p) TRUST_FLAG_PROD='true' ;; 30 u) TRUST_MAIN_USER=$OPTARG;; v) TRUST_SVN_REV=$OPTARG;; 31 w) TRUST_DIR_WORK=$OPTARG;; 32 :) echo 'Arg. needed for '$OPTARG && TRUST_FLAG_HELP='true' ;; 33 *) TRUST_FLAG_HELP='true' ;; 35 34 esac 36 35 … … 38 37 39 38 40 ## Initialization (HPC & user environment) 39 ##-------------------------------------------------------------------------------- 40 ## Initialization (user & HPC environment) 41 41 ##-------------------------------------------------------------------------------- 42 42 43 if [[ ! -e cfg/${TRUST_MAIN_USER}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg || ${TRUST_FLAG_HELP} -eq 1 ]]; then 43 if [[ ! -e cfg/${TRUST_MAIN_USER}.cfg || ! -e cfg/${TRUST_MAIN_HPCC}.cfg \ 44 || ${TRUST_FLAG_HELP} == 'true' ]]; then 44 45 cat ./inc/trusting_help.txt 45 46 46 if [ ${TRUST_FLAG_HELP} -eq 0]; then47 if [ ${TRUST_FLAG_HELP} == 'false' ]; then 47 48 printf "\n\n\033[0;33m" 48 49 printf "At least one configuration (arch or user) file is missing or misspelled:" … … 56 57 exit 1 57 58 else 58 . ./inc/trusting.env && . ./inc/trusting_func.sh 59 ## Verbose output on debug mode 60 [ ${TRUST_FLAG_DEBUG} == 'true' ] && set -vx 59 61 60 ## DEBUG option to speed up & expand verbosity of compilation 61 [ ${TRUST_FLAG_DEBUG} -eq 1 ] && { set -vx; xios_mode=''; stdout_redir='>'; } 62 63 ## If -v|--version option has been set, modify default SVN action on directories 64 if [ $( echo ${TRUST_SVN_REV} | grep "HEAD\|up\|update" ) ]; then 65 TRUST_SVN_ACTION='svn update -r HEAD' 66 elif [ $( echo ${TRUST_SVN_REV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) ]; then 67 TRUST_SVN_ACTION='svn update -r '$( echo ${TRUST_SVN_REV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) 68 elif [ $( echo ${TRUST_SVN_REV} | grep -o '[0-9]*' ) ]; then 69 TRUST_SVN_ACTION='svn update -r '$( echo ${TRUST_SVN_REV} | grep -o '[0-9]*' ) 70 fi 62 . ./inc/trusting.env 63 . ./inc/trusting_func.sh 71 64 72 65 fi 73 66 74 67 75 ## Display contextual summary of trusting test 68 ##-------------------------------------------------------------------------------- 69 ## Trusting workflow 76 70 ##-------------------------------------------------------------------------------- 77 71 72 ## Display summary of test 73 ##------------------------ 74 78 75 echo 79 80 76 if [ -t 0 ]; then cat ./inc/banner.txt; else cat ./inc/banner.html; fi 81 82 77 echo 83 78 echo '****************************************************************************************************' … … 91 86 printf "\t§ User installation\t\t%s\n\n" ${TRUST_MAIN_USER} 92 87 echo 93 printf "\t§ Testing configuration\t\t%s based on %s\n" ${TRUST_CFG_NEW} ${TRUST_CFG_REF} 94 printf "\t§ SVN working copy\t\t%s/%s\n" ${TRUST_DIR_WORK} ${TRUST_SVN_BRANCH} 88 printf "\t§ Testing configuration\t\t%s based on %s\n" \ 89 ${TRUST_CFG_NEW} ${TRUST_CFG_REF} 90 printf "\t§ SVN working copy\t\t%s/%s\n" \ 91 ${TRUST_DIR_WORK} ${TRUST_SVN_BRANCH} 95 92 if [ ${TRUST_TEST_BENCHMARK} ]; then 96 93 printf "\t§ Benchmark folder\t\t%s\n" ${TRUST_TEST_BENCHMARK} … … 98 95 99 96 100 ## Make timestamped directory with messenger files101 ##------------------ --------------------------------------------------------------97 ## Testing directory 98 ##------------------ 102 99 103 100 print_step 'Timestamped testing directory' 104 105 mkdir -p ${TRUST_TEST_DIR} ${TRUST_TEST_BENCHMARK} || get_out B 106 cd ${TRUST_TEST_DIR} 107 echo ${TRUST_TEST_DIR} 108 109 init_files 110 111 get_date 101 init 112 102 113 103 114 ## Get SVN revision on XIOS & NEMO essentials directories115 ##------------------- -------------------------------------------------------------104 ## Local working copy 105 ##------------------- 116 106 117 print_step "SVN action on NEMO directories: ${TRUST_SVN_ACTION}"118 107 print_step 'SVN action on NEMO directories' 108 echo "${TRUST_SVN_ACTION} on ${TRUST_SVN_NEMOGCM}:" 119 109 get_nemo_rev 120 110 121 111 122 ## Check softwares versions (after sourced arch environment)123 ##------------ --------------------------------------------------------------------112 ## Environment 113 ##------------ 124 114 125 115 print_step 'Get testing environment' 126 127 116 get_soft_rel 128 117 129 cat model.log | awk '{printf "%-20s %s %s\n", $1, $2, $3}' 130 env | sort > env.log 118 119 ## Compilation(s) 120 ##--------------- 121 122 print_step 'Compile XIOS' 123 compile_xios 124 125 print_step "Compile ${TRUST_CFG_REF} configuration" 126 compile_nemo 131 127 132 128 133 ## XIOS compilation from scratch 134 ##-------------------------------------------------------------------------------- 135 136 print_step 'Compile XIOS' 137 138 cd ${TRUST_IO_XIOS} 139 140 eval ./make_xios ${xios_mode} --arch ${TRUST_MAIN_HPCC} --job ${TRUST_COMPILE_NPROC} \ 141 ${stdout_redir} /dev/null 142 143 [ ! -e lib/libxios.a ] && get_out D || echo 'Success' 144 145 146 ## NEMO compilation from scratch 147 ##-------------------------------------------------------------------------------- 148 149 print_step "Compile ${TRUST_CFG_REF} configuration" 150 151 cd ${TRUST_SVN_NEMOGCM}/CONFIG 152 153 if [[ -d ${TRUST_CFG_NEW} && ${TRUST_FLAG_DEBUG} -eq 0 ]]; then 154 ./makenemo -n ${TRUST_CFG_NEW} clean_config \ 155 > /dev/null <<EOF 156 y 157 EOF 158 fi 159 160 eval ./makenemo -n ${TRUST_CFG_NEW} -r ${TRUST_CFG_REF} \ 161 -m ${TRUST_MAIN_HPCC} -j ${TRUST_COMPILE_NPROC} \ 162 ${TRUST_CFG_KEY_ADD} ${TRUST_CFG_KEY_DEL} \ 163 ${stdout_redir} /dev/null 164 165 [ ! -e ${TRUST_CFG_NEW}/BLD/bin/nemo.exe ] && get_out E || echo 'Success' 166 167 168 ## Get all inputs for running 169 ##-------------------------------------------------------------------------------- 129 ## Inputs 130 ##------- 170 131 171 132 print_step 'Set job (copying or extracting inputs)' 172 173 cd ${TRUST_TEST_DIR}174 175 133 get_inputs 176 134 177 cp ${TRUST_SVN_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/cpp_* .178 find ${TRUST_SVN_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/EXP00 \179 -regex '.*\(_cfg\|.in\|opa\|_ref\|.xml\)' \180 -exec cp {} . \;181 182 183 ## Check inputs184 ##--------------------------------------------------------------------------------185 186 135 print_step 'Compare inputs' 187 188 136 diff_inputs 189 137 190 138 191 ## Job submission & computation192 ##---- ----------------------------------------------------------------------------139 ## Job 140 ##---- 193 141 194 142 print_step 'Submit job' 195 196 ## Copy the submitting script to testing folder 197 cp ${TRUST_JOB_SCRIPT} ${TRUST_TEST_DIR} 198 TRUST_JOB_ID=$( eval ${TRUST_JOB_SUBMIT} ) 199 200 [ $? -ne 0 ] && get_out G || printf "Success (job ID %s)\n" ${TRUST_JOB_ID} 143 job_submit 201 144 202 145 print_step 'Pending job' 203 204 146 job_pending 205 147 206 148 print_step 'Job finished' 207 149 208 209 ## Check job state & get computation performances if succeeded210 ##--------------------------------------------------------------------------------211 212 150 print_step 'Test job state' 213 214 if [[ ! -e time.step || $( grep 'E R R O R' ocean.output ) ]]; then 215 get_out H 216 else 217 echo 'Success' ## Must be reviewed 218 fi 151 job_state 219 152 220 153 print_step 'Get job performances' 221 222 get_time 223 224 get_memy 154 job_perfs 225 155 226 156 227 ## Check outputs 228 ##-------------------------------------------------------------------------------- 229 230 TRUST_FLAG_RESULT='OK' ## 'OK' by default 157 ## Outputs 158 ##-------- 231 159 232 160 print_step 'Compare outputs' 233 234 161 diff_results 235 162 236 163 print_step 'Compare restarts' 237 238 164 diff_restarts 239 240 [ $TRUST_FLAG_RESULT= == 'FAILED' ] && get_out L241 165 242 166 243 167 ## End, at least nothing major has changed ;-) 244 ##-------------------------------------------- ------------------------------------168 ##-------------------------------------------- 245 169 246 170 get_out 0
Note: See TracChangeset
for help on using the changeset viewer.