source: branches/libIGCM_MPI_OpenMP/libIGCM_sys/libIGCM_sys_mercurex8.ksh @ 559

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