Ignore:
Timestamp:
08/09/12 10:55:47 (12 years ago)
Author:
acosce
Message:

Add parallel version - global double check - minor bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/PACK_IPSL/showPackProgress.sh

    r1848 r1849  
    44export EXE_DIR=${JOB_DIR} 
    55 
    6 export INPUT_DMF_DATA=${SCRATCHDIR}/PSEUDO_DMNFS_light 
    7 export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE 
    8 export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK 
     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# -------------------- 
     15export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane 
     16export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE  
     17export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK 
    918 
    1019SCRIPT_NAME=$(basename ${0} ) 
     
    1625 
    1726source ${EXE_DIR}/DEM_utilities.sh 
     27 
     28export timeHandlingFile="timeHandlingFile.txt" 
    1829 
    1930 
     
    115126 
    116127 
     128function getWaitingTime 
     129{ 
     130    timeNow_=$1 
     131    stillWaiting_=1 
     132     
     133    launchTimeString=`cat $timeHandlingFile | grep -e 'launch time:[[:digit:].]*$' ` 
     134    if [ "x${launchTimeString}" == "x" ] 
     135    then 
     136        echo "no launch time" 
     137        return 
     138    fi 
     139    launchTime_=`echo $launchTimeString | awk -F":" '{print $2}' ` 
     140     
     141     
     142    startExecTimeString=`cat $timeHandlingFile | grep -e 'start time:[[:digit:].]*$' ` 
     143    if [ "x${startExecTimeString}" == "x" ] 
     144    then 
     145        execTime_=${timeNow_}    
     146    else 
     147        execTime_=`echo $startExecTimeString | awk -F":" '{print $2}' ` 
     148        stillWaiting_=0 
     149    fi 
     150     
     151    waitingTime_=$( awk 'BEGIN { print '${execTime_}'-'${launchTime_}' }' ) 
     152    waitingTime_=$( awk 'BEGIN { print '${waitingTime_}'/'1000' }' ) 
     153    if [ "x$stillWaiting_" == "x1" ] 
     154    then 
     155       waitingTime_="${waitingTime_}, still waiting..." 
     156    fi 
     157     
     158    echo $waitingTime_ 
     159} 
     160     
     161     
     162function getTimeSinceExecutionStart 
     163 
     164     
     165    timeNow_=$1 
     166    stillWaiting_=1     
     167     
     168    execTimeString=`cat $timeHandlingFile | grep -e 'start time:[[:digit:].]*$' ` 
     169    if [ "x${execTimeString}" == "x" ] 
     170    then 
     171        echo "no start time" 
     172        return 
     173    fi 
     174    execTime_=`echo $execTimeString | awk -F":" '{print $2}' ` 
     175     
     176         
     177    endTimeString=`cat $timeHandlingFile | grep -e 'end time:[[:digit:].]*$' ` 
     178    if [ "x${endTimeString}" == "x" ] 
     179    then 
     180        endTime_=${timeNow_} 
     181    else 
     182        endTime_=`echo $endTimeString | awk -F":" '{print $2}' ` 
     183        stillWaiting_=0 
     184    fi 
     185     
     186    timeSinceExec_=$( awk 'BEGIN { print '${endTime_}'-'${execTime_}' }' ) 
     187    timeSinceExec_=$( awk 'BEGIN { print '${timeSinceExec_}'/'1000' }' ) 
     188    if [ "x$stillWaiting_" == "x1" ] 
     189    then 
     190       timeSinceExec_="${timeSinceExec_}, still executing..." 
     191    fi 
     192     
     193    echo $timeSinceExec_ 
     194} 
     195 
    117196################################# 
    118197####### Main script ############# 
    119198################################# 
    120199> showPackProgress.log # vider le fichier de log 
     200 
     201# Recuperation des temps d'attente et ecoule depuis de demarrage des traitements en batch 
     202if [ -e $timeHandlingFile ] 
     203then 
     204    timeNow=$( getDateMilliSeconds ) 
     205    waitingTime=$( getWaitingTime $timeNow ) 
     206    timeSinceExecutionStart=$( getTimeSinceExecutionStart $timeNow ) 
     207else 
     208    waitingTime="no handling time file available." 
     209    timeFromExecutionStart="no handling time file available." 
     210fi 
     211 
    121212 
    122213totalNbOfList=0 
     
    135226TotalNbInodes=0 
    136227TotalSimuTar=0 
     228totalTime=0 
    137229 
    138230for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do  
     
    193285                   
    194286                  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 
    195293             done 
    196294         done 
     
    219317echo "nb inode before : $NbInodeBefore" 
    220318echo "nb inode after : $NbInodeAfter" 
    221  
    222  
    223  
    224  
     319echo "Total time for elementary operations : $totalTime  (sum of times on several proc)"  
     320echo "waiting time : $waitingTime" 
     321echo "Time since execution start : $timeSinceExecutionStart"  
     322 
     323 
     324 
     325 
Note: See TracChangeset for help on using the changeset viewer.