source: tags/libIGCM_v1_2/AA_job @ 1133

Last change on this file since 1133 was 43, checked in by sdipsl, 15 years ago

SD : - Change default PBS resources for brodie and mercure 1h and 8GB

  • Add LMDZOR config as known configuration for create_se
  • 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 Date Author Revision
File size: 16.1 KB
Line 
1#-Q- platine #!/usr/bin/ksh
2#-Q- platine ##################
3#-Q- platine ## PLATINE   CEA ##
4#-Q- platine ##################
5#-Q- platine #BSUB -J ::Jobname::       # nom de la requete
6#-Q- platine #BSUB -N                   # message a la fin du job
7#-Q- platine #BSUB -o Script_Output_::Jobname::.1    # nom du fichier de sortie
8#-Q- platine #BSUB -n ::JobNumProcTot::             # reservation des processeurs pour le job
9#-Q- platine #BSUB -W 1:00           # Limite temps
10#-Q- platine BATCH_NUM_PROC_TOT=$SLURM_NPROCS
11#-Q- sx8brodie #######################
12#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
13#-Q- sx8brodie #######################
14#-Q- sx8brodie #PBS -N ::Jobname::         # nom de la requete
15#-Q- sx8brodie #PBS -m a                   # message a la fin du job
16#-Q- sx8brodie #PBS -j o                   # regroupement des sorties du job : standard error et output
17#-Q- sx8brodie #PBS -o Script_Output_::Jobname::.1  # nom du fichier de sortie
18#-Q- sx8brodie #PBS -S /usr/bin/ksh        # shell de soumission
19#-Q- sx8brodie #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
20#-Q- sx8brodie #PBS -q ::JobClass::                # classe multi pour BATCH_NUM_PROC_TOT superieur a 2, mono sinon
21#-Q- sx8brodie #PBS -l cpunum_job=${BATCH_NUM_PROC_TOT}  # reservation des processeurs pour le job
22#-Q- sx8brodie #PBS -l memsz_job=8.0gb     # Limite memoire
23#-Q- sx8brodie #PBS -l cputim_job=1:00:00  # Limite temps
24#-Q- sx8mercure #!/bin/ksh
25#-Q- sx8mercure ######################
26#-Q- sx8mercure ## SX8MERCURE   CEA ##
27#-Q- sx8mercure ######################
28#-Q- sx8mercure #PBS -N ::Jobname::           # nom de la requete
29#-Q- sx8mercure #PBS -m a                     # message a la fin du job
30#-Q- sx8mercure #PBS -j o                     # regroupement des sorties du job : standard error et output
31#-Q- sx8mercure #PBS -o Script_Output_::Jobname::.1   # nom du fichier de sortie
32#-Q- sx8mercure #PBS -S /usr/bin/ksh          # shell de soumission
33#-Q- sx8mercure #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
34#-Q- sx8mercure #PBS -l cpunum_job=${BATCH_NUM_PROC_TOT}          # reservation des processeurs pour le job
35#-Q- sx8mercure #PBS -l memsz_job=8.0gb       # limite memoire
36#-Q- sx8mercure #PBS -l elapstim_req=01:00:00 # limite en temps elapsed
37#-Q- default #!/bin/ksh
38#-Q- default ##################
39#-Q- default ## DEFAULT HOST ##
40#-Q- default ##################
41#-Q- default #For MPI use, uncomment next line :
42#-Q- default #BATCH_NUM_PROC_TOT=::JobNumProcTot::
43
44# $Date$
45# $Author$
46# $Revision$
47# IPSL (2006)
48#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
49
50#set -eu
51#set -vx
52
53date
54echo
55echo "#######################################"
56echo "#       ANOTHER GREAT SIMULATION      #"
57echo "#######################################"
58echo
59
60#D--------------------------------------------------------------------==
61#D--------------------------------------------------------------------==
62#D-
63#D-                      Job to launch IGCM models
64#D-
65#D--------------------------------------------------------------------==
66#D--------------------------------------------------------------------==
67#D-
68
69MODIPSL=::modipsl::
70libIGCM=${MODIPSL}/libIGCM
71
72#D--------------------------------------------------------------------==
73#D-                   -1. User modification place
74#D-                      - Job Verbosity
75#D-                      - PeriodNb
76#D--------------------------------------------------------------------==
77
78#D- Increased verbosity (1, 2, 3)
79Verbosity=3
80#D- Number of execution in one job
81PeriodNb=1
82
83#D-
84# --------------------------------------------------------------------
85#D- ! Optionnal features /!\ Use with care !
86# --------------------------------------------------------------------
87
88#D- Low level debug : to bypass lib test checks and stack construction
89#D- Default=true
90DEBUG_debug=false
91
92#D- Set DEBUG_sys to false to disable output calls of function
93#D- Default=true
94#DEBUG_sys=false
95
96#D- Define running directory
97#D- Default=${TMPDIR} ie temporary batch directory
98#RUN_DIR_PATH=/workdir4/rech/ces/rces452/BABATEST/TESTPOST
99
100#D- Define submit directory
101#D- Default= where you launch qsub
102#SUBMIT_DIR=/workdir4/rech/ces/rces452/SCRIPT_V1/modipsl/config/IPSLCM4_v1_OASIS3/EXP01
103
104#D- Turn in dry run mode ? (0,1,2,3)
105#D- Default=0
106#DRYRUN=3
107# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
108# -------------------------------------------------------------------------------------
109# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
110# |          |  Cp/Exe param files |            |  Chmod  |                           |
111# |          |      Qsub           |            |         |                           |
112# -------------------------------------------------------------------------------------
113# |    0     |       yes           |    yes     |  yes    |      yes                  |
114# -------------------------------------------------------------------------------------
115# |    1     |       yes           |    yes     |  yes    |      no                   |
116# -------------------------------------------------------------------------------------
117# |    2     |       yes           |    yes     |  no     |      no                   |
118# -------------------------------------------------------------------------------------
119# |    3     |       yes           |    no      |  no     |      no                   |
120# -------------------------------------------------------------------------------------
121
122#D- Define input file root directory
123#D- Default=/u/rech/ces/rces452/IGCM
124#R_IN=/u/rech/por/rpor111/DATA
125
126#D-
127#D--------------------------------------------------------------------==
128#D-                   0. System Environment
129#D-                      - Define variables for Number of processors
130#D-                      - Define MPI variables
131#D-                      - Define batch scheduler variables
132#D-                      - Source IGCM Library
133#D-                      - Get RESOLution in .resol file (temporary)
134#D--------------------------------------------------------------------==
135
136#D--------------------------------------------------------------------==
137
138. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
139        ( ${DEBUG_debug} ) && IGCM_debug_Check
140. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
141       ( ${DEBUG_debug} ) && IGCM_card_Check
142. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
143       ( ${DEBUG_debug} ) && IGCM_date_Check
144#-------
145. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
146. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
147. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
148. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
149
150#D--------------------------------------------------------------------==
151
152#-- Resolution FLAG for oasis input
153RESOL=$(cat ${SUBMIT_DIR}/../.resol)
154#RESOL="ORCA2xLMD9671"
155
156#D-
157#D--------------------------------------------------------------------==
158#D-           1. INITIALIZE CONFIGURATION AND THEN COMPONENTS
159#D--------------------------------------------------------------------==
160
161# --------------------------------------------------------------------==
162#D- Initialize configuration :
163#D-              - Simulation configuration
164#D-              - Simulation parameters
165#D-              - Execution parameter
166#D-              - Define input files directory
167#D-              - Read or initialize CumulPeriod
168#D-              - run.card
169#D-
170# --------------------------------------------------------------------==
171IGCM_config_Initialize
172
173# --------------------------------------------------------------------==
174#D- Define, create and cd RUN_DIR
175#D- 
176# --------------------------------------------------------------------==
177RUN_DIR=${RUN_DIR_PATH}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
178IGCM_sys_MkdirWork ${RUN_DIR}
179IGCM_sys_Cd ${RUN_DIR}
180
181# --------------------------------------------------------------------==
182#D- Define REBUILD_DIR :
183#D- where we store files needing rebuild process
184#D- 
185# --------------------------------------------------------------------==
186if [ ${config_Post_RebuildFromArchive} = true ]; then
187    REBUILD_DIR=${R_SAVE}/TMP
188    IGCM_sys_MkdirArchive ${REBUILD_DIR}
189else
190    REBUILD_DIR=\${RUN_DIR}
191fi
192
193# --------------------------------------------------------------------==
194#D- Initialize each components taking part
195#D- into simulation configuration :
196#D-         - Define component executable
197#D-         - Define Write Frequency by component "1M" "1D" ...
198#D-         - Source ${comp}.driver
199#D-         - Define Storage Places by component
200#D-         - ${comp}_Initialize :
201#D-         - Patterns to sed
202#D-         - Variables from namelist
203#D-
204# --------------------------------------------------------------------==
205IGCM_comp_Initialize
206
207# --------------------------------------------------------------------==
208#D- Verify compatibility of period length and write frequencies
209#D-
210# --------------------------------------------------------------------==
211#IGCM_config_Check
212
213#D--------------------------------------------------------------------==
214#D-                  2. ENTER THE DEEP EXECUTION LOOP
215#D-                  !!!! FASTEN YOUR SEAT BELTS !!!!
216#D-                  !!!!!      PLEASE.          !!!!
217#D-                  !! WE WILL CROSS TURBULENCES. !!
218#D--------------------------------------------------------------------==
219
220Period=1
221while [ ${Period} -le ${PeriodNb} ]; do
222
223    echo
224    echo "Starting iteration ${Period} / ${PeriodNb}"
225
226    #D-
227    # ------------------------------------------------------------------
228    #D- COMPUTE AND DEFINE DATE STUFF.
229    # ------------------------------------------------------------------
230    IGCM_config_PeriodStart
231    #D- => ${PeriodDateBegin}
232    #D- => ${PeriodDateEnd}
233    #D- => ${CumulPeriod}
234    #D- => ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd}
235    #D- => ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0
236    #D- => update run.card value
237   
238    #D-
239    # ------------------------------------------------------------------
240    #D- Get parameters text files updated by job (.def, namelist ...)
241    #D- READ AND USE BY GCM AT EACH EXECUTION.
242    # ------------------------------------------------------------------
243    IGCM_comp_GetInputParametersFiles
244
245    #D-
246    # ------------------------------------------------------------------
247    #D- Get initial state (Etat0, carteveg,relief...)
248    #D- NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1
249    #D- AND ???_Restart=NO
250    #D- READ AND USE BY GCM FOR ONLY ONE EXECUTION.
251    # ------------------------------------------------------------------
252    IGCM_comp_GetInputInitialStateFiles
253
254    #D-
255    # ------------------------------------------------------------------
256    #D- Get Boundaries Conditions (SST, WIND[X,Y,Z], LAI ...)
257    #D- READ AND USE BY GCM AT EACH EXECUTION.
258    # ------------------------------------------------------------------
259    IGCM_comp_GetInputBoundaryFiles
260
261    #D-
262    # ------------------------------------------------------------------
263    #D- Get restart files (restartphy.nc, orca_restart.nc ...)
264    #D- READ AND USE BY GCM AT EACH EXECUTION.
265    #D-
266    #D- IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART
267    #D- ONLY IF CumulPeriod= (=> NUMERO) == 1
268    #D- MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e)
269    #D-
270    #D- IF CumulPeriod == 1
271    #D- AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART
272    #D- MUST BRING THIS RESTART IN ${RUN_DIR_PATH}
273    #D-
274    #D- ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH}
275    # ------------------------------------------------------------------
276    IGCM_comp_GetInputRestartFiles
277   
278    #D-
279    # ------------------------------------------------------------------
280    #D- Test if all was right before Update
281    # ------------------------------------------------------------------
282    IGCM_debug_Verif_Exit
283
284    # ------------------------------------------------------------------
285    #D- Activate running environnement variables
286    # ------------------------------------------------------------------
287    IGCM_sys_activ_variables
288
289    #D-
290    # ------------------------------------------------------------------
291    #D- UPDATE ParametersFiles (.def, namelist ...) with
292    #D- current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...)
293    # ------------------------------------------------------------------
294    IGCM_comp_Update
295
296    #D-
297    # ------------------------------------------------------------------
298    #D- Test if all was right before execution
299    # ------------------------------------------------------------------
300    IGCM_debug_Verif_Exit
301
302    #D-
303    #D----------------------------------------------------------------==
304    #D-                          3. Execution
305    #D----------------------------------------------------------------==
306
307    echo
308    echo "#######################################"
309    echo "#      DIR BEFORE RUN EXECUTION       #"
310    echo "#######################################"
311    echo
312    ls -lrt
313
314    echo "========================================================================"
315    if ( [ X${BATCH_NUM_PROC_TOT} != X ] && [ "${BATCH_NUM_PROC_TOT}" -gt 1 ] ) ; then
316        MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND}
317        eval MPIRUN_OPTIONS=${config_UserChoices_JobRunOptions}
318    else
319        MPIRUN_COMMAND=${MPIRUN_COMMAND:="time "}
320        MPIRUN_OPTIONS=${MPIRUN_OPTIONS:=""}
321    fi
322
323    if [ ${DRYRUN} -le 1 ] ; then
324        REAL_DATE_INIT=$( date )
325        echo "EXECUTION of : ${MPIRUN_COMMAND} ${MPIRUN_OPTIONS} ./${config_Executable_Name} > ${Exe_Output} 2>&1"
326        typeset RET
327        ${MPIRUN_COMMAND} ${MPIRUN_OPTIONS} ./${config_Executable_Name} > ${Exe_Output} 2>&1
328        RET=$?
329        if [ ${RET} -gt 0 ] ; then
330            echo "Return code of executable :" ${RET}
331            IGCM_debug_Exit "EXECUTABLE"
332            IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/${PREFIX}_${Exe_Output}_error
333        fi
334        echo ${REAL_DATE_INIT} >> ${Exe_Output}
335        date >> ${Exe_Output}
336    else
337        echo "EXECUTION of : ${MPIRUN_COMMAND} ${MPIRUN_OPTIONS} ./${config_Executable_Name} simulated for DRYRUN = " $DRYRUN
338        if ( $DEBUG_debug ) ; then
339            echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack
340        fi
341    fi
342    echo "========================================================================"
343
344    echo
345    echo "#######################################"
346    echo "#       DIR AFTER RUN EXECUTION       #"
347    echo "#######################################"
348    echo
349    ls -lrt
350
351    #D-
352    # ------------------------------------------------------------------
353    #D- Desactivate running environnement variables
354    # ------------------------------------------------------------------
355    IGCM_sys_desactiv_variables
356
357    #D-
358    #D----------------------------------------------------------------==
359    #D-                    4. Post execution operations
360    #D----------------------------------------------------------------==
361
362    #D-
363    # ------------------------------------------------------------------
364    #D- Save on archive machine netcdf outputs, restarts
365    #D- and text files of models
366    # ------------------------------------------------------------------
367    IGCM_comp_Finalize
368
369    #D-
370    # ------------------------------------------------------------------
371    #D- Test if all was right after Finalize
372    # ------------------------------------------------------------------
373    IGCM_debug_Verif_Exit
374
375    #D-
376    # ------------------------------------------------------------------
377    #D- Launch remote rebuild or/and post-treatment process if necessary
378    # ------------------------------------------------------------------
379    IGCM_post_Configure
380
381    #D-
382    # ------------------------------------------------------------------
383    #D- Save job output
384    #D- Manage executable size to save only different binary
385    #D- Write in run.card user, system and elapse time
386    #D- Check that everything went well ! No ? then we stop.
387    #D- Determine next computed period
388    # ------------------------------------------------------------------
389    IGCM_config_PeriodEnd
390
391    echo "Ending iteration ${Period}"
392    (( Period = Period + 1 ))
393
394    # End loop if date end is reached
395    if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then
396        break ;
397    fi
398
399done 
400
401#D-
402#D--------------------------------------------------------------------==
403#D-     5. Submit next job or send mail if simulation over.
404#D--------------------------------------------------------------------==
405IGCM_config_Finalize
406
407date
Note: See TracBrowser for help on using the repository browser.