source: trunk/libIGCM/AA_rebuild_fromWorkdir @ 1029

Last change on this file since 1029 was 1029, checked in by sdipsl, 10 years ago

See #198: Add ssd header examples

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