source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh @ 437

Last change on this file since 437 was 437, checked in by sdipsl, 13 years ago

Send mail notification when computing job stops
It could be that we send a notification if a post-processing job stops in PROD mode ---> need some refactoring and caution...

  • 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: 34.5 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil, Martial Mancip
5# Contact: 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#D-#==================================================
21#D-LibIGCM_sys for Mercure SX8-R
22#D-#==================================================
23#D-
24#D- This ksh library if a layer under some usefull
25#D-environment variables and shell commands.
26#D-All those definitions depend on host particularities.
27#D-It manages a stack mechanism and test validity of operations.
28#D-All function described bellow must be prefixed by IGCM_sys.
29
30#====================================================
31# libIGCM_sys PARAMETERS
32#====================================================
33
34# gawk specific location on SX9
35export PATH=/applications/gawk-3.0.4/bin:${PATH}
36
37#====================================================
38# set DEBUG_sys to true to output calls of function
39typeset -r DEBUG_sys=${DEBUG_sys:=true}
40
41#====================================================
42# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
43typeset -r DRYRUN=${DRYRUN:=0}
44
45# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
46# -------------------------------------------------------------------------------------
47# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
48# |          |  Cp/Exe param files |            |  Chmod  |                           |
49# |          |      Qsub           |            |         |                           |
50# -------------------------------------------------------------------------------------
51# |    0     |       yes           |    yes     |  yes    |      yes                  |
52# -------------------------------------------------------------------------------------
53# |    1     |       yes           |    yes     |  yes    |      no                   |
54# -------------------------------------------------------------------------------------
55# |    2     |       yes           |    yes     |  no     |      no                   |
56# -------------------------------------------------------------------------------------
57# |    3     |       yes           |    no      |  no     |      no                   |
58# -------------------------------------------------------------------------------------
59
60#=====================================================
61# Global Variables :
62#=====================================================
63# Language : "fr" or "en"
64typeset -r MYLANG="fr"
65
66#=====================================================
67# Host and user names
68# $hostname ou hostname
69typeset  HOST=${HOST:=$( hostname )}
70# $username ou whoami
71typeset  LOGIN=${LOGIN:=$( whoami )}
72# $hostname of the MASTER job
73typeset -r MASTER=mercure
74
75#D-
76#D-#==================================================
77#D-Program used in libIGCM
78#D-#==================================================
79
80# rsync with path
81typeset -r RSYNC=/home/cont003/p86denv/SX_RSYNC/bin/rsync
82# RSYNC_opt args to rsync
83typeset -r RSYNC_opt="-va"
84# ie storage filesystem
85typeset -r RHOST=mercure
86
87#====================================================
88# Host specific DIRECTORIES
89#====================================================
90
91#====================================================
92#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
93typeset -r R_EXE="${MODIPSL}/bin"
94
95#====================================================
96#- SUBMIT_DIR : submission dir
97typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
98
99#====================================================
100#- ARCHIVE
101typeset -r ARCHIVE=${DMFDIR}
102
103# ============ CESIUM START ============ #
104
105#====================================================
106#- Mirror libIGCM from mercure to cesium if needed
107#ROOTSYS=$( echo ${libIGCM} | gawk -F"/" '{print $2}' )
108#if [ ! ${ROOTSYS} = "home" ] ; then
109#    typeset -r MirrorlibIGCM=${MirrorlibIGCM:=true}
110#else
111#    typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
112#fi
113
114#====================================================
115#- libIGCM_POST
116#if ( ${MirrorlibIGCM} ) ; then
117#    PATHlibIGCM=$( echo ${libIGCM} | gawk -F"${LOGIN}/" '{print $2}' | sed -e "s&/libIGCM&&" )
118#    typeset -r libIGCM_POST=${HOME}/MIRROR/${PATHlibIGCM}/libIGCM
119#else
120#    typeset -r libIGCM_POST=${libIGCM}
121#fi
122
123# ============ CESIUM  END  ============ #
124
125#====================================================
126#- Mirror libIGCM from mercure to cesium if needed
127typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
128
129#====================================================
130#- libIGCM_POST
131typeset -r libIGCM_POST=${libIGCM}
132
133#====================================================
134#- IN
135typeset -r R_IN=${R_IN:=/dmnfs/cont003/p86ipsl/IGCM}
136typeset -r R_IN_ECMWF=${R_IN:=/dmnfs/cont003/p24data}
137
138#====================================================
139#- OUT
140typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
141
142#====================================================
143#- OUT_POST
144typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT
145
146#====================================================
147#- RUN_DIR_PATH : Temporary working directory (=> TMP)
148typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${LOCALTMPDIR}}
149
150#====================================================
151#- BIG_DIR : BIG_DIR to store files waiting for rebuild
152typeset -r BIG_DIR=${BIG_DIR:=${SCRATCHDIR}/REBUILD}
153
154#====================================================
155#- HOST_MPIRUN_COMMAND
156typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="mpirun"}
157
158#====================================================
159#- Max number of arguments passed to nco operator or demigration command
160UNIX_MAX_LIMIT=360
161
162#D-#==================================================
163#D-function IGCM_sys_RshArchive
164#D-* Purpose: Archive rsh command
165#D-* Examples:
166#D-
167function IGCM_sys_RshArchive {
168    IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
169    /bin/ksh <<-EOF
170${@}
171EOF
172    if [ $? -gt 0 ] ; then
173        echo "IGCM_sys_RshArchive : erreur."
174        IGCM_debug_Exit "IGCM_sys_RshArchive"
175    fi
176    IGCM_debug_PopStack "IGCM_sys_RshArchive"
177}
178
179#D-#==================================================
180#D-function IGCM_sys_RshPost
181#D-* Purpose: Post-process rsh command
182#D-* Examples:
183#D-
184function IGCM_sys_RshPost {
185    IGCM_debug_PushStack "IGCM_sys_RshPost" $@
186    if ( $DEBUG_sys ) ; then
187        echo "IGCM_sys_RshPost :" $@
188    fi
189
190# ============ CESIUM START ============ #
191#    typeset NB_ESSAI DELAI status
192#    #nombre d'essai avant abandon
193#    NB_ESSAI=5
194#    #temps entre chaque essai
195#    DELAI=10
196#    i=0
197#    while [ $i -ne $NB_ESSAI ] ; do
198#        ssh -t mercure ssh cesium /bin/ksh ${@} 2>/dev/null
199#        status=$?
200#        if [ ${status} -ne 0 ];
201#        then
202#            sleep $DELAI
203#        else
204#            break
205#        fi
206#        let i=$i+1
207#    done
208# ============ CESIUM  END  ============ #
209
210
211    /bin/ksh ${@}
212    if [ $? -gt 0 ] ; then
213        echo "IGCM_sys_RshPost : erreur."
214        IGCM_debug_Exit "IGCM_sys_RshPost"
215    fi
216    IGCM_debug_PopStack "IGCM_sys_RshPost"
217}
218
219#D-#==================================================
220#D-function IGCM_sys_SendMail
221#D-* Purpose: Send mail when simulation is over
222#D-* Examples:
223#D-
224function IGCM_sys_SendMail {
225    IGCM_debug_PushStack "IGCM_sys_SendMail" $@
226    if ( $DEBUG_sys ) ; then
227        echo "IGCM_sys_SendMail :" $@
228    fi
229
230    if ( ${ExitFlag} ) ; then
231        status=FAILED
232        # Nothing fo now
233    else
234        status=COMPLETED
235        ssh mercure /bin/ksh <<-EOF
236    export LOGIN=${LOGIN}
237    export config_UserChoices_JobName=${config_UserChoices_JobName}
238    export config_UserChoices_MailName=${config_UserChoices_MailName}
239    export DateBegin=${DateBegin}
240    export DateEnd=${DateEnd}
241    export R_SAVE=${R_SAVE}
242    export SUBMIT_DIR=${SUBMIT_DIR}
243
244    cat  << END_MAIL > job_end.mail
245Dear ${LOGIN},
246
247  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`.
248  Job started : ${DateBegin}
249  Job ended   : ${DateEnd}
250  Output files are available in ${R_SAVE}
251  Script files and Script Outputs are available in ${SUBMIT_DIR}
252END_MAIL
253
254    if [ ! -z ${config_UserChoices_MailName} ] ; then
255       mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail
256    elif [ -f ~/.forward ] ; then
257       mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
258    fi
259
260    sleep 10
261    rm -f job_end.mail
262EOF
263    fi
264
265    if [ $? -gt 0 ] ; then
266        echo "IGCM_sys_SendMail : erreur."
267        IGCM_debug_Exit "IGCM_sys_SendMail"
268    fi
269    IGCM_debug_PopStack "IGCM_sys_SendMail"
270}
271
272#D-#==================================================
273#D-function IGCM_sys_Mkdir
274#D-* Purpose: Master locale mkdir command
275#D-* Examples:
276#D-
277function IGCM_sys_Mkdir {
278    IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
279    if ( $DEBUG_sys ) ; then
280        echo "IGCM_sys_Mkdir :" $@
281    fi
282    if [ ! -d ${1} ]; then
283        \mkdir -p $1
284        if [ $? -gt 0 ] ; then
285            echo "IGCM_sys_Mkdir : erreur."
286            IGCM_debug_Exit "IGCM_sys_Mkdir"
287        fi
288    fi
289    # vérification :
290    if [ ! -d ${1} ] ; then
291        echo "IGCM_sys_Mkdir : erreur."
292        IGCM_debug_Exit "IGCM_sys_Mkdir"
293    fi
294    IGCM_debug_PopStack "IGCM_sys_Mkdir"
295}
296
297#D-#==================================================
298#D-function IGCM_sys_MkdirArchive
299#D-* Purpose: Mkdir on Archive
300#D-* Examples:
301#D-
302function IGCM_sys_MkdirArchive {
303    IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
304    if ( $DEBUG_sys ) ; then
305        echo "IGCM_sys_MkdirArchive :" $@
306    fi
307    #- creation de repertoire sur le serveur fichier
308    if [ ! -d ${1} ]; then 
309        \mkdir -p $1
310        if [ $? -gt 0 ] ; then
311            echo "IGCM_sys_MkdirArchive : erreur."
312            IGCM_debug_Exit "IGCM_sys_MkdirArchive"
313        fi
314    fi
315    IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
316}
317
318#D-#==================================================
319#D-function IGCM_sys_MkdirWork
320#D-* Purpose: Mkdir on Work
321#D-* Examples:
322#D-
323function IGCM_sys_MkdirWork {
324    IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
325    if ( $DEBUG_sys ) ; then
326        echo "IGCM_sys_MkdirWork :" $@
327    fi
328    #- creation de repertoire sur le serveur fichier
329    if [ ! -d ${1} ]; then 
330        \mkdir -p $1
331        if [ $? -gt 0 ] ; then
332            echo "IGCM_sys_MkdirWork : erreur."
333            IGCM_debug_Exit "IGCM_sys_MkdirWork"
334        fi
335    fi
336    IGCM_debug_PopStack "IGCM_sys_MkdirWork"
337}
338
339#D-#==================================================
340#D-function IGCM_sys_Cd
341#D-* Purpose: master cd command
342#D-* Examples:
343#D-
344function IGCM_sys_Cd {
345    IGCM_debug_PushStack "IGCM_sys_Cd" $@
346    if ( $DEBUG_sys ) ; then
347        echo "IGCM_sys_Cd :" $@
348    fi
349    \cd $1
350    if [ $? -gt 0 ] ; then
351        echo "IGCM_sys_Cd : erreur."
352        IGCM_debug_Exit "IGCM_sys_Cd"
353    fi
354    IGCM_debug_PopStack "IGCM_sys_Cd"
355}
356
357#D-#==================================================
358#D-function IGCM_sys_Chmod
359#D-* Purpose: Chmod
360#D-* Examples:
361#D-
362function IGCM_sys_Chmod {
363    IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
364    if ( $DEBUG_sys ) ; then
365        echo "IGCM_sys_Chmod :" $@
366    fi
367    if [ $DRYRUN -le 1 ]; then
368        \chmod $@
369        if [ $? -gt 0 ] ; then
370            echo "IGCM_sys_Chmod : erreur."
371            IGCM_debug_Exit "IGCM_sys_Chmod"
372        fi
373    else
374        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
375    fi
376    IGCM_debug_PopStack "IGCM_sys_Chmod"
377}
378
379#D-#==================================================
380#D-function IGCM_sys_FileSize
381#D-* Purpose: Filesize
382#D-* Examples:
383#D-
384function IGCM_sys_FileSize {
385    IGCM_debug_PushStack "IGCM_sys_FileSize" $@
386
387    typeset sizeF
388    set +A sizeF -- $( ls -la ${1} )
389    if [ $? -gt 0 ] ; then
390        IGCM_debug_Exit "IGCM_sys_FileSize"
391    fi
392    eval ${2}=${sizeF[4]}
393
394    IGCM_debug_PopStack "IGCM_sys_FileSize"
395}
396
397#D-#==================================================
398#D-function IGCM_sys_TestDir
399#D-* Purpose: Test Directory that must exists
400#D-* Examples:
401#D-
402function IGCM_sys_TestDir {
403    IGCM_debug_PushStack "IGCM_sys_TestDir" $@
404    if ( $DEBUG_sys ) ; then
405        echo "IGCM_sys_TestDir :" $@
406    fi
407    typeset ExistFlag
408    ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
409    IGCM_debug_PopStack "IGCM_sys_TestDir"
410
411    return ${ExistFlag}
412}
413
414#D-#==================================================
415#D-function IGCM_sys_TestDirArchive
416#D-* Purpose: Test Directory that must exists on Archive
417#D-* Examples:
418#D-
419function IGCM_sys_TestDirArchive {
420    IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
421    if ( $DEBUG_sys ) ; then
422        echo "IGCM_sys_TestDirArchive :" $@
423    fi
424    typeset ExistFlag
425    ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
426    IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
427
428    return ${ExistFlag}
429}
430
431#D-#==================================================
432#D-function IGCM_sys_TestFileArchive
433#D-* Purpose: Test file that must NOT EXISTS on Archive
434#D-* Examples:
435#D-
436function IGCM_sys_TestFileArchive {
437    IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
438    typeset ExistFlag
439    ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
440    IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
441
442    return ${ExistFlag}
443}
444
445#D-#==================================================
446#D-function IGCM_sys_CountFileArchive
447#D-* Purpose: Count files on Archive filesystem
448#D-* Examples:
449#D-
450function IGCM_sys_CountFileArchive {
451    IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
452    ls ${@} 2>/dev/null | wc -l
453    if [ $? -gt 0 ] ; then
454        echo "IGCM_sys_CountFileArchive : erreur."
455    fi
456    IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
457}
458
459#D-#==================================================
460#D-function IGCM_sys_Tree
461#D-* Purpose: Tree directories with files on ${ARCHIVE}
462#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
463#D-
464function IGCM_sys_Tree {
465    IGCM_debug_PushStack "IGCM_sys_Tree" $@
466    if ( $DEBUG_sys ) ; then
467        echo "IGCM_sys_Tree :" $@
468    fi
469
470    \ls -lR ${@}
471
472    IGCM_debug_PopStack "IGCM_sys_Tree"
473}
474
475#D-#==================================================
476#D-function IGCM_sys_Tar
477#D-* Purpose: master un-tar command
478#D-* Examples:
479#D-
480function IGCM_sys_Tar {
481    IGCM_debug_PushStack "IGCM_sys_Tar" $@
482    if ( $DEBUG_sys ) ; then
483        echo "IGCM_sys_Tar :" $@
484    fi
485    \tar xvf $1
486    if [ $? -gt 0 ] ; then
487        echo "IGCM_sys_Tar : erreur."
488        IGCM_debug_Exit "IGCM_sys_Tar"
489    fi
490    IGCM_debug_PopStack "IGCM_sys_Tar"
491}
492
493#D-#==================================================
494#D-function IGCM_sys_UnTar
495#D-* Purpose: master un-tar command
496#D-* Examples:
497#D-
498function IGCM_sys_UnTar {
499    IGCM_debug_PushStack "IGCM_sys_UnTar" $@
500    if ( $DEBUG_sys ) ; then
501        echo "IGCM_sys_UnTar :" $@
502    fi
503    \tar xvf $1
504    if [ $? -gt 0 ] ; then
505        echo "IGCM_sys_UnTar : erreur."
506        IGCM_debug_Exit "IGCM_sys_UnTar"
507    fi
508    IGCM_debug_PopStack "IGCM_sys_UnTar"
509}
510
511#D-#==================================================
512#D-function IGCM_sys_Qsub
513#D-* Purpose: Qsub new job
514#D-* Examples:
515#D-
516function IGCM_sys_Qsub {
517    IGCM_debug_PushStack "IGCM_sys_Qsub" $@
518    if ( $DEBUG_sys ) ; then
519        echo "IGCM_sys_Qsub :" $@
520    fi
521    /usr/bin/nqsII/qsub -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} < $1
522    if [ $? -gt 0 ] ; then
523        echo "IGCM_sys_Qsub : erreur -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} $@."
524        IGCM_debug_Exit "IGCM_sys_Qsub"
525    fi
526    IGCM_debug_PopStack "IGCM_sys_Qsub"
527}
528
529#D-#==================================================
530#D-function IGCM_sys_QsubPost
531#D-* Purpose: Qsub new job on scalaire
532#D-* Examples:
533#D-
534function IGCM_sys_QsubPost {
535    IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
536    if ( $DEBUG_sys ) ; then
537        echo "IGCM_sys_QsubPost :" $@
538    fi
539    # ============ CESIUM START ============ #
540    #/usr/local/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.e.out -E "-v ${listVarEnv}" ${libIGCM_POST}/$1.job
541    # ============ CESIUM  END  ============ #
542    /usr/bin/nqsII/qsub -o ${POST_DIR}/${Script_Post_Output}.out ${libIGCM}/$1.job -v ${listVarEnv}
543    if [ $? -gt 0 ] ; then
544        echo "IGCM_sys_QsubPost : erreur " $@
545        IGCM_debug_Exit "IGCM_sys_QsubPost"
546    fi
547    IGCM_debug_PopStack "IGCM_sys_QsubPost"
548}
549
550#D-*************************
551#D- File transfer functions
552#D-*************************
553#D-
554
555#D-#==================================================
556#D-function IGCM_sys_Rsync_out
557#D-* Purpose: treat return val of rsync
558#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
559#D-  Error values and explanations can depend on your system version.
560function IGCM_sys_Rsync_out {
561    RET=$1
562    if [ ! $RET ] ; then
563        echo "rsync error !"
564    fi
565
566    if [ $MYLANG = "fr" ]; then
567        case $RET in
568            0)  return ;;
569            1)  echo "Erreur de rsync ; RERR_SYNTAX : "
570                echo "Erreur de syntaxe ou d'utilisation."
571                return;;
572            2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
573                echo "Incompatibilité de protocole."
574                return;;
575            3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
576                echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
577                echo "répertoires"
578                return;;
579            4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
580                echo "Action demandée non supportée : une tentative de manipulation de"
581                echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
582                echo "été faite ; ou une option qui est supportée par le  client  mais"
583                echo "pas par le serveur a été spécifiée."
584                return;;
585            10) echo "Erreur de rsync ; RERR_SOCKETIO"
586                echo "Erreur dans le socket d'entrée sortie"
587                return;;
588            11) echo "Erreur de rsync ; RERR_FILEIO"
589                echo "Erreur d'entrée sortie fichier"
590                return;;
591            12) echo "Erreur de rsync ; RERR_STREAMIO"
592                echo "Erreur dans flux de donnée du protocole rsync"
593                return;;
594            13) echo "Erreur de rsync ; RERR_MESSAGEIO"
595                echo "Erreur avec les diagnostics du programme"
596                return;;
597            14) echo "Erreur de rsync ; RERR_IPC"
598                echo "Erreur dans le code IPC"
599                return;;
600            20) echo "Erreur de rsync ; RERR_SIGNAL"
601                echo "SIGUSR1 ou SIGINT reçu"
602                return;;
603            21) echo "Erreur de rsync ; RERR_WAITCHILD"
604                echo "Une erreur retournée par waitpid()"
605                return;;
606            22) echo "Erreur de rsync ; RERR_MALLOC"
607                echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
608                return;;
609            23) echo ""
610                echo "Erreur fichier inexistant"
611                return;;
612            30) echo "Erreur de rsync ; RERR_TIMEOUT"
613                echo "Temps d'attente écoulé dans l'envoi/réception de données"
614                return;;
615            *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
616                return;;
617        esac
618    elif [ $MYLANG = "en" ] ; then
619        case $RET in
620            0)  return;;               
621            1)  echo "rsync error : Syntax or usage error "
622                return;;
623            2)  echo "rsync error : Protocol incompatibility "
624                return;;
625            3)  echo "rsync error : Errors selecting input/output files, dirs"
626                return;;
627            4)  echo "rsync error : Requested action not supported: an attempt"
628                echo "was made to manipulate 64-bit files on a platform that cannot support"
629                echo "them; or an option was specified that is supported by the client and"
630                echo "not by the server."
631                return;;
632            5)  echo "rsync error : Error starting client-server protocol"
633                return;;
634            10) echo "rsync error : Error in socket I/O "
635                return;;
636            11) echo "rsync error : Error in file I/O "
637                return;;
638            12) echo "rsync error : Error in rsync protocol data stream "
639                return;;
640            13) echo "rsync error : Errors with program diagnostics "
641                return;;
642            14) echo "rsync error : Error in IPC code "
643                return;;
644            20) echo "rsync error : Received SIGUSR1 or SIGINT "
645                return;;
646            21) echo "rsync error : Some error returned by waitpid() "
647                return;;
648            22) echo "rsync error : Error allocating core memory buffers "
649                return;;
650            23) echo "rsync error : Partial transfer due to error"
651                return;;
652            24) echo "rsync error : Partial transfer due to vanished source files"
653                return;;
654            30) echo "rsync error : Timeout in data send/receive "
655                return;;
656            *)  echo "rsync error : return code of rsync unknown :" $RET
657                return;;
658        esac
659    else
660        echo "unknown language $MYLANG."
661        return
662    fi
663}
664   
665
666#D-#==================================================
667#D-function IGCM_sys_Miror_libIGCM
668#D-* Purpose: Mirror libIGCM PATH and lib to cesium
669#D-* Examples:
670#D-
671function IGCM_sys_Mirror_libIGCM {
672    IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM"
673    if ( $DEBUG_sys ) ; then
674        echo "IGCM_sys_Mirror_libIGCM"
675    fi
676
677    typeset RET DEST
678
679    mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
680
681    echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1
682    ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1
683    RET=$?
684
685    if [ ${RET} -gt 0 ] ; then
686        echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."
687        cat out_rsync
688    fi
689    IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
690}
691
692#====================================================
693#- Call IGCM_sys_Mirror_libIGCM now !
694if ( $MirrorlibIGCM ) ; then
695    IGCM_sys_Mirror_libIGCM
696fi
697
698#D-#==================================================
699#D-function IGCM_sys_Cp
700#D-* Purpose: generic cp
701#D-* Examples:
702#D-
703function IGCM_sys_Cp {
704    IGCM_debug_PushStack "IGCM_sys_Cp" $@
705    if ( $DEBUG_sys ) ; then
706        echo "IGCM_sys_Cp :" $@
707    fi
708
709    typeset RET
710
711    echo cp $@ > out_rsync 2>&1
712    \cp $@ >> out_rsync 2>&1
713    RET=$?
714
715    if [ ${RET} -gt 0 ] ; then
716        echo "IGCM_sys_Cp : error."
717        cat out_rsync
718        IGCM_debug_Exit "IGCM_sys_Cp"
719     else
720         \rm out_rsync
721    fi
722    IGCM_debug_PopStack "IGCM_sys_Cp"
723}
724
725#D-#==================================================
726#D-function IGCM_sys_Rm
727#D-* Purpose: generic rm
728#D-* Examples:
729#D-
730function IGCM_sys_Rm {
731    IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
732    if ( $DEBUG_sys ) ; then
733        echo "IGCM_sys_Rm :" $@
734    fi
735
736    typeset RET
737
738    echo rm $@ > out_rsync 2>&1
739    \rm $@ >> out_rsync 2>&1
740    RET=$?
741
742    if [ ${RET} -gt 0 ] ; then
743        echo "IGCM_sys_Rm : error."
744        cat out_rsync
745        IGCM_debug_Exit "IGCM_sys_Rm"
746    else
747        \rm out_rsync
748    fi
749    IGCM_debug_PopStack "IGCM_sys_Rm"
750}
751
752#D-#==================================================
753#D-function IGCM_sys_Mv
754#D-* Purpose: generic move
755#D-* Examples:
756#D-
757function IGCM_sys_Mv {
758    IGCM_debug_PushStack "IGCM_sys_Mv" $@
759    if ( $DEBUG_sys ) ; then
760        echo "IGCM_sys_Mv :" $@
761    fi
762
763    if [ $DRYRUN = 0 ]; then
764
765        typeset RET
766           
767        echo mv $@ > out_rsync 2>&1
768        \mv $@ >> out_rsync 2>&1
769        RET=$?
770   
771        if [ ${RET} -gt 0 ] ; then
772            echo "IGCM_sys_Mv : error in mv."
773            cat out_rsync
774            IGCM_debug_Exit "IGCM_sys_Mv"
775        else
776            \rm out_rsync
777        fi
778    else
779        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
780    fi
781
782    IGCM_debug_PopStack "IGCM_sys_Mv"
783}
784
785#D-#==================================================
786#D-function IGCM_sys_Put_Dir
787#D-* Purpose: Copy a complete directory on $(ARCHIVE)
788#D-* Examples:
789#D-
790function IGCM_sys_Put_Dir {
791    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
792    if ( $DEBUG_sys ) ; then
793        echo "IGCM_sys_Put_Dir :" $@
794    fi
795    if [ $DRYRUN = 0 ]; then
796        if [ ! -d ${1} ] ; then
797            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
798            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
799            return
800        fi
801
802        typeset RET
803
804        # Only if we use rsync
805        #IGCM_sys_TestDirArchive $( dirname $2 )
806        #
807        #USUAL WAY
808        \cp -r $1 $2 > out_rsync 2>&1
809        RET=$?
810
811        if [ ${RET} -gt 0 ] ; then
812            echo "IGCM_sys_Put_Dir : error."
813            cat out_rsync
814            IGCM_debug_Exit "IGCM_sys_Put_Dir"
815        else
816            \rm out_rsync
817        fi
818    else
819        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
820    fi
821    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
822}
823
824#D-#==================================================
825#D-function IGCM_sys_Get_Dir
826#D-* Purpose: Copy a complete directory from $(ARCHIVE)
827#D-* Examples:
828#D-
829function IGCM_sys_Get_Dir {
830    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
831    if ( $DEBUG_sys ) ; then
832        echo "IGCM_sys_Get_Dir :" $@
833    fi
834    if [ $DRYRUN = 0 ]; then
835        if [ ! -d ${1} ] ; then
836            echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
837            IGCM_debug_PopStack "IGCM_sys_Get_Dir"
838            return
839        fi
840
841        typeset RET
842
843        # Only if we use rsync
844        #IGCM_sys_TestDirArchive $( dirname $2 )
845        #
846        #USUAL WAY
847        \cp -r $1 $2 > out_rsync 2>&1
848        RET=$?
849
850        if [ ${RET} -gt 0 ] ; then
851            echo "IGCM_sys_Get_Dir : error."
852            cat out_rsync
853            IGCM_debug_Exit "IGCM_sys_Get_Dir"
854        else
855            \rm out_rsync
856        fi
857    else
858        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
859    fi
860    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
861}
862
863#D-#==================================================
864#D-function IGCM_sys_Put_Rest
865#D-* Purpose: Put computied restarts on $(ARCHIVE).
866#D-           File and target directory must exist.
867#D-* Examples:
868#D-
869function IGCM_sys_Put_Rest {
870    IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
871    if ( $DEBUG_sys ) ; then
872        echo "IGCM_sys_Put_Rest :" $@
873    fi
874    if [ $DRYRUN = 0 ]; then
875        if [ ! -f ${1} ] ; then
876            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
877            IGCM_debug_Exit "IGCM_sys_Put_Rest"
878        fi
879
880        typeset RET
881        #
882        if [ X${JobType} = XRUN ] ; then
883            IGCM_sys_Chmod 444 ${1}
884        fi
885        #
886        IGCM_sys_TestDirArchive $( dirname $2 )
887        #
888        # USUAL WAY
889        putfer $1 $2 > out_rsync 2>&1
890        RET=$?
891
892#       #RSYNC WITH NETWORK SSH CALL
893#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
894#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
895
896#       #RSYNC WITH NFS USE
897#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
898#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
899
900#       RET=$?
901#       IGCM_sys_Rsync_out $RET
902
903#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
904#       (( RET=RET+$? ))
905
906        if [ ${RET} -gt 0 ] ; then
907            echo "IGCM_sys_Put_Rest : error."
908            cat out_rsync
909            IGCM_debug_Exit "IGCM_sys_Put_Rest"
910        else
911            \rm out_rsync
912        fi
913    else
914        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
915    fi
916    IGCM_debug_PopStack "IGCM_sys_Put_Rest"
917}
918
919#D-#==================================================
920#D-function IGCM_sys_Put_Out
921#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
922#D-* Examples:
923#D-
924function IGCM_sys_Put_Out {
925    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
926    if ( $DEBUG_sys ) ; then
927        echo "IGCM_sys_Put_Out :" $@
928    fi
929    if [ $DRYRUN = 0 ]; then
930        if [ ! -f ${1} ] ; then
931            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
932            IGCM_debug_PopStack "IGCM_sys_Put_Out"
933            return 1
934        fi
935        #
936        IGCM_sys_MkdirArchive $( dirname $2 )
937        #
938        typeset RET
939
940        #=====================================================
941        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
942        #=====================================================
943
944        #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
945        #if [ $? -eq 0 ] ; then
946        #    typeset WORKPATH FILEPATH
947        #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_OUT_SCR}|" )
948        #    IGCM_sys_MkdirWork ${WORKPATH}
949        #    FILEPATH=${WORKPATH}/$( basename $2 )
950        #    #
951        #    IGCM_sys_Cp ${1} ${FILEPATH}
952        #fi
953
954        if [ X${JobType} = XRUN ] ; then
955            if [ X${3} = X ] ; then
956                IGCM_sys_Chmod 444 ${1}
957            fi
958        fi
959        #
960        # USUAL WAY
961        putfer $1 $2 > out_rsync 2>&1
962        RET=$?
963
964#       #RSYNC WITH NETWORK SSH CALL
965#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
966#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
967
968#       #RSYNC WITH NFS USE
969#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
970#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
971
972#       RET=$?
973#       IGCM_sys_Rsync_out $RET
974
975#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
976#       (( RET=RET+$? ))
977
978        if [ ${RET} -gt 0 ] ; then
979            echo "IGCM_sys_Put_Out : error."
980            cat out_rsync
981            IGCM_debug_Exit "IGCM_sys_Put_Out"
982        else
983            \rm out_rsync
984        fi
985    else
986        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
987    fi
988    IGCM_debug_PopStack "IGCM_sys_Put_Out"
989    return 0
990}
991
992#D-#==================================================
993#D-function IGCM_sys_Get
994#D-* Purpose: Get a file from ${ARCHIVE}
995#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
996#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
997function IGCM_sys_Get {
998    IGCM_debug_PushStack "IGCM_sys_Get" $@
999
1000    typeset DEST RET dm_liste ifile target file_work
1001
1002    if ( $DEBUG_sys ) ; then
1003        echo "IGCM_sys_Get :" $@
1004    fi
1005    if [ $DRYRUN -le 2 ]; then
1006        if [ X${1} = X'/l' ] ; then
1007            # test if the first file is present in the old computation :
1008            eval set +A dm_liste \${${2}}
1009        else
1010            eval set +A dm_liste ${1}
1011        fi
1012        eval DEST=\${${#}}
1013
1014        #=====================================================
1015        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
1016        #=====================================================
1017
1018        # Is it an R_OUT file (not R_IN) ?
1019        #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
1020        #if [ $? -eq 0 ] ; then
1021        #    # Yes  ? then we try to get it in SCRATCHDIR
1022        #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|" )
1023        #    if [ -f ${file_work[0]} ] ; then
1024        #       IGCM_sys_Cp ${file_work[*]} ${DEST}
1025        #       IGCM_debug_PopStack "IGCM_sys_Get"
1026        #       return
1027        #    fi
1028        #fi
1029
1030        # test if the (first) file is present in the old computation :
1031        IGCM_sys_TestFileArchive ${dm_liste[0]}
1032        RET=$?
1033        if [ ${RET} -gt 0 ] ; then
1034            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
1035            IGCM_debug_Exit "IGCM_sys_Get"
1036            IGCM_debug_PopStack "IGCM_sys_Get"
1037            return
1038        fi
1039
1040        dmget ${dm_liste[*]} > out_rsync 2>&1
1041        RET=$?
1042        if [ ${RET} -gt 0 ] ; then
1043            echo "IGCM_sys_Get : demigration error."
1044            cat out_rsync
1045            IGCM_debug_Exit "IGCM_sys_Get"
1046        fi
1047
1048        #USUAL WAY
1049        if [ X${1} = X'/l' ] ; then
1050            (( RET=0 ))
1051            for target in ${dm_liste[*]} ; do
1052                local_file=$( basename ${target} )
1053                \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
1054                (( RET = RET + $? ))
1055            done
1056        else
1057            \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
1058            RET=$?
1059        fi
1060
1061#       #RSYNC WITH NETWORK SSH CALL
1062#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
1063#       ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
1064
1065#       #RSYNC WITH NFS USE
1066#       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
1067#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
1068
1069#       RET=$?
1070#       IGCM_sys_Rsync_out $RET
1071
1072#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
1073#       (( RET=RET+$? ))
1074
1075        if [ ${RET} -gt 0 ] ; then
1076            echo "IGCM_sys_Get : copy error."
1077            cat out_rsync
1078            IGCM_debug_Exit "IGCM_sys_Get"
1079        else
1080            \rm out_rsync
1081        fi
1082    else
1083        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1084    fi
1085    IGCM_debug_PopStack "IGCM_sys_Get"
1086}
1087
1088############################################################## A FINIR !!
1089
1090#D-#==================================================
1091#D-function IGCM_sys_GetDate_FichWork
1092#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
1093#D-* Examples:
1094#D-
1095function IGCM_sys_GetDate_FichWork {
1096    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1097    if ( $DEBUG_sys ) ; then
1098        echo "IGCM_sys_GetDate_FichWork :" $@
1099    fi
1100    # donne la date filesys d'un fichier sur la machine work
1101    IGCM_debug_PopStack "IGCM_sys_FichWork"
1102}
1103
1104#D-#==================================================
1105#D-function IGCM_sys_GetDate_FichArchive
1106#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1107#D-* Examples:
1108#D-
1109function IGCM_sys_GetDate_FichArchive {
1110    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1111    if ( $DEBUG_sys ) ; then
1112        echo "IGCM_sys_GetDate_FichArchive :" $@
1113    fi
1114    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1115}
1116
1117##############################################################
1118# REBUILD OPERATOR
1119
1120function IGCM_sys_rebuild {
1121    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1122    if ( $DEBUG_sys ) ; then
1123        echo "IGCM_sys_rebuild :" $@
1124    fi
1125    /home/cont003/p86ipsl/SX8/bin/rebuild -f -o $@
1126    if [ $? -gt 0 ] ; then
1127       echo "IGCM_sys_rebuild : erreur ${@}."
1128       IGCM_debug_Exit "rebuild"
1129    fi
1130
1131    IGCM_debug_PopStack "IGCM_sys_rebuild"
1132}
1133
1134############################################################
1135# Activate Running Environnment Variables
1136
1137function IGCM_sys_activ_variables {
1138    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1139    if ( $DEBUG_sys ) ; then
1140        echo "IGCM_sys_activ_variables"
1141    fi
1142
1143# --------------------------------------------------------------------
1144#D- MPI specifications
1145# --------------------------------------------------------------------
1146
1147#D-- MPISUSPEND
1148    export MPISUSPEND=${MPISUSPEND:=OFF}
1149
1150#D-- MPIPROGINF #other choices : ALL_DETAIL2
1151    export MPIPROGINF=ALL
1152#D- activate ftrace (with -ftrace)
1153    export F_FTRACE=YES
1154#D- communication information (with -ftrace)
1155    export MPICOMMINF=DETAIL
1156
1157# --------------------------------------------------------------------
1158#D- Other specifications
1159# --------------------------------------------------------------------
1160
1161#D- max number of character/line in output job
1162    export F_SYSLEN=5000
1163#D- number of error that can be admitted on the NEC
1164    export F_ERRCNT=0
1165#D- global performance
1166    export F_PROGINF=DETAIL
1167
1168#D- I/O performance (FORTRAN I/O only not netCDF)
1169    export F_FILEINF=${F_FILEINF:=NO}
1170#D- netCDF I/O performance
1171    export NC_FILEINF=${NC_FILEINF:=NO}
1172
1173    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1174}
1175
1176############################################################
1177# Desactivate Running Environnment Variables
1178
1179function IGCM_sys_desactiv_variables {
1180    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1181    if ( $DEBUG_sys ) ; then
1182        echo "IGCM_sys_desactiv_variables"
1183    fi
1184# --------------------------------------------------------------------
1185#D- MPI specifications
1186# --------------------------------------------------------------------
1187
1188#D-- MPIPROGINF
1189    export MPIPROGINF=NO
1190
1191# --------------------------------------------------------------------
1192#D- Other specifications
1193# --------------------------------------------------------------------
1194
1195#D- global performance
1196    export F_PROGINF=NO 
1197
1198    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1199}
1200
1201############################################################
1202# Build run file
1203
1204function IGCM_sys_build_run_file {
1205    IGCM_debug_PushStack "IGCM_sys_build_run_file" $@
1206    if ( $DEBUG_sys ) ; then
1207        echo "IGCM_sys_build_run_file " $@
1208    fi
1209    (( NUM_PROC_ATM = BATCH_NUM_PROC_TOT - 1 ))
1210    (( NUM_PROC_OASIS = BATCH_NUM_PROC_TOT - NUM_PROC_ATM ))
1211    (( NUM_PROC_OCE = BATCH_NUM_PROC_TOT - NUM_PROC_ATM ))
1212   
1213    if [ $1 = MPI2 ]; then
1214        cat <<EOF > run_file
1215-p 1 -np 1 -e ./oasis
1216EOF
1217        (( NUM_PROCESS = BATCH_NUM_PROC_TOT + 1 ))
1218        config_UserChoices_JobRunOptions='"-max_np ${NUM_PROCESS} -f"'
1219
1220    elif [ $1 = MPI1 ]; then
1221        cat <<EOF > run_file
1222-p $NUM_PROC_OASIS -e ./oasis
1223-p $NUM_PROC_ATM -e ./lmdz.x
1224-p $NUM_PROC_OCE -e ./opa.xx
1225EOF
1226 
1227    fi
1228
1229    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1230 
1231}
Note: See TracBrowser for help on using the repository browser.