source: trunk/libIGCM/AA_monitoring @ 1579

Last change on this file since 1579 was 1573, checked in by jgipsl, 16 months ago

Monitoring has not been adapted for mesoipsl. Exit monitoring job in a quite ugly way...

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