source: trunk/libIGCM/AA_rebuild @ 58

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

Headers for LoadLeveler? 3.5

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