source: trunk/libIGCM/AA_monitoring @ 1498

Last change on this file since 1498 was 1498, checked in by acosce, 5 years ago

Add header for monitoring job on jeanzay - comment ccc_hsm get on libIGCM_sys_jeanzay -> need to find the command adapted to this computing center

  • 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: 11.1 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 -o MONITORING.out_%I
6#-Q- curie #MSUB -e MONITORING.out_%I
7#-Q- curie #MSUB -n 1              # Reservation du processus
8#-Q- curie #MSUB -T 80000          # Limite de temps elapsed du job
9#-Q- curie #MSUB -q ::default_node::
10#-Q- curie #MSUB -c ::default_core::
11#-Q- curie #MSUB -Q normal
12#-Q- curie #MSUB -A ::default_project::
13#-Q- curie set +x
14#-Q- irene ######################
15#-Q- irene ## IRENE   TGCC/CEA ##
16#-Q- irene ######################
17#-Q- irene #MSUB -r MONITORING    # Job name
18#-Q- irene #MSUB -o MONITORING.out_%I
19#-Q- irene #MSUB -e MONITORING.out_%I
20#-Q- irene #MSUB -n 1             # Number of cores
21#-Q- irene #MSUB -T 80000         # Maximum elapsed time
22#-Q- irene #MSUB -q ::default_node::
23#-Q- irene #MSUB -c ::default_core::
24#-Q- irene #MSUB -Q normal
25#-Q- irene #MSUB -A ::default_post_project::
26#-Q- irene #MSUB -m store,work,scratch
27#-Q- irene set +x
28#-Q- jeanzay #!/bin/ksh
29#-Q- jeanzay ######################
30#-Q- jeanzay ## JEANZAY    IDRIS ##
31#-Q- jeanzay ######################
32#-Q- jeanzay #SBATCH --job-name=MONITORING         # Job Name
33#-Q- jeanzay #SBATCH --output=MONITORING.out_%I    # standard output
34#-Q- jeanzay #SBATCH --error=MONITORING.out_%I     # error output
35#-Q- jeanzay #SBATCH --ntasks=1                    # Number of core
36#-Q- jeanzay #SBATCH --hint=nomultithread          # 1 processus MPI par coeur physique (pas d'hyperthreading)
37#-Q- jeanzay #SBATCH --time=10:00:00               # Wall clock limit (seconds)
38#-Q- jeanzay #SBATCH --account ::default_project::@cpu
39#-Q- jeanzay set +x
40#-Q- ada #!/bin/ksh
41#-Q- ada #######################
42#-Q- ada ## ADA         IDRIS ##
43#-Q- ada #######################
44#-Q- ada # @ job_type = mpich
45#-Q- ada # @ requirements = (Feature == "prepost")
46#-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss
47#-Q- ada # @ wall_clock_limit = 4:00:00
48#-Q- ada # Memory required for ferret (_SEP _MAR variables)
49#-Q- ada # @ as_limit = 30Gb
50#-Q- ada # Nom du travail LoadLeveler
51#-Q- ada # @ job_name   = MONITORING
52#-Q- ada # Fichier de sortie standard du travail
53#-Q- ada # @ output     = $(job_name).$(jobid)
54#-Q- ada # Fichier de sortie d'erreur du travail
55#-Q- ada # @ error      =  $(job_name).$(jobid)
56#-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
57#-Q- ada # @ notification = error
58#-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; wall_clock_limit=$(wall_clock_limit)
59#-Q- ada # @ queue
60#-Q- lxiv8 ######################
61#-Q- lxiv8 ## OBELIX      LSCE ##
62#-Q- lxiv8 ######################
63#-Q- lxiv8 #PBS -N MONITORING
64#-Q- lxiv8 #PBS -m a
65#-Q- lxiv8 #PBS -j oe
66#-Q- lxiv8 #PBS -q medium
67#-Q- lxiv8 #PBS -o MONITORING.$$
68#-Q- lxiv8 #PBS -S /bin/ksh
69#-Q- ifort_CICLAD ######################
70#-Q- ifort_CICLAD ##   CICLAD    IPSL ##
71#-Q- ifort_CICLAD ######################
72#-Q- ifort_CICLAD #PBS -N MONITORING
73#-Q- ifort_CICLAD #PBS -m a
74#-Q- ifort_CICLAD #PBS -j oe
75#-Q- ifort_CICLAD #PBS -q std
76#-Q- ifort_CICLAD #PBS -S /bin/ksh
77#-Q- default #!/bin/ksh
78#-Q- default ##################
79#-Q- default ## DEFAULT HOST ##
80#-Q- default ##################
81
82#**************************************************************
83# Author: Sebastien Denvil
84# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
85# $Revision::                                          $ Revision of last commit
86# $Author::                                            $ Author of last commit
87# $Date::                                              $ Date of last commit
88# IPSL (2006)
89#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
90#
91#**************************************************************
92
93#set -eu
94#set -vx
95
96date
97
98#-Q- ada export OMP_NUM_THREADS=1
99
100#D- Task type DO NOT CHANGE (computing, post-processing or checking)
101TaskType=post-processing
102
103########################################################################
104
105#D- Flag to determine if this job in a standalone mode
106#D- Default : value from AA_job if any
107StandAlone=${StandAlone:=true}
108
109#D- Path to libIGCM
110#D- Default : value from AA_job if any
111# WARNING For StandAlone use : To run this script on some machine (ada and cesium)
112# WARNING you must check MirrorlibIGCM variable in sys library.
113# WARNING If this variable is true, you must use libIGCM_POST path instead
114# WARNING of your running libIGCM directory.
115libIGCM=${libIGCM:=::modipsl::/libIGCM}
116
117#D- Increased verbosity (1, 2, 3)
118#D- Default : value from AA_job if any
119Verbosity=${Verbosity:=3}
120
121#D- Low level debug : to bypass lib test checks and stack construction
122#D- Default : value from AA_job if any
123DEBUG_debug=${DEBUG_debug:=false}
124
125#D- TEMPORARY Flag to determine atmospheric resolution
126#D- Default : value from atmospheric driver if any
127RESOL_ATM=${RESOL_ATM:=ALL}
128
129#D- Flag to determine surface resolution
130#D- Default : value from surface driver if any
131RESOL_SRF=${RESOL_SRF:=ALL}
132
133#D- Flag to determine surface resolution
134#D- Default : value from surface driver if any
135RESOL_SBG=${RESOL_SBG:=ALL}
136
137#D- TEMPORARY Flag to determine ocean resolution
138#D- Default : value from ocean driver if any
139RESOL_OCE=${RESOL_OCE:=ORCA2}
140
141#D- TEMPORARY Flag to determine ice resolution
142#D- Default : value from ice driver if any
143RESOL_ICE=${RESOL_OCE:=ORCA2}
144
145#D- TEMPORARY Flag to determine marine biogeochemistry resolution
146#D- Default : value from ice driver if any
147RESOL_MBG=${RESOL_OCE:=ORCA2}
148
149######################################################################
150
151. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
152. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
153. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
154#-------
155. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
156. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
157#-------
158RUN_DIR=${RUN_DIR_PATH}
159IGCM_sys_MkdirWork ${RUN_DIR}
160IGCM_sys_Cd ${RUN_DIR}
161#-------
162( ${DEBUG_debug} ) && IGCM_debug_Check
163( ${DEBUG_debug} ) && IGCM_card_Check
164( ${DEBUG_debug} ) && IGCM_date_Check
165
166######################################################################
167
168#set -vx
169
170# ------------------------------------------------------------------
171# Test if all was right before proceeding further
172# ------------------------------------------------------------------
173IGCM_debug_Verif_Exit
174
175if [ ${StandAlone} = true ] ; then
176  CARD_DIR=${SUBMIT_DIR}
177else
178  CARD_DIR=${RUN_DIR}
179  IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
180  IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
181  IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
182  IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
183fi
184
185#==================================
186# First of all
187#
188# Read libIGCM compatibility version in config.card
189# Read UserChoices section
190# Read Ensemble section
191# Read Post section
192# Define all netcdf output directories
193#==================================
194IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
195
196# ------------------------------------------------------------------
197# Activate BigBrother so as to supervise this job
198# ------------------------------------------------------------------
199IGCM_debug_BigBro_Initialize
200
201#==================================
202# Read ListOfComponents section:
203IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents
204
205# Create R_FIGR that has been defined by IGCM_config_CommonConfiguration
206IGCM_sys_MkdirArchive ${R_FIGR}
207#
208IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING
209if [ $? = 0 ] ; then
210  IGCM_debug_Print 1 "Get MONITORING directory from archive"
211  IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR}
212else
213  IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before"
214fi
215# --------------------------------------------
216# Insert your commands between III...III lines
217# and precise produced directories to save
218# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
219
220for comp in ${config_ListOfComponents[*]} ; do
221  IGCM_debug_Print 1 "################## Component: ${comp} ######################"
222  liste_file_monitoring=""
223  IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
224  eval compname=\${config_ListOfComponents_${comp}[0]}                > /dev/null 2>&1
225
226  PATH_monitoring_file=""
227  eval monitoring_file=monitoring01_${compname}_\${RESOL_${comp}}.cfg > /dev/null 2>&1
228  if [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/${monitoring_file} ]] ; then
229    PATH_monitoring_file=${CARD_DIR}/POST/${monitoring_file}
230  elif [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/monitoring01_${compname}.cfg ]] ; then
231    PATH_monitoring_file=${CARD_DIR}/POST/monitoring01_${compname}.cfg
232  elif [ -f ${FER_ATLAS}/${monitoring_file} ] ; then
233    PATH_monitoring_file=${FER_ATLAS}/${monitoring_file}
234  else
235    IGCM_debug_Print 1 "No monitoring file found for this component. Was expecting ${monitoring_file}"
236    IGCM_debug_Print 1 "Step to next component"
237    continue
238  fi
239  #
240  if [ X${PATH_monitoring_file} != X"" ] ; then
241    IGCM_debug_Print 1 "Monitoring file used : ${PATH_monitoring_file}"
242    IGCM_debug_Print 1 "Determine which frequency of time series to be used."
243
244    FreqTS=$( grep FreqTS ${PATH_monitoring_file} | grep -v \# | awk -F "=" '{print $2}' )
245    if [ X${FreqTS} = X ] ; then
246      # Default frequency is MO
247      FreqTS=MO
248    fi
249
250    IGCM_debug_Print 1 "Times series frequency to be used is ${FreqTS}"
251    IGCM_debug_Print 1 "Determine which files we need."
252    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}
253    liste_file_monitoring=$( . monitoring01 -q -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} )
254  fi
255  #
256  if [ ! "X${liste_file_monitoring}" = X ] ; then
257    IGCM_sys_Get /l liste_file_monitoring ${RUN_DIR}
258    IGCM_debug_Print 1 "monitoring01 -c ${CARD_DIR} -p ${comp} --time -t \"${config_UserChoices_JobName} monitoring\" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} ."
259    IGCM_debug_Print 1 "monitoring01 starts ................................................."
260    monitoring01 -c ${CARD_DIR} -p ${comp} --time -t "${config_UserChoices_JobName} monitoring" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} .
261  else
262    IGCM_debug_Print 1 "No time series detected by this command :"
263    IGCM_debug_Print 1 "monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}"
264    . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}
265  fi
266
267  # Now do cleaning before starting with next component
268  rm -f ${RUN_DIR}/*nc
269
270done
271
272# IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
273
274# Save files
275IGCM_sys_Put_Dir MONITORING ${R_FIGR}
276
277# Dods copy
278if [ X${config_Post_DodsCopy} = XTRUE ]  ; then
279  IGCM_sys_Put_Dods MONITORING
280fi
281
282# Clean RUN_DIR_PATH (necessary for cesium and titane only)
283IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
284
285# ------------------------------------------------------------------
286# Finalize BigBrother to inform that the jobs end
287# ------------------------------------------------------------------
288IGCM_debug_BigBro_Finalize
Note: See TracBrowser for help on using the repository browser.