Ignore:
Timestamp:
09/03/12 11:29:13 (12 years ago)
Author:
gpincka
Message:

principalement : enchainement du launcher parallele + gestion reprise du code parallele

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/PACK_IPSL/showPackProgress.sh

    r1850 r1853  
    44export EXE_DIR=${JOB_DIR} 
    55 
    6 # gpdebug : pour titane 
    7 # --------------------- 
    8 # export INPUT_DMF_DATA=${SCRATCHDIR}/datasLabo/dataDMNFS_simple1 
    9 # export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE 
    10 # export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK 
    11  
    12  
    13 # gpdebug : pour curie 
    14 # -------------------- 
    15 export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane 
    16 export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE  
    17 export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK 
     6# On renseigne les variables d'environnement  
     7. load_ipslPack_env.sh 
    188 
    199SCRIPT_NAME=$(basename ${0} ) 
    2010 
    21 export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM 
    22 export IGCM_TMP=${SCRATCHDIR}/IGCM_DEM/tmp 
     11export IGCM_TMP="${IGCM_DEM}/tmp"  # gpdebug : added 
    2312 
    2413export config_card=${IGCM_DEM}/config_card.liste 
     
    2615source ${EXE_DIR}/DEM_utilities.sh 
    2716 
    28 export timeHandlingFile="timeHandlingFile.txt" 
     17export timeHandlingFile="${USER_OUTPUT_PROGRESS}/timeHandlingFile.txt" 
    2918 
    3019 
     
    3322   config_card=$1 
    3423    
    35    baseName=$( basename $config_card ) 
    36    simuName=`echo ${baseName} | sed 's;config_card_;;' ` 
     24   dirSimu=$( dirname $config_card ) 
     25   simuName=`echo ${dirSimu} | sed "s;${IGCM_DEM}/;;" ` 
    3726   echo $simuName 
    3827 
     
    194183} 
    195184 
     185 
     186 
     187function getListProgress 
     188{ 
     189     set=$1      
     190      
     191     listName=`echo $(basename $set) | sed 's;\.list$;;' | sed 's;\.nc$;;' ` 
     192     ListNbInode=`cat $set |wc -l` 
     193     TotalNbInodes=$(( $TotalNbInodes + $ListNbInode )) 
     194     statusfile=${set%%.list}.status 
     195     status=$( progressStatus $statusfile ) # gpdebug : a retablir 
     196     timeTaken="???" 
     197   
     198     packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible)' | wc -l ` 
     199     if [ "x${packFailed}" != "x0" ] 
     200     then 
     201        nbOfListsFailed=$(( $nbOfListsFailed + 1 )) 
     202        simuOK=$(( $simuOK && 0 )) # marque une simu pas OK 
     203     fi 
     204   
     205     packSuccess=`echo $status | grep "COMPLETED" | wc -l ` 
     206     if [ "x${packSuccess}" != "x0" ] 
     207     then 
     208        timeTaken=$( getTimeTaken $statusfile ) 
     209        nbOfListsPacked=$(( $nbOfListsPacked + 1 )) 
     210     fi 
     211      
     212     echo "       $listName : $status | time : $timeTaken" >> simuPrint.txt 
     213      
     214     timeInSecondsOK=`echo $timeTaken | grep -e '^[[:digit:].]*$' | wc -l ` 
     215     if [ "x${timeInSecondsOK}" != "x0" ] 
     216     then 
     217         totalTime=$(awk 'BEGIN { print '$totalTime'+'$timeTaken' }') 
     218     fi 
     219 
     220 
     221 
     222} 
     223 
    196224################################# 
    197225####### Main script ############# 
    198226################################# 
     227 
     228########  Options du script ######################################################## 
     229focusOnSimu= 
     230outputFile= 
     231detailed_mode=1 
     232while [ $# -gt 0 ] 
     233do 
     234   # echo "boucle sur les arguments du script ..." 
     235   # echo "@=$@" 
     236   case $1 in 
     237   -s)  echo "option -s selectionnee : afficher une simulation" 
     238        shift 
     239        focusOnSimu=$1 
     240        is_simu_an_option=`echo $focusOnSimu | grep -e '^-' | wc -l ` 
     241        if [ "x${is_simu_an_option}" != "x0" ] || [ "x$focusOnSimu" == "x" ] 
     242        then 
     243           echo "L'option -s doit etre suivie d'une simulation !" 
     244           exit 1 
     245        fi 
     246        ;; 
     247   -o)  echo "option -o selectionnee : fichier d'output" 
     248        shift 
     249        outputFile=$1 
     250        is_output_an_option=`echo $outputFile | grep -e '^-' | wc -l ` 
     251        if [ "x${is_output_an_option}" != "x0" ] || [ "x$outputFile" == "x" ] 
     252        then 
     253           echo "L'option -o doit etre suivie d'un fichier d'output !" 
     254           exit 1 
     255        fi 
     256        ;; 
     257   --not-detailled)  echo "option '--not-detailled' selectionnee" 
     258                     detailed_mode=0 
     259                     ;; 
     260   esac 
     261   shift 
     262done 
     263 
     264# echo "focusOnSimu=$focusOnSimu" 
     265# echo "outputFile=$outputFile" 
     266# echo "detailed_mode=$detailed_mode" 
     267###################################################################################### 
     268# exit 0 # gpdebug : a virer 
     269 
     270 
     271 
    199272> showPackProgress.log # vider le fichier de log 
     273 
    200274 
    201275# Recuperation des temps d'attente et ecoule depuis de demarrage des traitements en batch 
     
    228302totalTime=0 
    229303 
     304 
    230305for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do  
    231306 
    232307    DEM_state=$( DEM_read_state ${IGCM_DEM}/config_card.liste ${CONFIG} ) 
    233  
    234     if [[ "${DEM_state}" != "TarDone" ]] ; then 
    235  
    236          simuName=$( getSimuName $CONFIG ) 
    237          echo "*******************************************" 
    238          echo "simulation : $simuName" 
    239          echo "*******************************************" 
    240          export PATH_SIMU=$( dirname $CONFIG ) 
    241          # echo "PATH_SIMU = $PATH_SIMU" 
    242          
     308     
     309    # Eviter les simus autre que celle selectionnee par l'option -s 
     310    showCurrentSimu=`echo $CONFIG | grep "${focusOnSimu}" | wc -l ` 
     311    if [ "x${showCurrentSimu}" == "x0" ] 
     312    then 
     313        continue 
     314    fi 
     315 
     316    simuName=$( getSimuName $CONFIG ) 
     317     
     318    > simuPrint.txt 
     319 
     320    export PATH_SIMU=$( dirname $CONFIG ) 
     321    # echo "PATH_SIMU = $PATH_SIMU" 
     322     
     323    simuOK=1  
     324     
     325    if [ ! -e "${PATH_SIMU}/tar_full_simul.list" ] 
     326    then 
     327         
    243328         listOfDir="output_ncrcat output_tar restart_tar debug_tar store_cp work_cp" 
    244329         for dir in $listOfDir 
    245330         do 
    246              echo "   ${dir} :" 
     331             echo "   ${dir} :" >> simuPrint.txt 
    247332             if [ ! -d $PATH_SIMU/${dir} ] 
    248333             then 
    249                 echo "      ${dir} n'existe pas pour cette simu" 
     334                echo "      ${dir} n'existe pas pour cette simu" >> simuPrint.txt 
     335                simuOK=$(( $simuOK && 0 )) # marque une simu pas OK 
    250336                continue 
    251337             fi 
     
    254340             if [ "x$listFilesInDir" == "x0" ] 
    255341             then 
    256                 echo "       -- no list --" 
     342                echo "       -- no list --" >> simuPrint.txt 
    257343                continue            
    258344             fi 
     
    262348             for set in $setList 
    263349             do 
    264                   listName=`echo $(basename $set) | sed 's;\.list$;;' | sed 's;\.nc$;;' ` 
    265                   ListNbInode=`cat $set |wc -l` 
    266                   TotalNbInodes=$(( $TotalNbInodes + $ListNbInode )) 
    267                   statusfile=${set%%.list}.status 
    268                   status=$( progressStatus $statusfile ) # gpdebug : a retablir 
    269                   timeTaken="???" 
    270                   # progressStatus $statusfile # gpdebug : a virer 
    271                   # exit 0 # gpdebug : a virer 
    272                 
    273                   packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible)' | wc -l ` 
    274                   if [ "x${packFailed}" != "x0" ] 
    275                   then 
    276                      nbOfListsFailed=$(( $nbOfListsFailed + 1 )) 
    277                   fi 
    278                 
    279                   packSuccess=`echo $status | grep "COMPLETED" | wc -l ` 
    280                   if [ "x${packSuccess}" != "x0" ] 
    281                   then 
    282                      timeTaken=$( getTimeTaken $statusfile ) 
    283                      nbOfListsPacked=$(( $nbOfListsPacked + 1 )) 
    284                   fi 
    285                    
    286                   echo "       $listName : $status | time : $timeTaken" 
    287                    
    288                   timeInSecondsOK=`echo $timeTaken | grep -e '^[[:digit:].]*$' | wc -l ` 
    289                   if [ "x${timeInSecondsOK}" != "x0" ] 
    290                   then 
    291                       totalTime=$(awk 'BEGIN { print '$totalTime'+'$timeTaken' }') 
    292                   fi 
     350                  getListProgress $set 
    293351             done 
    294352         done 
     353    else          
     354         getListProgress ${PATH_SIMU}/tar_full_simul.list 
     355         TotalSimuTar=$(( $TotalSimuTar + 1 )) 
     356    fi 
     357     
     358    resSimu="OK" 
     359    if [ "x${simuOK}" == "x0" ] 
     360    then 
     361        resSimu="not OK" 
     362    fi 
     363     
     364    if [ "x${outputFile}" == "x" ] 
     365    then 
     366        echo "***************************************************" 
     367        echo "simulation : $simuName  ===> $resSimu" 
     368        echo "***************************************************" 
     369        if [ "x${detailed_mode}" == "x1" ] 
     370        then 
     371            cat simuPrint.txt  $outRedirectStatement 
     372        fi 
    295373    else 
    296 #si "${DEM_state}" == "TarDone" 
    297  
    298          simuName=$( getSimuName $CONFIG ) 
    299          echo "*******************************************" 
    300          echo "simulation : $simuName TAR" 
    301          echo "*******************************************" 
    302          TotalSimuTar=$(( $TotalSimuTar + 1 )) 
    303     fi 
     374        echo "***************************************************" >> ${outputFile} 
     375        echo "simulation : $simuName  ===> $resSimu"               >> ${outputFile} 
     376        echo "***************************************************" >> ${outputFile} 
     377        if [ "x${detailed_mode}" == "x1" ] 
     378        then 
     379            cat simuPrint.txt  $outRedirectStatement               >> ${outputFile} 
     380        fi      
     381    fi  
     382    rm simuPrint.txt 
    304383done 
    305384 
Note: See TracChangeset for help on using the changeset viewer.