source: branches/libIGCM_MPI_OpenMP/AA_SaveSourceModifications @ 593

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

Second merge of libIGCM_MPI_OpenMP branch with libIGCM trunk, revision 591.

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