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 @ 1574

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

NVTK: few changes to allow NVTK to manage properly MPI runs, see ticket: #513

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