source: trunk/libIGCM/AA_SaveSourceModifications @ 530

Last change on this file since 530 was 530, checked in by mmaipsl, 13 years ago

correct SaveSourceModification?.job : OK for titane.

  • Property svn:executable set to *
File size: 6.8 KB
Line 
1#-Q- platine #!/usr/bin/ksh
2#-Q- platine ###################
3#-Q- platine ## PLATINE   CEA ##
4#-Q- platine ###################
5#-Q- platine #BSUB -J SaveSource                     # Nom du job
6#-Q- platine #BSUB -N                        # message a la fin du job
7#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
8#-Q- platine #BSUB -W 0:10                   # Limite temps
9#-Q- platine #BSUB -q post              # Passage en queue post
10#-Q- platine #BSUB -L /bin/ksh
11#-Q- sx8brodie #!/bin/ksh
12#-Q- sx8brodie #######################
13#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
14#-Q- sx8brodie #######################
15#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
16#-Q- sx8brodie # @ wall_clock_limit = 00:10:00
17#-Q- sx8brodie # Nom du travail LoadLeveler
18#-Q- sx8brodie # @ job_name   = SaveSource
19#-Q- sx8brodie # Fichier de sortie standard du travail       
20#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
21#-Q- sx8brodie # Fichier de sortie d'erreur du travail
22#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
23#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
24#-Q- sx8brodie # @ notification = error
25#-Q- sx8brodie # @ environment  = $MODIPSL ; $ExeOutDateMax ; $R_OUT_EXE ; $PREFIX ; $SUBMIT_DIR
26#-Q- sx8brodie # @ queue
27#-Q- aix6 #!/bin/ksh
28#-Q- aix6 #######################
29#-Q- aix6 ##   VARGAS   IDRIS  ##
30#-Q- aix6 #######################
31#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
32#-Q- aix6 # @ wall_clock_limit = 00:10:00
33#-Q- aix6 # Nom du travail LoadLeveler
34#-Q- aix6 # @ job_name   = SaveSource
35#-Q- aix6 # Fichier de sortie standard du travail       
36#-Q- aix6 # @ output     = $(job_name).$(jobid)
37#-Q- aix6 # Fichier de sortie d'erreur du travail
38#-Q- aix6 # @ error      =  $(job_name).$(jobid)
39#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
40#-Q- aix6 # @ notification = error
41#-Q- aix6 # @ environment  = $MODIPSL ; $ExeOutDateMax ; $R_OUT_EXE ; $PREFIX ; $SUBMIT_DIR
42#-Q- aix6 # @ queue
43#-Q- sx8mercure #!/bin/ksh
44#-Q- sx8mercure ######################
45#-Q- sx8mercure ## SX8MERCURE   CEA ##
46#-Q- sx8mercure ######################
47#-Q- sx8mercure #PBS -N SaveSource           # Nom du job
48#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
49#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
50#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
51#-Q- sx8mercure #PBS -l cputim_job=0:10:00   # Limite temps a 1 heures
52#-Q- sx8mercure #PBS -q scalaire
53#-Q- sx9mercure #!/bin/ksh
54#-Q- sx9mercure #########################
55#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
56#-Q- sx9mercure #########################
57#-Q- sx9mercure #PBS -N SaveSource           # Nom du job
58#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
59#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
60#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
61#-Q- sx9mercure #PBS -l cputim_job=0:10:00   # Limite temps a 1 heures
62#-Q- sx9mercure #PBS -q scalaire
63#-Q- titane #!/bin/ksh
64#-Q- titane ######################
65#-Q- titane ## TITANE   CEA ##
66#-Q- titane ######################
67#-Q- titane #MSUB -r SaveSource     # Nom du job               
68#-Q- titane #MSUB -n 1              # Reservation du processus
69#-Q- titane #MSUB -T 1800           # Limite de temps elapsed du job
70#-Q- titane #MSUB -E "-eo"
71#-Q- titane #MSUB -E "-L /bin/ksh"
72#-Q- titane #MSUB -E "-Ep "${ExeOutDateMax}
73#-Q- titane #MSUB -E "-Ep "${R_OUT_EXE}
74#-Q- titane #MSUB -E "-Ep "${PREFIX}
75#-Q- titane #MSUB -E "-Ep "${SUBMIT_DIR}
76#-Q- titane #MSUB -q testext
77#-Q- lxiv8 ###################### ???
78#-Q- lxiv8 ## OBELIX      LSCE ##
79#-Q- lxiv8 ######################
80#-Q- lxiv8 #PBS -N SaveSource
81#-Q- lxiv8 #PBS -m a
82#-Q- lxiv8 #PBS -j oe
83#-Q- lxiv8 #PBS -q test 
84#-Q- lxiv8 #PBS -o SaveSource.$$
85#-Q- lxiv8 #PBS -S /bin/ksh
86#-Q- default #!/bin/ksh
87#-Q- default ##################
88#-Q- default ## DEFAULT HOST ##
89#-Q- default ##################
90
91#**************************************************************
92# Author: Martial Mancip
93# Contact: Martial.Mancip__at__ipsl.jussieu.fr
94# $Revision::                                          $ Revision of last commit
95# $Author::                                            $ Author of last commit
96# $Date::                                              $ Date of last commit
97# IPSL (2006)
98#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
99#
100#**************************************************************
101
102#set -eu
103#set -vx
104
105date
106
107#-Q- sx8brodie export OMP_NUM_THREADS=1
108#-Q- aix6 export OMP_NUM_THREADS=1
109
110MODIPSL=::modipsl::
111
112#D- Low level debug : to bypass lib test checks and stack construction
113#D- Default : value from AA_job if any
114libIGCM=${libIGCM:=::modipsl::/libIGCM}
115# WARNING for StandAlone used : To run this script on some machine,
116# you must check MirrorlibIGCM variable in sys library.
117# If this variable is true, you must use libIGCM_POST path instead
118# of your running libIGCM directory.
119
120. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
121      ( ${DEBUG_debug} ) && IGCM_debug_Check
122#-------
123. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
124. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
125
126IGCM_sys_MkdirWork ${RUN_DIR_PATH}
127IGCM_sys_Cd ${RUN_DIR_PATH}
128
129ExeOutDateMax=${ExeOutDateMax:=$1}
130R_OUT_EXE=${R_OUT_EXE:=$2}
131PREFIX=${PREFIX:=$3}
132SUBMIT_DIR=${SUBMIT_DIR:=$4}
133
134IGCM_sys_RshMaster "cd ${MODIPSL};\
135                    . ${MODIPSL}/util/script_diff_model ${SUBMIT_DIR};\
136                    echo 'script_diff_model return ' \$?" > out_script_diff_model 2>&1
137
138ERR_script_diff_model=$( cat out_script_diff_model | grep "script_diff_model return [0-9]*" | sed -e "s&script_diff_model return *\([0-9]*\)&\1&" )
139
140if [ ! X${ERR_script_diff_model} = X0 ] ; then
141    echo 'Error in script_diff_model :' ${ERR_script_diff_model}
142    exit ${ERR_script_diff_model}
143fi
144
145MODIPSL_SAVE_NAME=$( cat out_script_diff_model | grep "SAVE directory in" | sed -e "s&SAVE directory in  &&" )
146MODIPSL_SAVE=${MODIPSL}/tmp/${MODIPSL_SAVE_NAME}
147if ( [ X${MODIPSL_SAVE_NAME} = X ] || [ ! -d ${MODIPSL_SAVE} ] ) ; then
148    echo 'Error in SaveSourceModifications: no MODIPSL_SAVE_NAME avaible. We STOP'
149    exit 1
150fi
151
152MaxModifiedDate=$( tail -1 ${MODIPSL_SAVE}/Last_log )
153
154cd ${MODIPSL}/tmp
155tar cf ${RUN_DIR_PATH}/${MODIPSL_SAVE_NAME}.tar ${MODIPSL_SAVE_NAME}
156cd -
157if ( ! ${DEBUG_debug} ) ; then
158    IGCM_sys_Rm -rf ${MODIPSL_SAVE}
159fi
160
161if [ ${MaxModifiedDate} -lt ${ExeOutDateMax} ] ; then
162    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_certified.tar
163else
164    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_NOTcertified.tar
165fi
166if ( ! ${DEBUG_debug} ) ; then
167    IGCM_sys_Rm ${MODIPSL_SAVE_NAME}.tar
168fi
169
170# Clean RUN_DIR_PATH (necessary for cesium)
171if ( ! ${DEBUG_debug} ) ; then
172    IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
173fi
Note: See TracBrowser for help on using the repository browser.