Changeset 1864 for TOOLS


Ignore:
Timestamp:
09/06/12 15:26:07 (12 years ago)
Author:
gpincka
Message:

gestion (a ameliorer) des echecs ncrcat + check automatiques et aleatoires + resolution bug sur outil visu avancement + suppr liste 'manquant' vides

Location:
TOOLS/PACK_IPSL
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/PACK_IPSL/DEM_utilities.sh

    r1857 r1864  
    352352 
    353353   # Plus besoin du myModuleList.txt 
    354    # rm -f myModuleList.txt 
    355  
    356 } 
     354   rm -f myModuleList.txt 
     355 
     356} 
     357 
     358 
     359function check_cdo 
     360{ 
     361   # nom du présent prog (pour gestion des erreurs)  
     362   PROGNAME="DEM_utilities.sh" ######### 
     363   . /etc/profile  
     364   module list >& myModuleList.txt 
     365    
     366   if [ "x$?" != "x0" ] 
     367   then 
     368       # echo "La commande module list a rencontre un pb !" 
     369       DEM_errorSend "${PROGNAME}:${LINENO}:La commande module list a rencontre un pb !" 
     370   fi 
     371    
     372   if [ ! -e myModuleList.txt ] 
     373   then 
     374       # echo "Le fichier 'myModuleList.txt'  n existe pas" 
     375       DEM_errorSend "${PROGNAME}:${LINENO}:Le fichier 'myModuleList.txt' n'existe pas." 
     376   fi    
     377    
     378   # Presence de la chaine "n) nco/" ou n est un nombre   
     379   nb_of_libLines=` grep -e '[[:digit:]]*) cdo/' myModuleList.txt | wc -l ` 
     380 
     381   if [ "x${nb_of_libLines}" == "x0" ] 
     382   then 
     383       DEM_errorSend "${PROGNAME}:${LINENO}:Aucun cdo n'est charge" 
     384   fi 
     385 
     386   # Plus besoin du myModuleList.txt 
     387   rm -f myModuleList.txt 
     388 
     389} 
     390 
     391 
    357392function prepareMonitoringDir 
    358393{ 
  • TOOLS/PACK_IPSL/check_ncrcat_list.sh

    r1853 r1864  
    55# /ccc/scratch/cont003/incka/pierreg/IGCM_DEM/dataDMNFS_FromTitane/IGCM_OUT/IPSLCM5A/REDO/historicalGHG/v3.historicalGHG1R/output_tar/v3.historicalGHG1R_20101201_20121231_1M_histmthNMC.nc.list 
    66 
    7 if [ ! -e $listToProcessFile ] 
    8 then 
    9     echo "Le fichier en entree n'existe pas. STOP." 
    10     exit 1 
    11 fi 
    127 
    138# On renseigne les variables d'environnement (ici surtout pour la var OUTPUT_CHECK)  
     
    6055 
    6156 
    62 echo 
    63 echo "ncrcat file to compare cdo cat file with :" 
    64 echo "$output_ncrcat_file" 
    65 echo 
    66 echo "Output cdo cat file to write:" 
    67 echo "$output_cdocat_file" 
    68 echo 
    69 echo "Output cdo cat log file to write:" 
    70 echo "$output_cdocat_logFile" 
     57#echo 
     58#echo "ncrcat file to compare cdo cat file with :" 
     59#echo "$output_ncrcat_file" 
     60#echo 
     61#echo "Output cdo cat file to create:" 
     62#echo "$output_cdocat_file" 
     63#echo 
     64#echo "Output cdo cat log file:" 
     65#echo "$output_cdocat_logFile" 
     66 
     67if [ ! -e $listToProcessFile ] 
     68then 
     69    echo "Le fichier en entree n'existe pas. STOP." > $output_cdocat_logFile 
     70    exit 1 
     71fi 
    7172 
    7273 
    7374if [ ! -e $outputfile ] 
    7475then 
    75    echo "Le fichier liste suivant n'existe pas :" 
    76    echo "$outputfile" 
     76   echo "Le fichier liste suivant n'existe pas :" >> $output_cdocat_logFile 
     77   echo "$outputfile" >> $output_cdocat_logFile 
     78   exit 1 
    7779fi 
    7880 
     
    8183listOfFilesToCdocat=`cat $listToProcessFile ` 
    8284 
     85 
    8386cdo cat $listOfFilesToCdocat $output_cdocat_file > $output_cdocat_logFile 2>&1 
     87 
    8488 
    8589echo >> $output_cdocat_logFile 
  • TOOLS/PACK_IPSL/launch_and_measureTime.sh

    r1863 r1864  
    3535               echo "./process_list.sh $newCmdToPrint" >> ${tasksListFile} 
    3636           ;; 
     37           x50) 
     38               # ne fait rien, la liste, au depart a concatener, a ete taree  
     39               # car echec de la concatenation   
     40           ;; 
    3741           *) 
    3842               echo "./process_list.sh $cmdToPrint" >> ${tasksListFile} 
     
    6165  
    6266   done 
    63    IFS=$old_IFS     # rétablissement du séparateur de champ par défaut      
     67   IFS=$old_IFS     # rétablissement du séparateur de champ par défaut 
     68    
     69   # Il peut arriver que 2 listes soient identiques, on empeche ce cas 
     70   cat ${tasksListFile} | sort | uniq > taskFile.txt 
     71   cat taskFile.txt > ${tasksListFile}   
    6472 
    6573} 
     
    172180} 
    173181 
     182export RANDOM=$$ # random seed 
     183function gives_random_number 
     184{ 
     185   lim=$1 
     186   bit=-1 
     187   let "bit = RANDOM % $lim" 
     188   bit=$(( $bit + 1 )) # nb entre 1 et $limit 
     189   echo $bit 
     190} 
     191 
    174192########## batch directives : begin ########## 
    175193#MSUB -r pack_ipsl          # Nom du job                 
     
    206224export output="${progressDir}/packOutput__try__${numCurrentTry}__instance__${numNewInstance}.log" 
    207225export reportFile="${progressDir}/report__try__${numCurrentTry}__instance__${numNewInstance}.log" 
    208  
     226export checkFile="${progressDir}/check__try__${numCurrentTry}__instance__${numNewInstance}.log" 
     227export checkFileTmp="checkTmp__try__${numCurrentTry}__instance__${numNewInstance}.txt" 
    209228 
    210229export noInterruptFile="${progressDir}/noInterrupt__try__${numCurrentTry}__instance__${numNewInstance}.txt" 
     
    349368update_tasks_list $nextInputCmd $output $inputCmd 
    350369 
     370# Verifications sur qq listes (dont le traitement semble correct) : 
     371# ---------------------------------------------------------------------------------------- 
     372if [ "x${nbListsToCheck}" == "x" ] 
     373then 
     374    echo "nbre de listes a checker absent" >> $checkFile 
     375    echo "nbre de listes a checker absent" >> $badFailureFile 
     376    exit 1 
     377fi 
     378> $checkFileTmp 
     379# ensemble des listes concatenees correctement 
     380set_of_good_lists=`cat $output | grep -e '^#executed by process' | awk '{ if ($9==0){print $12} }' | grep "output_ncrcat" ` 
     381 
     382# envoi des cmds de check dans fichier tmp 
     383for lst in $set_of_good_lists 
     384do 
     385   echo "./check_ncrcat_list.sh $lst" >> $checkFileTmp 
     386done 
     387 
     388# nombre de listes concatenees correctement 
     389nb_of_good_lists=`cat $checkFileTmp | wc -l ` 
     390 
     391# le nb de listes a checker ne peut exceder le nb de listes disponibles pour le check 
     392if [ $nbListsToCheck -ge $nb_of_good_lists ] 
     393then 
     394    nbListsToCheck=$nb_of_good_lists 
     395fi 
     396nbLstToCheck_tmp=$nbListsToCheck 
     397 
     398while [ $nbLstToCheck_tmp -gt 0 ] 
     399do 
     400    random_number=$( gives_random_number $nbLstToCheck_tmp ) # nb aleatoire entre 1 et $nbLstToCheck_tmp 
     401    checkCmd=`sed -n "${random_number}p" $checkFileTmp ` 
     402    $checkCmd # on envoie la cmd de check 
     403    resCmd=$? 
     404    if [ "x${resCmd}" != "x0" ] 
     405    then 
     406        echo "$checkCmd ==> not OK ==> stop everything." >> $checkFile 
     407        echo "$checkCmd ==> not OK ==> stop everything." >> $badFailureFile 
     408        # exit 1 # a retablir 
     409    else 
     410        echo "$checkCmd ==> OK" >> $checkFile 
     411    fi 
     412    sed -i "${random_number}d" $checkFileTmp # on retire la cmd qui vient d'etre effectuee du fichier tmp 
     413    nbLstToCheck_tmp=$(( $nbLstToCheck_tmp - 1 )) 
     414done 
     415 
     416 
     417rm $checkFileTmp 
     418# ----- Fin verif ------------------------------------------------------------------------ 
     419 
    351420echo "no interruption has occured" > ${noInterruptFile} 
     421 
     422# exit 0 # a virer 
    352423 
    353424# Tout s'est bien passe 
    354425# ---------------------- 
    355426everythingOK=`cat $nextInputCmd | wc -l ` 
    356 if [ "x${everythingOK}" == "x0"] 
     427if [ "x${everythingOK}" == "x0" ] 
    357428then 
    358429    echo "Tout s'est fini correctement" >> $badFailureFile 
    359     exit 1 
     430    exit 0 
    360431fi 
    361432 
  • TOOLS/PACK_IPSL/launch_ipsl_pack.sh

    r1863 r1864  
    3939echo "Fin boucle sur arguments" 
    4040export execEveryStep=${execEveryStep} 
     41if [ "x${LISTE_SIMUL}" == "x" ] 
     42then 
     43    echo "Vous devez passer un fichier en parametre" 
     44    exit 1 
     45fi 
    4146 
    4247# fichier de progression d'execution 
  • TOOLS/PACK_IPSL/parallelPack.sh

    r1863 r1864  
    116116# On charge les directives batch 
    117117. load_batch_directives.sh 
     118 
     119# On charge les parametres 
     120. loadParameters.sh 
    118121 
    119122# on verifie que la machine est 'curie' ou 'titane' 
  • TOOLS/PACK_IPSL/process_list.sh

    r1863 r1864  
    100100                echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile 
    101101        fi 
    102         # echo "output_ncrcat : blabla 1" 
    103         #----------------------------------- 
     102         
    104103        # Switch to tar command 
    105104        if [ $switchtotar -eq 1 ] ; then 
     
    109108                exit 5 
    110109        fi 
    111         # echo "output_ncrcat : blabla 2" 
    112         #----------------------------------- 
    113         # Skip the set if last line of the status file is "COMPLETED" or "DELEGATE" 
    114         if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then 
    115                 printf "====> " 
    116                 tail -1 $statusfile 
    117                 exit 0 # gpdebug : modif 
    118         fi 
    119          
    120         # echo "output_ncrcat : blabla 3" 
     110         
     111        # Skip the set if last line of the status file is "DELEGATE" 
     112        if tail -1 $statusfile | grep -q -E 'DELEGATE' ; then 
     113                printf "====> " 
     114                tail -1 $statusfile 
     115                exit 50 
     116        fi 
     117         
     118        # Skip the set if last line of the status file is "COMPLETED" 
     119        if tail -1 $statusfile | grep -q -E 'COMPLETED' ; then 
     120                printf "====> " 
     121                tail -1 $statusfile 
     122                exit 0 
     123        fi       
    121124 
    122125        #----------------------------------- 
  • TOOLS/PACK_IPSL/showPackProgress.sh

    r1863 r1864  
    231231     timeTaken="???" 
    232232   
    233      packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible)' | wc -l ` 
     233     packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible|Non traite)' | wc -l ` 
    234234     if [ "x${packFailed}" != "x0" ] 
    235235     then 
     
    245245     fi 
    246246      
     247     packNottreated=`echo $status | grep -E "Non traitee" | wc -l ` 
     248     if [ "x${packNottreated}" != "x0" ] 
     249     then 
     250         nbOfListsNottreated=$(( $nbOfListsNottreated + 1 )) 
     251     fi 
     252 
    247253     echo "       $listName : $status | time : $timeTaken" >> simuPrint.txt 
    248254      
     
    335341nbOfListsPacked=0 
    336342nbOfListsFailed=0 
     343nbOfListsNottreated=0 
    337344TotalNbInodes=0 
    338345TotalSimuTar=0 
     
    441448    echo "nb of Lists packed with success : ${nbOfListsPacked} / ${totalNbOfList}" 
    442449    echo "nb of fails : $nbOfListsFailed" 
     450    echo "nb of not treated : ${nbOfListsNottreated}" 
    443451    echo "nb of inodes packed : $TotalNbInodes" 
    444452    echo "nb simul full tared : $TotalSimuTar" 
     
    455463    echo "nb of Lists packed with success : ${nbOfListsPacked} / ${totalNbOfList}" >> ${outputFile} 
    456464    echo "nb of fails : $nbOfListsFailed" >> ${outputFile} 
     465    echo "nb of not treated : ${nbOfListsNottreated}" >> ${outputFile} 
    457466    echo "nb of inodes packed : $TotalNbInodes" >> ${outputFile} 
    458467    echo "nb simul full tared : $TotalSimuTar" >> ${outputFile} 
Note: See TracChangeset for help on using the changeset viewer.