source: trunk/libIGCM/AA_SaveSourceModifications @ 640

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

Add norerun option on SX front-end. Transfer specific files ie config.card COMP ... with IGCM_sys_Get_Master and modify IGCM_sys_Get_Master to allow file transfer. tested on ulam and SX front-end.

  • Property svn:executable set to *
File size: 5.6 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- lxiv8 ###################### ???
56#-Q- lxiv8 ## OBELIX      LSCE ##
57#-Q- lxiv8 ######################
58#-Q- lxiv8 #PBS -N SaveSource
59#-Q- lxiv8 #PBS -m a
60#-Q- lxiv8 #PBS -j oe
61#-Q- lxiv8 #PBS -q test 
62#-Q- lxiv8 #PBS -o SaveSource.$$
63#-Q- lxiv8 #PBS -S /bin/ksh
64#-Q- default #!/bin/ksh
65#-Q- default ##################
66#-Q- default ## DEFAULT HOST ##
67#-Q- default ##################
68
69#**************************************************************
70# Author: Martial Mancip
71# Contact: Martial.Mancip__at__ipsl.jussieu.fr
72# $Revision::                                          $ Revision of last commit
73# $Author::                                            $ Author of last commit
74# $Date::                                              $ Date of last commit
75# IPSL (2006)
76#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
77#
78#**************************************************************
79
80#set -eu
81#set -vx
82
83date
84
85#-Q- sx8brodie export OMP_NUM_THREADS=1
86#-Q- aix6 export OMP_NUM_THREADS=1
87
88MODIPSL=::modipsl::
89
90#D- Path to libIGCM
91#D- Default : value from AA_job if any
92# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
93# WARNING you must check MirrorlibIGCM variable in sys library.
94# WARNING If this variable is true, you must use libIGCM_POST path instead
95# WARNING of your running libIGCM directory.
96libIGCM=${libIGCM:=::modipsl::/libIGCM}
97
98. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
99      ( ${DEBUG_debug} ) && IGCM_debug_Check
100#-------
101. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
102. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
103
104IGCM_sys_MkdirWork ${RUN_DIR_PATH}
105IGCM_sys_Cd ${RUN_DIR_PATH}
106
107ExeOutDateMax=${ExeOutDateMax:=$1}
108R_OUT_EXE=${R_OUT_EXE:=$2}
109PREFIX=${PREFIX:=$3}
110SUBMIT_DIR=${SUBMIT_DIR:=$4}
111
112cd ${MODIPSL};
113${MODIPSL}/util/script_diff_model ${SUBMIT_DIR} > ${RUN_DIR_PATH}/out_script_diff_model 2>&1
114echo "script_diff_model return" $? >> ${RUN_DIR_PATH}/out_script_diff_model 2>&1
115cd ${RUN_DIR_PATH}
116
117ERR_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&" )
118
119if [ ! X${ERR_script_diff_model} = X0 ] ; then
120    echo 'Error in script_diff_model :' ${ERR_script_diff_model}
121    exit ${ERR_script_diff_model}
122fi
123
124MODIPSL_SAVE_NAME=$( cat out_script_diff_model | grep "SAVE directory in" | sed -e "s&SAVE directory in  &&" )
125MODIPSL_SAVE=${MODIPSL}/tmp/${MODIPSL_SAVE_NAME}
126if ( [ X${MODIPSL_SAVE_NAME} = X ] || [ ! -d ${MODIPSL_SAVE} ] ) ; then
127    echo 'Error in SaveSourceModifications: no MODIPSL_SAVE_NAME avaible. We STOP'
128    exit 1
129fi
130
131MaxModifiedDate=$( tail -1 ${MODIPSL_SAVE}/Last_log )
132
133cd ${MODIPSL}/tmp
134IGCM_sys_Tar ${RUN_DIR_PATH}/${MODIPSL_SAVE_NAME}.tar ${MODIPSL_SAVE_NAME}
135cd -
136if ( ! ${DEBUG_debug} ) ; then
137    IGCM_sys_Rm -rf ${MODIPSL_SAVE}
138fi
139
140if [ ${MaxModifiedDate} -lt ${ExeOutDateMax} ] ; then
141    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_certified.tar
142else
143    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_NOTcertified.tar
144fi
145if ( ! ${DEBUG_debug} ) ; then
146    IGCM_sys_Rm ${MODIPSL_SAVE_NAME}.tar
147fi
148
149# Clean RUN_DIR_PATH (necessary for cesium and titane only)
150if ( ! ${DEBUG_debug} ) ; then
151    IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
152fi
Note: See TracBrowser for help on using the repository browser.