- Timestamp:
- 09/07/12 15:30:06 (12 years ago)
- Location:
- TOOLS/PACK_IPSL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/launch_and_measureTime.sh
r1864 r1869 35 35 echo "./process_list.sh $newCmdToPrint" >> ${tasksListFile} 36 36 ;; 37 x50)38 # ne fait rien, la liste, au depart a concatener, a ete taree39 # car echec de la concatenation40 ;;41 37 *) 42 38 echo "./process_list.sh $cmdToPrint" >> ${tasksListFile} … … 127 123 local file1=$1 128 124 local file2=$2 129 if [ "x${file1}" == "x" ] || [ "x${file2}" == "x" ] 125 local file_to_get_retCode=$3 126 if [ "x${file1}" == "x" ] || [ "x${file2}" == "x" ] || [ "x${file_to_get_retCode}" == "x" ] 130 127 then 131 echo "check_progress : Le nom d'au moins 1 des 2fichiers d'entree est vide" >> $badFailureFile128 echo "check_progress : Le nom d'au moins 1 des 3 fichiers d'entree est vide" >> $badFailureFile 132 129 exit 1 133 130 fi 134 131 135 if [ ! -e $file1 ] || [ ! -e $file2 ] 132 if [ ! -e $file1 ] || [ ! -e $file2 ] || [ ! -e ${file_to_get_retCode} ] 136 133 then 137 echo "check_progress : au moins un des 2 fichiers suivants n'existe pas :" >> $badFailureFile 138 echo "$file1" 139 echo "$file2" 134 echo "check_progress : au moins un des 3 fichiers suivants n'existe pas :" >> $badFailureFile 135 echo "$file1" >> $badFailureFile 136 echo "$file2" >> $badFailureFile 137 echo "${file_to_get_retCode}" >> $badFailureFile 140 138 exit 1 141 139 fi 142 140 local nbLineFile1=`cat $file1 | wc -l ` 143 local nbLineFile 1=`cat $file2 | wc -l `144 if [ $nbLineFile1 -ne $nbLineFile 1]141 local nbLineFile2=`cat $file2 | wc -l ` 142 if [ $nbLineFile1 -ne $nbLineFile2 ] 145 143 then 146 144 echo 1 147 145 return 148 146 fi 147 # si l'on parvient a ce stade, c'est les 2 fichiers ont le meme 148 # nombre de lignes 149 149 150 150 old_IFS=$IFS # sauvegarde du séparateur de champ … … 160 160 fi 161 161 done 162 IFS=$old_IFS # rétablissement du séparateur de champ par défaut 162 IFS=$old_IFS # rétablissement du séparateur de champ par défaut 163 164 # Les codes de retour sont-ils != 0 ? 165 nbNonZeroCodes=`cat ${file_to_get_retCode} | grep -e '^#executed by' | awk '{ if ($9 != 0) {print $9} }' | wc -l ` 166 if [ $nbNonZeroCodes -gt 0 ] 167 then 168 echo 1 169 return 170 fi 171 163 172 echo 0 164 173 } … … 368 377 update_tasks_list $nextInputCmd $output $inputCmd 369 378 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" ] 379 if [ "x${doYouWantCheck}" == "xyes" ] 380 then 381 # Verifications sur qq listes (dont le traitement semble correct) : 382 # ---------------------------------------------------------------------------------------- 383 if [ "x${nbListsToCheck}" == "x" ] 405 384 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 385 echo "nbre de listes a checker absent" >> $checkFile 386 echo "nbre de listes a checker absent" >> $badFailureFile 387 exit 1 411 388 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 ------------------------------------------------------------------------ 389 > $checkFileTmp 390 # ensemble des listes concatenees correctement 391 set_of_good_lists=`cat $output | grep -e '^#executed by process' | awk '{ if ($9==0){print $12} }' | grep "output_ncrcat" ` 392 393 # envoi des cmds de check dans fichier tmp 394 for lst in $set_of_good_lists 395 do 396 echo "./check_ncrcat_list.sh $lst" >> $checkFileTmp 397 done 398 399 # nombre de listes concatenees correctement 400 nb_of_good_lists=`cat $checkFileTmp | wc -l ` 401 402 # le nb de listes a checker ne peut exceder le nb de listes disponibles pour le check 403 if [ $nbListsToCheck -ge $nb_of_good_lists ] 404 then 405 nbListsToCheck=$nb_of_good_lists 406 fi 407 nbLstToCheck_tmp=$nbListsToCheck 408 409 while [ $nbLstToCheck_tmp -gt 0 ] 410 do 411 random_number=$( gives_random_number $nbLstToCheck_tmp ) # nb aleatoire entre 1 et $nbLstToCheck_tmp 412 checkCmd=`sed -n "${random_number}p" $checkFileTmp ` 413 $checkCmd # on envoie la cmd de check 414 resCmd=$? 415 if [ "x${resCmd}" != "x0" ] 416 then 417 echo "$checkCmd ==> not OK ==> stop everything." >> $checkFile 418 echo "$checkCmd ==> not OK ==> stop everything." >> $badFailureFile 419 # exit 1 # a retablir 420 else 421 echo "$checkCmd ==> OK" >> $checkFile 422 fi 423 sed -i "${random_number}d" $checkFileTmp # on retire la cmd qui vient d'etre effectuee du fichier tmp 424 nbLstToCheck_tmp=$(( $nbLstToCheck_tmp - 1 )) 425 done 426 427 428 rm $checkFileTmp 429 # ----- Fin verif ------------------------------------------------------------------------ 430 fi 419 431 420 432 echo "no interruption has occured" > ${noInterruptFile} … … 431 443 fi 432 444 433 # y a t il progression ? 434 # ---------------------- 435 resDiff=$( check_progress $inputCmd $nextInputCmd ) 445 # y a t il progression avant traitements et apres ? 446 # ------------------------------------------------- 447 # Dans la fonction 'check_progress', on a besoin de verifier le code 448 # de retour du traitement des listes : en effet, si les 2 fichiers a comparer 449 # contiennent les memes fichiers de liste, il faut aussi que les codes de 450 # retour soient != 0. 451 file_to_get_lists_retCode=$output 452 resDiff=$( check_progress $inputCmd $nextInputCmd $file_to_get_lists_retCode ) 453 436 454 # resDiff == 1 : fichiers differents 437 455 # resDiff == 0 : fichiers identiques -
TOOLS/PACK_IPSL/process_list.sh
r1864 r1869 105 105 echo "====> DELEGATE to tar command with option --switchtotar" 106 106 echo "DELEGATE to tar command with option --switchtotar" >> $statusfile 107 mkdir -p $PATH_SIMU/output_tar 107 108 mv $set $PATH_SIMU/output_tar 108 109 exit 5 109 110 fi 110 111 111 # Skip the set if last line of the status file is "DELEGATE"112 if tail -1 $statusfile | grep -q -E 'DELEGATE' ; then113 printf "====> "114 tail -1 $statusfile115 exit 50116 fi112 # # Skip the set if last line of the status file is "DELEGATE" 113 # if tail -1 $statusfile | grep -q -E 'DELEGATE' ; then 114 # printf "====> " 115 # tail -1 $statusfile 116 # exit 50 117 # fi 117 118 118 119 # Skip the set if last line of the status file is "COMPLETED" 119 if tail -1 $statusfile | grep -q -E ' COMPLETED' ; then120 if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then 120 121 printf "====> " 121 122 tail -1 $statusfile … … 153 154 # Copy to output_tar directory 154 155 echo "====> COPY to tar command because find other variables ($varstoexcludefiltered) than t_inst_*" 155 echo "COPY to tar command because find other variables ($varstoexcludefiltered) than t_inst_*" >> $statusfile 156 # echo "COPY to tar command because find other variables ($varstoexcludefiltered) than t_inst_*" >> $statusfile 157 mkdir -p $PATH_SIMU/output_tar 156 158 cp $set $PATH_SIMU/output_tar 159 157 160 fi 158 161 … … 178 181 echo "====> COMPLETED at try #$nbtries (at 1st shot on 2)" 179 182 echo "COMPLETED at try #$nbtries (at 1st shot on 2)" >> $statusfile 183 # exit 10 : il faut tarer cette liste dans "output_tar" et tenter de la concatener a nouveau 184 # exit 5 : seulement la tarer dans "output_tar" 185 if [ "x${extratar}" == "x1" ] 186 then 187 exit 10 188 fi 180 189 else 181 190 # Add --md5_digest … … 195 204 echo "====> COMPLETED at try #$nbtries (at 2nd shot on 2)" 196 205 echo "COMPLETED at try #$nbtries (at 2nd shot on 2)" >> $statusfile 206 if [ "x${extratar}" == "x1" ] 207 then 208 exit 10 209 fi 197 210 else 198 211 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` … … 203 216 echo "====> DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)" 204 217 echo "DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)" >> $statusfile 218 mkdir -p $PATH_SIMU/output_tar 205 219 cp $set $PATH_SIMU/output_tar # gpdebug : a retablir 220 exit 10 206 221 fi 207 222 … … 212 227 exit 10 213 228 else 214 exit 5229 exit 1 215 230 fi 216 231 fi
Note: See TracChangeset
for help on using the changeset viewer.