source: trunk/libIGCM/AA_rebuild_fromWorkdir @ 1510

Last change on this file since 1510 was 1468, checked in by mafoipsl, 6 years ago

On curie : set output files for all jobs.

On irene :

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