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