source: trunk/libIGCM/AA_rebuild @ 103

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