Changeset 1849 for TOOLS


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

Add parallel version - global double check - minor bug

Location:
TOOLS/PACK_IPSL
Files:
7 added
6 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/PACK_IPSL/DEM_utilities.sh

    r1838 r1849  
    305305   # On verifie que xyz est un nombre a 3 chiffres 
    306306   verNCOnumberOK=`echo $verNCOnumber | grep -e '^[0-9]\{3\}$' | wc -l ` 
    307    #  if ! [[ "$verNCOnumber" =~ ^[0-9]\{3\}$ ]] 
     307   #  if ! [[ "$verNCOnumber" =~ ^[0-9]\{3\}$ ]] # gpdebug : ne marche pas sous curie si ksh.  
    308308   if [ "x${verNCOnumberOK}" == "x0" ] 
    309309   then 
     
    509509} 
    510510 
     511 
     512function getDateMilliSeconds 
     513{ 
     514   test=`date +%s%N` 
     515   testnum=${#test} 
     516   millisec=${test:0:$testnum-6} 
     517   echo "$millisec" 
     518} 
     519 
     520function getTimeDiffSeconds 
     521{ 
     522   startTimeMilliSec=$1 
     523   endTimeMilliSec=$( getDateMilliSeconds ) 
     524    
     525   diffMilliSec=$(( $endTimeMilliSec - $startTimeMilliSec )) 
     526    
     527   diffSeconds=$(awk 'BEGIN { print '$diffMilliSec'/'1000' }') 
     528   echo "$diffSeconds"   
     529 
     530} 
     531 
    511532# gpdebug : fin ##################################################################################### 
    512533 
  • TOOLS/PACK_IPSL/create_config_card.sh

    r1845 r1849  
    5353    #PATH_SIMUL_SHORT=${PATH_SIMUL_FULL##${ROOT_DIR}} # Enleve le debut du path 
    5454#    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed 's%/[^/]*/[^/]*/[^/]*/%%' ) 
    55     PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed 's%/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/%%' ) 
    56  
     55#    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed 's%/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/%%' ) 
     56    echo "gpdebug : PATH_SIMUL_FULL :" # gpdebug : a virer 
     57    echo "$PATH_SIMUL_FULL :" # gpdebug : a virer 
     58    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed "s%${SCRATCHDIR}/%%" ) # gpdebug : added 
     59    echo "gpdebug : PATH_SIMUL_SHORT :" # gpdebug : a virer 
     60    echo "$PATH_SIMUL_SHORT :" # gpdebug : a virer   
    5761    DEM_log -3 PATH_SIMUL_SHORT : ${PATH_SIMUL_SHORT} 
    5862     
  • TOOLS/PACK_IPSL/enlarge_my_files.sh

    r1843 r1849  
    103103# gpdebug : ****************************** fin ******************** 
    104104 
    105  
    106 #********** gpdebug : mesure d'intervalles de temps *************** 
    107 function getDateMilliSeconds 
    108 { 
    109    test=`date +%s%N` 
    110    testnum=${#test} 
    111    millisec=${test:0:$testnum-6} 
    112    echo "$millisec" 
    113 } 
    114  
    115 function getTimeDiffSeconds 
    116 { 
    117    startTimeMilliSec=$1 
    118    endTimeMilliSec=$( getDateMilliSeconds ) 
    119     
    120    diffMilliSec=$(( $endTimeMilliSec - $startTimeMilliSec )) 
    121     
    122    diffSeconds=$(awk 'BEGIN { print '$diffMilliSec'/'1000' }') 
    123    echo "$diffSeconds"   
    124  
    125 } 
    126 # gpdebug : ****************************** fin ******************** 
     105source ${EXE_DIR}/DEM_utilities.sh # gpdebug : pour trouver les fonctions de mesure de temps 
     106 
    127107#------------------------------------------------------ 
    128108for set in $( ls $PATH_SIMU/output_ncrcat/*list ) ; do 
  • TOOLS/PACK_IPSL/launch_ipsl_pack.sh

    r1822 r1849  
    4141 
    4242# fichier de progression d'execution 
    43 extSuiviListes=`echo ${LISTE_SIMUL} | sed 's;\.[[:alnum:]]*$;;' ` 
     43ficParam=$( basename ${LISTE_SIMUL} ) # gpdebug : modif ici et ligne d'apres 
     44extSuiviListes=`echo ${ficParam} | sed 's;\.[[:alnum:]]*$;;' ` 
    4445# echo "extSuiviListes=$extSuiviListes" # gpdebug : a virer 
    4546export MonitoringDir="${PWD}/SuiviListes_${extSuiviListes}" 
  • TOOLS/PACK_IPSL/showListsProgress.sh

    r1822 r1849  
    5656# fichier de progression d'execution 
    5757# Le seul arg du script doit etre un fichier param 
    58 paramFile=$(basename ${1}) 
     58 
     59paramFile=${1} 
     60paramFileBasename=$(basename ${1}) 
     61 
    5962if [ ! -e $paramFile ] || [ "x${paramFile}" == "x" ] 
    6063then 
    61     echo "Le repertoire en argument n existe pas" 
     64    echo "Le fichier en argument n existe pas" 
    6265    exit 0 
    6366fi 
    64 extSuiviListes=`echo ${paramFile} | sed 's;\.[[:alnum:]]*$;;' ` 
     67extSuiviListes=`echo ${paramFileBasename} | sed 's;\.[[:alnum:]]*$;;' ` 
    6568export MonitoringDir="${PWD}/SuiviListes_${extSuiviListes}" 
    6669# echo "MonitoringDir=$MonitoringDir" 
  • 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.