Changeset 1864
- Timestamp:
- 09/06/12 15:26:07 (12 years ago)
- Location:
- TOOLS/PACK_IPSL
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/DEM_utilities.sh
r1857 r1864 352 352 353 353 # Plus besoin du myModuleList.txt 354 # rm -f myModuleList.txt 355 356 } 354 rm -f myModuleList.txt 355 356 } 357 358 359 function 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 357 392 function prepareMonitoringDir 358 393 { -
TOOLS/PACK_IPSL/check_ncrcat_list.sh
r1853 r1864 5 5 # /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 6 6 7 if [ ! -e $listToProcessFile ]8 then9 echo "Le fichier en entree n'existe pas. STOP."10 exit 111 fi12 7 13 8 # On renseigne les variables d'environnement (ici surtout pour la var OUTPUT_CHECK) … … 60 55 61 56 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 67 if [ ! -e $listToProcessFile ] 68 then 69 echo "Le fichier en entree n'existe pas. STOP." > $output_cdocat_logFile 70 exit 1 71 fi 71 72 72 73 73 74 if [ ! -e $outputfile ] 74 75 then 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 77 79 fi 78 80 … … 81 83 listOfFilesToCdocat=`cat $listToProcessFile ` 82 84 85 83 86 cdo cat $listOfFilesToCdocat $output_cdocat_file > $output_cdocat_logFile 2>&1 87 84 88 85 89 echo >> $output_cdocat_logFile -
TOOLS/PACK_IPSL/launch_and_measureTime.sh
r1863 r1864 35 35 echo "./process_list.sh $newCmdToPrint" >> ${tasksListFile} 36 36 ;; 37 x50) 38 # ne fait rien, la liste, au depart a concatener, a ete taree 39 # car echec de la concatenation 40 ;; 37 41 *) 38 42 echo "./process_list.sh $cmdToPrint" >> ${tasksListFile} … … 61 65 62 66 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} 64 72 65 73 } … … 172 180 } 173 181 182 export RANDOM=$$ # random seed 183 function 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 174 192 ########## batch directives : begin ########## 175 193 #MSUB -r pack_ipsl # Nom du job … … 206 224 export output="${progressDir}/packOutput__try__${numCurrentTry}__instance__${numNewInstance}.log" 207 225 export reportFile="${progressDir}/report__try__${numCurrentTry}__instance__${numNewInstance}.log" 208 226 export checkFile="${progressDir}/check__try__${numCurrentTry}__instance__${numNewInstance}.log" 227 export checkFileTmp="checkTmp__try__${numCurrentTry}__instance__${numNewInstance}.txt" 209 228 210 229 export noInterruptFile="${progressDir}/noInterrupt__try__${numCurrentTry}__instance__${numNewInstance}.txt" … … 349 368 update_tasks_list $nextInputCmd $output $inputCmd 350 369 370 # Verifications sur qq listes (dont le traitement semble correct) : 371 # ---------------------------------------------------------------------------------------- 372 if [ "x${nbListsToCheck}" == "x" ] 373 then 374 echo "nbre de listes a checker absent" >> $checkFile 375 echo "nbre de listes a checker absent" >> $badFailureFile 376 exit 1 377 fi 378 > $checkFileTmp 379 # ensemble des listes concatenees correctement 380 set_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 383 for lst in $set_of_good_lists 384 do 385 echo "./check_ncrcat_list.sh $lst" >> $checkFileTmp 386 done 387 388 # nombre de listes concatenees correctement 389 nb_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 392 if [ $nbListsToCheck -ge $nb_of_good_lists ] 393 then 394 nbListsToCheck=$nb_of_good_lists 395 fi 396 nbLstToCheck_tmp=$nbListsToCheck 397 398 while [ $nbLstToCheck_tmp -gt 0 ] 399 do 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 )) 414 done 415 416 417 rm $checkFileTmp 418 # ----- Fin verif ------------------------------------------------------------------------ 419 351 420 echo "no interruption has occured" > ${noInterruptFile} 421 422 # exit 0 # a virer 352 423 353 424 # Tout s'est bien passe 354 425 # ---------------------- 355 426 everythingOK=`cat $nextInputCmd | wc -l ` 356 if [ "x${everythingOK}" == "x0" ]427 if [ "x${everythingOK}" == "x0" ] 357 428 then 358 429 echo "Tout s'est fini correctement" >> $badFailureFile 359 exit 1430 exit 0 360 431 fi 361 432 -
TOOLS/PACK_IPSL/launch_ipsl_pack.sh
r1863 r1864 39 39 echo "Fin boucle sur arguments" 40 40 export execEveryStep=${execEveryStep} 41 if [ "x${LISTE_SIMUL}" == "x" ] 42 then 43 echo "Vous devez passer un fichier en parametre" 44 exit 1 45 fi 41 46 42 47 # fichier de progression d'execution -
TOOLS/PACK_IPSL/parallelPack.sh
r1863 r1864 116 116 # On charge les directives batch 117 117 . load_batch_directives.sh 118 119 # On charge les parametres 120 . loadParameters.sh 118 121 119 122 # on verifie que la machine est 'curie' ou 'titane' -
TOOLS/PACK_IPSL/process_list.sh
r1863 r1864 100 100 echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile 101 101 fi 102 # echo "output_ncrcat : blabla 1" 103 #----------------------------------- 102 104 103 # Switch to tar command 105 104 if [ $switchtotar -eq 1 ] ; then … … 109 108 exit 5 110 109 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 121 124 122 125 #----------------------------------- -
TOOLS/PACK_IPSL/showPackProgress.sh
r1863 r1864 231 231 timeTaken="???" 232 232 233 packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible )' | wc -l `233 packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible|Non traite)' | wc -l ` 234 234 if [ "x${packFailed}" != "x0" ] 235 235 then … … 245 245 fi 246 246 247 packNottreated=`echo $status | grep -E "Non traitee" | wc -l ` 248 if [ "x${packNottreated}" != "x0" ] 249 then 250 nbOfListsNottreated=$(( $nbOfListsNottreated + 1 )) 251 fi 252 247 253 echo " $listName : $status | time : $timeTaken" >> simuPrint.txt 248 254 … … 335 341 nbOfListsPacked=0 336 342 nbOfListsFailed=0 343 nbOfListsNottreated=0 337 344 TotalNbInodes=0 338 345 TotalSimuTar=0 … … 441 448 echo "nb of Lists packed with success : ${nbOfListsPacked} / ${totalNbOfList}" 442 449 echo "nb of fails : $nbOfListsFailed" 450 echo "nb of not treated : ${nbOfListsNottreated}" 443 451 echo "nb of inodes packed : $TotalNbInodes" 444 452 echo "nb simul full tared : $TotalSimuTar" … … 455 463 echo "nb of Lists packed with success : ${nbOfListsPacked} / ${totalNbOfList}" >> ${outputFile} 456 464 echo "nb of fails : $nbOfListsFailed" >> ${outputFile} 465 echo "nb of not treated : ${nbOfListsNottreated}" >> ${outputFile} 457 466 echo "nb of inodes packed : $TotalNbInodes" >> ${outputFile} 458 467 echo "nb simul full tared : $TotalSimuTar" >> ${outputFile}
Note: See TracChangeset
for help on using the changeset viewer.