source: trunk/libIGCM/AA_rebuild_fromArchive @ 858

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