Changeset 1899


Ignore:
Timestamp:
10/18/12 17:52:26 (9 years ago)
Author:
aclsce
Message:

Added what is needed to use monitoring.

Location:
TOOLS/PACK_IPSL
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/PACK_IPSL/showPackProgress.sh

    r1885 r1899  
    225225      
    226226     listName=`echo $(basename $set) | sed 's;\.list$;;' | sed 's;\.nc$;;' ` 
    227      ListNbInode=`cat $set | wc -l` 
    228 #     TotalNbInodes=$(( $TotalNbInodes + $ListNbInode )) 
     227 
    229228     statusfile=${set%%.list}.status 
    230229     status=$( progressStatus $statusfile ) # gpdebug : a retablir 
    231230     timeTaken="???" 
    232    
     231 
     232     if [ -e ${statusfile} ] 
     233     then 
     234         for file in `awk '{print $0}' $set` ; do 
     235         if [[ "$listName" == *"_restart_"* ]] || [[ "$listName" == *"_debug_"* ]]  
     236         then 
     237             file_tmp=$( echo $file | cut -c 5- ) 
     238         else 
     239             file_tmp=$file 
     240         fi 
     241         grep -v $file_tmp ${IGCM_DEM}/Listing_progress.txt > ${IGCM_DEM}/Listing_progress_tmp.txt 
     242         mv ${IGCM_DEM}/Listing_progress_tmp.txt ${IGCM_DEM}/Listing_progress.txt 
     243         done 
     244     fi 
     245 
    233246     packFailed=`echo $status | grep -E '(DELEGATE|FAILED)' | wc -l ` 
    234247     if [ "x${packFailed}" != "x0" ] 
     
    272285focusOnSimu= 
    273286outputFile= 
     287outputFile_simus= 
    274288detailed_mode=1 
    275289publish_mode=1 
     
    303317                     ;; 
    304318   -p) echo "option -p selectionnee : publication" 
    305        publish_mode=0       
     319       publish_mode=0 
     320       outputFile="monit_${USER}.txt" 
     321       outputFile_simus="${USER}_SIMUS/monit_${USER}_simus.txt" 
     322       if [ -d ${USER}_SIMUS ] 
     323       then 
     324           rm -f ${USER}_SIMUS/* 
     325       else 
     326           mkdir -p ${USER}_SIMUS 
     327       fi 
     328       echo "Simulation;Status" > ${outputFile_simus} 
    306329   esac 
    307330   shift 
     
    351374nbOfListsFailed=0 
    352375nbOfListsNottreated=0 
    353 #TotalNbInodes=0 
     376TotalNbInodes=0 
    354377TotalSimuTar=0 
    355378totalTime=0 
    356  
     379cp ${IGCM_DEM}/Listing.txt ${IGCM_DEM}/Listing_progress.txt 
    357380TotalNbSimu=`cat ${IGCM_DEM}/config_card.liste |wc -l` 
    358381 
     
    459482        else 
    460483# Publication 
    461         echo "$simuName;$resSimu" >> ${outputFile}_${USER} 
     484            echo "$simuName;$resSimu" >> ${outputFile_simus} 
     485            if [ "x${resSimu}" == "xnot OK" ] 
     486            then 
     487                simuName_modif=$( echo $simuName | sed s%"/"%"_"%g ) 
     488                cat simuPrint.txt $outRedirectStatemen > ${USER}_SIMUS/${simuName_modif}".log" 
     489            fi 
    462490        fi 
    463491    fi  
     
    465493done 
    466494 
    467 NbInodeBefore=`cat ${IGCM_DEM}/Listing.txt |wc -l` 
    468 # find $IGCM_DEM -printf "%y %s %p \n" >> ${IGCM_DEM}/ListingEnd.txt 
    469 rm -f ${IGCM_DEM}/ListingEnd.txt 
     495NbInodeBefore=`cat ${IGCM_DEM}/Listing.txt | grep "f " | wc -l` 
     496#NbInodeBefore=`cat ${IGCM_DEM}/Listing.txt  | wc -l` 
    470497 if [ -d "${OUTPUT_STORE}" ] 
    471498 then 
    472      find $OUTPUT_STORE -printf "%y %s %p \n" >> ${IGCM_DEM}/ListingEnd.txt 
     499     NbInodeAfterStore=$( find $OUTPUT_STORE -type f -printf "%y %s %p \n" | wc -l ) 
    473500 fi 
    474501 if [ -d "${OUTPUT_WORK}" ] 
    475502 then 
    476      find $OUTPUT_WORK -printf "%y %s %p \n" >> ${IGCM_DEM}/ListingEnd.txt 
     503     NbInodeAfterWork=$( find $OUTPUT_WORK -type f -printf "%y %s %p \n" | wc -l ) 
    477504 fi 
    478505 
    479 if [ -e ${IGCM_DEM}/ListingEnd.txt ] 
    480 then  
    481     NbInodeAfter=`cat ${IGCM_DEM}/ListingEnd.txt |wc -l` 
     506# NbInodeAfter=`cat ${IGCM_DEM}/ListingEnd.txt | grep "f " | wc -l` 
     507 NbInodeAfter=$(( $NbInodeAfterStore + $NbInodeAfterWork )) 
     508 
     509if [ -e ${IGCM_DEM}/Listing_progress.txt ] 
     510then 
     511    NbInodesprogressed=`cat ${IGCM_DEM}/Listing_progress.txt | grep "f " | wc -l` 
     512#    NbInodesprogressed=`cat ${IGCM_DEM}/Listing_progress.txt | wc -l` 
    482513fi 
     514TotalNbInodes=$(( $NbInodeBefore - $NbInodesprogressed )) 
     515 
    483516 
    484517if [ "x${outputFile}" == "x" ] 
     
    494527    echo "nb of fails : $nbOfListsFailed" 
    495528    echo "nb of not treated : ${nbOfListsNottreated}" 
    496 #    echo "nb of inodes packed : $TotalNbInodes" 
     529    echo "nb of inodes packed : $TotalNbInodes" 
    497530    echo "nb simul full tared : $TotalSimuTar" 
    498531    echo "nb inode before : $NbInodeBefore" 
    499     echo "nb inode after : $NbInodeAfter" 
     532    echo "nb inode after WORK : $NbInodeAfterWork" 
     533    echo "nb inode after STORE : $NbInodeAfterStore" 
    500534    echo "Total time for elementary operations : $totalTime"  
    501535    echo "Time since launch start : $timeSinceLaunchStart" 
     
    514548    echo "nb of fails : $nbOfListsFailed" >> ${outputFile} 
    515549    echo "nb of not treated : ${nbOfListsNottreated}" >> ${outputFile} 
    516 #    echo "nb of inodes packed : $TotalNbInodes" >> ${outputFile} 
     550    echo "nb of inodes packed : $TotalNbInodes" >> ${outputFile} 
    517551    echo "nb simul full tared : $TotalSimuTar" >> ${outputFile} 
    518552    echo "nb inode before : $NbInodeBefore" >> ${outputFile} 
     
    522556    else 
    523557# Publication 
    524     echo "User;TotalNbSimu;NbOfSimuPacked;NbOfSimuFailed;NbOfSimuNottreated;TotalNbOfList;NbOfListsPacked;NbOfListsFailed;NbOfListsNottreated;TotalNbFiles;Nbfilesafter;NbSimuTar" > ${outputFile} 
    525     echo "${USER};${TotalNbSimu};${nbOfSimuPacked};${nbOfSimuFailed};${nbOfSimuNottreated};${totalNbOfList};${nbOfListsPacked};$nbOfListsFailed;${nbOfListsNottreated};$NbInodeBefore;$NbInodeAfter;$TotalSimuTar" >> ${outputFile} 
     558    echo "User;Inode NB;Inode Processed;Inode Treatment Percentage;Inode After;Inode store;Inode percentage STORE-WORK;Simu NB;Simu OK; Simu FAILED;Simu Percentage;List NB;List OK;List FAILED;List Percentage" > ${outputFile} 
     559        echo "${USER};$NbInodeBefore;$TotalNbInodes;PIE2;$NbInodeAfter;$NbInodeAfterStore;PIE2;${TotalNbSimu};${nbOfSimuPacked};${nbOfSimuFailed};PIE3;${totalNbOfList};${nbOfListsPacked};$nbOfListsFailed;PIE3" >> ${outputFile} 
    526560    fi 
    527561fi 
Note: See TracChangeset for help on using the changeset viewer.