source: trunk/libIGCM/AA_rebuild @ 34

Last change on this file since 34 was 34, checked in by sdipsl, 15 years ago

SD : - 2 options for asynchronous rebuild

  • from SCRATCHDIR (very good for platine, the same for mercure)
  • from Archive (good for platine, good for mercure)
File size: 5.1 KB
Line 
1#-Q- platine #!/usr/bin/ksh
2#-Q- platine ###################
3#-Q- platine ## PLATINE   CEA ##
4#-Q- platine ###################
5#-Q- platine #BSUB -J REBUILD                # 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 4:00                   # Limite temps
9#-Q- platine #BSUB -q post                   # Passage en queue post
10#-Q- sx8brodie #######################
11#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
12#-Q- sx8brodie #######################
13#-Q- sx8brodie #QSUB -r REBUILD              # Nom du job
14#-Q- sx8brodie #QSUB -lT 4:00:00             # limite en temps total
15#-Q- sx8brodie #QSUB -lt 4:00:00             # limite en temps par process
16#-Q- sx8brodie #QSUB -lM 1Gb
17#-Q- sx8brodie #QSUB -eo                     # rassemble standard error et output
18#-Q- sx8brodie #QSUB -J m
19#-Q- sx8brodie #QSUB -l mpp_p=4
20#-Q- sx8brodie #QSUB -s /bin/ksh             # shell du job
21#-Q- sx8mercure #!/bin/ksh
22#-Q- sx8mercure ######################
23#-Q- sx8mercure ## SX8MERCURE   CEA ##
24#-Q- sx8mercure ######################
25#-Q- sx8mercure #PBS -N REBUILD              # Nom du job
26#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
27#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
28#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
29#-Q- sx8mercure #PBS -l cputim_job=24:00:00   # Limite temps a 1 heures
30#-Q- sx8mercure #PBS -q scalaire
31#-Q- default #!/bin/ksh
32#-Q- default ##################
33#-Q- default ## DEFAULT HOST ##
34#-Q- default ##################
35
36#set -vx
37
38date
39
40#-Q- sx8brodie export OMP_NUM_THREADS=1
41
42# $Date: $
43# $Author: $
44# $Revision: $
45# IPSL (2006)
46#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
47
48########################################################################
49
50#D- Flag to determine if this job in a standalone mode
51#D- Default : value from AA_job if any
52StandAlone=${StandAlone:=true}
53
54#D- Flag to determine atlas job's output directory
55#D- Default : value from libIGCM_post.ksh if any
56POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
57
58#D- Increased verbosity (1, 2, 3)
59#D- Default : value from AA_job if any
60Verbosity=${Verbosity:=3}
61
62#D- Low level debug : to bypass lib test checks and stack construction
63#D- Default : value from AA_job if any
64DEBUG_debug=${DEBUG_debug:=false}
65
66#D- Low level debug : to bypass lib test checks and stack construction
67#D- Default : value from AA_job if any
68libIGCM=${libIGCM:=/home/rech/ces/rces452/libIGCM}
69
70########################################################################
71
72. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
73        ( ${DEBUG_debug} ) && IGCM_debug_Check
74. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
75       ( ${DEBUG_debug} ) && IGCM_card_Check
76. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
77       ( ${DEBUG_debug} ) && IGCM_date_Check
78#-------
79. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
80. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
81
82########################################################################
83
84#set -vx
85
86if [ ${StandAlone} = true ] ; then
87    CARD_DIR=${SUBMIT_DIR}
88else
89    CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} )
90    IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH}
91fi
92
93#
94# Perhaps not usefull ?
95#
96IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card UserChoices
97typeset option
98for option in ${config_UserChoices[*]} ; do
99    IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
100done
101#
102echo
103IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
104IGCM_debug_PrintVariables 3 config_UserChoices_JobName
105IGCM_debug_PrintVariables 3 config_UserChoices_LongName
106IGCM_debug_PrintVariables 3 config_UserChoices_TagName
107IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
108IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
109IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
110IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength
111echo
112
113if [ ${RebuildFromArchive} = true ] ; then
114    RUN_DIR=${RUN_DIR_PATH}
115else
116    RUN_DIR=${REBUILD_DIR}
117fi
118IGCM_sys_Cd ${RUN_DIR}
119ListAllRebuildDir=$( ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${PeriodDateBegin} )
120
121for directory in ${ListAllRebuildDir} ; do
122    #
123    if [ ${RebuildFromArchive} = true ] ; then
124        IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
125    fi
126    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
127    # --------------------------------------------------------------------
128    # Function define in rebuild.ksh has not been closed yet. Do it now
129    # --------------------------------------------------------------------
130    echo IGCM_debug_PopStack "IGCM_post_Submit" >> rebuild.ksh
131    echo }                                      >> rebuild.ksh
132
133    # --------------------------------------------------------------------
134    # Source function include in the REBUILD ksh and rebuild
135    # --------------------------------------------------------------------
136    . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
137    IGCM_FlushRebuild
138    #
139    IGCM_sys_Cd ${RUN_DIR}
140    IGCM_sys_Rm -rf ${directory}
141done
Note: See TracBrowser for help on using the repository browser.