Changeset 1853 for TOOLS/PACK_IPSL/showPackProgress.sh
- Timestamp:
- 09/03/12 11:29:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/showPackProgress.sh
r1850 r1853 4 4 export EXE_DIR=${JOB_DIR} 5 5 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 # -------------------- 15 export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane 16 export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE 17 export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK 6 # On renseigne les variables d'environnement 7 . load_ipslPack_env.sh 18 8 19 9 SCRIPT_NAME=$(basename ${0} ) 20 10 21 export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM 22 export IGCM_TMP=${SCRATCHDIR}/IGCM_DEM/tmp 11 export IGCM_TMP="${IGCM_DEM}/tmp" # gpdebug : added 23 12 24 13 export config_card=${IGCM_DEM}/config_card.liste … … 26 15 source ${EXE_DIR}/DEM_utilities.sh 27 16 28 export timeHandlingFile=" timeHandlingFile.txt"17 export timeHandlingFile="${USER_OUTPUT_PROGRESS}/timeHandlingFile.txt" 29 18 30 19 … … 33 22 config_card=$1 34 23 35 baseName=$( basename $config_card )36 simuName=`echo ${ baseName} | sed 's;config_card_;;'`24 dirSimu=$( dirname $config_card ) 25 simuName=`echo ${dirSimu} | sed "s;${IGCM_DEM}/;;" ` 37 26 echo $simuName 38 27 … … 194 183 } 195 184 185 186 187 function getListProgress 188 { 189 set=$1 190 191 listName=`echo $(basename $set) | sed 's;\.list$;;' | sed 's;\.nc$;;' ` 192 ListNbInode=`cat $set |wc -l` 193 TotalNbInodes=$(( $TotalNbInodes + $ListNbInode )) 194 statusfile=${set%%.list}.status 195 status=$( progressStatus $statusfile ) # gpdebug : a retablir 196 timeTaken="???" 197 198 packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible)' | wc -l ` 199 if [ "x${packFailed}" != "x0" ] 200 then 201 nbOfListsFailed=$(( $nbOfListsFailed + 1 )) 202 simuOK=$(( $simuOK && 0 )) # marque une simu pas OK 203 fi 204 205 packSuccess=`echo $status | grep "COMPLETED" | wc -l ` 206 if [ "x${packSuccess}" != "x0" ] 207 then 208 timeTaken=$( getTimeTaken $statusfile ) 209 nbOfListsPacked=$(( $nbOfListsPacked + 1 )) 210 fi 211 212 echo " $listName : $status | time : $timeTaken" >> simuPrint.txt 213 214 timeInSecondsOK=`echo $timeTaken | grep -e '^[[:digit:].]*$' | wc -l ` 215 if [ "x${timeInSecondsOK}" != "x0" ] 216 then 217 totalTime=$(awk 'BEGIN { print '$totalTime'+'$timeTaken' }') 218 fi 219 220 221 222 } 223 196 224 ################################# 197 225 ####### Main script ############# 198 226 ################################# 227 228 ######## Options du script ######################################################## 229 focusOnSimu= 230 outputFile= 231 detailed_mode=1 232 while [ $# -gt 0 ] 233 do 234 # echo "boucle sur les arguments du script ..." 235 # echo "@=$@" 236 case $1 in 237 -s) echo "option -s selectionnee : afficher une simulation" 238 shift 239 focusOnSimu=$1 240 is_simu_an_option=`echo $focusOnSimu | grep -e '^-' | wc -l ` 241 if [ "x${is_simu_an_option}" != "x0" ] || [ "x$focusOnSimu" == "x" ] 242 then 243 echo "L'option -s doit etre suivie d'une simulation !" 244 exit 1 245 fi 246 ;; 247 -o) echo "option -o selectionnee : fichier d'output" 248 shift 249 outputFile=$1 250 is_output_an_option=`echo $outputFile | grep -e '^-' | wc -l ` 251 if [ "x${is_output_an_option}" != "x0" ] || [ "x$outputFile" == "x" ] 252 then 253 echo "L'option -o doit etre suivie d'un fichier d'output !" 254 exit 1 255 fi 256 ;; 257 --not-detailled) echo "option '--not-detailled' selectionnee" 258 detailed_mode=0 259 ;; 260 esac 261 shift 262 done 263 264 # echo "focusOnSimu=$focusOnSimu" 265 # echo "outputFile=$outputFile" 266 # echo "detailed_mode=$detailed_mode" 267 ###################################################################################### 268 # exit 0 # gpdebug : a virer 269 270 271 199 272 > showPackProgress.log # vider le fichier de log 273 200 274 201 275 # Recuperation des temps d'attente et ecoule depuis de demarrage des traitements en batch … … 228 302 totalTime=0 229 303 304 230 305 for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do 231 306 232 307 DEM_state=$( DEM_read_state ${IGCM_DEM}/config_card.liste ${CONFIG} ) 233 234 if [[ "${DEM_state}" != "TarDone" ]] ; then 235 236 simuName=$( getSimuName $CONFIG ) 237 echo "*******************************************" 238 echo "simulation : $simuName" 239 echo "*******************************************" 240 export PATH_SIMU=$( dirname $CONFIG ) 241 # echo "PATH_SIMU = $PATH_SIMU" 242 308 309 # Eviter les simus autre que celle selectionnee par l'option -s 310 showCurrentSimu=`echo $CONFIG | grep "${focusOnSimu}" | wc -l ` 311 if [ "x${showCurrentSimu}" == "x0" ] 312 then 313 continue 314 fi 315 316 simuName=$( getSimuName $CONFIG ) 317 318 > simuPrint.txt 319 320 export PATH_SIMU=$( dirname $CONFIG ) 321 # echo "PATH_SIMU = $PATH_SIMU" 322 323 simuOK=1 324 325 if [ ! -e "${PATH_SIMU}/tar_full_simul.list" ] 326 then 327 243 328 listOfDir="output_ncrcat output_tar restart_tar debug_tar store_cp work_cp" 244 329 for dir in $listOfDir 245 330 do 246 echo " ${dir} :" 331 echo " ${dir} :" >> simuPrint.txt 247 332 if [ ! -d $PATH_SIMU/${dir} ] 248 333 then 249 echo " ${dir} n'existe pas pour cette simu" 334 echo " ${dir} n'existe pas pour cette simu" >> simuPrint.txt 335 simuOK=$(( $simuOK && 0 )) # marque une simu pas OK 250 336 continue 251 337 fi … … 254 340 if [ "x$listFilesInDir" == "x0" ] 255 341 then 256 echo " -- no list --" 342 echo " -- no list --" >> simuPrint.txt 257 343 continue 258 344 fi … … 262 348 for set in $setList 263 349 do 264 listName=`echo $(basename $set) | sed 's;\.list$;;' | sed 's;\.nc$;;' ` 265 ListNbInode=`cat $set |wc -l` 266 TotalNbInodes=$(( $TotalNbInodes + $ListNbInode )) 267 statusfile=${set%%.list}.status 268 status=$( progressStatus $statusfile ) # gpdebug : a retablir 269 timeTaken="???" 270 # progressStatus $statusfile # gpdebug : a virer 271 # exit 0 # gpdebug : a virer 272 273 packFailed=`echo $status | grep -E '(DELEGATE|FAILED|illisible)' | wc -l ` 274 if [ "x${packFailed}" != "x0" ] 275 then 276 nbOfListsFailed=$(( $nbOfListsFailed + 1 )) 277 fi 278 279 packSuccess=`echo $status | grep "COMPLETED" | wc -l ` 280 if [ "x${packSuccess}" != "x0" ] 281 then 282 timeTaken=$( getTimeTaken $statusfile ) 283 nbOfListsPacked=$(( $nbOfListsPacked + 1 )) 284 fi 285 286 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 350 getListProgress $set 293 351 done 294 352 done 353 else 354 getListProgress ${PATH_SIMU}/tar_full_simul.list 355 TotalSimuTar=$(( $TotalSimuTar + 1 )) 356 fi 357 358 resSimu="OK" 359 if [ "x${simuOK}" == "x0" ] 360 then 361 resSimu="not OK" 362 fi 363 364 if [ "x${outputFile}" == "x" ] 365 then 366 echo "***************************************************" 367 echo "simulation : $simuName ===> $resSimu" 368 echo "***************************************************" 369 if [ "x${detailed_mode}" == "x1" ] 370 then 371 cat simuPrint.txt $outRedirectStatement 372 fi 295 373 else 296 #si "${DEM_state}" == "TarDone" 297 298 simuName=$( getSimuName $CONFIG ) 299 echo "*******************************************" 300 echo "simulation : $simuName TAR" 301 echo "*******************************************" 302 TotalSimuTar=$(( $TotalSimuTar + 1 )) 303 fi 374 echo "***************************************************" >> ${outputFile} 375 echo "simulation : $simuName ===> $resSimu" >> ${outputFile} 376 echo "***************************************************" >> ${outputFile} 377 if [ "x${detailed_mode}" == "x1" ] 378 then 379 cat simuPrint.txt $outRedirectStatement >> ${outputFile} 380 fi 381 fi 382 rm simuPrint.txt 304 383 done 305 384
Note: See TracChangeset
for help on using the changeset viewer.