source: trunk/libIGCM/AA_monitoring @ 837

Last change on this file since 837 was 837, checked in by labetoulle, 11 years ago

On Curie, ins_job sets up project ID. See #98.

Add

#-Q- curie #MSUB -A ::default_project::

to job headers, to be replaced by proper project ID by ins_job.

  • 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.3 KB
Line 
1#-Q- curie ######################
2#-Q- curie ## CURIE   TGCC/CEA ##
3#-Q- curie ######################
4#-Q- curie #MSUB -r MONITORING     # Nom du job
5#-Q- curie #MSUB -eo
6#-Q- curie #MSUB -n 1              # Reservation du processus
7#-Q- curie #MSUB -T 86400          # Limite de temps elapsed du job
8#-Q- curie #MSUB -q xlarge
9#-Q- curie #MSUB -Q normal
10#-Q- curie #MSUB -A ::default_project::
11#-Q- curie set +x
12#-Q- ada #!/bin/ksh
13#-Q- ada #######################
14#-Q- ada ##   ADA   IDRIS  ##
15#-Q- ada #######################
16#-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss
17#-Q- ada # @ wall_clock_limit = 1:00:00
18#-Q- ada # Nom du travail LoadLeveler
19#-Q- ada # @ job_name   = MONITORING
20#-Q- ada # Fichier de sortie standard du travail
21#-Q- ada # @ output     = $(job_name).$(jobid)
22#-Q- ada # Fichier de sortie d'erreur du travail
23#-Q- ada # @ error      =  $(job_name).$(jobid)
24#-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
25#-Q- ada # @ notification = error
26#-Q- ada # @ environment  = $POST_DIR ; $SUBMIT_DIR ; $libIGCM ; $libIGCM_SX ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $R_SAVE ; $config_UserChoices_JobName ; $config_UserChoices_TagName ; $YEARS ; $MASTER
27#-Q- ada # @ queue
28#-Q- sx9mercure #!/bin/ksh
29#-Q- sx9mercure ######################
30#-Q- sx9mercure ## SX9MERCURE  CCRT ##
31#-Q- sx9mercure ######################
32#-Q- sx9mercure #PBS -N  MONITORING          # Nom du job
33#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
34#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
35#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
36#-Q- sx9mercure #PBS -l elapstim_req=1:00:00   # Limite temps a 2 heures
37#-Q- sx9mercure #PBS -q scalaire
38#-Q- sx9mercure #PBS -r n
39#-Q- titane #!/bin/ksh
40#-Q- titane ######################
41#-Q- titane ## TITANE   CEA ##
42#-Q- titane ######################
43#-Q- titane #MSUB -r MONITORING     # Nom du job
44#-Q- titane #MSUB -eo
45#-Q- titane #MSUB -n 1              # Reservation du processus
46#-Q- titane #MSUB -T 86400          # Limite de temps elapsed du job
47#-Q- titane #MSUB -q mono
48#-Q- titane #MSUB -E '-rn'
49#-Q- lxiv8 ######################
50#-Q- lxiv8 ## OBELIX      LSCE ##
51#-Q- lxiv8 ######################
52#-Q- lxiv8 #PBS -N MONITORING
53#-Q- lxiv8 #PBS -m a
54#-Q- lxiv8 #PBS -j oe
55#-Q- lxiv8 #PBS -q medium
56#-Q- lxiv8 #PBS -o MONITORING.$$
57#-Q- lxiv8 #PBS -S /bin/ksh
58#-Q- default #!/bin/ksh
59#-Q- default ##################
60#-Q- default ## DEFAULT HOST ##
61#-Q- default ##################
62
63#**************************************************************
64# Author: Sebastien Denvil
65# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
66# $Revision::                                          $ Revision of last commit
67# $Author::                                            $ Author of last commit
68# $Date::                                              $ Date of last commit
69# IPSL (2006)
70#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
71#
72#**************************************************************
73
74#set -eu
75#set -vx
76
77date
78
79#-Q- ada export OMP_NUM_THREADS=1
80
81#D- Task type (computing or post-processing)
82TaskType=post-processing
83
84########################################################################
85
86#D- Flag to determine if this job in a standalone mode
87#D- Default : value from AA_job if any
88StandAlone=${StandAlone:=true}
89
90#D- Path to libIGCM
91#D- Default : value from AA_job if any
92# WARNING For StandAlone use : To run this script on some machine (ada and cesium)
93# WARNING you must check MirrorlibIGCM variable in sys library.
94# WARNING If this variable is true, you must use libIGCM_POST path instead
95# WARNING of your running libIGCM directory.
96libIGCM=${libIGCM:=::modipsl::/libIGCM}
97
98#D- Increased verbosity (1, 2, 3)
99#D- Default : value from AA_job if any
100Verbosity=${Verbosity:=3}
101
102#D- Low level debug : to bypass lib test checks and stack construction
103#D- Default : value from AA_job if any
104DEBUG_debug=${DEBUG_debug:=false}
105
106#D- TEMPORARY Flag to determine atmospheric resolution
107#D- Default : value from atmospheric driver if any
108RESOL_ATM=${RESOL_ATM:=ALL}
109
110#D- Flag to determine surface resolution
111#D- Default : value from surface driver if any
112RESOL_SRF=${RESOL_SRF:=ALL}
113
114#D- Flag to determine surface resolution
115#D- Default : value from surface driver if any
116RESOL_SBG=${RESOL_SBG:=ALL}
117
118#D- TEMPORARY Flag to determine ocean resolution
119#D- Default : value from ocean driver if any
120RESOL_OCE=${RESOL_OCE:=ORCA2}
121
122#D- TEMPORARY Flag to determine ice resolution
123#D- Default : value from ice driver if any
124RESOL_ICE=${RESOL_ICE:=ORCA2}
125
126#D- TEMPORARY Flag to determine marine biogeochemistry resolution
127#D- Default : value from ice driver if any
128RESOL_MBG=${RESOL_MBG:=ORCA2}
129
130######################################################################
131
132. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
133. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
134. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
135#-------
136. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
137. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
138#-------
139( ${DEBUG_debug} ) && IGCM_debug_Check
140( ${DEBUG_debug} ) && IGCM_card_Check
141( ${DEBUG_debug} ) && IGCM_date_Check
142
143######################################################################
144
145#set -vx
146
147#===========================================
148RUN_DIR=${RUN_DIR_PATH}
149IGCM_sys_MkdirWork ${RUN_DIR}
150IGCM_sys_Cd ${RUN_DIR}
151
152# ------------------------------------------------------------------
153# Test if all was right before proceeding further
154# ------------------------------------------------------------------
155IGCM_debug_Verif_Exit_Post
156
157if [ ${StandAlone} = true ] ; then
158  CARD_DIR=${SUBMIT_DIR}
159else
160  CARD_DIR=${RUN_DIR}
161  IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
162  IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
163  IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
164  IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
165fi
166
167#==================================
168# First of all
169#
170# Read libIGCM compatibility version in config.card
171# Read UserChoices section
172# Read Ensemble section
173# Read Post section
174# Define all netcdf output directories
175#==================================
176IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
177
178#==================================
179# Read ListOfComponents section:
180IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
181
182# Create R_FIGR that has been defined by IGCM_config_CommonConfiguration
183IGCM_sys_MkdirArchive ${R_FIGR}
184#
185IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING
186if [ $? = 0 ] ; then
187  IGCM_debug_Print 1 "Get MONITORING directory from archive"
188  IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR}
189else
190  IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before"
191fi
192# --------------------------------------------
193# Insert your commands between III...III lines
194# and precise produced directories to save
195# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
196
197for comp in ${config_ListOfComponents[*]} ; do
198  IGCM_debug_Print 1 "################## Component: ${comp} ######################"
199  liste_file_monitoring=""
200  IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
201  eval compname=\${config_ListOfComponents_${comp}[0]}                > /dev/null 2>&1
202
203  PATH_monitoring_file=""
204  eval monitoring_file=monitoring01_${compname}_\${RESOL_${comp}}.cfg > /dev/null 2>&1
205  if [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/monitoring01_${compname}.cfg ]] ; then
206    PATH_monitoring_file=${CARD_DIR}/POST/monitoring01_${compname}.cfg
207  elif [ -f ${FER_ATLAS}/${monitoring_file} ] ; then
208    PATH_monitoring_file=${FER_ATLAS}/${monitoring_file}
209  else
210    IGCM_debug_Print 1 "No monitoring file found for this component. Was expecting ${monitoring_file}"
211    IGCM_debug_Print 1 "Step to next component"
212    continue
213  fi
214  #
215  if [ X${PATH_monitoring_file} != X"" ] ; then
216    IGCM_debug_Print 1 "Monitoring file used : ${PATH_monitoring_file}"
217    IGCM_debug_Print 1 "Determine which files we need."
218    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO
219    liste_file_monitoring=$( . monitoring01 -q -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO )
220  fi
221  #
222  if [ ! "X${liste_file_monitoring}" = X ] ; then
223    IGCM_sys_Get /l liste_file_monitoring ${RUN_DIR}
224    IGCM_debug_Print 1 "monitoring01 -c ${CARD_DIR} -p ${comp} --time -t \"${config_UserChoices_JobName} monitoring\" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} ."
225    IGCM_debug_Print 1 "monitoring01 starts ................................................."
226    monitoring01 -c ${CARD_DIR} -p ${comp} --time -t "${config_UserChoices_JobName} monitoring" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} .
227  else
228    IGCM_debug_Print 1 "No time series detected by this command :"
229    IGCM_debug_Print 1 "monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO"
230    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO
231  fi
232  #
233done
234
235# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
236
237# Save files
238IGCM_sys_Put_Dir MONITORING ${R_FIGR}
239
240# Dods copy
241IGCM_sys_Put_Dods MONITORING
242
243# Clean RUN_DIR_PATH (necessary for cesium and titane only)
244IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.