New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
assessment.ksh in trunk/NVTK/INSTALL/JOBS – NEMO

source: trunk/NVTK/INSTALL/JOBS/assessment.ksh @ 1301

Last change on this file since 1301 was 1301, checked in by ctlod, 15 years ago

improvements of NVTK environnement, see ticket: #240

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