source: tags/libIGCM_v2.0_rc1/AA_SaveSourceModifications @ 1137

Last change on this file since 1137 was 712, checked in by aclsce, 12 years ago
  • Added TaskType? variable in jobs to specify the type of the job (computing or post-processing).
  • Added the use of TaskType? variable in Curie libsys to source the appropriate .atlas_env* configuration file.
  • 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
89#D- Task type (computing or post-processing)
90TaskType=post-processing
91
92MODIPSL=::modipsl::
93
94#D- Path to libIGCM
95#D- Default : value from AA_job if any
96# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
97# WARNING you must check MirrorlibIGCM variable in sys library.
98# WARNING If this variable is true, you must use libIGCM_POST path instead
99# WARNING of your running libIGCM directory.
100libIGCM=${libIGCM:=::modipsl::/libIGCM}
101
102. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
103      ( ${DEBUG_debug} ) && IGCM_debug_Check
104#-------
105. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
106. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
107
108IGCM_sys_MkdirWork ${RUN_DIR_PATH}
109IGCM_sys_Cd ${RUN_DIR_PATH}
110
111ExeOutDateMax=${ExeOutDateMax:=$1}
112R_OUT_EXE=${R_OUT_EXE:=$2}
113PREFIX=${PREFIX:=$3}
114SUBMIT_DIR=${SUBMIT_DIR:=$4}
115
116cd ${MODIPSL};
117${MODIPSL}/util/script_diff_model ${SUBMIT_DIR} > ${RUN_DIR_PATH}/out_script_diff_model 2>&1
118echo "script_diff_model return" $? >> ${RUN_DIR_PATH}/out_script_diff_model 2>&1
119cd ${RUN_DIR_PATH}
120
121ERR_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&" )
122
123if [ ! X${ERR_script_diff_model} = X0 ] ; then
124    echo 'Error in script_diff_model :' ${ERR_script_diff_model}
125    exit ${ERR_script_diff_model}
126fi
127
128MODIPSL_SAVE_NAME=$( cat out_script_diff_model | grep "SAVE directory in" | sed -e "s&SAVE directory in  &&" )
129MODIPSL_SAVE=${MODIPSL}/tmp/${MODIPSL_SAVE_NAME}
130if ( [ X${MODIPSL_SAVE_NAME} = X ] || [ ! -d ${MODIPSL_SAVE} ] ) ; then
131    echo 'Error in SaveSourceModifications: no MODIPSL_SAVE_NAME avaible. We STOP'
132    exit 1
133fi
134
135MaxModifiedDate=$( tail -1 ${MODIPSL_SAVE}/Last_log )
136
137cd ${MODIPSL}/tmp
138IGCM_sys_Tar ${RUN_DIR_PATH}/${MODIPSL_SAVE_NAME}.tar ${MODIPSL_SAVE_NAME}
139cd -
140if ( ! ${DEBUG_debug} ) ; then
141    IGCM_sys_Rm -rf ${MODIPSL_SAVE}
142fi
143
144if [ ${MaxModifiedDate} -lt ${ExeOutDateMax} ] ; then
145    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_certified.tar
146else
147    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_NOTcertified.tar
148fi
149if ( ! ${DEBUG_debug} ) ; then
150    IGCM_sys_Rm ${MODIPSL_SAVE_NAME}.tar
151fi
152
153# Clean RUN_DIR_PATH (necessary for cesium and titane only)
154if ( ! ${DEBUG_debug} ) ; then
155    IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
156fi
Note: See TracBrowser for help on using the repository browser.