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 tags/nemo_v3_2/nemo_v3_2/NVTK/INSTALL/JOBS – NEMO

source: tags/nemo_v3_2/nemo_v3_2/NVTK/INSTALL/JOBS/assessment.ksh @ 1878

Last change on this file since 1878 was 1878, checked in by flavoni, 14 years ago

initial test for nemogcm

File size: 30.4 KB
Line 
1#!/bin/ksh
2# $Id: assessment.ksh 1603 2009-08-11 12:27:01Z ctlod $
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###########################################################
62CONF=`basename $( pwd ) | cut -c2-`
63EXPER=$1
64TARGET=sx8brodie
65INFOF="./infos/specifs_${EXPER}.txt"
66LRTYPE="$( ( awk '/runs=/ { printf  "%s %s %s", $2 , $3 , $4}' ${INFOF} ) )"
67MPIDCI="$( ( awk '/mpis=/ { printf  "%s ", $2}' ${INFOF} ) )"
68MPIDCJ="$( ( awk '/mpis=/ { printf  "%s ", $3}' ${INFOF} ) )"
69MPIDCIJ="$( ( awk '/mpis=/ { printf  "%s ", $4}' ${INFOF} ) )"
70VTIME=$( ( awk '/time=/ { print $2 }' ${INFOF} ) )
71REF_TAG=$( (awk '/tagname=/ {print $2}' ${INFOF}) )
72URL_USE=$( (awk '/URL:/ {print $0}' ${INFOF} ) )
73REV_USE=$( (awk '/Revision:/ {print $2}' ${INFOF} ) )
74TITLE="NEMO VALIDATION ${EXPER} : $CONF on $TARGET"
75EMAIL='ctlod@locean-ipsl.upmc.fr'
76
77OUTPUTF="endjob_${EXPER}.txt"
78
79\rm ${OUTPUTF} 2> /dev/null
80touch ${OUTPUTF}
81
82if [ ${CONF} == 'ORCA2_LIM' ] ; then
83    CONFS=ORCA2
84elif [ ${CONF} == 'ORCA2_LIM3' ] ; then
85    CONFS=OR2L3
86elif [ ${CONF} == 'GYRE' ] ; then
87    CONFS=GYREO
88elif [ ${CONF} == 'GYRE_LOBSTER' ] ; then
89    CONFS=GYREL
90elif [ ${CONF} == 'ORCA2_LIM_PISCES' ] ; then
91    CONFS=OR2LP
92elif [ ${CONF} == 'ORCA2_OFF_PISCES' ] ; then
93    CONFS=OR2OP
94elif [ ${CONF} == 'ZAGRIF' ] ; then
95    CONFS=ZAGRI
96else
97    CONFS=${CONF}
98fi
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 #################
110function checkfile
111{
112# name of the file to check
113zf2check=$1
114# print output file name
115zoutfile=$2
116# white space prints
117zworkt=$3
118# Print a message only once
119zreprint=$4
120# Print iterations number
121ziter=$5
122
123#set -x
124
125test -n "${ziter}"
126zrepiter=$?
127
128
129genf=$( basename ${zf2check} )
130
131case "${zworkt}" in
132      'NORM' )  blnk='       ' ;;
133      'DIFF' )  blnk=' '  ;;
134esac
135fmes4=" - file ${zf2check} doesn't exist "
136
137# Check file exists
138if [ -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
173else
174   [ ${zoutfile} ] && echo "${blnk}${fmes4}" >> ${zoutfile}
175   xist=1 ; return ${xist}
176fi
177return
178}
179############### End checkfile function ###############
180######################################################
181
182# Get the name of the present script
183nscript=$( (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 #################
198function mak_diff_file
199{
200#
201# help_diff() To print help
202#
203function 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
221zfex=1
222zfile1=
223zfile2=
224zruntype=
225zstream=
226ztag=
227zkind=none
228outdir='./infos/inter/'
229
230# Get arguments
231while getopts x:a:b:r:s:t:k: opt
232do
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
243done
244
245zgenf=$( basename ${zfile1} )
246zgenftrc=$( basename ${zfile1%.*} )
247
248case "$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} ;;
270esac
271
272
273if [ ${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
316else
317       # It is not possible to conclude because files are missing or empty
318       echo "                             " >> ${OUTPUTF}
319       echo "${zmesg_wht}"                  >> ${OUTPUTF}
320       echo "                             " >> ${OUTPUTF}
321fi
322
323return
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 #################
338function concat_perf
339{
340
341#set -x
342
343# name of the configuration
344zconf=$1
345
346# List of files to treat
347zcatfe[0]="mon/LONG/${EXPER}/mon${zconf}_err"
348zcatfe[1]="mon/GTIME/${EXPER}/mon${zconf}_err"
349zcatfe[2]="mpi/GTIME/${EXPER}/mpi${zconf}_err"
350
351ind=0
352while [ ${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
363done
364
365return
366}
367############### End concat_perf function ###############
368########################################################
369
370
371# ###############################
372# 0. EXPERIENCE NAME
373# ###############################
374echo " ############################                           "  > ${OUTPUTF}
375echo " EXPERIENCE NAME: $EXPER                                " >> ${OUTPUTF}
376echo " ############################                           " >> ${OUTPUTF}
377echo "                                                        " >> ${OUTPUTF}
378
379# ###############################
380# 0.I LIST OF FILES TESTED, i.e. stored under NVTK/2TEST directory
381# ###############################
382echo " #################################################      " >> ${OUTPUTF}
383echo " FILES STORED UNDER NVTK/${EXPER} DIRECTORY & TESTED    " >> ${OUTPUTF}
384echo " #################################################      " >> ${OUTPUTF}
385echo "                                                        " >> ${OUTPUTF}
386LSFILES=`tail -2 ${INFOF} | head -1 | wc -w`
387if [ $LSFILES != 0 ] ; then
388    for file in `tail -2 ${INFOF} | head -1` ; do
389        echo "   -" $file                                       >> ${OUTPUTF}
390    done
391else
392    echo "                                                    " >> ${OUTPUTF}
393    echo "   ---> NO files tested                             " >> ${OUTPUTF}
394    echo "                                                    " >> ${OUTPUTF}
395fi
396echo "                                                        " >> ${OUTPUTF}
397
398# ###############################
399# 0.II LIST OF CPP KEYS USED
400# ###############################
401echo " #################################################      " >> ${OUTPUTF}
402echo " CPP KEYS USED FOR ${EXPER} EXPERIENCE                  " >> ${OUTPUTF}
403echo " #################################################      " >> ${OUTPUTF}
404echo "                                                        " >> ${OUTPUTF}
405for file in `tail -2 ${INFOF} | tail -1` ; do
406    echo "   -" $file                                           >> ${OUTPUTF}
407done
408echo "                                                        " >> ${OUTPUTF}
409
410
411# ###############################
412# ###############################
413# 0.III NEMO MPI DECOMPOSITION USED
414# ###############################
415for 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
424done
425
426# ###############################
427# ###############################
428# 0.IV NEMO SOURCE FILES INFORMATION, i.e. revision & URL downloaded
429# ###############################
430echo " #############################                          " >> ${OUTPUTF}
431echo " NEMO SOURCE FILES INFORMATION                          " >> ${OUTPUTF}
432echo " #############################                          " >> ${OUTPUTF}
433echo "                                                        " >> ${OUTPUTF}
434echo "   NEMO downloaded from server: ${URL_USE}              " >> ${OUTPUTF}
435echo "   NEMO revision : ${REV_USE}                           " >> ${OUTPUTF}
436echo "                                                        " >> ${OUTPUTF}
437
438if [ ${TARGET} = 'aix6' -a ${VTIME} = 'timing' ] ; then concat_perf ${CONFS} ; fi
439
440#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
441#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
442# ###############################
443# I. CHECK EXECUTABLE MEMORY SIZE
444# ###############################
445filecs="mon/LONG/${EXPER}/memory_size.txt"  ;  filers="mon/LONG/${REF_TAG}/memory_size.txt"
446filecm="mon/LONG/${EXPER}/mon${CONFS}_err"  ;  filerm="mon/LONG/${REF_TAG}/mon${CONFS}_err"
447xfilecs=0  ; xfilecm=0 ; xfilers=0 ; xfilerm=0
448echo " ############################                           " >> ${OUTPUTF}
449echo " CHECK EXECUTABLE MEMORY SIZE                           " >> ${OUTPUTF}
450echo " ############################                           " >> ${OUTPUTF}
451echo "                                                        " >> ${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
459if [ ${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
467else
468    echo "                                                    " >> ${OUTPUTF}
469    echo "   ---> NO memory size check                        " >> ${OUTPUTF}
470    echo "                                                    " >> ${OUTPUTF}
471fi
472#
473#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
474#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
475# #######################
476# II. CHECK CPU TIME USED
477# #######################
478if [ ${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
520fi
521
522#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
523#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
524# ########################################################
525# III. CHECK REPRODUCTIBILITY: mon .vs. mpi & mon .vs .omp
526# ########################################################
527echo "                                                        " >> ${OUTPUTF}
528echo " ######################                                 " >> ${OUTPUTF}
529echo " CHECK REPRODUCTIBILITY                                 " >> ${OUTPUTF}
530echo " ######################                                 " >> ${OUTPUTF}
531echo "                                                        " >> ${OUTPUTF}
532#------
533for 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
582done
583
584#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
585#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
586# ##########################################
587# IV. CHECK RESTARTABILITY: mon mpi omp runs
588# ##########################################
589echo "                                                        " >> ${OUTPUTF}
590echo " ####################                                   " >> ${OUTPUTF}
591echo " CHECK RESTARTABILITY                                   " >> ${OUTPUTF}
592echo " ####################                                   " >> ${OUTPUTF}
593echo "                                                        " >> ${OUTPUTF}
594
595for 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   
648done
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
657if [ ${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    #-------
717fi
718
719#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
720#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
721# ###############################################
722# VI. SEND THE ASSESSMENT FILE REPORT "endjob_EXPER.txt"
723# ###############################################
724mail -s "$TITLE" ${EMAIL} < ${OUTPUTF}
Note: See TracBrowser for help on using the repository browser.