Changeset 1911
- Timestamp:
- 11/08/12 09:53:43 (12 years ago)
- Location:
- TOOLS/PACK_IPSL
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/DEM_utilities.sh
r1910 r1911 1 1 #!/bin/bash 2 3 2 # 4 3 # Fonctions utiles pour les scripts de Pack IPSL … … 232 231 PROGNAME="DEM_utilities.sh" ######### 233 232 . /etc/profile 234 module list >& myModuleList.txt233 module list >& ${JOB_DIR}/myModuleList.txt 235 234 236 235 if [ "x$?" != "x0" ] … … 240 239 fi 241 240 242 if [ ! -e myModuleList.txt ]241 if [ ! -e ${JOB_DIR}/myModuleList.txt ] 243 242 then 244 243 # echo "Le fichier 'myModuleList.txt' n existe pas" … … 247 246 248 247 # Presence de la chaine "n) nco/" ou n est un nombre 249 ncoLines=` grep -e '[[:digit:]]*) nco/' myModuleList.txt `248 ncoLines=` grep -e '[[:digit:]]*) nco/' ${JOB_DIR}/myModuleList.txt ` 250 249 # ncoLines=` grep -e '[[:digit:]]*) nco/' moduleList.txt ` 251 250 # echo "ncoLines=${ncoLines}|" … … 253 252 254 253 # Plus besoin du myModuleList.txt 255 rm -f myModuleList.txt254 rm -f ${JOB_DIR}/myModuleList.txt 256 255 257 256 # La chaine "nco" est remplacee par le caractere "#" … … 331 330 PROGNAME="DEM_utilities.sh" ######### 332 331 . /etc/profile 333 module list >& myModuleList.txt332 module list >& ${JOB_DIR}/myModuleList.txt 334 333 335 334 if [ "x$?" != "x0" ] … … 339 338 fi 340 339 341 if [ ! -e myModuleList.txt ]340 if [ ! -e ${JOB_DIR}/myModuleList.txt ] 342 341 then 343 342 # echo "Le fichier 'myModuleList.txt' n existe pas" … … 346 345 347 346 # Presence de la chaine "n) nco/" ou n est un nombre 348 ncoLines=` grep -e '[[:digit:]]*) nco/' myModuleList.txt `347 ncoLines=` grep -e '[[:digit:]]*) nco/' ${JOB_DIR}/myModuleList.txt ` 349 348 # ncoLines=` grep -e '[[:digit:]]*) nco/' moduleList.txt ` 350 349 # echo "ncoLines=${ncoLines}|" … … 352 351 353 352 # Plus besoin du myModuleList.txt 354 rm -f myModuleList.txt353 rm -f ${JOB_DIR}/myModuleList.txt 355 354 356 355 # La chaine "nco" est remplacee par le caractere "#" … … 427 426 PROGNAME="DEM_utilities.sh" ######### 428 427 . /etc/profile 429 module list >& myModuleList.txt428 module list >& ${JOB_DIR}/myModuleList.txt 430 429 431 430 if [ "x$?" != "x0" ] … … 435 434 fi 436 435 437 if [ ! -e myModuleList.txt ]436 if [ ! -e ${JOB_DIR}/myModuleList.txt ] 438 437 then 439 438 # echo "Le fichier 'myModuleList.txt' n existe pas" … … 442 441 443 442 # Presence de la chaine "n) nco/" ou n est un nombre 444 nb_of_libLines=` grep -e '[[:digit:]]*) netcdf/' myModuleList.txt | wc -l `443 nb_of_libLines=` grep -e '[[:digit:]]*) netcdf/' ${JOB_DIR}/myModuleList.txt | wc -l ` 445 444 446 445 if [ "x${nb_of_libLines}" == "x0" ] … … 450 449 451 450 # Plus besoin du myModuleList.txt 452 rm -f myModuleList.txt451 rm -f ${JOB_DIR}/myModuleList.txt 453 452 } 454 453 … … 458 457 PROGNAME="DEM_utilities.sh" ######### 459 458 . /etc/profile 460 module list >& myModuleList.txt459 module list >& ${JOB_DIR}/myModuleList.txt 461 460 462 461 if [ "x$?" != "x0" ] … … 466 465 fi 467 466 468 if [ ! -e myModuleList.txt ]467 if [ ! -e ${JOB_DIR}/myModuleList.txt ] 469 468 then 470 469 # echo "Le fichier 'myModuleList.txt' n existe pas" … … 473 472 474 473 # Presence de la chaine "n) nco/" ou n est un nombre 475 nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' myModuleList.txt | wc -l `474 nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' ${JOB_DIR}/myModuleList.txt | wc -l ` 476 475 477 476 if [ "x${nb_of_libLines}" == "x0" ] … … 481 480 482 481 # Plus besoin du myModuleList.txt 483 rm -f myModuleList.txt482 rm -f ${JOB_DIR}/myModuleList.txt 484 483 485 484 } … … 491 490 PROGNAME="DEM_utilities.sh" ######### 492 491 . /etc/profile 493 module list >& myModuleList.txt492 module list >& ${JOB_DIR}/myModuleList.txt 494 493 495 494 if [ "x$?" != "x0" ] … … 499 498 fi 500 499 501 if [ ! -e myModuleList.txt ]500 if [ ! -e ${JOB_DIR}/myModuleList.txt ] 502 501 then 503 502 # echo "Le fichier 'myModuleList.txt' n existe pas" … … 506 505 507 506 # Presence de la chaine "n) nco/" ou n est un nombre 508 nb_of_libLines=` grep -e '[[:digit:]]*) cdo/' myModuleList.txt | wc -l `507 nb_of_libLines=` grep -e '[[:digit:]]*) cdo/' ${JOB_DIR}/myModuleList.txt | wc -l ` 509 508 510 509 if [ "x${nb_of_libLines}" == "x0" ] … … 514 513 515 514 # Plus besoin du myModuleList.txt 516 rm -f myModuleList.txt515 rm -f ${JOB_DIR}/myModuleList.txt 517 516 518 517 } -
TOOLS/PACK_IPSL/archive_debug.sh
r1900 r1911 58 58 59 59 cd ${STORE_DEBUG} 60 if [ "x${STORE_DEBUG}" != "x" ] 61 then 60 62 rm -rf * 63 fi 61 64 62 65 # On copie les fichiers de Debug sur le scratchdir en changeant le nom et conservant la date -
TOOLS/PACK_IPSL/archive_restart.sh
r1900 r1911 74 74 75 75 cd ${STORE_RESTART} 76 if [ "x${STORE_RESTART}" != "x" ] 77 then 76 78 rm -rf * 79 fi 77 80 78 81 # On les copie sur le scratchdir en changeant le nom et conservant la date -
TOOLS/PACK_IPSL/check_libccc_user.sh
r1867 r1911 3 3 function check_cdo 4 4 { 5 module list >& myModuleList.txt 5 . load_ipslPack_env.sh 6 module list >& ${TMP_MIGR_DATA}/myModuleList.txt 6 7 7 8 # Presence de la chaine "n) nco/" ou n est un nombre 8 nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' myModuleList.txt | wc -l `9 nb_of_libLines=` grep -e '[[:digit:]]*) libccc_user/' ${TMP_MIGR_DATA}/myModuleList.txt | wc -l ` 9 10 10 11 if [ "x${nb_of_libLines}" == "x0" ] … … 15 16 16 17 # Plus besoin du myModuleList.txt 17 rm -f myModuleList.txt > /dev/null 2>&118 rm -f ${TMP_MIGR_DATA}/myModuleList.txt > /dev/null 2>&1 18 19 # echo "0" 19 20 exit 0 -
TOOLS/PACK_IPSL/diff.bash
r1882 r1911 16 16 fi 17 17 18 cdo -s $delname $1 out_tmp1.nc19 cdo -s $delname $2 out_tmp2.nc18 cdo -s $delname $1 ${JOB_DIR}/out_tmp1.nc 19 cdo -s $delname $2 ${JOB_DIR}/out_tmp2.nc 20 20 21 cdo -s diff out_tmp1.nc out_tmp2.nc >diff_$$.tmp 2>&122 result2=`cat diff_$$.tmp | grep -i "records differ" | tr -s " " | cut -f2 -d" "`21 cdo -s diff ${JOB_DIR}/out_tmp1.nc ${JOB_DIR}/out_tmp2.nc > ${JOB_DIR}/diff_$$.tmp 2>&1 22 result2=`cat ${JOB_DIR}/diff_$$.tmp | grep -i "records differ" | tr -s " " | cut -f2 -d" "` 23 23 24 24 if [ "$result2" = "0" ] ; then … … 28 28 echo "$2" 29 29 echo "are the same" 30 rm -f diff_$$.tmp out_tmp1.ncout_tmp2.nc30 rm -f ${JOB_DIR}/diff_$$.tmp ${JOB_DIR}/out_tmp1.nc ${JOB_DIR}/out_tmp2.nc 31 31 exit 0 32 32 else … … 36 36 echo "$2" 37 37 echo "differ" 38 cat diff_$$.tmp | grep -i "records differ"39 rm -f diff_$$.tmp out_tmp1.ncout_tmp2.nc38 cat ${JOB_DIR}/diff_$$.tmp | grep -i "records differ" 39 rm -f ${JOB_DIR}/diff_$$.tmp ${JOB_DIR}/out_tmp1.nc ${JOB_DIR}/out_tmp2.nc 40 40 echo "==============> ERROR" 41 41 exit 1 -
TOOLS/PACK_IPSL/find_directory_simul.sh
r1900 r1911 104 104 DEM_log -1 "Suppression des doublons" 105 105 106 awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' <${IGCM_TMP}/${$}.path_simul.txt >> liste_simul_${LISTE_SIMUL_NAME}107 awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' < liste_simul_${LISTE_SIMUL_NAME} >>liste_simul_${LISTE_SIMUL_NAME}.tmp${$}108 mv liste_simul_${LISTE_SIMUL_NAME}.tmp${$} ${IGCM_DEM}/liste_simul_${LISTE_SIMUL_NAME}109 rm -f liste_simul_${LISTE_SIMUL_NAME}106 awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' <${IGCM_TMP}/${$}.path_simul.txt >> ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME} 107 awk '{if (x[$0] != "") next ; print $0 ; x[$0]=$0}' <${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME} >> ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME}.tmp${$} 108 mv ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME}.tmp${$} ${IGCM_DEM}/liste_simul_${LISTE_SIMUL_NAME} 109 rm -f ${JOB_DIR}/liste_simul_${LISTE_SIMUL_NAME} 110 110 111 111 # gpdebug : envoi du nombre de simu dans un "nbSimu.txt" du rep de suivi -
TOOLS/PACK_IPSL/launch_and_measureTime.sh
r1900 r1911 58 58 59 59 # Il peut arriver que 2 listes soient identiques, on empeche ce cas 60 cat ${tasksListFile} | sort | uniq > taskFile.txt61 cat taskFile.txt > ${tasksListFile}60 cat ${tasksListFile} | sort | uniq > ${JOB_DIR}/taskFile.txt 61 cat ${JOB_DIR}/taskFile.txt > ${tasksListFile} 62 62 63 63 } … … 343 343 #MSUB -r pack_ipsl # Nom du job 344 344 ### mutable directives ### 345 #MSUB -o /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/ detailed_pack_output/pack_ipsl_%I.o346 #MSUB -e /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/ detailed_pack_output/pack_ipsl_%I.e345 #MSUB -o /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/R55C/detailed_pack_output/pack_ipsl_%I.o 346 #MSUB -e /ccc/dmfbuf/ipsl_logs/dsm/bacasable/ARNAUD/PSEUDO_DMNFS_PROGRESS/ARNAUD/IPSLCM5/R55C/detailed_pack_output/pack_ipsl_%I.e 347 347 #MSUB -n 16 348 348 #MSUB -T 1500 … … 352 352 ########## batch directives : end ########## 353 353 set +x 354 355 354 export JOB_DIR=${TMP_MIGR_DATA} 356 355 export EXE_DIR=${LS_SUBCWD:-${PWD}} … … 376 375 export reportFile="${progressDir}/report__try__${numCurrentTry}__instance__${numNewInstance}.log" 377 376 export checkFile="${progressDir}/check__try__${numCurrentTry}__instance__${numNewInstance}.log" 378 export checkFileTmp=" checkTmp__try__${numCurrentTry}__instance__${numNewInstance}.txt"377 export checkFileTmp="${JOB_DIR}/checkTmp__try__${numCurrentTry}__instance__${numNewInstance}.txt" 379 378 380 379 export listsOfFilesToRemove="${progressDir}/listsToRmv__try__${numCurrentTry}__instance__${numNewInstance}.txt" -
TOOLS/PACK_IPSL/process_list.sh
r1900 r1911 50 50 for file in `cat $1` ; do 51 51 # ncdump -h ${file} | gawk '{if (match($0, /(byte|char|short|int|float|double) (.*)\(/, arr)) print arr[2] }' >> tmp_$$.txt 52 ncdump -h ${file} | grep -Ew "byte|char|short|int|float|double" | awk -F\( '{split($1,a," ") ; split($2,b,")") ; if (a[2] != b[1]) print a[2]}' >> tmp_$$.txt52 ncdump -h ${file} | grep -Ew "byte|char|short|int|float|double" | awk -F\( '{split($1,a," ") ; split($2,b,")") ; if (a[2] != b[1]) print a[2]}' >> ${JOB_DIR}/tmp_$$.txt 53 53 let nbfile=nbfile+1 54 54 done 55 55 56 varstoexclude=`cat tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 != nbfile) {print $2}}' | paste -s -d','`57 varstoexcludefiltered=`cat tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if (($1 != nbfile) && !(match($2, /t_inst_(.*)/))) {print $2}}' | paste -s -d','`56 varstoexclude=`cat ${JOB_DIR}/tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 != nbfile) {print $2}}' | paste -s -d','` 57 varstoexcludefiltered=`cat ${JOB_DIR}/tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if (($1 != nbfile) && !(match($2, /t_inst_(.*)/))) {print $2}}' | paste -s -d','` 58 58 nbvars=`echo $varstoexcludefiltered | gawk -F',' '{print NF}'` 59 59 -
TOOLS/PACK_IPSL/showListsProgress.sh
r1900 r1911 53 53 # Main program ######## 54 54 ####################### 55 55 . load_ipslPack_env.sh 56 56 # fichier de progression d'execution 57 57 # Le seul arg du script doit etre un fichier param 58 59 paramFile=${1} 60 paramFileBasename=$(basename ${1}) 61 62 if [ ! -e $paramFile ] || [ "x${paramFile}" == "x" ] 58 # paramFile=${1} 59 # paramFileBasename=$(basename ${1}) 60 61 # if [ ! -e $paramFile ] || [ "x${paramFile}" == "x" ] 62 # then 63 # echo "Le fichier en argument n existe pas" 64 # exit 0 65 # fi 66 67 if [ ! -e ${1} ] || [ "x${1}" == "x" ] 63 68 then 64 69 echo "Le fichier en argument n existe pas" 65 70 exit 0 66 fi 71 else 72 paramFile=${1} 73 paramFileBasename=$(basename ${1}) 74 fi 75 76 67 77 extSuiviListes=`echo ${paramFileBasename} | sed 's;\.[[:alnum:]]*$;;' ` 68 78 export MonitoringDir="${TMP_MIGR_DATA}/SuiviListes_${extSuiviListes}" -
TOOLS/PACK_IPSL/showPackProgress.sh
r1900 r1911 55 55 { 56 56 statFile=$1 57 echo "statFile=$1" >> showPackProgress.log57 echo "statFile=$1" >> ${JOB_DIR}/showPackProgress.log 58 58 if [ ! -e $statFile ] 59 59 then … … 61 61 return 62 62 fi 63 echo "blabla" >> showPackProgress.log64 echo "----------------------------------------------" >> showPackProgress.log63 echo "blabla" >> ${JOB_DIR}/showPackProgress.log 64 echo "----------------------------------------------" >> ${JOB_DIR}/showPackProgress.log 65 65 # echo "progressStatus..." # gpdebug : a virer 66 66 … … 266 266 fi 267 267 268 echo " $listName : $status | time : $timeTaken" >> simuPrint.txt268 echo " $listName : $status | time : $timeTaken" >> ${JOB_DIR}/simuPrint.txt 269 269 270 270 timeInSecondsOK=`echo $timeTaken | grep -e '^[[:digit:].]*$' | wc -l ` … … 339 339 340 340 341 > showPackProgress.log # vider le fichier de log341 > ${JOB_DIR}/showPackProgress.log # vider le fichier de log 342 342 343 343 … … 399 399 simuName=$( getSimuName $CONFIG ) 400 400 401 > simuPrint.txt401 > ${JOB_DIR}/simuPrint.txt 402 402 403 403 export PATH_SIMU=$( dirname $CONFIG ) … … 413 413 for dir in $listOfDir 414 414 do 415 echo " ${dir} :" >> simuPrint.txt415 echo " ${dir} :" >> ${JOB_DIR}/simuPrint.txt 416 416 if [ ! -d $PATH_SIMU/${dir} ] 417 417 then 418 echo " ${dir} n'existe pas pour cette simu" >> simuPrint.txt418 echo " ${dir} n'existe pas pour cette simu" >> ${JOB_DIR}/simuPrint.txt 419 419 # simuOK=$(( $simuOK && 0 )) # marque une simu pas OK 420 420 continue … … 424 424 if [ "x$listFilesInDir" == "x0" ] 425 425 then 426 echo " -- no list --" >> simuPrint.txt426 echo " -- no list --" >> ${JOB_DIR}/simuPrint.txt 427 427 continue 428 428 fi … … 468 468 if [ "x${detailed_mode}" == "x1" ] 469 469 then 470 cat simuPrint.txt $outRedirectStatement470 cat ${JOB_DIR}/simuPrint.txt $outRedirectStatement 471 471 fi 472 472 else … … 478 478 if [ "x${detailed_mode}" == "x1" ] 479 479 then 480 cat simuPrint.txt $outRedirectStatement >> ${outputFile}480 cat ${JOB_DIR}/simuPrint.txt $outRedirectStatement >> ${outputFile} 481 481 fi 482 482 else … … 486 486 then 487 487 simuName_modif=$( echo $simuName | sed s%"/"%"_"%g ) 488 cat simuPrint.txt $outRedirectStatemen > ${USER}_SIMUS/${simuName_modif}".log"488 cat ${JOB_DIR}/simuPrint.txt $outRedirectStatemen > ${USER}_SIMUS/${simuName_modif}".log" 489 489 fi 490 490 fi 491 491 fi 492 rm simuPrint.txt492 rm ${JOB_DIR}/simuPrint.txt 493 493 done 494 494
Note: See TracChangeset
for help on using the changeset viewer.