source: trunk/libIGCM/AA_monitoring @ 1510

Last change on this file since 1510 was 1501, checked in by acosce, 4 years ago

change in post treatment Jean Zay job header to add jobid in the log out file

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