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