source: trunk/libIGCM/AA_rebuild_fromWorkdir @ 1170

Last change on this file since 1170 was 1167, checked in by sdipsl, 9 years ago

run rebuild on standard node using iRAM high speed disk partition

  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

    The fact that you are presently reading this means that you have had
    knowledge of the CeCILL license and that you accept its terms.
  • Property svn:keywords set to Revision Author Date
File size: 7.6 KB
RevLine 
[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
[770]15#-Q- ada #!/bin/ksh
16#-Q- ada #######################
[929]17#-Q- ada ## ADA         IDRIS ##
[770]18#-Q- ada #######################
[848]19#-Q- ada # @ job_type = serial
20#-Q- ada # @ requirements = (Feature == "prepost")
[770]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
[1112]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
[770]32#-Q- ada # @ queue
[281]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
[108]42#-Q- default #!/bin/ksh
43#-Q- default ##################
44#-Q- default ## DEFAULT HOST ##
45#-Q- default ##################
46
[373]47#**************************************************************
48# Author: Sebastien Denvil
49# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
50# $Revision::                                          $ Revision of last commit
51# $Author::                                            $ Author of last commit
52# $Date::                                              $ Date of last commit
[108]53# IPSL (2006)
54#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
[373]55#
56#**************************************************************
[108]57
58#set -eu
59#set -vx
60
61date
62
[770]63#-Q- ada export OMP_NUM_THREADS=1
[108]64
[712]65#D- Task type (computing or post-processing)
66TaskType=post-processing
67
[108]68########################################################################
69
70#D- Flag to determine if this job in a standalone mode
71#D- Default : value from AA_job if any
72StandAlone=${StandAlone:=true}
73
[554]74#D- Path to libIGCM
[206]75#D- Default : value from AA_job if any
[554]76# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
77# WARNING you must check MirrorlibIGCM variable in sys library.
78# WARNING If this variable is true, you must use libIGCM_POST path instead
79# WARNING of your running libIGCM directory.
[229]80libIGCM=${libIGCM:=::modipsl::/libIGCM}
[206]81
[327]82#-D- $hostname of the MASTER job when SUBMIT_DIR is not visible on postprocessing computer.
[928]83MASTER=${MASTER:=ada|curie}
[327]84
[906]85#D- Directory where files we need to rebuild are store
[257]86#D- Default : value from AA_job if any
[1031]87#D- REBUILD_DIR=${BIGDIR}/REBUILD/TagName/JobName/
[257]88#D- example : /scratch/cont003/p86denv/REBUILD/IPSLCM5/SCAL-NEW
[206]89REBUILD_DIR=${REBUILD_DIR:=/path/to/your/TMP/REBUILD/FILES}
90
91#D- How many directory to rebuild we have to consider
92#D- Default : value from AA_job if any
[229]93NbRebuildDir=${NbRebuildDir:=1000}
[206]94
95#D- Suffix date we will use to determine which directory to rebuild
96#D- We will rebuild NbRebuildDir before and including PeriodDateBegin
97#D- Default : value from AA_job if any
[419]98LastPeriodForRebuild=${LastPeriodForRebuild:=${PeriodDateBegin:=18901201}}
[206]99
[108]100#D- Flag to determine atlas job's output directory
101#D- Default : value from libIGCM_post.ksh if any
102POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
103
[327]104#-D- libIGCM_SX contains libIGCM on Master computer. Required on some center. Always OK.
105libIGCM_SX=${libIGCM_SX:=::modipsl::/libIGCM}
106
[108]107#D- Increased verbosity (1, 2, 3)
108#D- Default : value from AA_job if any
109Verbosity=${Verbosity:=3}
110
111#D- Low level debug : to bypass lib test checks and stack construction
112#D- Default : value from AA_job if any
113DEBUG_debug=${DEBUG_debug:=false}
114
115#D- TEMPORARY Flag to determine atmospheric resolution
116#D- Default : value from atmospheric driver if any
[135]117RESOL_ATM=${RESOL_ATM:=ALL}
[108]118
119#D- TEMPORARY Flag to determine ocean resolution
120#D- Default : value from ocean driver if any
121RESOL_OCE=${RESOL_OCE:=ORCA2}
122
123#D- TEMPORARY Flag to determine ice resolution
124#D- Default : value from ice driver if any
125RESOL_ICE=${RESOL_ICE:=ORCA2}
126
[196]127#D- TEMPORARY Flag to determine biogeochemistry resolution
128#D- Default : value from ice driver if any
[178]129RESOL_MBG=${RESOL_MBG:=ORCA2}
130
[108]131#D- Flag to determine surface resolution
132#D- Default : value from surface driver if any
[213]133RESOL_SRF=ALL
[108]134
[213]135#D- Flag to determine surface resolution
136#D- Default : value from surface driver if any
137RESOL_SBG=ALL
[207]138
[108]139########################################################################
140
141. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
142. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
143. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
144#-------
145. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
[1117]146. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
[108]147. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
[832]148#-------
149( ${DEBUG_debug} ) && IGCM_debug_Check
150( ${DEBUG_debug} ) && IGCM_card_Check
151( ${DEBUG_debug} ) && IGCM_date_Check
[108]152
153########################################################################
154
155#set -vx
156
[202]157RUN_DIR=${RUN_DIR_PATH}
158IGCM_sys_MkdirWork ${RUN_DIR}
159IGCM_sys_Cd ${RUN_DIR}
[436]160
161# ------------------------------------------------------------------
162# Test if all was right before proceeding further
163# ------------------------------------------------------------------
164IGCM_debug_Verif_Exit_Post
[1112]165
166if [ ${StandAlone} = true ] ; then
167  CARD_DIR=${SUBMIT_DIR}
168else
169  CARD_DIR=${RUN_DIR}
170  IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
171  IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
172  IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
173  IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
174fi
175
176#==================================
177# First of all
[202]178#
[1112]179# Read libIGCM compatibility version in config.card
180# Read UserChoices section
181# Read Ensemble section
182# Read Post section
183# Define all netcdf output directories
184#==================================
185IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
186
187# Directory list to work with
[1031]188ListAllRebuildDir=$( IGCM_sys_RshMaster ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
[236]189
[108]190for directory in ${ListAllRebuildDir} ; do
[785]191  #
[1031]192  IGCM_sys_Get_Master ${directory} ${RUN_DIR}
[785]193  #
194  IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
[108]195
[785]196  # --------------------------------------------------------------------
197  # Source function include in the REBUILD ksh and rebuild
198  # --------------------------------------------------------------------
199  . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
200  IGCM_FlushRebuild
201  #
202  IGCM_sys_Cd ${RUN_DIR}
203  # Clean Up
204  # local clean up
205  IGCM_sys_Rm -rf $( basename ${directory} )
206  # remote clean up
[1031]207  IGCM_sys_RshMaster rm -rf ${directory}
[108]208done
[203]209
[590]210# Clean RUN_DIR_PATH (necessary for cesium and titane only)
[203]211IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
[590]212
213date
Note: See TracBrowser for help on using the repository browser.