source: trunk/libIGCM/AA_rebuild_fromArchive @ 837

Last change on this file since 837 was 837, checked in by labetoulle, 11 years ago

On Curie, ins_job sets up project ID. See #98.

Add

#-Q- curie #MSUB -A ::default_project::

to job headers, to be replaced by proper project ID by ins_job.

  • Property svn:keywords set to Revision Author Date
File size: 8.1 KB
Line 
1#-Q- curie ######################
2#-Q- curie ## CURIE   TGCC/CEA ##
3#-Q- curie ######################
4#-Q- curie #MSUB -r REBUILDARCH    # Nom du job               
5#-Q- curie #MSUB -eo
6#-Q- curie #MSUB -n 1              # Reservation du processus
7#-Q- curie #MSUB -T 86400          # Limite de temps elapsed du job
8#-Q- curie #MSUB -q xlarge
9#-Q- curie #MSUB -Q normal
10#-Q- curie #MSUB -A ::default_project::
11#-Q- curie set +x
12#-Q- ada #!/bin/ksh
13#-Q- ada #######################
14#-Q- ada ##   VARGAS   IDRIS  ##
15#-Q- ada #######################
16#-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss
17#-Q- ada # @ wall_clock_limit = 10:00:00
18#-Q- ada # Nom du travail LoadLeveler
19#-Q- ada # @ job_name   = REBUILDARCH
20#-Q- ada # Fichier de sortie standard du travail
21#-Q- ada # @ output     = $(job_name).$(jobid)
22#-Q- ada # Fichier de sortie d'erreur du travail
23#-Q- ada # @ error      =  $(job_name).$(jobid)
24#-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
25#-Q- ada # @ notification = error
26#-Q- ada # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER
27#-Q- ada # @ queue
28#-Q- sx9mercure #!/bin/ksh
29#-Q- sx9mercure ######################
30#-Q- sx9mercure ## SX9MERCURE  CCRT ##
31#-Q- sx9mercure ######################
32#-Q- sx9mercure #PBS -N REBUILDARCH          # Nom du job
33#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
34#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
35#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
36#-Q- sx9mercure #PBS -l elapstim_req=24:00:00  # Limite temps a 1 heures
37#-Q- sx9mercure #PBS -q scalaire
38#-Q- sx9mercure #PBS -r n
39#-Q- titane #!/bin/ksh
40#-Q- titane ######################
41#-Q- titane ## TITANE   CEA     ##
42#-Q- titane ######################
43#-Q- titane #MSUB -r REBUILDARCH     # Nom du job
44#-Q- titane #MSUB -eo
45#-Q- titane #MSUB -n 1               # Reservation du processus
46#-Q- titane #MSUB -T 86400           # Limite de temps elapsed du job
47#-Q- titane #MSUB -q mono
48#-Q- titane #MSUB -E '-rn'
49#-Q- lxiv8 ######################
50#-Q- lxiv8 ## OBELIX      LSCE ##
51#-Q- lxiv8 ######################
52#-Q- lxiv8 #PBS -N REBUILDARCH
53#-Q- lxiv8 #PBS -m a
54#-Q- lxiv8 #PBS -j oe
55#-Q- lxiv8 #PBS -q medium
56#-Q- lxiv8 #PBS -o REBUILDARCH.$$
57#-Q- lxiv8 #PBS -S /bin/ksh
58#-Q- default #!/bin/ksh
59#-Q- default ##################
60#-Q- default ## DEFAULT HOST ##
61#-Q- default ##################
62
63#**************************************************************
64# Author: Sebastien Denvil
65# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
66# $Revision::                                          $ Revision of last commit
67# $Author::                                            $ Author of last commit
68# $Date::                                              $ Date of last commit
69# IPSL (2006)
70#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
71#
72#**************************************************************
73
74#set -eu
75#set -vx
76
77date
78
79#-Q- ada export OMP_NUM_THREADS=1
80
81#D- Task type (computing or post-processing)
82TaskType=post-processing
83
84########################################################################
85
86#D- Flag to determine if this job in a standalone mode
87#D- Default : value from AA_job if any
88StandAlone=${StandAlone:=true}
89
90#D- Path to libIGCM
91#D- Default : value from AA_job if any
92# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
93# WARNING you must check MirrorlibIGCM variable in sys library.
94# WARNING If this variable is true, you must use libIGCM_POST path instead
95# WARNING of your running libIGCM directory.
96libIGCM=${libIGCM:=::modipsl::/libIGCM}
97
98#-D- $hostname of the MASTER job when SUBMIT_DIR is not visible on postprocessing computer.
99MASTER=${MASTER:=mercure|titane|brodie|vargas}
100
101#D- Do we rebuild parallel output from archive or from ${BIGDIR}
102#D- Default : value from AA_job if any
103RebuildFromArchive=${RebuildFromArchive:=true}
104
105#D- Directory where files we need to rebuild are store
106#D- Default : value from AA_job if any
107#D- if RebuildFromArchive=true REBUILD_DIR=${DMFDIR}/IGCM_OUT/.../JobName/TMP
108#D- example : /dmnfs09/cont003/p86denv/IGCM_OUT/IPSLCM5/CM5PIRC7/TMP
109#D- if RebuildFromArchive=false REBUILD_DIR=${BIGDIR}/REBUILD/TagName/JobName/
110#D- example : /scratch/cont003/p86denv/REBUILD/IPSLCM5/SCAL-NEW
111REBUILD_DIR=${REBUILD_DIR:=/path/to/your/TMP/REBUILD/FILES}
112
113#D- How many directory to rebuild we have to consider
114#D- Default : value from AA_job if any
115NbRebuildDir=${NbRebuildDir:=1000}
116
117#D- Suffix date we will use to determine which directory to rebuild
118#D- We will rebuild NbRebuildDir before and including PeriodDateBegin
119#D- Default : value from AA_job if any
120LastPeriodForRebuild=${LastPeriodForRebuild:=${PeriodDateBegin:=18901201}}
121
122#D- Flag to determine atlas job's output directory
123#D- Default : value from libIGCM_post.ksh if any
124POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
125
126#-D- libIGCM_SX contains libIGCM on Master computer. Required on some center. Always OK.
127libIGCM_SX=${libIGCM_SX:=::modipsl::/libIGCM}
128
129#D- Increased verbosity (1, 2, 3)
130#D- Default : value from AA_job if any
131Verbosity=${Verbosity:=3}
132
133#D- Low level debug : to bypass lib test checks and stack construction
134#D- Default : value from AA_job if any
135DEBUG_debug=${DEBUG_debug:=false}
136
137#D- TEMPORARY Flag to determine atmospheric resolution
138#D- Default : value from atmospheric driver if any
139RESOL_ATM=${RESOL_ATM:=ALL}
140
141#D- TEMPORARY Flag to determine ocean resolution
142#D- Default : value from ocean driver if any
143RESOL_OCE=${RESOL_OCE:=ORCA2}
144
145#D- TEMPORARY Flag to determine ice resolution
146#D- Default : value from ice driver if any
147RESOL_ICE=${RESOL_ICE:=ORCA2}
148
149#D- TEMPORARY Flag to determine biogeochemistry resolution
150#D- Default : value from ice driver if any
151RESOL_MBG=${RESOL_MBG:=ORCA2}
152
153#D- Flag to determine surface resolution
154#D- Default : value from surface driver if any
155RESOL_SRF=ALL
156
157#D- Flag to determine surface resolution
158#D- Default : value from surface driver if any
159RESOL_SBG=ALL
160
161########################################################################
162
163. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
164. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
165. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
166#-------
167. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
168. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
169#-------
170( ${DEBUG_debug} ) && IGCM_debug_Check
171( ${DEBUG_debug} ) && IGCM_card_Check
172( ${DEBUG_debug} ) && IGCM_date_Check
173
174########################################################################
175
176#set -vx
177
178RUN_DIR=${RUN_DIR_PATH}
179IGCM_sys_MkdirWork ${RUN_DIR}
180IGCM_sys_Cd ${RUN_DIR}
181
182# ------------------------------------------------------------------
183# Test if all was right before proceeding further
184# ------------------------------------------------------------------
185IGCM_debug_Verif_Exit_Post
186
187#
188if [ ${RebuildFromArchive} = true ] ; then
189  ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
190else
191  ListAllRebuildDir=$( IGCM_sys_RshMaster ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
192fi
193#
194
195for directory in ${ListAllRebuildDir} ; do
196  #
197  if [ ${RebuildFromArchive} = true ] ; then
198    IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
199  else
200    IGCM_sys_Get_Master ${directory} ${RUN_DIR}
201  fi
202  #
203  IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
204
205  # --------------------------------------------------------------------
206  # Source function include in the REBUILD ksh and rebuild
207  # --------------------------------------------------------------------
208  . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
209  IGCM_FlushRebuild
210  #
211  IGCM_sys_Cd ${RUN_DIR}
212  # Clean Up
213  # local clean up
214  IGCM_sys_Rm -rf $( basename ${directory} )
215  # remote clean up
216  if [ ${RebuildFromArchive} = true ] ; then
217    IGCM_sys_RshArchive rm -rf ${directory}
218  else
219    IGCM_sys_Rm -rf ${directory}
220  fi
221done
222
223# Clean RUN_DIR_PATH (necessary for cesium and titane only)
224IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
225
226date
Note: See TracBrowser for help on using the repository browser.