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