[695] | 1 | #!/bin/ksh |
---|
[1154] | 2 | # $Id$ |
---|
[695] | 3 | ###################################################### |
---|
[1301] | 4 | # Original : C. Talandier for NEMO team |
---|
| 5 | # Contact : nemo_st@locean-ipsl.upmc.fr |
---|
[695] | 6 | # |
---|
| 7 | # It is automatically launched (by the cron_jobs.ksh |
---|
| 8 | # script) when all runs (mon, mpi, (omp)) for a given |
---|
| 9 | # configuration are finished |
---|
| 10 | # |
---|
[1574] | 11 | # INPUT ARGS: 1 optional |
---|
[695] | 12 | # - TODO: (optional) Arg=yes or empty to build |
---|
| 13 | # output files including timing results. |
---|
| 14 | # Specific to Zahir |
---|
| 15 | # |
---|
| 16 | # WORK: It aims to (for each standard configuration) : |
---|
| 17 | # |
---|
| 18 | # I. Check Executable Memory size |
---|
| 19 | # - from memory_size.txt output file |
---|
| 20 | # *- compare it to a reference version |
---|
| 21 | # |
---|
| 22 | # II. Check CPU time used (if specified) |
---|
| 23 | # - from timing output files |
---|
| 24 | # *- compare it to a reference version |
---|
| 25 | # |
---|
| 26 | # III. Check the reproductibility between mon & mpi runs |
---|
| 27 | # - making diff of solver.stat output files |
---|
| 28 | # |
---|
| 29 | # IV. Check the restartability for mon & mpi runs |
---|
| 30 | # - making diff of solver.stat output files |
---|
| 31 | # |
---|
| 32 | # V.*Compare current results to a reference one |
---|
| 33 | # |
---|
| 34 | # VI. Send the assessment file "endjob.txt" using |
---|
| 35 | # user's e-mail |
---|
| 36 | # |
---|
| 37 | # * this step is performed only if a reference tag |
---|
| 38 | # is passing through the specifs.txt file |
---|
[1140] | 39 | # See the Makefile under ./config/NVTK directory |
---|
[695] | 40 | # |
---|
| 41 | # It is based on the directories architecture below : |
---|
| 42 | # |
---|
| 43 | # NEMO_VALID/WNAME_CONFIG/ |
---|
| 44 | # |-- mon --> MONO run |
---|
| 45 | # | |-- 1_SHORT |
---|
| 46 | # | |-- 2_SHORT |
---|
| 47 | # | |-- LONG |
---|
| 48 | # | `-- GTIME |
---|
| 49 | # |-- mpi --> MPI run |
---|
| 50 | # | |-- 1_SHORT |
---|
| 51 | # | |-- 2_SHORT |
---|
| 52 | # | |-- LONG |
---|
| 53 | # | `-- GTIME |
---|
| 54 | # `-- omp --> Open-MP run |
---|
| 55 | # |-- 1_SHORT |
---|
| 56 | # |-- 2_SHORT |
---|
| 57 | # |-- LONG |
---|
| 58 | # `-- GTIME |
---|
| 59 | # |
---|
| 60 | ########################################################### |
---|
| 61 | #set -xv |
---|
| 62 | ########################################################### |
---|
[1574] | 63 | CONF=`basename $( pwd ) | cut -c2-` |
---|
[695] | 64 | TODO=$2 |
---|
[1301] | 65 | TARGET=sx8brodie |
---|
| 66 | EXPER=$( ( awk '/test=/ { print $2 }' specifs.txt ) ) |
---|
[695] | 67 | LRTYPE="$( ( awk '/runs=/ { printf "%s %s %s", $2 , $3 , $4}' specifs.txt ) )" |
---|
[1574] | 68 | MPIDCI="$( ( awk '/mpis=/ { printf "%s ", $2}' specifs.txt ) )" |
---|
| 69 | MPIDCJ="$( ( awk '/mpis=/ { printf "%s ", $3}' specifs.txt ) )" |
---|
| 70 | MPIDCIJ="$( ( awk '/mpis=/ { printf "%s ", $4}' specifs.txt ) )" |
---|
[695] | 71 | VTIME=$( ( awk '/time=/ { print $2 }' specifs.txt ) ) |
---|
| 72 | REF_TAG=$( (awk '/tagname=/ {print $2}' specifs.txt) ) |
---|
[1301] | 73 | URL_USE=$( (awk '/URL:/ {print $0}' specifs.txt) ) |
---|
| 74 | REV_USE=$( (awk '/Revision:/ {print $2}' specifs.txt) ) |
---|
| 75 | TITLE="NEMO VALIDATION ${EXPER} : $CONF on $TARGET" |
---|
[1365] | 76 | EMAIL='ctlod@locean-ipsl.upmc.fr' |
---|
[695] | 77 | |
---|
| 78 | \rm endjob.txt 2> /dev/null |
---|
| 79 | touch endjob.txt |
---|
| 80 | |
---|
[1564] | 81 | if [ ${CONF} == 'ORCA2_LIM' ] ; then |
---|
| 82 | CONFS=ORCA2 |
---|
| 83 | elif [ ${CONF} == 'ORCA2_LIM3' ] ; then |
---|
| 84 | CONFS=OR2L3 |
---|
| 85 | elif [ ${CONF} == 'GYRE' ] ; then |
---|
| 86 | CONFS=GYREO |
---|
| 87 | elif [ ${CONF} == 'GYRE_LOBSTER' ] ; then |
---|
| 88 | CONFS=GYREL |
---|
| 89 | elif [ ${CONF} == 'ORCA2_LIM_PISCES' ] ; then |
---|
| 90 | CONFS=OR2LP |
---|
| 91 | elif [ ${CONF} == 'ORCA2_OFF_PISCES' ] ; then |
---|
| 92 | CONFS=OR2OP |
---|
| 93 | elif [ ${CONF} == 'ZAGRIF' ] ; then |
---|
| 94 | CONFS=ZAGRI |
---|
| 95 | else |
---|
| 96 | CONFS=${CONF} |
---|
| 97 | fi |
---|
| 98 | |
---|
[695] | 99 | ########################################################### |
---|
| 100 | # checkfile() is a local function to check if a file exist |
---|
[1564] | 101 | # 5 arguments: |
---|
[695] | 102 | # - zf2check : file name to check |
---|
| 103 | # - zoutfile : output file name to print results |
---|
| 104 | # - zwork : kind of prints to perform |
---|
[1157] | 105 | # - zreprint : print a message once (yes/no) |
---|
| 106 | # - ziter : (optional) print time steps number (yes/no) |
---|
[695] | 107 | ########################################################### |
---|
| 108 | ################ Begin checkfile function ################# |
---|
| 109 | function checkfile |
---|
| 110 | { |
---|
| 111 | # name of the file to check |
---|
| 112 | zf2check=$1 |
---|
| 113 | # print output file name |
---|
| 114 | zoutfile=$2 |
---|
| 115 | # white space prints |
---|
| 116 | zworkt=$3 |
---|
| 117 | # Print a message only once |
---|
| 118 | zreprint=$4 |
---|
[1157] | 119 | # Print iterations number |
---|
| 120 | ziter=$5 |
---|
[695] | 121 | |
---|
| 122 | #set -x |
---|
| 123 | |
---|
[1157] | 124 | test -n "${ziter}" |
---|
| 125 | zrepiter=$? |
---|
[695] | 126 | |
---|
| 127 | |
---|
| 128 | genf=$( basename ${zf2check} ) |
---|
| 129 | |
---|
| 130 | case "${zworkt}" in |
---|
| 131 | 'NORM' ) blnk=' ' ;; |
---|
| 132 | 'DIFF' ) blnk=' ' ;; |
---|
| 133 | esac |
---|
| 134 | fmes4=" - file ${zf2check} doesn't exist " |
---|
| 135 | |
---|
| 136 | # Check file exists |
---|
| 137 | if [ -a ${zf2check} ] ; then |
---|
| 138 | fmes1=" List ${genf} files and check date creation: " |
---|
[1157] | 139 | fmes2=" `ls -o ${zf2check}` " |
---|
[695] | 140 | fmes3=" - file ${zf2check} is empty " |
---|
[1301] | 141 | fmes4=" Num. time steps: done / expected " |
---|
[1157] | 142 | if [ ${zreprint} = 'yes' ] ; then |
---|
| 143 | if [ ${zrepiter} == 0 ] ; then |
---|
| 144 | echo "${blnk}${fmes1}" "${fmes4}" >> ${zoutfile} |
---|
| 145 | else |
---|
| 146 | echo "${blnk}${fmes1}" >> ${zoutfile} |
---|
| 147 | fi |
---|
| 148 | fi |
---|
[695] | 149 | |
---|
| 150 | # Check file is not empty |
---|
| 151 | if [ -s ${zf2check} ] ; then |
---|
[1157] | 152 | if [ ${zrepiter} == 0 ] ; then |
---|
| 153 | # Check run's iterations number from solver.stat |
---|
| 154 | basedir="`dirname ${zf2check}`" |
---|
| 155 | echo "`tail -1 ${zf2check}`" > temp1 |
---|
| 156 | echo "`grep nitend ${basedir}/namelist`" > temp2 |
---|
| 157 | typeset -Z4 ziter_run |
---|
| 158 | typeset -Z4 ziter_ask |
---|
| 159 | ziter_run="`awk '{print $3}' temp1`" |
---|
| 160 | ziter_ask="`awk '{print $3}' temp2`" |
---|
| 161 | \rm temp1 temp2 |
---|
| 162 | [ ${zoutfile} ] && echo "${blnk}${fmes2}" " ${ziter_run} / ${ziter_ask}" >> ${zoutfile} |
---|
| 163 | xist=0 ; return ${xist} |
---|
| 164 | else |
---|
| 165 | [ ${zoutfile} ] && echo "${blnk}${fmes2}" >> ${zoutfile} |
---|
| 166 | xist=0 ; return ${xist} |
---|
| 167 | fi |
---|
[695] | 168 | else |
---|
| 169 | [ ${zoutfile} ] && echo "${blnk}${fmes3}" >> ${zoutfile} |
---|
| 170 | xist=1 ; return ${xist} |
---|
| 171 | fi |
---|
| 172 | else |
---|
| 173 | [ ${zoutfile} ] && echo "${blnk}${fmes4}" >> ${zoutfile} |
---|
| 174 | xist=1 ; return ${xist} |
---|
| 175 | fi |
---|
| 176 | return |
---|
| 177 | } |
---|
| 178 | ############### End checkfile function ############### |
---|
| 179 | ###################################################### |
---|
| 180 | |
---|
| 181 | # Get the name of the present script |
---|
| 182 | nscript=$( (basename $0) ) |
---|
| 183 | |
---|
| 184 | ########################################################### |
---|
| 185 | # mak_diff_file() is a local function which performs diff |
---|
| 186 | # on some files and print messages in the endjob.txt file |
---|
| 187 | # 7 input arguments: |
---|
| 188 | # - zfex : (0/1) (make/do not make) diff (files doesn't exist) |
---|
| 189 | # - zfile1 : first input file name |
---|
| 190 | # - zfile2 : second input file name |
---|
| 191 | # - zruntype: run type (mon, mpi, omp) |
---|
| 192 | # - zstream : stream of the run (long, stream_1, stream_2) |
---|
| 193 | # - ztag : the tag name to which are compared files |
---|
| 194 | # - zkind : kind of the check (repro/resta) |
---|
| 195 | ############################################################### |
---|
| 196 | ################ Begin mak_diff_file function ################# |
---|
| 197 | function mak_diff_file |
---|
| 198 | { |
---|
| 199 | # |
---|
| 200 | # help_diff() To print help |
---|
| 201 | # |
---|
| 202 | function help_diff |
---|
| 203 | { |
---|
| 204 | echo "Usage: ${nscript} [-x] [-a] [-b] [-r] [-s] [-t] [-k]" |
---|
| 205 | echo "Options: These are optional argument" |
---|
| 206 | echo " -x : (0/1) (make/do not make) diff " |
---|
| 207 | echo " -a : first input file name" |
---|
| 208 | echo " -b : second input file name" |
---|
| 209 | echo " -r : run type (mon, mpi, omp)" |
---|
| 210 | echo " -s : stream of the run (long, stream_1, stream_2)" |
---|
| 211 | echo " -t : tag name to which are compared files" |
---|
| 212 | echo " -k : kind of the check (repro/resta)" |
---|
| 213 | echo " their values are not taken)" |
---|
| 214 | exit 1 |
---|
| 215 | } |
---|
| 216 | |
---|
| 217 | ##set -xv |
---|
| 218 | |
---|
| 219 | # Initialization |
---|
| 220 | zfex=1 |
---|
| 221 | zfile1= |
---|
| 222 | zfile2= |
---|
| 223 | zruntype= |
---|
| 224 | zstream= |
---|
| 225 | ztag= |
---|
| 226 | zkind=none |
---|
| 227 | |
---|
| 228 | # Get arguments |
---|
| 229 | while getopts x:a:b:r:s:t:k: opt |
---|
| 230 | do |
---|
| 231 | case "$opt" in |
---|
| 232 | x) zfex="$OPTARG";; |
---|
| 233 | a) zfile1="$OPTARG";; |
---|
| 234 | b) zfile2="$OPTARG";; |
---|
| 235 | r) zruntype="$OPTARG";; |
---|
| 236 | s) zstream="$OPTARG";; |
---|
| 237 | t) ztag="$OPTARG";; |
---|
| 238 | k) zkind="$OPTARG";; |
---|
| 239 | *) help_diff;; |
---|
| 240 | esac |
---|
| 241 | done |
---|
| 242 | |
---|
| 243 | zgenf=$( basename ${zfile1} ) |
---|
| 244 | zgenftrc=$( basename ${zfile1%.*} ) |
---|
| 245 | |
---|
| 246 | case "$zkind" in |
---|
| 247 | none ) |
---|
| 248 | zmesg1=" Current run ${ztag} run " |
---|
| 249 | zmesg2=" ----------- --------------" |
---|
| 250 | zmesg_NOK=" ${zstream} ${zgenf} is NOT identical to the version ${ztag} one" |
---|
| 251 | zmesg_OK=" ${zstream} ${zgenf} IS IDENTICAL to the version ${ztag} one " |
---|
| 252 | zmesg_wht=" NO comparison between current ${zstream} and the version ${ztag} ${zgenf} " |
---|
| 253 | bnam='cvref_'${zgenftrc}_${zstream}_${zruntype} ;; |
---|
| 254 | repro ) |
---|
| 255 | zmesg1=" mon run ${zruntype} run " |
---|
| 256 | zmesg2=" ------- ------- " |
---|
| 257 | zmesg_NOK=" NO NO NO NO NO NO for the current version" |
---|
| 258 | zmesg_OK=" YES YES YES YES YES YES YES YES for the current version " |
---|
| 259 | zmesg_wht=" NO CONCLUSION !!!!! " |
---|
| 260 | bnam=${zkind}_${zgenftrc} ;; |
---|
| 261 | resta ) |
---|
| 262 | zmesg1=" LONG Stream SHORT Streams" |
---|
| 263 | zmesg2=" ----------- -------------" |
---|
| 264 | zmesg_NOK=" NO NO NO NO NO NO for the current version i.e. LONG stream != ( 1_SHORT + 2_SHORT ) streams " |
---|
| 265 | zmesg_OK=" YES YES YES YES YES YES YES YES for the current version i.e. LONG stream = ( 1_SHORT + 2_SHORT ) streams " |
---|
| 266 | zmesg_wht=" NO CONCLUSION !!!!!! " |
---|
| 267 | bnam=${zkind}_${zgenftrc} ;; |
---|
| 268 | esac |
---|
| 269 | |
---|
| 270 | |
---|
| 271 | if [ ${zfex} == 0 ] ; then |
---|
| 272 | \rm ${bnam}.txt 2> /dev/null |
---|
| 273 | echo " Make difference between ${zgenf} files " > ${bnam}.txt |
---|
| 274 | echo " ${zstream} ${zruntype} run " >> ${bnam}.txt |
---|
| 275 | echo "${zmesg1}" >> ${bnam}.txt |
---|
| 276 | echo "${zmesg2}" >> ${bnam}.txt |
---|
| 277 | sdiff ${zfile1} ${zfile2} >> ${bnam}.txt |
---|
| 278 | sdiff -s ${zfile1} ${zfile2} >> ${bnam}_dd.txt |
---|
| 279 | |
---|
| 280 | #--------- |
---|
| 281 | if [ ${zgenf} = 'ocean.output' ] ; then |
---|
| 282 | echo " " >> ${zstream}_head.txt |
---|
| 283 | echo " Make difference between ${zgenf} files " > ${zstream}_head.txt |
---|
| 284 | echo " ${zstream} ${zruntype} run " >> ${zstream}_head.txt |
---|
| 285 | echo " Current run ${ztag} run " >> ${zstream}_head.txt |
---|
| 286 | echo " ----------- --------------" >> ${zstream}_head.txt |
---|
| 287 | echo " " >> ${zstream}_head.txt |
---|
| 288 | zfout=${bnam}_dd.txt |
---|
| 289 | zspmes=" See ${bnam}.txt file for full difference" |
---|
| 290 | else |
---|
| 291 | touch ${zstream}_head.txt |
---|
| 292 | zfout=${bnam}.txt |
---|
| 293 | zspmes="" |
---|
| 294 | fi |
---|
| 295 | #--------- |
---|
| 296 | if [ -s ${bnam}_dd.txt ] ; then |
---|
| 297 | # Differences exist between solver.stat or ocean.output files |
---|
| 298 | echo " " >> endjob.txt |
---|
| 299 | echo "${zmesg_NOK}" >> endjob.txt |
---|
| 300 | echo " ${zspmes} " >> endjob.txt |
---|
| 301 | echo " " >> endjob.txt |
---|
| 302 | cat ${zstream}_head.txt ${zfout} >> endjob.txt |
---|
| 303 | echo " " >> endjob.txt |
---|
| 304 | echo " " >> endjob.txt |
---|
| 305 | else |
---|
| 306 | # No differences exist between solver.stat or ocean.output files |
---|
| 307 | echo " " >> endjob.txt |
---|
| 308 | echo "${zmesg_OK}" >> endjob.txt |
---|
| 309 | echo " " >> endjob.txt |
---|
| 310 | fi |
---|
| 311 | |
---|
| 312 | \rm *_dd* *_head.txt 2> /dev/null |
---|
| 313 | |
---|
| 314 | else |
---|
| 315 | # It is not possible to conclude because files are missing or empty |
---|
| 316 | echo " " >> endjob.txt |
---|
| 317 | echo "${zmesg_wht}" >> endjob.txt |
---|
| 318 | echo " " >> endjob.txt |
---|
| 319 | fi |
---|
| 320 | |
---|
| 321 | return |
---|
| 322 | |
---|
| 323 | } |
---|
| 324 | ############### End mak_diff_file function #################### |
---|
| 325 | ############################################################### |
---|
| 326 | |
---|
| 327 | ########################################################### |
---|
| 328 | # concat_perf() is a local function to gather performances |
---|
| 329 | # files (perfs_runtype.txt_xxxx) build with the hpmcount |
---|
| 330 | # command on Zahir and standard(s) error output file(s) |
---|
| 331 | # runtypeCONFNAME_err |
---|
| 332 | # 1 argument: |
---|
| 333 | # - zconf : configuration name |
---|
| 334 | ############################################################# |
---|
| 335 | ################ Begin concat_perf function ################# |
---|
| 336 | function concat_perf |
---|
| 337 | { |
---|
| 338 | |
---|
| 339 | #set -x |
---|
| 340 | |
---|
| 341 | # name of the configuration |
---|
| 342 | zconf=$1 |
---|
| 343 | |
---|
| 344 | # List of files to treat |
---|
[1301] | 345 | zcatfe[0]="mon/LONG/${EXPER}/mon${zconf}_err" |
---|
| 346 | zcatfe[1]="mon/GTIME/${EXPER}/mon${zconf}_err" |
---|
| 347 | zcatfe[2]="mpi/GTIME/${EXPER}/mpi${zconf}_err" |
---|
[695] | 348 | |
---|
| 349 | ind=0 |
---|
| 350 | while [ ${ind} -lt 3 ] ; do |
---|
| 351 | |
---|
| 352 | zpath=$( ( dirname ${zcatfe[${ind}]} ) ) |
---|
| 353 | zname=$( ( basename ${zcatfe[${ind}]} ) ) |
---|
| 354 | cd ${zpath} |
---|
| 355 | cp ${zname} ${zname}_save |
---|
| 356 | for kf in `ls perf*` ; do |
---|
| 357 | cat ${kf} >> ${zname} |
---|
| 358 | done |
---|
[1301] | 359 | cd ../../.. |
---|
[695] | 360 | let ind=${ind}+1 |
---|
| 361 | done |
---|
| 362 | |
---|
| 363 | return |
---|
| 364 | } |
---|
| 365 | ############### End concat_perf function ############### |
---|
| 366 | ######################################################## |
---|
| 367 | |
---|
| 368 | |
---|
| 369 | # ############################### |
---|
[1301] | 370 | # 0. EXPERIENCE NAME |
---|
[695] | 371 | # ############################### |
---|
| 372 | echo " ############################ " > endjob.txt |
---|
[1301] | 373 | echo " EXPERIENCE NAME: $EXPER " >> endjob.txt |
---|
[695] | 374 | echo " ############################ " >> endjob.txt |
---|
| 375 | echo " " >> endjob.txt |
---|
| 376 | |
---|
[1301] | 377 | # ############################### |
---|
| 378 | # 0.I LIST OF FILES TESTED, i.e. stored under NVTK/2TEST directory |
---|
| 379 | # ############################### |
---|
| 380 | echo " ################################################# " >> endjob.txt |
---|
[1564] | 381 | echo " FILES STORED UNDER NVTK/${EXPER} DIRECTORY & TESTED " >> endjob.txt |
---|
[1301] | 382 | echo " ################################################# " >> endjob.txt |
---|
| 383 | echo " " >> endjob.txt |
---|
[1564] | 384 | LSFILES=`head -1 f2test.txt | wc -w` |
---|
| 385 | if [ $LSFILES != 0 ] ; then |
---|
| 386 | for file in `head -1 f2test.txt` ; do |
---|
| 387 | echo " -" $file >> endjob.txt |
---|
| 388 | done |
---|
| 389 | else |
---|
| 390 | echo " " >> endjob.txt |
---|
| 391 | echo " ---> NO files tested " >> endjob.txt |
---|
| 392 | echo " " >> endjob.txt |
---|
| 393 | fi |
---|
[1301] | 394 | echo " " >> endjob.txt |
---|
[1564] | 395 | |
---|
| 396 | # ############################### |
---|
| 397 | # 0.II LIST OF CPP KEYS USED |
---|
| 398 | # ############################### |
---|
| 399 | echo " ################################################# " >> endjob.txt |
---|
| 400 | echo " CPP KEYS USED FOR ${EXPER} EXPERIENCE " >> endjob.txt |
---|
| 401 | echo " ################################################# " >> endjob.txt |
---|
[1301] | 402 | echo " " >> endjob.txt |
---|
[1564] | 403 | for file in `tail -1 f2test.txt` ; do |
---|
| 404 | echo " -" $file >> endjob.txt |
---|
| 405 | done |
---|
| 406 | echo " " >> endjob.txt |
---|
[1301] | 407 | |
---|
[1574] | 408 | |
---|
[1301] | 409 | # ############################### |
---|
| 410 | # ############################### |
---|
[1574] | 411 | # 0.III NEMO MPI DECOMPOSITION USED |
---|
[1564] | 412 | # ############################### |
---|
[1574] | 413 | for runt in ${LRTYPE} ; do |
---|
| 414 | if [ ${runt} = 'mpi' ] ; then |
---|
| 415 | echo " ############################# " >> endjob.txt |
---|
| 416 | echo " NEMO MPI DECOMPOSITION USED " >> endjob.txt |
---|
| 417 | echo " ############################# " >> endjob.txt |
---|
| 418 | echo " " >> endjob.txt |
---|
| 419 | echo " jpni = ${MPIDCI} ; jpnj = ${MPIDCJ} ; jpnij = ${MPIDCIJ} " >> endjob.txt |
---|
| 420 | echo " " >> endjob.txt |
---|
| 421 | fi |
---|
| 422 | done |
---|
| 423 | |
---|
| 424 | # ############################### |
---|
| 425 | # ############################### |
---|
| 426 | # 0.IV NEMO SOURCE FILES INFORMATION, i.e. revision & URL downloaded |
---|
| 427 | # ############################### |
---|
[1301] | 428 | echo " ############################# " >> endjob.txt |
---|
| 429 | echo " NEMO SOURCE FILES INFORMATION " >> endjob.txt |
---|
| 430 | echo " ############################# " >> endjob.txt |
---|
| 431 | echo " " >> endjob.txt |
---|
| 432 | echo " NEMO downloaded from server: ${URL_USE} " >> endjob.txt |
---|
| 433 | echo " NEMO revision : ${REV_USE} " >> endjob.txt |
---|
| 434 | echo " " >> endjob.txt |
---|
| 435 | |
---|
[695] | 436 | test -n "${TODO}" |
---|
| 437 | id2do=$? |
---|
[1564] | 438 | if [ ${id2do} == 0 -a ${TARGET} = 'aix6' ] ; then concat_perf ${CONFS} ; fi |
---|
[695] | 439 | |
---|
| 440 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 441 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 442 | # ############################### |
---|
| 443 | # I. CHECK EXECUTABLE MEMORY SIZE |
---|
| 444 | # ############################### |
---|
[1564] | 445 | filecs="mon/LONG/${EXPER}/memory_size.txt" ; filers="mon/LONG/${REF_TAG}/memory_size.txt" |
---|
| 446 | filecm="mon/LONG/${EXPER}/mon${CONFS}_err" ; filerm="mon/LONG/${REF_TAG}/mon${CONFS}_err" |
---|
[695] | 447 | xfilecs=0 ; xfilecm=0 ; xfilers=0 ; xfilerm=0 |
---|
| 448 | echo " ############################ " >> endjob.txt |
---|
| 449 | echo " CHECK EXECUTABLE MEMORY SIZE " >> endjob.txt |
---|
| 450 | echo " ############################ " >> endjob.txt |
---|
| 451 | echo " " >> endjob.txt |
---|
| 452 | #-------- |
---|
| 453 | checkfile ${filecs} 'endjob.txt' DIFF yes ; xfilecs=$? |
---|
[1157] | 454 | checkfile ${filers} 'endjob.txt' DIFF no ; xfilers=$? |
---|
| 455 | checkfile ${filecm} 'endjob.txt' DIFF no ; xfilecm=$? |
---|
| 456 | checkfile ${filerm} 'endjob.txt' DIFF no ; xfilerm=$? |
---|
[695] | 457 | |
---|
| 458 | # If current version files exist |
---|
| 459 | if [ ${xfilecs} == 0 ] ; then |
---|
| 460 | |
---|
| 461 | if [ ${REF_TAG} ] ; then |
---|
[1564] | 462 | ./MEM_size_${TARGET}.ksh -a ${xfilecm} -b ${xfilers} -d ${xfilerm} -e ${EXPER} -c ${CONFS} -o endjob.txt -t ${REF_TAG} |
---|
[695] | 463 | else |
---|
[1564] | 464 | ./MEM_size_${TARGET}.ksh -a ${xfilecm} -b ${xfilers} -d ${xfilerm} -e ${EXPER} -c ${CONFS} -o endjob.txt |
---|
[695] | 465 | fi |
---|
| 466 | |
---|
| 467 | else |
---|
| 468 | echo " " >> endjob.txt |
---|
| 469 | echo " ---> NO memory size check " >> endjob.txt |
---|
| 470 | echo " " >> endjob.txt |
---|
| 471 | fi |
---|
| 472 | # |
---|
| 473 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 474 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 475 | # ####################### |
---|
| 476 | # II. CHECK CPU TIME USED |
---|
| 477 | # ####################### |
---|
| 478 | if [ ${VTIME} = 'timing' ] ; then |
---|
| 479 | |
---|
| 480 | echo " " >> endjob.txt |
---|
| 481 | echo " ###################### " >> endjob.txt |
---|
| 482 | echo " CHECK CPU TIME USED " >> endjob.txt |
---|
| 483 | echo " ###################### " >> endjob.txt |
---|
| 484 | echo " " >> endjob.txt |
---|
| 485 | #------ |
---|
| 486 | |
---|
| 487 | for runt in ${LRTYPE} ; do |
---|
| 488 | |
---|
| 489 | echo " " >> endjob.txt |
---|
| 490 | echo " ---> Timing for the ${runt} run : " >> endjob.txt |
---|
| 491 | echo " ---------------------------- " >> endjob.txt |
---|
| 492 | echo " " >> endjob.txt |
---|
| 493 | |
---|
| 494 | xfilecv=0 ; xfilerv=0 |
---|
| 495 | |
---|
| 496 | # Check that timing file for the ${runt} current version exist |
---|
[1564] | 497 | filecv="${runt}/GTIME/${EXPER}/${runt}${CONFS}_err" |
---|
[695] | 498 | checkfile ${filecv} 'endjob.txt' NORM yes ; xfilecv=$? |
---|
| 499 | |
---|
| 500 | # Check that timing file for the ${runt} reference version exist |
---|
[1564] | 501 | filerv="${runt}/GTIME/${REF_TAG}/${runt}${CONFS}_err" |
---|
[1157] | 502 | checkfile ${filerv} 'endjob.txt' NORM no ; xfilerv=$? |
---|
[695] | 503 | echo " " >> endjob.txt |
---|
| 504 | |
---|
| 505 | if [ ${xfilecv} == 0 ] ; then |
---|
| 506 | if [ ${REF_TAG} ] ; then |
---|
[1564] | 507 | ./CPU_time_${TARGET}.ksh -r ${runt} -a ${filecv} -b ${filerv} -o endjob.txt -x ${xfilerv} -t ${REF_TAG} |
---|
[695] | 508 | else |
---|
[1564] | 509 | ./CPU_time_${TARGET}.ksh -r ${runt} -a ${filecv} -b ${filerv} -o endjob.txt -x ${xfilerv} |
---|
[695] | 510 | fi |
---|
| 511 | fi |
---|
| 512 | |
---|
| 513 | done |
---|
| 514 | |
---|
| 515 | fi |
---|
| 516 | |
---|
| 517 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 518 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 519 | # ######################################################## |
---|
| 520 | # III. CHECK REPRODUCTIBILITY: mon .vs. mpi & mon .vs .omp |
---|
| 521 | # ######################################################## |
---|
| 522 | echo " " >> endjob.txt |
---|
| 523 | echo " ###################### " >> endjob.txt |
---|
| 524 | echo " CHECK REPRODUCTIBILITY " >> endjob.txt |
---|
| 525 | echo " ###################### " >> endjob.txt |
---|
| 526 | echo " " >> endjob.txt |
---|
| 527 | #------ |
---|
| 528 | for runt in ${LRTYPE} ; do |
---|
| 529 | |
---|
| 530 | if [ ${runt} != 'mon' ] ; then |
---|
| 531 | |
---|
[1356] | 532 | if [ ${CONF} != 'ORCA2_OFF_PISCES' ] ; then |
---|
| 533 | echo " " >> endjob.txt |
---|
| 534 | echo " ---> Ocean Reproductibility mon .vs. ${runt} ? : " >> endjob.txt |
---|
| 535 | echo " ------------------------------------------- " >> endjob.txt |
---|
[695] | 536 | |
---|
[1356] | 537 | filemon="mon/LONG/${EXPER}/solver.stat" ; filexxx="${runt}/LONG/${EXPER}/solver.stat" |
---|
| 538 | xfilemon=0 |
---|
| 539 | |
---|
| 540 | checkfile ${filemon} 'endjob.txt' NORM yes yes ; xfilemon=$? |
---|
| 541 | checkfile ${filexxx} 'endjob.txt' NORM no yes ; xfilemon=$? |
---|
[695] | 542 | |
---|
[1356] | 543 | mak_diff_file -x ${xfilemon} -a ${filemon} -b ${filexxx} -r ${runt} -s LONG -k repro |
---|
| 544 | fi |
---|
[795] | 545 | |
---|
[1356] | 546 | if [ ${CONF} = 'GYRE_LOBSTER' -o ${CONF} = 'ORCA2_LIM_PISCES' -o ${CONF} = 'ORCA2_OFF_PISCES' ] ; then |
---|
[795] | 547 | # check that ocean.output files exist |
---|
[1301] | 548 | filemon="mon/LONG/${EXPER}/ocean.output" ; filexxx="${runt}/LONG/${EXPER}/ocean.output" |
---|
[795] | 549 | xfilemon=0 |
---|
| 550 | |
---|
| 551 | checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$? |
---|
[1157] | 552 | checkfile ${filexxx} 'endjob.txt' NORM no ; xfilemon=$? |
---|
[795] | 553 | |
---|
| 554 | # check that tracer.stat files have been built based on ocean.output ones |
---|
[1301] | 555 | filemon="mon/LONG/${EXPER}/tracer.stat" ; filexxx="${runt}/LONG/${EXPER}/tracer.stat" |
---|
[795] | 556 | xfilemon=0 |
---|
[1356] | 557 | if [ ${CONF} = 'GYRE_LOBSTER' ] ; then |
---|
| 558 | echo " " >> endjob.txt |
---|
| 559 | echo " ---> LOBSTER Reproductibility mon .vs. ${runt} ? : " >> endjob.txt |
---|
| 560 | echo " --------------------------------------------- " >> endjob.txt |
---|
[795] | 561 | |
---|
[1356] | 562 | ./LOBSTER_stat.ksh -a ${filemon} -b ${filexxx} -c ocean.output |
---|
| 563 | else |
---|
| 564 | echo " " >> endjob.txt |
---|
| 565 | echo " ---> PISCES Reproductibility mon .vs. ${runt} ? : " >> endjob.txt |
---|
| 566 | echo " --------------------------------------------- " >> endjob.txt |
---|
| 567 | |
---|
| 568 | ./PISCES_stat.ksh -a ${filemon} -b ${filexxx} -c ocean.output |
---|
| 569 | fi |
---|
| 570 | |
---|
[795] | 571 | checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$? |
---|
[1157] | 572 | checkfile ${filexxx} 'endjob.txt' NORM no ; xfilemon=$? |
---|
[795] | 573 | |
---|
| 574 | mak_diff_file -x ${xfilemon} -a ${filemon} -b ${filexxx} -r ${runt} -s LONG -k repro |
---|
| 575 | fi |
---|
[695] | 576 | fi |
---|
| 577 | done |
---|
| 578 | |
---|
| 579 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 580 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 581 | # ########################################## |
---|
| 582 | # IV. CHECK RESTARTABILITY: mon mpi omp runs |
---|
| 583 | # ########################################## |
---|
| 584 | echo " " >> endjob.txt |
---|
| 585 | echo " #################### " >> endjob.txt |
---|
| 586 | echo " CHECK RESTARTABILITY " >> endjob.txt |
---|
| 587 | echo " #################### " >> endjob.txt |
---|
| 588 | echo " " >> endjob.txt |
---|
| 589 | |
---|
| 590 | for runt in ${LRTYPE} ; do |
---|
[1356] | 591 | if [ ${CONF} != 'ORCA2_OFF_PISCES' ] ; then |
---|
| 592 | echo " " >> endjob.txt |
---|
| 593 | echo " ---> ${runt} ocean restartability ? : " >> endjob.txt |
---|
| 594 | echo " -------------------------------- " >> endjob.txt |
---|
[695] | 595 | |
---|
[1356] | 596 | file1="${runt}/1_SHORT/${EXPER}/solver.stat" ; file2="${runt}/2_SHORT/${EXPER}/solver.stat" ; file3="${runt}/LONG/${EXPER}/solver.stat" |
---|
| 597 | xfile1=0 |
---|
| 598 | #------- |
---|
| 599 | checkfile ${file1} 'endjob.txt' NORM yes yes ; xfile1=$? |
---|
| 600 | checkfile ${file2} 'endjob.txt' NORM no yes ; xfile1=$? |
---|
| 601 | # |
---|
| 602 | cat ${file1} ${file2} > short_solver_${runt}.stat |
---|
| 603 | mak_diff_file -x ${xfile1} -a ${file3} -b short_solver_${runt}.stat -r ${runt} -k resta |
---|
| 604 | \rm short_solver_${runt}.stat |
---|
| 605 | fi |
---|
[695] | 606 | #------- |
---|
[795] | 607 | |
---|
[1356] | 608 | if [ ${CONF} = 'GYRE_LOBSTER' -o ${CONF} = 'ORCA2_LIM_PISCES' -o ${CONF} = 'ORCA2_OFF_PISCES' ] ; then |
---|
[795] | 609 | |
---|
| 610 | # check that ocean.output files exist |
---|
[1301] | 611 | file1="${runt}/2_SHORT/${EXPER}/ocean.output" ; file2="${runt}/LONG/${EXPER}/ocean.output" |
---|
[795] | 612 | xfile1=0 |
---|
| 613 | |
---|
| 614 | checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$? |
---|
[1157] | 615 | checkfile ${file2} 'endjob.txt' NORM no ; xfile1=$? |
---|
[795] | 616 | |
---|
| 617 | # check that tracer.stat files have been built based on ocean.output ones |
---|
[1301] | 618 | file1="${runt}/2_SHORT/${EXPER}/tracer.stat" ; file2="${runt}/LONG/${EXPER}/tracer.stat" |
---|
[795] | 619 | xfile1=0 |
---|
| 620 | |
---|
[1356] | 621 | if [ ${CONF} = 'GYRE_LOBSTER' ] ; then |
---|
| 622 | echo " " >> endjob.txt |
---|
| 623 | echo " ---> ${runt} LOBSTER restartability ? : " >> endjob.txt |
---|
| 624 | echo " ---------------------------------- " >> endjob.txt |
---|
[795] | 625 | |
---|
[1356] | 626 | ./LOBSTER_stat.ksh -a ${file1} -b ${file2} -c ocean.output |
---|
| 627 | else |
---|
| 628 | echo " " >> endjob.txt |
---|
| 629 | echo " ---> ${runt} PISCES restartability ? : " >> endjob.txt |
---|
| 630 | echo " --------------------------------------------- " >> endjob.txt |
---|
| 631 | |
---|
| 632 | ./PISCES_stat.ksh -a ${file1} -b ${file2} -c ocean.output |
---|
| 633 | fi |
---|
| 634 | |
---|
| 635 | |
---|
[795] | 636 | checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$? |
---|
[1157] | 637 | checkfile ${file2} 'endjob.txt' NORM no ; xfile1=$? |
---|
[795] | 638 | # |
---|
| 639 | mak_diff_file -x ${xfile1} -a ${file2} -b ${file1} -r ${runt} -k resta |
---|
| 640 | |
---|
| 641 | fi |
---|
| 642 | |
---|
[695] | 643 | done |
---|
| 644 | |
---|
| 645 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 646 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 647 | # ####################################################### |
---|
| 648 | # V. COMPARE CURRENT ${runt} RESULTS TO THE $REF_TAG ONES |
---|
| 649 | # ####################################################### |
---|
| 650 | |
---|
| 651 | # This step is realised only if a reference tag ${REF_TAG} is specified |
---|
| 652 | if [ ${REF_TAG} ] ; then |
---|
| 653 | |
---|
| 654 | echo " " >> endjob.txt |
---|
| 655 | echo " #################################################### " >> endjob.txt |
---|
| 656 | echo " COMPARE CURRENT VERSION RESULTS TO THE $REF_TAG ONES " >> endjob.txt |
---|
| 657 | echo " #################################################### " >> endjob.txt |
---|
| 658 | echo " " >> endjob.txt |
---|
| 659 | |
---|
| 660 | for runt in ${LRTYPE} ; do |
---|
| 661 | |
---|
| 662 | echo " -----------------------------------------------------------------------------" >> endjob.txt |
---|
| 663 | echo " ---> ${runt} results : current version | ${REF_TAG} version STREAM 1 & 2" >> endjob.txt |
---|
| 664 | echo ' solver.stat .vs. solver.stat ' >> endjob.txt |
---|
| 665 | echo ' ocean.output .vs. ocean.output ' >> endjob.txt |
---|
| 666 | |
---|
[1301] | 667 | file1="${runt}/1_SHORT/${EXPER}/solver.stat" ; file2="${runt}/2_SHORT/${EXPER}/solver.stat" |
---|
[1564] | 668 | filev1="${runt}/1_SHORT/${REF_TAG}/solver.stat" ; filev2="${runt}/2_SHORT/${REF_TAG}/solver.stat" |
---|
[1301] | 669 | file_oc1="${runt}/1_SHORT/${EXPER}/ocean.output" ; file_oc2="${runt}/2_SHORT/${EXPER}/ocean.output" |
---|
[1564] | 670 | file_roc1="${runt}/1_SHORT/${REF_TAG}/ocean.output" ; file_roc2="${runt}/2_SHORT/${REF_TAG}/ocean.output" |
---|
[695] | 671 | xfilev1=0 ; xfilev2=0 ; xfile_oc1=0 ; xfile_oc2=0 |
---|
| 672 | |
---|
| 673 | echo " " >> endjob.txt |
---|
| 674 | echo " STREAM 1 results : " >> endjob.txt |
---|
| 675 | echo " ----------------- " >> endjob.txt |
---|
| 676 | # |
---|
| 677 | #------- |
---|
| 678 | # solver.stat STREAM 1 |
---|
| 679 | checkfile ${file1} 'endjob.txt' NORM yes ; xfilev1=$? |
---|
[1157] | 680 | checkfile ${filev1} 'endjob.txt' NORM no ; xfilev1=$? |
---|
[695] | 681 | |
---|
| 682 | mak_diff_file -x ${xfilev1} -a ${file1} -b ${filev1} -r ${runt} -s STREAM_1 -t ${REF_TAG} |
---|
| 683 | |
---|
| 684 | #------- |
---|
| 685 | # ocean.output STREAM 1 |
---|
| 686 | checkfile ${file_oc1} 'endjob.txt' NORM yes ; xfile_oc1=$? |
---|
[1157] | 687 | checkfile ${file_roc1} 'endjob.txt' NORM no ; xfile_oc1=$? |
---|
[695] | 688 | |
---|
| 689 | mak_diff_file -x ${xfile_oc1} -a ${file_oc1} -b ${file_roc1} -r ${runt} -s STREAM_1 -t ${REF_TAG} |
---|
| 690 | |
---|
| 691 | echo " " >> endjob.txt |
---|
| 692 | echo " STREAM 2 results : " >> endjob.txt |
---|
| 693 | echo " ----------------- " >> endjob.txt |
---|
| 694 | # |
---|
| 695 | #------- |
---|
| 696 | # solver.stat STREAM 2 |
---|
| 697 | checkfile ${file2} 'endjob.txt' NORM yes ; xfilev2=$? |
---|
[1157] | 698 | checkfile ${filev2} 'endjob.txt' NORM no ; xfilev2=$? |
---|
[695] | 699 | |
---|
| 700 | mak_diff_file -x ${xfilev2} -a ${file2} -b ${filev2} -r ${runt} -s STREAM_2 -t ${REF_TAG} |
---|
| 701 | |
---|
| 702 | #------- |
---|
| 703 | # ocean.output STREAM 2 |
---|
| 704 | checkfile ${file_oc2} 'endjob.txt' NORM yes ; xfile_oc2=$? |
---|
[1157] | 705 | checkfile ${file_roc2} 'endjob.txt' NORM no ; xfile_oc2=$? |
---|
[695] | 706 | |
---|
| 707 | mak_diff_file -x ${xfile_oc2} -a ${file_oc2} -b ${file_roc2} -r ${runt} -s STREAM_2 -t ${REF_TAG} |
---|
| 708 | |
---|
| 709 | done |
---|
| 710 | # |
---|
| 711 | #------- |
---|
| 712 | fi |
---|
| 713 | |
---|
| 714 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 715 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
---|
| 716 | # ############################################### |
---|
| 717 | # VI. SEND THE ASSESSMENT FILE REPORT "endjob.txt" |
---|
| 718 | # ############################################### |
---|
| 719 | mail -s "$TITLE" ${EMAIL} < endjob.txt |
---|