Changeset 834


Ignore:
Timestamp:
03/22/13 11:49:51 (11 years ago)
Author:
labetoulle
Message:

Look for the right string to check rebuild jobs when SpaceName?=TEST. See #106.

Location:
trunk/libIGCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_RunChecker

    r832 r834  
    163163 
    164164 
    165    
     165 
    166166  # Print header 
    167167  # ============ 
     
    315315      echo "       the config.card instead of the job name." 
    316316      exit ;; 
    317 #    -b|-nocolor) 
    318 #      fg_color=false 
    319 #      shift 1 ;; 
    320317    -j|-job-number) 
    321318      NbHisto="$2" 
     
    358355libIGCM=${libIGCM:=::modipsl::/libIGCM} 
    359356 
     357DEBUG_debug=false 
     358 
    360359. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh 
    361360. ${libIGCM}/libIGCM_card/libIGCM_card.ksh 
     
    462461  echo "Work:    >${CWORK_DIR}<" 
    463462 
     463  # Are packs activated or not ? 
     464  # ============================ 
     465  if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && \ 
     466       [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then 
     467    Pack=true 
     468  else 
     469    Pack=false 
     470  fi 
     471 
     472 
    464473  if [ $PeriodState != "Waiting" ] ; then 
    465474 
     
    498507      typeset    name1="${JobType}_String" 
    499508      typeset    name2="${JobType}_Field" 
     509      typeset    name3="${JobType}_Activ" 
    500510      if [ X${JobType} == X${RebuildJob} ] ; then 
    501         eval ${name1}=IGCM_sys_PutBuffer_Out 
     511        if ( ${Pack} ) ; then 
     512          eval ${name1}=IGCM_sys_PutBuffer_Out 
     513        else 
     514          eval ${name1}=IGCM_sys_Put_Out 
     515        fi 
    502516        eval ${name2}=4 
     517        eval ${name3}=true 
    503518      else 
    504519        eval ${name1}=IGCM_sys_Put_Out 
    505520        eval ${name2}=3 
     521        if ( ${Pack} ) ; then 
     522          eval ${name3}=true 
     523        else 
     524          eval ${name3}=false 
     525        fi 
    506526      fi 
    507527    done 
     
    513533      eval String=\${${JobType}_String} 
    514534      eval Field=\${${JobType}_Field} 
    515  
    516       set -A FileList $( ls ${POST_DIR}/${JobType}.*.out | tail -n ${NbHisto} ) 
    517  
    518       if [ ${#FileList[*]} -gt ${NbLines} ] ; then 
    519         NbLines=${#FileList[*]} 
     535      eval Activ=\${${JobType}_Activ} 
     536 
     537      if ( ${Activ} ) ; then 
     538 
     539        set -A FileList $( ls ${POST_DIR}/${JobType}.*.out | tail -n ${NbHisto} ) 
     540 
     541        if [ ${#FileList[*]} -gt ${NbLines} ] ; then 
     542          NbLines=${#FileList[*]} 
     543        fi 
     544 
     545        (( ind = 0 )) 
     546        for FileName in ${FileList[*]} ; do 
     547          LastDate=$( basename ${FileName} | gawk -F"." '{ print $(NF-1) }' ) 
     548 
     549          set -- $( gawk -v String=${String} \ 
     550                         'BEGIN { nb_ok = 0 ; nb_ko = 0 } \ 
     551                         ($1 ~ String) { \ 
     552                           if ($3 !~ /error./) { \ 
     553                             nb_ok = nb_ok + 1 \ 
     554                           } else { \ 
     555                             nb_ko = nb_ko + 1 \ 
     556                           } \ 
     557                         } \ 
     558                         END { print nb_ok " " nb_ko }' \ 
     559                         ${POST_DIR}/${JobType}.${LastDate}.out ) 
     560          Match=$1 
     561          Error=$2 
     562 
     563          (( Nb = ${Match} - ${Error} )) 
     564 
     565          if ( [ ${Error} -eq 0 ] && [ ${Nb} -gt 0 ] ) ; then 
     566            Status=OK 
     567          else 
     568            Status=KO 
     569          fi 
     570 
     571          eval ${JobType}_Date[$ind]=${LastDate} 
     572          eval ${JobType}_Status[$ind]=${Status} 
     573          eval ${JobType}_Nb[$ind]=${Nb} 
     574 
     575          (( ind = ind + 1 )) 
     576        done 
     577 
     578      else 
     579 
     580          eval ${JobType}_Date[0]="" 
     581          eval ${JobType}_Status[0]="" 
     582          eval ${JobType}_Nb[0]="" 
     583 
    520584      fi 
    521585 
    522       (( ind = 0 )) 
    523       for FileName in ${FileList[*]} ; do 
    524         LastDate=$( basename ${FileName} | gawk -F"." '{ print $(NF-1) }' ) 
    525  
    526         Error=$( gawk -v String=${String} \ 
    527                      'BEGIN { x=0 } ($1~String) && ($3~"error.") { x=x+1 } END { print x }' \ 
    528                      ${POST_DIR}/${JobType}.${LastDate}.out ) 
    529  
    530         Match=$( gawk -v String=${String} \ 
    531                      'BEGIN { x=0 } ($1~String) && ($3!~"error.") { x=x+1 } END { print x }' \ 
    532                      ${POST_DIR}/${JobType}.${LastDate}.out ) 
    533         (( Nb = ${Match} - ${Error} )) 
    534  
    535         if ( [ ${Error} -eq 0 ] && [ ${Nb} -gt 0 ] ) ; then 
    536           Status=OK 
    537         else 
    538           Status=KO 
    539         fi 
    540  
    541         eval ${JobType}_Date[$ind]=${LastDate} 
    542         eval ${JobType}_Status[$ind]=${Status} 
    543         eval ${JobType}_Nb[$ind]=${Nb} 
    544          
    545         (( ind = ind + 1 )) 
    546       done 
    547586    done 
    548587 
     
    583622 
    584623  fi 
    585      
     624 
    586625 
    587626  # Print results 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh

    r828 r834  
    22892289 
    22902290  # With -f option, the full job name is given in the last column 
    2291   NbRun=$( ccc_mstat -f | gawk -v JobName=$1 'BEGIN { x=0 } ($NF~String) { x=x+1 } END { print x }' ) 
     2291  NbRun=$( ccc_mstat -f | gawk -v JobName=$1 'BEGIN { x=0 } ( $NF ~ JobName ) { x=x+1 } END { print x }' ) 
    22922292 
    22932293  eval ${2}=${NbRun} 
Note: See TracChangeset for help on using the changeset viewer.