source: tags/libIGCM_v2.0_beta3/AA_SaveSourceModifications

Last change on this file was 643, checked in by mafoipsl, 12 years ago

Add norerun options for jobs on titane and curie.

  • Property svn:executable set to *
File size: 5.7 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- aix6 #!/bin/ksh
16#-Q- aix6 #######################
17#-Q- aix6 ##   VARGAS   IDRIS  ##
18#-Q- aix6 #######################
19#-Q- sx8mercure #!/bin/ksh
20#-Q- sx8mercure ######################
21#-Q- sx8mercure ## SX8MERCURE   CEA ##
22#-Q- sx8mercure ######################
23#-Q- sx8mercure #PBS -N SaveSource           # Nom du job
24#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
25#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
26#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
27#-Q- sx8mercure #PBS -l cputim_job=0:10:00   # Limite temps a 1 heures
28#-Q- sx8mercure #PBS -q scalaire
29#-Q- sx8mercure #PBS -r n
30#-Q- sx9mercure #!/bin/ksh
31#-Q- sx9mercure #####################
32#-Q- sx9mercure ## SX9MERCURE  CEA ##
33#-Q- sx9mercure #####################
34#-Q- sx9mercure #PBS -N SaveSource           # Nom du job
35#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
36#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
37#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
38#-Q- sx9mercure #PBS -l elapstim_req=0:10:00   # Limite temps a 1 heures
39#-Q- sx9mercure #PBS -q scalaire
40#-Q- sx9mercure #PBS -r n
41#-Q- titane #!/bin/ksh
42#-Q- titane ######################
43#-Q- titane ## TITANE   CEA ##
44#-Q- titane ######################
45#-Q- titane #MSUB -r SaveSource     # Nom du job               
46#-Q- titane #MSUB -n 1              # Reservation du processus
47#-Q- titane #MSUB -T 1800           # Limite de temps elapsed du job
48#-Q- titane #MSUB -E "-eo"
49#-Q- titane #MSUB -E "-L /bin/ksh"
50#-Q- titane #MSUB -E "-Ep "${ExeOutDateMax}
51#-Q- titane #MSUB -E "-Ep "${R_OUT_EXE}
52#-Q- titane #MSUB -E "-Ep "${PREFIX}
53#-Q- titane #MSUB -E "-Ep "${SUBMIT_DIR}
54#-Q- titane #MSUB -q testext
55#-Q- titane #MSUB -E '-rn'
56#-Q- lxiv8 ###################### ???
57#-Q- lxiv8 ## OBELIX      LSCE ##
58#-Q- lxiv8 ######################
59#-Q- lxiv8 #PBS -N SaveSource
60#-Q- lxiv8 #PBS -m a
61#-Q- lxiv8 #PBS -j oe
62#-Q- lxiv8 #PBS -q test 
63#-Q- lxiv8 #PBS -o SaveSource.$$
64#-Q- lxiv8 #PBS -S /bin/ksh
65#-Q- default #!/bin/ksh
66#-Q- default ##################
67#-Q- default ## DEFAULT HOST ##
68#-Q- default ##################
69
70#**************************************************************
71# Author: Martial Mancip
72# Contact: Martial.Mancip__at__ipsl.jussieu.fr
73# $Revision::                                          $ Revision of last commit
74# $Author::                                            $ Author of last commit
75# $Date::                                              $ Date of last commit
76# IPSL (2006)
77#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
78#
79#**************************************************************
80
81#set -eu
82#set -vx
83
84date
85
86#-Q- sx8brodie export OMP_NUM_THREADS=1
87#-Q- aix6 export OMP_NUM_THREADS=1
88
89MODIPSL=::modipsl::
90
91#D- Path to libIGCM
92#D- Default : value from AA_job if any
93# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
94# WARNING you must check MirrorlibIGCM variable in sys library.
95# WARNING If this variable is true, you must use libIGCM_POST path instead
96# WARNING of your running libIGCM directory.
97libIGCM=${libIGCM:=::modipsl::/libIGCM}
98
99. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
100      ( ${DEBUG_debug} ) && IGCM_debug_Check
101#-------
102. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
103. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
104
105IGCM_sys_MkdirWork ${RUN_DIR_PATH}
106IGCM_sys_Cd ${RUN_DIR_PATH}
107
108ExeOutDateMax=${ExeOutDateMax:=$1}
109R_OUT_EXE=${R_OUT_EXE:=$2}
110PREFIX=${PREFIX:=$3}
111SUBMIT_DIR=${SUBMIT_DIR:=$4}
112
113cd ${MODIPSL};
114${MODIPSL}/util/script_diff_model ${SUBMIT_DIR} > ${RUN_DIR_PATH}/out_script_diff_model 2>&1
115echo "script_diff_model return" $? >> ${RUN_DIR_PATH}/out_script_diff_model 2>&1
116cd ${RUN_DIR_PATH}
117
118ERR_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&" )
119
120if [ ! X${ERR_script_diff_model} = X0 ] ; then
121    echo 'Error in script_diff_model :' ${ERR_script_diff_model}
122    exit ${ERR_script_diff_model}
123fi
124
125MODIPSL_SAVE_NAME=$( cat out_script_diff_model | grep "SAVE directory in" | sed -e "s&SAVE directory in  &&" )
126MODIPSL_SAVE=${MODIPSL}/tmp/${MODIPSL_SAVE_NAME}
127if ( [ X${MODIPSL_SAVE_NAME} = X ] || [ ! -d ${MODIPSL_SAVE} ] ) ; then
128    echo 'Error in SaveSourceModifications: no MODIPSL_SAVE_NAME avaible. We STOP'
129    exit 1
130fi
131
132MaxModifiedDate=$( tail -1 ${MODIPSL_SAVE}/Last_log )
133
134cd ${MODIPSL}/tmp
135IGCM_sys_Tar ${RUN_DIR_PATH}/${MODIPSL_SAVE_NAME}.tar ${MODIPSL_SAVE_NAME}
136cd -
137if ( ! ${DEBUG_debug} ) ; then
138    IGCM_sys_Rm -rf ${MODIPSL_SAVE}
139fi
140
141if [ ${MaxModifiedDate} -lt ${ExeOutDateMax} ] ; then
142    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_certified.tar
143else
144    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_NOTcertified.tar
145fi
146if ( ! ${DEBUG_debug} ) ; then
147    IGCM_sys_Rm ${MODIPSL_SAVE_NAME}.tar
148fi
149
150# Clean RUN_DIR_PATH (necessary for cesium and titane only)
151if ( ! ${DEBUG_debug} ) ; then
152    IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
153fi
Note: See TracBrowser for help on using the repository browser.