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