Changeset 338 for trunk


Ignore:
Timestamp:
08/24/10 18:06:05 (14 years ago)
Author:
mmaipsl
Message:

Improve TimeSeries? Checker to run during a job execution, not just on the end.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_TimeSeries_Checker

    r286 r338  
    11#!/bin/ksh 
     2#-Q- cesium #!/bin/ksh 
     3#-Q- cesium ###################### 
     4#-Q- cesium ## CESIUM   CEA ## 
     5#-Q- cesium ###################### 
     6#-Q- cesium #MSUB -r TimeSeries             # Nom du job                 
     7#-Q- cesium #MSUB -N 1              # Reservation du noeud 
     8#-Q- cesium #MSUB -n 1              # Reservation du processus 
     9#-Q- cesium #MSUB -T 86400          # Limite de temps elapsed du job 
     10#-Q- cesium #MSUB -E "-j o" 
     11#-Q- cesium #MSUB -E "-S /bin/ksh" 
     12#-Q- platine #!/usr/bin/ksh 
     13#-Q- platine ################### 
     14#-Q- platine ## PLATINE   CEA ## 
     15#-Q- platine ################### 
     16#-Q- platine #BSUB -J TimeSeries                     # Nom du job 
     17#-Q- platine #BSUB -N                        # message a la fin du job 
     18#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job 
     19#-Q- platine #BSUB -W 1:00                   # Limite temps 
     20#-Q- platine #BSUB -q post                   # Passage en queue post 
     21#-Q- sx8brodie #!/bin/ksh 
     22#-Q- sx8brodie ####################### 
     23#-Q- sx8brodie ## SX8BRODIE   IDRIS ## 
     24#-Q- sx8brodie ####################### 
     25#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss 
     26#-Q- sx8brodie # @ wall_clock_limit = 20:00:00 
     27#-Q- sx8brodie # Nom du travail LoadLeveler 
     28#-Q- sx8brodie # @ job_name   = TimeSeries 
     29#-Q- sx8brodie # Fichier de sortie standard du travail        
     30#-Q- sx8brodie # @ output     = $(job_name).$(jobid) 
     31#-Q- sx8brodie # Fichier de sortie d'erreur du travail 
     32#-Q- sx8brodie # @ error      =  $(job_name).$(jobid) 
     33#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
     34#-Q- sx8brodie # @ notification = error 
     35#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER 
     36#-Q- aix6 #!/bin/ksh 
     37#-Q- aix6 ####################### 
     38#-Q- aix6 ##   VARGAS   IDRIS  ## 
     39#-Q- aix6 ####################### 
     40#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss 
     41#-Q- aix6 # @ wall_clock_limit = 20:00:00 
     42#-Q- aix6 # Nom du travail LoadLeveler 
     43#-Q- aix6 # @ job_name   = TimeSeries 
     44#-Q- aix6 # Fichier de sortie standard du travail 
     45#-Q- aix6 # @ output     = $(job_name).$(jobid) 
     46#-Q- aix6 # Fichier de sortie d'erreur du travail 
     47#-Q- aix6 # @ error      =  $(job_name).$(jobid) 
     48#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 
     49#-Q- aix6 # @ notification = error 
     50#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $RebuildFrequency ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER 
     51#-Q- aix6 # @ queue 
     52#-Q- sx8brodie # @ queue 
     53#-Q- sx8mercure #!/bin/ksh 
     54#-Q- sx8mercure ###################### 
     55#-Q- sx8mercure ## SX8MERCURE   CEA ## 
     56#-Q- sx8mercure ###################### 
     57#-Q- sx8mercure #PBS -N TimeSeries                   # Nom du job 
     58#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr 
     59#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission 
     60#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go 
     61#-Q- sx8mercure #PBS -l cputim_job=24:00:00   # Limite temps a 2 heures 
     62#-Q- sx8mercure #PBS -q scalaire 
     63#-Q- sx9mercure #!/bin/ksh 
     64#-Q- sx9mercure ######################### 
     65#-Q- sx9mercure ## CESIUM FOR SX9  CEA ## 
     66#-Q- sx9mercure ######################### 
     67#-Q- sx9mercure #MSUB -r TimeSeries             # Nom du job                 
     68#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud 
     69#-Q- sx9mercure #MSUB -n 1              # Reservation du processus 
     70#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job 
     71#-Q- sx9mercure #MSUB -E "-j o" 
     72#-Q- sx9mercure #MSUB -E "-S /bin/ksh" 
     73#-Q- titane #!/bin/ksh 
     74#-Q- titane ###################### 
     75#-Q- titane ## TITANE   CEA ## 
     76#-Q- titane ###################### 
     77#-Q- titane #MSUB -r TimeSeries             # Nom du job                 
     78#-Q- titane #MSUB -N 1              # Reservation du noeud 
     79#-Q- titane #MSUB -n 1              # Reservation du processus 
     80#-Q- titane #MSUB -T 86400          # Limite de temps elapsed du job 
     81#-Q- titane #MSUB -E "-j o" 
     82#-Q- titane #MSUB -E "-S /bin/ksh" 
     83#-Q- titane ##MSUB -e nco.out        # Sortie standard 
     84#-Q- titane ##MSUB -o nco.out        # Sortie standard 
     85#-Q- lxiv8 ###################### 
     86#-Q- lxiv8 ## OBELIX      LSCE ## 
     87#-Q- lxiv8 ###################### 
     88#-Q- lxiv8 #PBS -N TimeSeries 
     89#-Q- lxiv8 #PBS -m a 
     90#-Q- lxiv8 #PBS -j oe 
     91#-Q- lxiv8 #PBS -q medium 
     92#-Q- lxiv8 #PBS -o TimeSeries.$$ 
     93#-Q- lxiv8 #PBS -S /bin/ksh 
     94#-Q- default #!/bin/ksh 
     95#-Q- default ################## 
     96#-Q- default ## DEFAULT HOST ## 
     97#-Q- default ################## 
    298 
    399#************************************************************** 
     
    17113# Display a short report 
    18114# Launch what's missing 
    19  
    20 # 
     115# For use during a run (not on the end : PeriodState=Completed), it will complete 
     116# all TS to last PeriodDateEnd value, give by run.card->Configuration->OldPrefix string. 
     117 
     118 
     119# Chemin vers libIGCM 
    21120libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    22  
    23 # 
    24 POST_DIR=${POST_DIR:=OutScript} 
     121# Attention : à changer si la machine de post-traitement n'est pas la frontale du serveur de calcul ! 
     122#             voir précence de la variable MirrorlibIGCM dans votre couche systÚme. 
    25123 
    26124# Type de run 
    27125EXPERIMENT=${EXPERIMENT:=historical} 
    28126 
    29 # Type de run 
     127# Nom du job 
    30128JobName=${JobName:=HISTORC2} 
    31129 
    32 # 
     130# répertoire courrant 
    33131CURRENT_DIR=$( pwd ) 
    34132 
    35 # 
    36 CARD_DIR=${CURRENT_DIR}/${EXPERIMENT}/${JobName} 
     133# Emplacement des cartes 
     134CARD_DIR=${CARD_DIR:=${CURRENT_DIR}/${EXPERIMENT}/${JobName}} 
     135 
     136# répertoire de stockate des sorties des create_ts 
     137POST_DIR=${POST_DIR:=${CARD_DIR}/OutScript} 
     138 
    37139 
    38140if [ ! -d ${CARD_DIR} ]; then 
     
    65167IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin 
    66168IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd 
     169 
     170if [ -f ${CARD_DIR}/run.card ] ; then 
     171    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration OldPrefix 
     172    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration PeriodState 
     173    IGCM_debug_PrintVariables 3 run_Configuration_OldPrefix 
     174    IGCM_debug_PrintVariables 3 run_Configuration_PeriodState 
     175    if [ X${run_Configuration_PeriodState} != X"Completed" ] ; then 
     176        DateEnd=$( IGCM_date_ConvertFormatToGregorian $( echo ${run_Configuration_OldPrefix} | awk -F'_' '{print $2}' ) ) 
     177    else 
     178        DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) 
     179    fi 
     180else 
     181    DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) 
     182fi 
     183 
     184echo 
     185echo "DateEnd for TimeSeries_Checker : " ${DateEnd} 
     186IGCM_date_GetYearMonth ${DateEnd}   YearEnd   MonthEnd 
     187echo "YearEnd MonthEnd for TimeSeries_Checker : " ${YearEnd} ${MonthEnd} 
    67188echo 
    68189 
     
    122243                if [ X"$( eval echo \${${compname}_${flag_post}_TimeSeriesVars[*]} )" = X"Option not found ${flag_post}" ] ; then 
    123244                    # New TimeSeriesVar description, with 2D, 3D and associate ChunckJob. 
     245                    unset ListDimension 
    124246                    ListDimension[0]=2D 
    125247                    ListDimension[1]=3D 
     
    157279 
    158280                        # 
    159                         #  ICI ON TEST QUE LES FICHIERS TS SONT LA! 
     281                        #  ICI ON TESTE QUE LES FICHIERS TS SONT LA! 
    160282                        # 
    161283                        # 
     
    177299                        # 
    178300                        if [ $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then 
     301                            IGCM_debug_Print 2 "Empty TS : ${compname}_Post_${FILE}_TimeSeriesVars${Dimension}" 
    179302                            #(( i=i+3 )) 
    180303                            continue 
     
    184307                        # 
    185308                        DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} ) 
    186                         DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) 
    187  
    188309                        IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin 
    189                         IGCM_date_GetYearMonth ${DateEnd}   YearEnd   MonthEnd 
    190310 
    191311                        # Si on n'a pas de chunck, dans ce cas chunck_size=la durée de la simulation en années 
    192312                        YearsChunckLength=$( echo ${chunck_size} | sed -e "s/[yY]//" ) 
    193                         [ ${chunck} = false ] && YearsChunckLength=$( expr \( ${YearEnd} \- ${YearBegin} \+ 1 \) ) 
    194  
    195                         NbYearsChunckLoop=$( expr \( ${YearEnd} \- ${YearBegin} \+ 1 \) / ${YearsChunckLength} ) 
    196                         Reste=$( expr \( ${YearEnd} \- ${YearBegin} \+ 1 \) % ${YearsChunckLength} ) 
    197  
    198                         if [ ${Reste} != 0 ] ; then 
    199                             NbYearsChunckLoop=$( expr ${NbYearsChunckLoop} + 1 ) 
     313                        if ( [ ${chunck} = false ] || [ X${YearsChunckLength} = XOFF ] ) ; then 
     314                            YearsChunckLength=$(( YearEnd - YearBegin + 1 )) 
     315                        fi 
     316 
     317                        NbYearsChunckLoop=$(( ( YearEnd - YearBegin + 1 ) / YearsChunckLength )) 
     318                        Reste=$(( ( YearEnd - YearBegin + 1 ) % YearsChunckLength )) 
     319 
     320                        if [ ${Reste} -ne 0 ] ; then 
     321                            NbYearsChunckLoop=$(( NbYearsChunckLoop + 1 )) 
    200322                        fi 
    201323 
     
    229351 
    230352                            SuccessRate=$(( countGood * 100 / countTotal )) 
    231                             if [ ! ${SuccessRate} = 100 ] ; then 
     353                            if [ ${SuccessRate} -ne 100 ] ; then 
    232354                                IGCM_debug_Print 2 -e "\033[1;31m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" 
    233355                            else 
     
    236358 
    237359                            echo 
    238                             if ( [ ${chunck} = true ] && [ ! ${SuccessRate} = 100 ] ) ; then 
     360                            if ( [ ${chunck} = true ] && [ ${SuccessRate} -ne 100 ] ) ; then 
    239361                                IGCM_debug_Print 2 -e "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin}" 
    240362                                listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,TsTask,CompToRead,FlagToRead" 
     
    254376                            fi 
    255377 
    256                             if ( [ ${chunck} = false ] && [ ! ${SuccessRate} = 100 ] ) ; then 
     378                            if ( [ ${chunck} = false ] && [ ${SuccessRate} -ne 100 ] ) ; then 
    257379                                eval Launch${Dimension}=true 
    258380                            fi 
     
    266388                                ChunckFin=${DateEnd} 
    267389                            else 
    268                                 #PeriodDateEnd=$( expr ${YearBegin} + ${YearsChunckLength} - 1 ) 
     390                                #PeriodDateEnd=$(( YearBegin + YearsChunckLength - 1 )) 
    269391                                ChunckFin=$( IGCM_date_AddDaysToGregorianDate ${ChunckDebut} $(( YearsChunckLength * DaysInYear - 1 )) ) 
    270392                            fi 
     
    287409echo 
    288410 
     411DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} ) 
     412IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin 
     413 
    289414if [ X${Launch2D} = Xtrue ] ; then 
    290415    IGCM_debug_Print 2 -e "\033[1;31mSubmit 2D\033[m without chunck period ${DateBegin}-${DateEnd}" 
Note: See TracChangeset for help on using the changeset viewer.