source: trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh @ 1348

Last change on this file since 1348 was 1348, checked in by sdipsl, 8 years ago
  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

    The fact that you are presently reading this means that you have had
    knowledge of the CeCILL license and that you accept its terms.
  • Property svn:keywords set to Revision Author Date
File size: 39.2 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Patrick Brockmann, Martial Mancip
5# Contact: Patrick.Brockmann__at__cea.fr Martial.Mancip__at__ipsl.jussieu.fr
6# $Revision::                                          $ Revision of last commit
7# $Author::                                            $ Author of last commit
8# $Date::                                              $ Date of last commit
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11#
12#**************************************************************
13
14#==================================================
15# The documentation of this file can be automatically generated
16# if you use the prefix #D- for comments to be extracted.
17# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
18#==================================================
19
20#==================================================
21# Add high level verbosity
22typeset -i Verbosity=${Verbosity:=3}
23
24#==================================================
25# DEBUG_debug
26# Add low level verbosity
27DEBUG_debug=${DEBUG_debug:=false}
28
29#D- postProcessingStopLevel (0,1,2,3)
30#D- 3 stop if any post-processing went wrong
31#D- 2 dont stop if atlas, monitoring or metrics failed
32#D- 1 dont stop if atlas, monitoring, metrics, create_ts or create_se failed
33#D- 0 dont stop if atlas, monitoring, metrics, create_ts, create_se, rebuild or pack_* failed
34postProcessingStopLevel=${postProcessingStopLevel:=0}
35
36#==================================================
37# GENERATE RANDOM ERROR ; only apply if ( ${DEBUG_debug} )
38typeset -r RandomError=false
39
40#==================================================
41# NULL_STR
42# Default null string
43typeset -r NULL_STR="_0_"
44
45#==================================================
46# libIGCM_CurrentTag
47# Current libIGCM tag, check compatibilty with *.card
48typeset -r libIGCMVersion="2.8.1"
49
50#==================================================
51# Exit Flag (internal debug)
52# When true, end the master loop AFTER SAVES FILES
53ExitFlag=false
54
55#==================================================
56# When we start to run the simulation is not finished
57simulationIsOver=false
58
59#==================================================
60# When we start to run we dont flush AMQP messages
61FlushAMQP=false
62
63#==================================================
64# Declare a stack of functions calls
65unset IGCM_debug_Stack
66unset IGCM_debug_StackArgs
67unset IGCM_debug_StackTiming
68IGCM_debug_Stack[0]=${NULL_STR}
69IGCM_debug_StackArgs[0]=${NULL_STR}
70IGCM_debug_StackTiming[0]=${NULL_STR}
71IGCM_debug_LenStack=0
72
73#D-#==================================================================
74#D-function IGCM_debug_getDate_ms
75#D- * Purpose: Give number of milliseconds since 01-jan-1970
76function IGCM_debug_getDate_ms
77{
78  typeset nanosecs ms
79  # nano secondes since 01-jan-1970
80  nanosecs=$( date +%s%N )
81
82  # truncate the last 6 digits to get milliseconds since 01-jan-1970
83  ms=${nanosecs:0:${#nanosecs}-6}
84
85  echo "$ms"
86}
87
88#D-#==================================================================
89#D-function IGCM_debug_sizeOfTabContent
90#D- * Purpose: Give sumed size of a list of files
91#D- * Usage: IGCM_debug_sizeOfTabContent entityList destination
92#D- *        where entityList is a list of files or directory
93#D- *        where dest is either a directory or a file name
94function IGCM_debug_sizeOfTabContent
95{
96  typeset entityListe destination iEntity sizeKo sumSizeKo sumSizeMo
97
98  eval set +A entityListe \${${1}}
99  destination=${2}
100  sumSizeKo=0
101
102  # Here we will try to compute size (file or directory size) from local path and not from archive.
103  for ((i = 0; i < ${#entityListe[*]}; i += 1)) ; do
104    if [ -f ${entityListe[$i]} ] ; then
105      # One file or a bunch of files has been copied without renaming from a visible filesystem
106      iEntity=${entityListe[$i]}
107    elif [ -f ${entityListe[$i]##/*/} ] ; then
108      # One file or a bunch of files has been copied without renaming from an non visible filesystem
109      # remove path /home/login/../ from entityListe elements
110      iEntity=${entityListe[$i]##/*/}
111    elif [ -f ${destination} ] ; then
112      # a file has been copied and renamed
113      iEntity=${destination}
114    elif [ -f ${destination}/${entityListe[$i]##/*/} ] ; then
115      # a copy in a directory but not in ${PWD}
116      iEntity=${destination}/${entityListe[$i]##/*/}
117    elif [ -d ${entityListe[$i]} ] ; then
118      # a directory has been copied from a non remote place
119      iEntity=${entityListe[$i]}
120    elif [ -d ${destination}/${entityListe[$i]##/*/} ] ; then
121      # a directory has been copied from a remote archive and not renamed
122      iEntity=${destination}/${entityListe[$i]##/*/}
123    elif [ -d ${destination} ] ; then
124      # a directory has been copied from a remote archive and renamed
125      iEntity=${destination}
126    fi
127    sizeKo=$( du --apparent-size -skL ${iEntity} | gawk '{print $1}' )
128    sumSizeKo=$(( $sumSizeKo + $sizeKo ))
129  done
130  sumSizeMo=$( echo "scale=6;${sumSizeKo}/1024" | bc )
131  echo "${sumSizeKo}|${sumSizeMo}"
132}
133
134#D-#==================================================================
135#D-function IGCM_debug_send_AMQP_msg__MAILTUNNEL
136#D- * Purpose: Take over AMQP C client using mail as a message recipient
137#D- * One argument : base64 encoded message
138#D- * Attach encoded config.card when starting the simulation
139
140function IGCM_debug_send_AMQP_msg__MAILTUNNEL {
141
142  typeset b64_encoded_msg mail_recipient
143  typeset buffer send_messages mail_frequency
144  typeset last_mail_date__file
145  typeset secondsBetweenRefAndLastMail secondsSinceLastMail
146
147  b64_encoded_msg=$1
148
149  mail_recipient="superviseur@ipsl.jussieu.fr"
150  send_messages=0
151  mail_frequency=3600 # in seconds
152  # use to keep track when was last mail sent (maybe to be replaced with global variable)
153  last_mail_date__file=${R_BUF}/.stamp.${config_UserChoices_TagName}.${config_UserChoices_JobName}
154  # use to accumulate messages before sending them
155  buffer=${R_BUF}/.buffer.${config_UserChoices_TagName}.${config_UserChoices_JobName}
156
157  # init
158  if [ ! -f "${buffer}" ]; then
159    touch ${buffer}
160  fi
161
162  if [ ! -f "${last_mail_date__file}" ]; then
163    touch ${last_mail_date__file}
164  else
165    # compute last time the file was changed (in seconds)
166    secondsBetweenRefAndLastMail=$(stat -c %Y ${last_mail_date__file})
167    status=$?
168    #
169    # Only execute this block when the stat command succeeded.
170    # The stat command might fail in some circumstance but we consider it is ok to continue anyway.
171    if [ ${status} -eq 0 ] ; then
172      secondsSinceLastMail=$(( $(date +%s) - ${secondsBetweenRefAndLastMail} ))
173      # send message when exceeding threshold
174      [ ${secondsSinceLastMail} -gt ${mail_frequency} ] && send_messages=1
175    fi
176  fi
177
178  # queue messages in the buffer
179  echo ${b64_encoded_msg} >> ${buffer}
180
181  # send mail
182
183  if [ X${initBigBro} = Xtrue ] ; then
184    #echo $(date +"%Y-%m-%dT%H:%M:%S.%N%z") > ${SUBMIT_DIR}/mail.txt
185    mailx -s "[TEMPORARY AMQP CHANNEL]" -a ${SUBMIT_DIR}/config.card.base64 ${mail_recipient} < ${buffer} # send buffer
186    rm -f $buffer ; touch ${buffer}                                    # clear buffer
187    touch ${last_mail_date__file}                                      # memorize last mail date
188    rm -f ${SUBMIT_DIR}/config.card.base64                             # remove temporary file
189    initBigBro=false
190  elif [ ${send_messages} -eq 1 ] ; then
191    #echo $(date +"%Y-%m-%dT%H:%M:%S.%N%z") >> ${SUBMIT_DIR}/mail.txt
192    mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient}  < ${buffer} # send buffer
193    rm -f ${buffer} ; touch ${buffer}                                  # flush the buffer
194    touch ${last_mail_date__file}                                      # memorize last mail date
195  fi
196
197  if ( ${FlushAMQP} ) ; then
198    mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient}  < ${buffer} # send buffer
199    rm -f ${buffer}                                                    # cleaning behind us
200    rm -f ${last_mail_date__file}                                      # cleaning behind us
201  fi
202
203  # Allways all good for now.
204  return 0
205}
206
207#D-#==================================================================
208#D-function IGCM_debug_sendAMQP_Metrics
209#D- * Purpose: Take over AMQP C client using mail as a message recipient
210#D- * Two arguments : - Directory where metrics.json files can be found
211#D- *                 - Metrics Group Name. metrics will be added to this group
212#D- * Attach encoded metrics.json files.
213
214function IGCM_debug_sendAMQP_Metrics {
215
216  typeset mail_recipient encodedBody
217  if [ X${ActivateBigBro} = Xtrue ] ; then
218    mail_recipient="superviseur@ipsl.jussieu.fr"
219    # Metrics tag on server side
220    code=7100
221    # Usual AMQP message to route messages on server side
222    encodedBody=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"metricsGroupName\":\"${2}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" |  base64 -w 0 )
223    # send mail
224    attachmentsOptions=""
225    for metricsFile in $( ls $1/*json ) ; do
226      attachmentsOptions="-a ${metricsFile} ${attachmentsOptions}"
227    done
228    IGCM_debug_Print 2 "IGCM_debug_sendAMQP_Metrics "
229    echo ${encodedBody}|mailx -s "[TEMPORARY AMQP CHANNEL]" ${attachmentsOptions} ${mail_recipient}
230  fi
231
232  # Allways all good for now.
233  return 0
234}
235
236#D-#==================================================================
237#D-function IGCM_debug_sendAMQP_projectAccounting
238#D- * Purpose: Take over AMQP C client using mail as a message recipient
239#D- * One argument : - File name where project accounting details are stored
240#D- * Attach encoded accounting file.
241
242function IGCM_debug_sendAMQP_projectAccounting {
243
244  typeset mail_recipient encodedBody
245  if [ X${ActivateBigBro} = Xtrue ] ; then
246    mail_recipient="superviseur@ipsl.jussieu.fr"
247    # Metrics tag on server side
248    code=7010
249    # Usual AMQP message to route messages on server side
250    encodedBody=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"accountingProject\":\"${PROJECT}\",\"centre\":\"${CENTER}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" |  base64 -w 0 )
251    # send mail
252    attachmentsOptions="-a ${1}"
253    IGCM_debug_Print 2 "IGCM_debug_sendAMQP_projectAccounting"
254    echo ${encodedBody}|mailx -s "[TEMPORARY AMQP CHANNEL]" ${attachmentsOptions} ${mail_recipient}
255    # clean behind
256    rm -f $1
257  fi
258
259  # Allways all good for now.
260  return 0
261}
262
263#D-#==================================================================
264#D-function IGCM_debug_SendAMQP
265#D- * Purpose: Send body; encoded body and config.card to rabbitMQ
266function IGCM_debug_sendAMQP {
267
268  typeset decal first additionnalOption encodedBody
269
270  # Encode message Body
271  encodedBody=$( echo "${Body}" | base64 -w 0 )
272
273  # Send config.card ?
274  if [ X${1} = Xactivate ] ; then
275    # Encode config.card
276    cat ${SUBMIT_DIR}/config.card | base64 -w 0 > ${SUBMIT_DIR}/config.card.base64
277    # Prepare additionnal option
278    additionnalOption="-f ${SUBMIT_DIR}/config.card.base64"
279    #
280    initBigBro=true
281  else
282    additionnalOption=
283    #
284    initBigBro=false
285  fi
286
287  # Only cosmetics : stack file
288  if [ X${ActivateStackFilling} = Xtrue ] ; then
289    decal=0
290    while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do
291      printf ' ' >> ${StackFileLocation}/${StackFileName}
292      (( decal = decal + 1 ))
293    done
294    # Log to stack file using human readable format
295    echo "${Body}" >> ${StackFileLocation}/${StackFileName}
296  fi
297
298  # Log separately encoded AMQP message command for reuse in a mock up
299  #echo sendAMQPMsg -h localhost -p 5672 ${additionnalOption} -b ${encodedBody} >> ${RUN_DIR_PATH}/send.AMQP.${config_UserChoices_JobName}.${config_UserChoices_ExperimentName}.${config_UserChoices_SpaceName}.${config_UserChoices_TagName}.${CumulPeriod}.history.txt
300
301  # Send the message
302  if [ X${BigBrotherChannel} = XMAIL ] ; then
303    IGCM_debug_send_AMQP_msg__MAILTUNNEL "${encodedBody}"
304    status=$?
305  else
306    sendAMQPMsg -h localhost -p 5672 ${additionnalOption} -b ${encodedBody}
307    status=$?
308  fi
309
310  if [ ${status} -gt 0 ] ; then
311    IGCM_debug_Print 2 "IGCM_debug_Push/PopStack/ActivateBigBro : command sendAMQPMsg failed error code ${status}"
312    echo sendAMQPMsg -h localhost -p 5672 -b "${Body}"
313    exit 1
314  fi
315}
316
317#D-#==================================================================
318#D-function IGCM_debug_CallStack
319#D-* Purpose: Print the call stack tree from the oldest to the youngest (opposite of the display standard)
320#D-
321function IGCM_debug_CallStack {
322  if ( $DEBUG_debug ) ; then
323    # Cosmetics
324    typeset i decal
325    i=0
326    until [ $i -eq ${IGCM_debug_LenStack} ]; do
327      decal=0
328      until [ $decal -eq ${i} ]; do
329        printf -- ' '
330        (( decal = decal + 1 ))
331      done
332      echo "$i - ${IGCM_debug_Stack[$(( $IGCM_debug_LenStack-$i-1 ))]}" "(${IGCM_debug_StackArgs[$(( $IGCM_debug_LenStack-$i-1 ))]})"
333      ((i = i + 1))
334    done
335  fi
336}
337
338#D-#==================================================================
339#D-function IGCM_debug_PushStack
340#D-* Purpose: Push a function name in the stack
341#D-
342function IGCM_debug_PushStack {
343  if ( $DEBUG_debug ) ; then
344    typeset decal inputs startTime_ms
345
346    # Only cosmetics : stack file
347    if [ X${ActivateStackFilling} = Xtrue ] ; then
348      echo >> ${StackFileLocation}/${StackFileName}
349      decal=0
350      while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do
351        printf ' ' >> ${StackFileLocation}/${StackFileName}
352        (( decal = decal + 1 ))
353      done
354
355      # Fill the stack file
356      echo "> ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName}
357    fi
358
359    # Save input list in an indexed array
360    INPUTS=( $@ )
361
362    # Get timing information
363    startTime_ms=$( IGCM_debug_getDate_ms )
364
365    # We add function call name on beginning of the stack
366    set +A IGCM_debug_Stack -- ${1} ${IGCM_debug_Stack[*]}
367
368    # Save timing in milliseconds in an indexed array
369    set +A IGCM_debug_StackTiming -- ${startTime_ms} ${IGCM_debug_StackTiming[*]}
370
371    # We include the "null" Args in the beginning of the StackArgs
372    set +A IGCM_debug_StackArgs ${NULL_STR} ${IGCM_debug_StackArgs[*]}
373
374    # Then, we shift StackArgs tabular
375    # Replacing blank separated list by comma separated list of quoted elements (except the first and last element)
376    if [ $# -gt 1 ]; then
377      IGCM_debug_StackArgs[0]=$(echo ${INPUTS[*]:1} | sed -e "s/\ /\",\"/g" )
378    fi
379
380    # Increment LenStack
381    (( IGCM_debug_LenStack = IGCM_debug_LenStack + 1 ))
382
383    #IGCM_debug_CallStack
384  fi
385}
386
387#D-#==================================================================
388#D-function IGCM_debug_PopStack
389#D-* Purpose: Pop a function name in the stack
390#D-
391function IGCM_debug_PopStack {
392  if ( $DEBUG_debug ) ; then
393    typeset i decal command arguments startTime_ms endTime_ms
394    typeset instrumentation dest prefix
395    # they are not typeset because they are send "by adress" to son functions
396    # we unset them to avoid "memory effect"
397    unset fileList source
398
399    # INTRODUCE SIMPLE ERROR GENERATOR TO TEST SUPERVISOR
400    # PROBABILITY ERROR IS 0.0001 PER COMMAND OR FUNCTION CALL
401    # THERE ARE ~500 COMMAND OR FUNCTION CALL PER PERIOD
402    # ONLY WHEN TaskType is "computing".
403    if [ X${ActivateBigBro} = Xtrue ] ; then
404      if [ X${TaskType} = Xcomputing ]; then
405        if ( ${RandomError} ) ; then
406          if [ $((RANDOM%10000)) -le 10 ] ; then
407            IGCM_debug_Print 1 "Random error has been triggered"
408            if [ X${ActivateStackFilling} = Xtrue ] ; then
409              echo "RANDOM ERROR" >> ${StackFileLocation}/${StackFileName}
410            fi
411            ExitFlag=true
412          fi
413        fi
414      fi
415    fi
416
417    if [ "${IGCM_debug_Stack[0]}" = "${1}" ]; then
418      # Everything is cool
419
420      # Get timing information
421      endTime_ms=$( IGCM_debug_getDate_ms )
422
423      # Save Stack information before poping the stack
424      command=${IGCM_debug_Stack[0]}
425
426      # Go from comma separated list of quoted elements (except the first and the last element)
427      # to unquoted space separated elements in an array
428      set -A arguments -- $( echo ${IGCM_debug_StackArgs[0]} | sed -e "s/\",\"/\ /g" )
429
430      # Save Stack information before poping the stack
431      startTime_ms=${IGCM_debug_StackTiming[0]}
432
433      # Pop the stack
434      (( IGCM_debug_LenStack = IGCM_debug_LenStack - 1 ))
435      set -A IGCM_debug_Stack -- ${IGCM_debug_Stack[*]:1}
436      set -A IGCM_debug_StackArgs -- ${IGCM_debug_StackArgs[*]:1}
437      set -A IGCM_debug_StackTiming -- ${IGCM_debug_StackTiming[*]:1}
438    else
439      echo 'IGCM_debug_Exit : stack is corrupted ! LenStack =' ${IGCM_debug_LenStack}
440      IGCM_debug_Exit $@
441    fi
442
443    # Special actions depending on command to prepare IGCM_debug_PrintInfosActions call
444    # We are interested in:
445    #  0. Which command performs the work
446    #  1. Size of entity we are working with
447    #  2. Where are we reading
448    #  3. Where are we writing
449    #  4. How long it took
450
451    instrumentation=false
452
453    case ${command} in
454    # Classical copy (only files are given to IGCM_sys_Cp as options)
455    IGCM_sys_Cp)
456      instrumentation=true
457      # All but the latest
458      fileList=${arguments[*]:0:${#arguments[*]}-1}
459      # just need the first file to get the directory
460      source=${arguments[0]}
461      # Nothing but the latest
462      dest=${arguments[${#arguments[*]}-1]}
463      # Size of file whose name are stored in a list
464      entitySize=$( IGCM_debug_sizeOfTabContent fileList ${dest} )
465      ;;
466
467    # Copy from archive machine or from buffer
468    IGCM_sys_Get|IGCM_sys_GetBuffer)
469      instrumentation=true
470      if [ ${#arguments[*]} -eq 2 ] ; then
471        source=${arguments[0]}
472        dest=${arguments[1]}
473        # Size of file whose name are stored in a variable
474        entitySize=$( IGCM_debug_sizeOfTabContent source ${dest} )
475      elif ( [ ${#arguments[*]} -eq 3 ] && [ ${arguments[0]} = '/l' ] ) ; then
476        # IGCM_sys_Get /l liste_file[*] /ccc/scratch/cont003/dsm/p86denv/RUN_DIR/985998_14754/
477        # Keep the array name hosting the all list
478        eval set +A fileList \${${arguments[1]}}
479        # just need the first file to get the directory
480        source=${fileList[0]}
481        dest=${arguments[2]}
482        # Size of file whose name are stored in a list
483        entitySize=$( IGCM_debug_sizeOfTabContent fileList[*] ${dest} )
484      elif [ [ ${#arguments[*]} -ge 3 ] ; then
485       # All but the latest
486        fileList=${arguments[*]:0:${#arguments[*]}-1}
487        # just need the first file to get the directory
488        source=${arguments[0]}
489        # Nothing but the latest
490        dest=${arguments[${#arguments[*]}-1]}
491        # Size of file whose name are stored in a list
492        entitySize=$( IGCM_debug_sizeOfTabContent fileList ${dest} )
493      fi
494      ;;
495
496    # Copy from compute node or copy to archive/buffer
497    IGCM_sys_Get_Master|IGCM_sys_Get_Dir|IGCM_sys_Put_Out|IGCM_sys_PutBuffer_Out)
498      instrumentation=true
499      source=${arguments[0]}
500      dest=${arguments[1]}
501      # Size of file whose name are stored in a variable
502      entitySize=$( IGCM_debug_sizeOfTabContent source ${dest} )
503      ;;
504
505    # Rebuild command
506    IGCM_sys_rebuild|IGCM_sys_rebuild_station)
507      instrumentation=true
508      # All but the first
509      fileList=${arguments[*]:1:${#arguments[*]}-1}
510      # just need a file to get the directory
511      source=${arguments[1]}
512      # Nothing but the first
513      dest=${arguments[0]}
514      # Size of file whose name are stored in a list
515      entitySize=$( IGCM_debug_sizeOfTabContent fileList ${dest} )
516      ;;
517
518    # NCO commands
519    IGCM_sys_ncrcat|IGCM_sys_ncecat|IGCM_sys_ncra|IGCM_sys_ncks|IGCM_sys_cdo)
520      # Example of what we want to catch : only filenames in those command lines
521      # IGCM_sys_ncrcat -O -v ${list_var_final_ncrcat} ${OUT_SE[*]} ${RESULT_SE}
522      # IGCM_sys_ncrcat --hst -v ${liste_coord}${var} ${file1} ${liste_file_tmp[*]} ${file_out}
523      # IGCM_sys_ncrcat -p ${dir} ${liste_file_tmp} --output ${output}
524      # IGCM_sys_ncrcat -x -v ${list_var} -p ${dir} ${liste_file_tmp} --output ${output}
525      instrumentation=true
526      keepGoing=true
527      prefix=.
528      i=0
529      while ( ${keepGoing} ) ; do
530        # the last one is not interesting
531        if [ ${i} -eq ${#arguments[*]}-1 ] ; then
532          keepGoing=false
533        # look after "-p" option. Path prefix is the following arguments
534        elif [ ${arguments[${i}]} = "-p" ] ; then
535          ((i = i + 1))
536          prefix=${arguments[${i}]}
537          ((i = i + 1))
538        elif [ ${i} -eq ${#arguments[*]}-1 ] ; then
539          keepGoing=false
540        # looking for files
541        elif [ -f ${prefix}/${arguments[${i}]} ] ; then
542          fileList="${fileList} ${prefix}/${arguments[${i}]}"
543          ((i = i + 1))
544        # other options are not interesting
545        else
546          ((i = i + 1))
547        fi
548      done
549
550      # i value is at least 1
551      # just need one file to get the directory
552      source=$( echo ${fileList} | gawk '{print $1}' )
553      # Nothing but the latest
554      dest=${arguments[${#arguments[*]}-1]}
555      # Size of file whose name are stored in a list
556      entitySize=$( IGCM_debug_sizeOfTabContent fileList ${dest} )
557      ;;
558    esac
559
560    # Print information related to instrumentation
561    ( ${instrumentation} ) && IGCM_debug_PrintInfosActions ${command} ${entitySize} ${startTime_ms} ${endTime_ms} ${dest} ${source}
562
563    # Only cosmetics : stack file
564    if [ X${ActivateStackFilling} = Xtrue ] ; then
565      decal=0
566      while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do
567        printf ' ' >> ${StackFileLocation}/${StackFileName}
568        (( decal = decal + 1 ))
569      done
570    fi
571
572    if ( ${ExitFlag} ) ; then
573      # Inform the stack file
574      if [ X${ActivateStackFilling} = Xtrue ] ; then
575        echo '!!! ExitFlag has been activated !!!' >> ${StackFileLocation}/${StackFileName}
576      fi
577
578      # Unplugged message 4900 handling for now. To ease downstream treatment.
579      if [ X${ActivateBigBro} = Xtrue ] ; then
580        if [ X${TaskType} = Xcomputing ]; then
581          # RabbitMQ message code "COMPUTING JOBs COMMAND FAILURE"
582          code=1900
583        elif [ X${TaskType} = Xpost-processing ]; then
584          # RabbitMQ message code "POST-PROCESSING JOBs COMMAND FAILURE"
585          code=2900
586        elif [ X${TaskType} = Xchecking ]; then
587          # RabbitMQ message code "POST-PROCESSING FROM CHECKER JOBs COMMAND FAILURE"
588          code=3900
589        fi
590        # RabbitMQ message body
591        Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )
592
593        # Fill the rabbitMQ queue
594        IGCM_debug_sendAMQP
595      fi
596    else
597      # Inform the stack file
598      if [ X${ActivateStackFilling} = Xtrue ] ; then
599        echo "< ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName}
600      fi
601    fi
602
603    # Reset array if necessary
604    if [ ${IGCM_debug_LenStack} = 0 ]; then
605      #echo
606      #IGCM_debug_Print 3 "Clean stack array"
607      #echo
608      unset IGCM_debug_Stack
609      unset IGCM_debug_StackArgs
610      unset IGCM_debug_StackTiming
611      IGCM_debug_Stack[0]=${NULL_STR}
612      IGCM_debug_StackArgs[0]=${NULL_STR}
613      IGCM_debug_StackTiming[0]=${NULL_STR}
614    fi
615  fi
616  #IGCM_debug_CallStack
617}
618
619#D-#==================================================================
620#D-function IGCM_debug_BigBro_Initialize
621#D-* Purpose: switch rabbitMQ on
622#D-
623function IGCM_debug_BigBro_Initialize {
624  IGCM_debug_PushStack "IGCM_debug_BigBro_Initialize"
625
626  typeset postProcessingIDLength postProcessingName postProcessingDate postProcessingDimn postProcessingComp postProcessingFile accountingFile
627
628# Message type standard fields:
629# https://github.com/Prodiguer/prodiguer-docs/wiki/MQ-Standard-Message-Fields
630
631# Message type dictionnary and custom fields:
632# https://github.com/Prodiguer/prodiguer-docs/wiki/Monitoring-Message-Dictionary
633
634  if [ X${BigBrother} = Xtrue ] ; then
635    # create a unique ID for this specific job
636    jobuid=$(uuidgen)
637
638    # get the assigned id by the scheduler for that job
639    IGCM_sys_getJobSchedulerID jobSchedulerID
640
641    if [ X${TaskType} = Xcomputing ]; then
642      if ( ${FirstInitialize} ) ; then
643        # RabbitMQ message code "BEGIN A SIMULATION"
644        code=0000
645        # create and persist a unique id for this simulation
646        simuid=$(uuidgen)
647        IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration simuid ${simuid}
648        # Standard fields for the first message
649        genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"activity\":\"IPSL\",\"name\":\"${config_UserChoices_JobName}\",\"experiment\":\"${config_UserChoices_ExperimentName}\",\"space\":\"${config_UserChoices_SpaceName}\",\"model\":\"${config_UserChoices_TagName}\",\"startDate\":\"${config_UserChoices_DateBegin}\",\"endDate\":\"${config_UserChoices_DateEnd}\",\"login\":\"${LOGIN}\",\"centre\":\"${CENTER}\",\"machine\":\"${MASTER}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )
650        # RabbitMQ message body with specific fields associated message codes treated here
651        Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\"jobSchedulerID\":\"${jobSchedulerID}\",\"jobSubmissionPath\":\"${SUBMIT_DIR}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )
652        # Fill the rabbitMQ queue (the config.card in use will be sent)
653        IGCM_debug_sendAMQP activate
654      else
655        # RabbitMQ message code "A NEW COMPUTING JOB IS RUNNING PART OF A SIMULATION"
656        code=1000
657        # retrieve this simulation's unique id
658        IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration simuid
659        simuid=${run_Configuration_simuid}
660        # Using standard fields for message others than the first one. Still subject to change
661        genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )
662        # RabbitMQ message body with specific fields associated message codes treated here
663        Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\"jobSchedulerID\":\"${jobSchedulerID}\",\"jobSubmissionPath\":\"${SUBMIT_DIR}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )
664        # Fill the rabbitMQ queue
665        IGCM_debug_sendAMQP
666      fi
667
668      # NOT VERY NICE BUT ... IT WORKS
669      # Be sure that the genericSimulationID will be small from now on
670      # Using standard fields for messages others than the first one. Still subject to change
671      genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )
672
673    elif [ X${TaskType} = Xpost-processing ]; then
674      # RabbitMQ message code "A NEW POST-PROCESSING JOB IS RUNNING PART OF A SIMULATION"
675      code=2000
676      # retrieve this simulation's unique id
677      IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration simuid
678      simuid=${run_Configuration_simuid}
679      # Using standard fields for message others than the first one. Still subject to change
680      genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )
681     
682      # Specify the post-processing task we are dealing with
683      postProcessingIDLength=$( echo "${Script_Post_Output}" | tr -d -c "\." | wc -c )
684      postProcessingName=$( echo "${Script_Post_Output}" | gawk -F. '{print $1}' )
685      postProcessingDate=$( echo "${Script_Post_Output}" | gawk -F. '{print $2}' )
686      postProcessingDimn="null"
687      postProcessingComp="null"
688      postProcessingFile="null"
689      if [ ${postProcessingIDLength} -eq 2 ] ; then
690        postProcessingDimn=$( echo "${Script_Post_Output}" | gawk -F. '{print $3}' )
691      elif [ ${postProcessingIDLength} -eq 4 ] ; then
692        postProcessingComp=$( echo "${Script_Post_Output}" | gawk -F. '{print $4}' )
693        postProcessingFile=$( echo "${Script_Post_Output}" | gawk -F. '{print $5}' )
694      fi
695
696      # RabbitMQ message body with specific fields associated message codes treated here
697      Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\"jobSchedulerID\":\"${jobSchedulerID}\",\"jobSubmissionPath\":\"${SUBMIT_DIR}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\",\"postProcessingName\":\"${postProcessingName}\",\"postProcessingDate\":\"${postProcessingDate}\",\"postProcessingDimn\":\"${postProcessingDimn}\",\"postProcessingComp\":\"${postProcessingComp}\",\"postProcessingFile\":\"${postProcessingFile}\"}" )
698      # Fill the rabbitMQ queue
699      IGCM_debug_sendAMQP
700    fi
701
702    # Turn the flag on
703    ActivateBigBro=true
704
705    # Save project accounting details in a file
706    accountingFile=cpt_${CENTER}_${PROJECT}_$( date +"%Y%m%d_%H%M" ).dat
707    IGCM_sys_projectAccounting ${accountingFile}
708
709    # And send it
710    IGCM_debug_sendAMQP_projectAccounting ${accountingFile}
711
712  fi
713  IGCM_debug_PopStack "IGCM_debug_BigBro_Initialize"
714}
715
716#D-#==================================================================
717#D-function IGCM_debug_BigBro_Update
718#D-* Purpose: Update rabbitMQ messages exchanges during the run
719#D-
720function IGCM_debug_BigBro_Update {
721  IGCM_debug_PushStack "IGCM_debug_BigBro_Update"
722
723  # Message type standard fields:
724  # https://github.com/Prodiguer/prodiguer-docs/wiki/MQ-Standard-Message-Fields
725
726  # Message type dictionnary and custom fields:
727  # https://github.com/Prodiguer/prodiguer-docs/wiki/Monitoring-Message-Dictionary
728
729  if [ X${ActivateBigBro} = Xtrue ] ; then
730      if [ X${TaskType} = Xcomputing ]; then
731        # Send ${PeriodDateBegin}, ${PeriodDateEnd} and ${CumulPeriod}
732        # RabbitMQ message body
733        Body=$( echo "{${genericSimulationID},\"msgCode\":\"1001\",\"PeriodDateBegin\":\"${PeriodDateBegin}\",\"PeriodDateEnd\":\"${PeriodDateEnd}\",\"CumulPeriod\":\"${CumulPeriod}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )
734        # Fill the rabbitMQ queue
735        IGCM_debug_sendAMQP
736      fi
737  fi
738  IGCM_debug_PopStack "IGCM_debug_BigBro_Update"
739}
740
741#D-#==================================================================
742#D-function IGCM_debug_BigBro_Finalize
743#D-* Purpose: Finalize rabbitMQ messages exchanges
744#D-
745function IGCM_debug_BigBro_Finalize {
746  IGCM_debug_PushStack "IGCM_debug_BigBro_Finalize"
747
748  # Message type standard fields:
749  # https://github.com/Prodiguer/prodiguer-docs/wiki/MQ-Standard-Message-Fields
750
751  # Message type dictionnary and custom fields:
752  # https://github.com/Prodiguer/prodiguer-docs/wiki/Monitoring-Message-Dictionary
753
754  if ( $DEBUG_debug ) ; then
755    if [ X${ActivateBigBro} = Xtrue ] ; then
756      if [ X${TaskType} = Xcomputing ]; then
757        if ( ${simulationIsOver} ) ; then
758          # RabbitMQ message code "SIMULATION ENDS"
759          code=0100
760          FlushAMQP=true
761        elif ( ${ExitFlag} ) ; then
762          # RabbitMQ message code "EXIT THE JOBS BECAUSE ERROR(S) HAS BEEN TRIGGERED"
763          code=1999
764          FlushAMQP=true
765        else
766          # RabbitMQ message code "COMPUTING JOB ENDS"
767          code=1100
768        fi
769      elif [ X${TaskType} = Xpost-processing ]; then
770        if ( ${ExitFlag} ) ; then
771          # RabbitMQ message code "POST-PROCESSING JOB FAILS"
772          code=2999
773          FlushAMQP=true
774        else
775          # RabbitMQ message code "POST-PROCESSING JOB ENDS"
776          code=2100
777          FlushAMQP=true
778        fi
779      elif [ X${TaskType} = Xchecking ]; then
780        if ( ${ExitFlag} ) ; then
781          # RabbitMQ message code "POST-PROCESSING JOB FAILS"
782          code=3999
783          FlushAMQP=true
784        else
785          # RabbitMQ message code "POST-PROCESSING JOB ENDS"
786          code=3100
787          FlushAMQP=true
788        fi
789      fi
790      # RabbitMQ message body
791      Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )
792      # Fill the rabbitMQ queue
793      IGCM_debug_sendAMQP
794    fi
795  fi
796 
797  IGCM_debug_PopStack "IGCM_debug_BigBro_Finalize"
798}
799
800#D-#==================================================================
801#D-function IGCM_debug_Exit
802#D-* Purpose: Print Call Stack and set ExitFlag to true
803#D-
804function IGCM_debug_Exit {
805  IGCM_debug_PushStack "IGCM_debug_Exit"
806  echo "IGCM_debug_Exit : " "${@}"
807  echo
808  echo "!!!!!!!!!!!!!!!!!!!!!!!!!!"
809  echo "!!   ERROR TRIGGERED    !!"
810  echo "!!   EXIT FLAG SET      !!"
811  echo "!------------------------!"
812  echo
813  IGCM_debug_CallStack
814  ExitFlag=true
815  IGCM_debug_PopStack "IGCM_debug_Exit"
816}
817
818#D-#==================================================
819#D-function IGCM_debug_Verif_Exit
820#D-* Purpose: exit with number 1 if ExitFlag is true
821#D-
822function IGCM_debug_Verif_Exit {
823  if ( ${ExitFlag} ) ; then
824    echo "IGCM_debug_Verif_Exit : Something wrong happened previously."
825    echo "IGCM_debug_Verif_Exit : ERROR and EXIT keyword will help find out where."
826    # Only computing TaskType stops the job for now.
827    if [ X${TaskType} = Xcomputing ] ; then
828      IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Fatal"
829      echo "                        EXIT THE JOB."
830      echo
831      IGCM_debug_CallStack
832
833      # Mail notification
834      IGCM_sys_SendMail
835
836      # Inform the rabbitMQ queue
837      IGCM_debug_BigBro_Finalize
838
839      # And Good Bye
840      date
841      exit 1
842
843    elif [ X${TaskType} = Xpost-processing ] ; then
844      StopAll=false
845      # Test if we need to stop the computing job
846      case ${postProcessingName} in
847      atlas*|monitoring*|metrics*)
848        [ ${postProcessingStopLevel} -gt 2 ] && StopAll=true ;;
849      create_*)
850        [ ${postProcessingStopLevel} -gt 1 ] && StopAll=true ;;
851      rebuild*|pack_*)
852        [ ${postProcessingStopLevel} -gt 0 ] && StopAll=true ;;
853      esac
854      # Notify the computing job that something wrong happened and stop it.
855      ( ${StopAll} ) && IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Fatal.${Script_Post_Output}"
856
857      # If SpaceName is PROD we stop when post_processing failed
858      if [ X${config_UserChoices_SpaceName} = XPROD ] ; then
859        echo "                        EXIT THE POST-PROCESSING JOB."
860        echo
861        IGCM_debug_CallStack
862
863        # Inform the rabbitMQ queue
864        IGCM_debug_BigBro_Finalize
865
866        # And Good Bye
867        date
868        exit 1
869      else
870        echo "In config.card the variable SpaceName is not in PROD"
871        echo "              SO WE DO NOT EXIT THE JOB."
872        echo
873        date
874      fi
875    elif [ X${TaskType} = Xchecking ] ; then
876      echo "Nothing will happen for now"
877    fi
878  fi
879}
880
881#D-#==================================================================
882#D-function IGCM_debug_Print
883#D-* Purpose: Print arguments according to a level of verbosity.
884#D-
885function IGCM_debug_Print
886{
887  typeset level=$1
888  shift
889
890  if [ X"${1}" = X"-e" ]; then
891    typeset cmd_echo="echo -e"
892    shift
893  else
894    typeset cmd_echo="echo"
895  fi
896
897  if [ ${level} -le ${Verbosity} ] ; then
898    typeset i
899    case "${level}" in
900    1) for i in "$@" ; do
901      ${cmd_echo} $(date +"%Y-%m-%d %T") "--Debug1-->" ${i}
902      done ;;
903    2) for i in "$@" ; do
904      ${cmd_echo} $(date +"%Y-%m-%d %T") "--------Debug2-->" ${i}
905      done ;;
906    3) for i in "$@" ; do
907      ${cmd_echo} $(date +"%Y-%m-%d %T") "--------------Debug3-->" ${i}
908      done ;;
909    esac
910  fi
911}
912
913#D-#==================================================================
914#D-function IGCM_debug_PrintVariables
915#D-* Purpose: Print arguments when match a pattern
916#D-           according to a level of verbosity.
917function IGCM_debug_PrintVariables
918{
919  typeset level=$1
920  shift
921
922  list=$( set | grep ^$1 | sed -e "s/'//g" )
923
924  if [ "X${list}" != X ]  ; then
925    IGCM_debug_Print ${level} ${list}
926  fi
927}
928
929#D-#==================================================================
930#D-function IGCM_debug_PrintInfosActions
931#D-* Purpose: Print information related to instrumentation
932function IGCM_debug_PrintInfosActions
933{
934  typeset actionType=$1
935  typeset entitySize=$2
936  typeset start_ms=$3
937  typeset end_ms=$4
938
939  typeset dest=$5
940  typeset source=$6
941
942  typeset diff_ms entitySizeKo entitySizeMo flux_Ko_ms flux_Ko_s flux_Mo_s
943  typeset dirFrom dirTo
944
945  diff_ms=$(( $end_ms - $start_ms ))
946  # echo "diff_ms=$diff_ms"
947
948  entitySizeKo=$( echo ${entitySize} | gawk -F"|" '{print $1}' )
949  # echo "entitySizeKo=$entitySizeKo"
950  entitySizeMo=$( echo ${entitySize} | gawk -F"|" '{print $2}' )
951
952  # flux en Ko / ms
953  flux_Ko_ms=$( echo "scale=6;${entitySizeKo}/${diff_ms}" | bc )
954  # echo "flux_Ko_ms=$flux_Ko_ms"
955
956  # flux en Ko / s
957  flux_Ko_s=$(( $flux_Ko_ms * 1000 ))
958  # echo "flux_Ko_s=$flux_Ko_s"
959
960  # flux en Mo / s
961  flux_Mo_s=$( echo "scale=6;${flux_Ko_s}/1024" | bc )
962  # echo "flux_Mo_s=$flux_Mo_s"
963
964  if [ -d $dest ] ; then
965    dirTo=$( readlink -f ${dest} )
966  else
967    dirTo=$( readlink -f $( dirname ${dest} ) )
968  fi
969
970  if [ -d $source ] ; then
971    dirFrom=$( readlink -f ${source} )
972  else
973    dirFrom=$( readlink -f $( dirname ${source} ) )
974  fi
975
976  instrumentationContent=$( echo "\"actionName\":\"${actionType}\",\"size_Mo\":\"${entitySizeMo}\",\"duration_ms\":\"${diff_ms}\",\"throughput_Mo_s\":\"${flux_Mo_s}\",\"dirFrom\":\"${dirFrom}\",\"dirTo\":\"${dirTo}\"" )
977
978  if [ X${ActivateStackFilling} = Xtrue ] ; then
979    echo "{${instrumentationContent}}" >> ${StackFileLocation}/${StackFileName}
980  fi
981
982  # Inform the rabbitMQ queue
983  if [ X${ActivateBigBro} = Xtrue ] ; then
984    # RabbitMQ message body
985    Body=$( echo "{${genericSimulationID},\"msgCode\":\"7000\",\"msgUID\":\"$(uuidgen)\",${instrumentationContent},\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )
986    # Fill the rabbitMQ queue
987    IGCM_debug_sendAMQP
988  fi
989}
990
991#D-#==================================================================
992#D-function IGCM_debug_Check
993#D- * Purpose: Check the present file by comparison with a reference file
994function IGCM_debug_Check
995{
996  #---------------------
997  if [ ! -n "${libIGCM}" ] ; then
998    echo "Check libIGCM_debug ..........................................[ FAILED ]"
999    echo "--Error--> libIGCM variable is not defined"
1000    exit 2
1001  fi
1002
1003  #---------------------
1004  if [ ! -n "${Verbosity}" ] ; then
1005    echo "Check libIGCM_debug ..........................................[ FAILED ]"
1006    echo "--Error--> Verbosity variable is not defined"
1007    exit 3
1008  fi
1009
1010  #---------------------
1011  # Need to remove timestamps here
1012  diff ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref <(${libIGCM}/libIGCM_debug/IGCM_debug_Test.ksh | sed -e "s:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]\:[0-9][0-9]\:[0-9][0-9] ::g") > /dev/null 2>&1
1013  status=$?
1014
1015  if [ ${status} -eq 0 ] ; then
1016    echo "Check libIGCM_debug ..............................................[ OK ]"
1017  else
1018    echo "Check libIGCM_debug ..........................................[ FAILED ]"
1019    echo "--Error--> Execution of ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ksh"
1020    echo "           has produced the file IGCM_debug_Test.ref.failed"
1021    echo "           Please analyse differences with the reference file by typing:"
1022    echo "           diff IGCM_debug_Test.ref.failed ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref"
1023    echo "           Report errors to the author: Patrick.Brockmann@cea.fr"
1024    diff ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref <(${libIGCM}/libIGCM_debug/IGCM_debug_Test.ksh | sed -e "s:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]\:[0-9][0-9]\:[0-9][0-9] ::g")
1025    exit 4
1026  fi
1027  #---------------------
1028}
Note: See TracBrowser for help on using the repository browser.