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