- Timestamp:
- 09/03/12 11:29:13 (12 years ago)
- Location:
- TOOLS/PACK_IPSL
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/DEM_utilities.sh
r1849 r1853 324 324 } 325 325 326 function check_libccc_user 327 { 328 # nom du présent prog (pour gestion des erreurs) 329 PROGNAME="DEM_utilities.sh" ######### 330 . /etc/profile 331 module list >& myModuleList.txt 332 333 if [ "x$?" != "x0" ] 334 then 335 # echo "La commande module list a rencontre un pb !" 336 DEM_errorSend "${PROGNAME}:${LINENO}:La commande module list a rencontre un pb !" 337 fi 338 339 if [ ! -e myModuleList.txt ] 340 then 341 # echo "Le fichier 'myModuleList.txt' n existe pas" 342 DEM_errorSend "${PROGNAME}:${LINENO}:Le fichier 'myModuleList.txt' n'existe pas." 343 fi 344 345 # Presence de la chaine "n) nco/" ou n est un nombre 346 libLines=` grep -e '[[:digit:]]*) libccc_user/' myModuleList.txt ` 347 echo "libLines :" 348 echo $libLines 349 nb_of_libLines=`echo $libLines | wc -l ` 350 if [ "x${nb_of_libLines}" == "x0" ] 351 then 352 DEM_errorSend "${PROGNAME}:${LINENO}:Aucun libccc_user n'est charge" 353 fi 354 355 # Plus besoin du myModuleList.txt 356 # rm -f myModuleList.txt 357 358 } 326 359 function prepareMonitoringDir 327 360 { -
TOOLS/PACK_IPSL/Makefile
r1849 r1853 1 1 2 MPICC=mpicc 3 MPICC_OPTS=-g 4 # do not forget "module load libccc_user" before 5 ifneq ($(CCC_LIBCCC_USER_LDFLAGS),) 6 LIBS=$(CCC_LIBCCC_USER_LDFLAGS) 7 MPICC_OPTS+=-D __HAVE_LIBCCC_USER__ -I$(CCC_LIBCCC_USER_INC_DIR) 8 endif 2 9 3 10 .PHONY: all 4 all : cmd_launch.exe11 all : glost_launch 5 12 6 %.exe:%.c 7 $(MPICC) -o $@ $< 13 %:%.c 14 $(MPICC) $(MPICC_OPTS) -o $@ $< $(LIBS) 15 16 clean: 17 $(RM) glost_launch 8 18 9 19 … … 12 22 13 23 14 -
TOOLS/PACK_IPSL/check_ncrcat_list.sh
r1849 r1853 5 5 # /ccc/scratch/cont003/incka/pierreg/IGCM_DEM/dataDMNFS_FromTitane/IGCM_OUT/IPSLCM5A/REDO/historicalGHG/v3.historicalGHG1R/output_tar/v3.historicalGHG1R_20101201_20121231_1M_histmthNMC.nc.list 6 6 7 if [ ! -e $listToProcessFile ] 8 then 9 echo "Le fichier en entree n'existe pas. STOP." 10 exit 1 11 fi 7 12 8 # export INPUT_DMF_DATA=${SCRATCHDIR}/datasLabo/dataDMNFS_simple1 9 export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane 10 11 # export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE 12 export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE 13 14 # export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK 15 export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK 16 17 # export OUTPUT_CHECK=${SCRATCHDIR}/PSEUDO_DMNFS_CHECK 18 export OUTPUT_CHECK=${SCRATCHDIR}/dataDMNFS_FromTitane_CHECK 13 # On renseigne les variables d'environnement (ici surtout pour la var OUTPUT_CHECK) 14 . load_ipslPack_env.sh 19 15 20 16 … … 28 24 source ${EXE_DIR}/DEM_utilities.sh 29 25 30 dirPathOfListFile=$( dirname $listToProcessFile ) 31 dirnameOfListFile=$( basename $dirPathOfListFile ) 26 # Ca sert a quoi tout ca ? 27 # dirPathOfListFile=$( dirname $listToProcessFile ) 28 # dirnameOfListFile=$( basename $dirPathOfListFile ) 32 29 33 30 # rep de simu : celui contenant le rep qui contient la liste 34 PATH_SIMU=$( dirname $dirPathOfListFile ) 31 # PATH_SIMU=$( dirname $dirPathOfListFile ) 32 35 33 set=$listToProcessFile 36 34 … … 63 61 64 62 echo 65 echo " Output file to write:"63 echo "ncrcat file to compare cdo cat file with :" 66 64 echo "$output_ncrcat_file" 67 65 echo -
TOOLS/PACK_IPSL/create_config_card.sh
r1849 r1853 56 56 echo "gpdebug : PATH_SIMUL_FULL :" # gpdebug : a virer 57 57 echo "$PATH_SIMUL_FULL :" # gpdebug : a virer 58 PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed "s%${ SCRATCHDIR}/%%" ) # gpdebug : added58 PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed "s%${INPUT_DMF_DATA}/%%" ) # gpdebug : added 59 59 echo "gpdebug : PATH_SIMUL_SHORT :" # gpdebug : a virer 60 60 echo "$PATH_SIMUL_SHORT :" # gpdebug : a virer -
TOOLS/PACK_IPSL/enlarge_my_files.sh
r1849 r1853 62 62 fi 63 63 64 if [[ ! -d $PATH_SIMU/output_ncrcat || ! -d $PATH_SIMU/output_tar || ! -d $PATH_SIMU/restart_tar || ! -d $PATH_SIMU/store_cp || ! -d $PATH_SIMU/work_cp || ! -d $PATH_SIMU/debug_tar || ! -d $PATH_SIMU/other_tar ]] ; then 64 if ( \ 65 [ ! -d $PATH_SIMU/output_ncrcat ] || \ 66 [ ! -d $PATH_SIMU/output_tar ] || \ 67 [ ! -d $PATH_SIMU/restart_tar ] || \ 68 [ ! -d $PATH_SIMU/store_cp ] || \ 69 [ ! -d $PATH_SIMU/work_cp ] || \ 70 [ ! -d $PATH_SIMU/debug_tar ] || \ 71 [ ! -d $PATH_SIMU/other_tar ] \ 72 ) \ 73 && \ 74 [ ! -e $PATH_SIMU/tar_full_simul.list ] 75 then 65 76 `dirname $0`/enlarge_my_files.sh -h 66 77 exit … … 599 610 #----------------------------------- 600 611 601 done 612 done 613 614 # if [ "$baseNameOfListFile" == "tar_full_simul.list" ] 615 for set in $( ls $PATH_SIMU/tar_full_simul.list ) 616 do 617 # set="${PATH_SIMU}/tar_full_simul.list" # gpdebug : foireux ? 618 #----------------------------------- 619 echo "#-------------------" 620 echo "Set: $set" 621 datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"` 622 datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 623 statusfile=${set%%.list}.status 624 logfile=${set%%.list}_${datestr}.log 625 626 #----------------------------------- 627 # Create status file if not exists 628 if [ ! -e $statusfile ] ; then 629 echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile 630 fi 631 632 #----------------------------------- 633 # Skip the set if last line of the status file is "COMPLETED" or "DELEGATE" 634 if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then 635 printf "====> " 636 tail -1 $statusfile 637 exit 0 638 fi 639 640 #----------------------------------- 641 # Set output file name from list name 642 # echo "PATH_SIMU=$PATH_SIMU" 643 dirOfOutputFile=`echo $PATH_SIMU | sed "s;${IGCM_DEM};${OUTPUT_STORE};" ` 644 fileout=${dirnameOfListFile}.tar 645 # echo "dirnameOfListFile=$dirnameOfListFile" 646 outputfile=$dirOfOutputFile/${fileout} 647 mkdir -p $dirOfOutputFile 648 echo "Output file to write: $outputfile tar_full_simul" 649 650 # exit 0 # a virer 651 652 #----------------------------------- 653 # Try 1 time before fire "FAILED" 654 # Waiting for CCRT command 655 tarcmd=tar 656 taroptions="--format=posix -W -cf" 657 # taroptions="--format=posix -cf" 658 659 filefirst=`head -n 1 $set` 660 dirinputfile=`dirname $filefirst` 661 cd $dirinputfile 662 663 set_local=${set%%.list}.local 664 > $set_local 665 for file in $( cat $set) ; do 666 basename $file >> $set_local 667 done 668 # ls 669 670 startTime=$( getDateMilliSeconds ) # gpdebug : time 671 resCmd=0 672 $tarcmd $taroptions $outputfile --dereference --files-from $set_local > $logfile 2>&1 # gpdebug : a retablir 673 resCmd=$? 674 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 675 676 # resultCmd=$( gives_0_or_1 ) 677 # if [ $resultCmd -eq 0 ] ; then 678 if [ $resCmd -eq 0 ] ; then 679 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 680 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 681 echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile 682 echo "====> COMPLETED at try #$nbtries (at 1st shot on 1)" 683 echo "COMPLETED at try #$nbtries (at 1st shot on 1)" >> $statusfile 684 else 685 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 686 echo "====> FAILED at try #$nbtries" 687 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 688 exit 1 689 fi 690 691 #----------------------------------- 692 done -
TOOLS/PACK_IPSL/launch_and_measureTime.sh
r1849 r1853 1 1 #!/bin/bash 2 2 3 function update_tasks_list 4 { 5 local tasksListFile=$1 # fichier contenant la nouvelle liste de cmds 6 touch $tasksListFile 7 local logFileOfPrevPack=$2 # fichier log de relatif a l'execution de la derniere liste de cmds 8 local tasksListFileOfPrevPack=$3 # fichier contenant la derniere liste de cmds 9 10 > $tasksListFile 11 12 old_IFS=$IFS # sauvegarde du séparateur de champ 13 IFS=$'\n' # nouveau séparateur de champ, le caractère fin de ligne 14 for cmdReport in $( cat $logFileOfPrevPack ) 15 do 16 hasCmdGoodFormat=`echo $cmdReport | grep -e '^#executed by process' | wc -l ` 17 if [ "x${hasCmdGoodFormat}" == "x0" ] 18 then 19 continue 20 fi 21 22 local resCmd=`echo $cmdReport | awk '{print $9}' ` 23 24 if [ "x$resCmd" != "x0" ] 25 then 26 local cmdToPrint=`echo $cmdReport | awk '{print $NF}' ` 27 echo "./process_list.sh $cmdToPrint" >> ${tasksListFile} 28 fi 29 done 30 IFS=$old_IFS # rétablissement du séparateur de champ par défaut 31 32 # Il faut aussi rajouter les cmds qui n'ont pas ete traitees du tout, 33 # par exemple en cas d'interruption du calculateur 34 # Pour cela, on boucle sur la derniere liste de cmds et on cherche dans le 35 # fichier log associe si certaines sont absentes. On remet ces commandes (absentes) 36 # dans la nouvelle liste 37 old_IFS=$IFS # sauvegarde du séparateur de champ 38 IFS=$'\n' # nouveau séparateur de champ, le caractère fin de ligne 39 for cmd in $( cat $tasksListFileOfPrevPack ) 40 do 41 local list=`echo $cmd | awk '{print $NF}' ` 42 hasListBeenTreated=`grep $list $logFileOfPrevPack | wc -l ` 43 if [ "x${hasListBeenTreated}" == "x0" ] 44 then 45 echo $cmd >> ${tasksListFile} 46 fi 47 48 49 done 50 IFS=$old_IFS # rétablissement du séparateur de champ par défaut 51 52 } 53 54 function getNumeroOfCurrentTry 55 { 56 local num_try="1" 57 tryNumFile=${USER_OUTPUT_PROGRESS}/numero_current_try.txt 58 if [ ! -e $tryNumFile ] 59 then 60 echo "Le fichier :" >> $badFailureFile 61 echo "$tryNumFile" >> $badFailureFile 62 echo "doit etre present dans le repertoire :" >> $badFailureFile 63 echo "${USER_OUTPUT_PROGRESS}" >> $badFailureFile 64 echo "et il doit contenir un numero d'essai" >> $badFailureFile 65 exit 1 66 fi 67 num_try=`head -n 1 $tryNumFile ` 68 echo $num_try 69 70 } 71 72 function getNumeroOfLastInstance 73 { 74 local num_instance="0" 75 local numTry=$1 76 ici=$PWD 77 local progressDirectory="${USER_OUTPUT_PROGRESS}/TRY__${numTry}" 78 if [ ! -e $progressDirectory ] 79 then 80 echo "fonction getNumeroOfLastInstance :" >> $badFailureFile 81 echo "Le repertoire :" >> $badFailureFile 82 echo "$progressDirectory" >> $badFailureFile 83 echo "devrait exister. Il n'existe pas." >> $badFailureFile 84 exit 1 85 fi 86 cd $progressDirectory 87 88 listFiles=`ls | grep -e "inputCmd__try__${numTry}__instance__[[:digit:]]\{1,2\}.list" ` 89 for listFile in $listFiles 90 do 91 num=`echo $listFile | awk -F"__" '{print $NF}' | awk -F"." '{print $1}' ` 92 if [ $num -gt $num_instance ] 93 then 94 num_instance=$num 95 fi 96 done 97 cd $ici 98 echo $num_instance 99 100 101 } 102 103 104 function check_progress 105 { 106 local file1=$1 107 local file2=$2 108 if [ "x${file1}" == "x" ] || [ "x${file2}" == "x" ] 109 then 110 echo "check_progress : Le nom d'au moins 1 des 2 fichiers d'entree est vide" >> $badFailureFile 111 exit 1 112 fi 113 114 if [ ! -e $file1 ] || [ ! -e $file2 ] 115 then 116 echo "check_progress : au moins un des 2 fichiers suivants n'existe pas :" >> $badFailureFile 117 echo "$file1" 118 echo "$file2" 119 exit 1 120 fi 121 local nbLineFile1=`cat $file1 | wc -l ` 122 local nbLineFile1=`cat $file2 | wc -l ` 123 if [ $nbLineFile1 -ne $nbLineFile1 ] 124 then 125 echo 1 126 return 127 fi 128 129 old_IFS=$IFS # sauvegarde du séparateur de champ 130 IFS=$'\n' # nouveau séparateur de champ, le caractère fin de ligne 131 for line in $( cat $file1 ) 132 do 133 # echo $line 134 local isLineInFile2=`grep $line $file2 | wc -l ` 135 if [ $isLineInFile2 -eq 0 ] 136 then 137 echo 1 138 return 139 fi 140 done 141 IFS=$old_IFS # rétablissement du séparateur de champ par défaut 142 echo 0 143 } 144 145 146 function update_report 147 { 148 > $reportFile # on vide le fichier rapport 149 echo "Execution of tasks :" >> $reportFile 150 echo "------------------" >> $reportFile 151 cat $inputCmd >> $reportFile 152 echo >> $reportFile 153 echo "Results of tasks :" >> $reportFile 154 echo "----------------" >> $reportFile 155 cat $output >> $reportFile 156 echo >> $reportFile 157 echo >> $reportFile 158 159 } 160 161 ########## batch directives : begin ########## 3 162 #MSUB -r pack_ipsl # Nom du job 4 #MSUB -e IO_parallel/launchMeasureTimeOutput/pack_ipsl_%I.e 5 #MSUB -o IO_parallel/launchMeasureTimeOutput/pack_ipsl_%I.o 6 #MSUB -n 7 # Reservation du processus 7 #MSUB -T 2500 # Limite de temps elapsed du job (en secondes) 163 ### mutable directives ### 164 #MSUB -o /ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_PROGRESS/zIGCM_OUT/LMDZ4OR_v2/detailed_pack_output/pack_ipsl_%I.o 165 #MSUB -e /ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_PROGRESS/zIGCM_OUT/LMDZ4OR_v2/detailed_pack_output/pack_ipsl_%I.e 166 #MSUB -n 4 167 #MSUB -T 900 8 168 #MSUB -A tgcc0013 9 169 #MSUB -q standard 10 # #MSUB -q large11 170 #MSUB -Qos test 12 13 171 ########## batch directives : end ########## 14 172 15 173 export JOB_DIR=${LS_SUBCWD:-${PWD}} … … 17 175 source ${EXE_DIR}/DEM_utilities.sh 18 176 19 20 export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM 21 22 23 # inputCmd="myIO/inputCmd.list" 24 inputCmd="inputCmd_Realistic.list" 25 output="IO_parallel/output.log" 26 27 > ${inputCmd} 28 29 listOfDir="output_ncrcat output_tar restart_tar debug_tar store_cp work_cp" 30 31 for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do 32 33 PATH_SIMU=$( dirname $CONFIG ) 34 echo "PATH_SIMU=$PATH_SIMU" 35 echo "------------------------------------------" 36 for typeDir in $listOfDir 37 do 38 typeDirList=`find $PATH_SIMU -type d -name "$typeDir" ` 39 for dir in $typeDirList 177 export badFailureFile=${USER_OUTPUT_PROGRESS}/badFailure.txt 178 179 export numCurrentTry=$( getNumeroOfCurrentTry ) 180 export progressDir="${USER_OUTPUT_PROGRESS}/TRY__${numCurrentTry}" 181 if [ ! -e $progressDir ] 182 then 183 echo "Le repertoire de suivi :" >> $badFailureFile 184 echo "$progressDir" >> $badFailureFile 185 echo "n'existe pas. STOP." >> $badFailureFile 186 exit 1 187 fi 188 export numPrevInstance=$( getNumeroOfLastInstance $numCurrentTry ) 189 export numNewInstance=$(( $numPrevInstance + 1 )) 190 191 export inputCmd="${progressDir}/inputCmd__try__${numCurrentTry}__instance__${numNewInstance}.list" 192 export nextInputCmd="${progressDir}/nextInputCmd__try__${numCurrentTry}__instance__${numNewInstance}.list" 193 export output="${progressDir}/packOutput__try__${numCurrentTry}__instance__${numNewInstance}.log" 194 export reportFile="${progressDir}/report__try__${numCurrentTry}__instance__${numNewInstance}.log" 195 196 197 export noInterruptFile="${progressDir}/noInterrupt__try__${numCurrentTry}__instance__${numNewInstance}.txt" 198 199 200 # a virer 201 #echo "inputCmd=$inputCmd" >> $badFailureFile 202 #echo "nextInputCmd=$nextInputCmd" >> $badFailureFile 203 #echo "output=$nextInputCmd" >> $badFailureFile 204 #echo "reportFile=$nextInputCmd" >> $badFailureFile 205 #echo "noInterruptFile=$noInterruptFile" >> $badFailureFile 206 207 # exit 0 # a virer 208 209 # a virer 210 #if [ ${numNewInstance} -ge 4 ] 211 #then 212 # echo "inputCmd=$inputCmd" >> $badFailureFile 213 # echo "nextInputCmd=$nextInputCmd" >> $badFailureFile 214 # echo "output=$nextInputCmd" >> $badFailureFile 215 # echo "reportFile=$nextInputCmd" >> $badFailureFile 216 # echo "noInterruptFile=$noInterruptFile" >> $badFailureFile 217 # echo >> $badFailureFile 218 #fi 219 220 if [ ${numCurrentTry} -le 1 ] && [ ${numNewInstance} -le 1 ] 221 then 222 # C'est le tout premier essai 223 # on construit la liste des taches a effectuer en inventoriant les fichiers *.liste 224 # dans les rep contenus dans le fichier "config_card.liste" 225 > ${inputCmd} 226 for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do 227 228 PATH_SIMU=$( dirname $CONFIG ) 229 # echo "PATH_SIMU=$PATH_SIMU" 230 231 setOfListFiles=`find $PATH_SIMU -type f -name "*.list" ` 232 for file in $setOfListFiles 40 233 do 41 # echo "dir=$dir" 42 listFilesInDir=`find $dir -name "*.list" ` 43 for file in $listFilesInDir 44 do 45 echo "./process_list.sh $file" >> ${inputCmd} 46 done 234 echo "./process_list.sh $file" >> ${inputCmd} 47 235 done 48 done 49 50 51 done 52 53 54 236 237 done 238 else 239 # if try > 1 && inst == 1 ==> construction liste cmd avec fichiers try - 1, derniere instance 240 # dans ce dernier cas, gerer une eventuelle interruption au try - 1 241 # if try > 1 && inst > 1 ==> construction liste cmd avec fichiers try, instance precedente 242 if [ ${numNewInstance} -ge 2 ] 243 then 244 nextInputCmd_of_PrevInst="${progressDir}/nextInputCmd__try__${numCurrentTry}__instance__${numPrevInstance}.list" 245 if [ ! -e $nextInputCmd_of_PrevInst ] 246 then 247 echo "Le fichier suivant :" >> $badFailureFile 248 echo "$nextInputCmd_of_PrevInst" >> $badFailureFile 249 echo "n'existe pas. Il devrait exister. STOP." >> $badFailureFile 250 exit 1 251 fi 252 cat $nextInputCmd_of_PrevInst > ${inputCmd} 253 254 else # numNewInstance == 1 255 numPrevTry=$(( $numCurrentTry - 1 )) 256 # echo "numCurrentTry=$numCurrentTry" >> $badFailureFile # a virer 257 # echo "numPrevTry=$numPrevTry" >> $badFailureFile # a virer 258 # exit 1 # a virer 259 numLastInstInstanceInPrevTry=$( getNumeroOfLastInstance $numPrevTry ) 260 noInterruptFile="${progressDir}/noInterrupt__try__${numPrevTry}__instance__${numLastInstInstanceInPrevTry}.txt" 261 if [ ! -e $noInterruptFile ] 262 then 263 # il y a eu interruption non prevue au dernier essai, il faut recomposer la liste des cmds avec les resultats 264 # de l'essai precedent, derniere instance 265 prevProgressDir="${USER_OUTPUT_PROGRESS}/TRY__${numPrevTry}" 266 nextInputCmd_of_LastInst="${prevProgressDir}/nextInputCmd__try__${numPrevTry}__instance__${numLastInstInstanceInPrevTry}.list" 267 output_of_LastInst="${prevProgressDir}/packOutput__try__${numPrevTry}__instance__${numLastInstInstanceInPrevTry}.log" 268 inputCmd_of_LastInst="${prevProgressDir}/inputCmd__try__${numPrevTry}__instance__${numLastInstInstanceInPrevTry}.list" 269 if [ ! -e $output_of_LastInst ] || [ ! -e $inputCmd_of_LastInst ] 270 then 271 echo "Les fichiers suivants :" >> $badFailureFile 272 echo "$output_of_LastInst" >> $badFailureFile 273 echo "$inputCmd_of_LastInst" >> $badFailureFile 274 echo "n'existent pas. Il devrait exister. STOP." >> $badFailureFile 275 exit 1 276 fi 277 278 update_tasks_list ${nextInputCmd_of_LastInst} ${output_of_LastInst} ${inputCmd_of_LastInst} 279 cat $nextInputCmd_of_LastInst > ${inputCmd} 280 else 281 nextInputCmd_of_LastInst="${progressDir}/nextInputCmd__try__${numPrevTry}__instance__${numLastInstInstanceInPrevTry}.list" 282 if [ ! -e $nextInputCmd_of_LastInst ] 283 then 284 echo "Le fichier suivant :" >> $badFailureFile 285 echo "$nextInputCmd_of_LastInst" >> $badFailureFile 286 echo "n'existe pas. Il devrait exister. STOP." >> $badFailureFile 287 exit 1 288 fi 289 cat $nextInputCmd_of_LastInst > ${inputCmd} 290 fi 291 292 fi 293 fi 294 295 # Initialisation du rapport : par defaut, les calculs ont ete interrompus 296 echo "No report. Le computation must have interrupted." > $reportFile 297 298 # exit 0 # a virer 299 300 # a virer ######################################### 301 #if [ ${numNewInstance} -ge 4 ] 302 #then 303 # echo >> $badFailureFile 304 # echo "4eme instance. STOP." >> $badFailureFile 305 # exit 1 306 #fi 307 ################################################### 55 308 startTime=$( getDateMilliSeconds ) 56 309 echo "start time:$startTime" >> $timeHandlingFile 57 310 58 ccc_mprun ./cmd_launch.exe ${inputCmd} 2>${output} 59 # ./cmd_launch.exe ${inputCmd} 2>${output} 60 # ccc_mprun -p standard -n ${BRIDGE_MSUB_NPROC} ./cmd_launch.exe ${inputCmd} 2>myIO/output.log 61 # mpirun -n 4 ./cmd_launch.exe myIO/inputCmd10.list 2>myIO/output.log 311 ccc_mprun ./glost_launch -R $timeLimitBeforeEnd ${inputCmd} 2>${output} 312 313 ### ccc_mprun ./cmd_launch.exe ${inputCmd} 2>${output} 314 315 ### ./cmd_launch.exe ${inputCmd} 2>${output} 316 ### ccc_mprun -p standard -n ${BRIDGE_MSUB_NPROC} ./cmd_launch.exe ${inputCmd} 2>myIO/output.log 317 ### mpirun -n 4 ./cmd_launch.exe myIO/inputCmd10.list 2>myIO/output.log 62 318 63 319 meantime=$( getTimeDiffSeconds $startTime ) … … 66 322 echo "end time:$endExecutionTime" >> $timeHandlingFile 67 323 68 69 324 echo "meantime ncrcat = $meantime" 325 326 # exit 0 # a virer 327 328 # Gestion des reprises : 329 # -------------------- 330 331 update_report 332 333 update_tasks_list $nextInputCmd $output $inputCmd 334 335 echo "no interruption has occured" > ${noInterruptFile} 336 337 # Tout s'est bien passe 338 # ---------------------- 339 everythingOK=`cat $nextInputCmd | wc -l ` 340 if [ "x{everythingOK}" == "x0"] 341 then 342 echo "Tout s'est fini correctement" >> $badFailureFile 343 exit 1 344 fi 345 346 # y a t il progression ? 347 # ---------------------- 348 resDiff=$( check_progress $inputCmd $nextInputCmd ) 349 # resDiff == 1 : fichiers differents 350 # resDiff == 0 : fichiers identiques 351 if [ "x${resDiff}" == "x0" ] 352 then 353 echo "Il n'y pas plus de progression" >> $badFailureFile 354 exit 1 355 fi 356 357 # On enchaine avec le meme script 358 ccc_msub launch_and_measureTime.sh -
TOOLS/PACK_IPSL/launch_ipsl_pack.sh
r1849 r1853 64 64 SCRIPT_NAME=$(basename ${0} ) 65 65 66 export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM 67 export IGCM_TMP=${SCRATCHDIR}/IGCM_DEM/tmp 66 # On renseigne les variables d'environnement 67 . load_ipslPack_env.sh 68 69 export IGCM_TMP="${IGCM_DEM}/tmp" # gpdebug : added 70 # INPUT_DMF_DATA, positionnee par le load_ipslPack_env.sh, sert pour pour PATH_SIMUL_SHORT dans create_config_card.sh 71 68 72 export clean_tmp=${clean_tmp:-yes} 69 73 export DEM_LOG=${JOB_DIR}/dem_${LSB_JOBID:-${$}}.log -
TOOLS/PACK_IPSL/parallelPack.sh
r1849 r1853 1 1 #!/bin/bash 2 3 function insertDirectives 4 { 5 6 local batchFile="launch_and_measureTime.sh" 7 local lineBeginMutableDrves=`grep -n "batch directives : begin" $batchFile | awk -F":" '{print $1}' ` 8 local lineHeaderMutableDrves=`grep -n "mutable directives" $batchFile | awk -F":" '{print $1}' ` 9 local lineEndMutableDrves=`grep -n "batch directives : end" $batchFile | awk -F":" '{print $1}' ` 10 if [ "x${lineBeginMutableDrves}" == "x" ] || [ "x${lineHeaderMutableDrves}" == "x" ] || [ "x${lineEndMutableDrves}" == "x" ] 11 then 12 echo "Examen du fichier $batchFile :" 13 echo "Il manque les balises commentees 'mutable directives' et 'batch directives : end' " 14 exit 1 15 fi 16 17 # echo "lineHeaderMutableDrves=$lineHeaderMutableDrves" 18 # echo "lineEndMutableDrves=$lineEndMutableDrves" 19 20 if [ $lineHeaderMutableDrves -ge $lineEndMutableDrves ] 21 then 22 echo "Examen du fichier $batchFile :" 23 echo "les lignes 'mutable directives' et 'batch directives : end' n'existent pas ou ne sont" 24 echo "pas bien placees l'une par rapport a l'autre ==> STOP." 25 exit 1 26 fi 27 28 # Suppression des anciennes directives 29 local firstLineToMove=$(( $lineHeaderMutableDrves + 1 )) 30 local lastLineToMove=$(( $lineEndMutableDrves - 1 )) 31 if [ $firstLineToMove -lt $lineEndMutableDrves ] 32 then 33 sed -i "${firstLineToMove},${lastLineToMove}d" $batchFile 34 fi 35 36 # insertion des directives chargees a partir de "load_batch_directives.sh" 37 local lineEndMutableDrves=`grep -n "batch directives : end" $batchFile | awk -F":" '{print $1}' ` 38 sed -i "${lineEndMutableDrves}i\#MSUB -Qos $QosType" $batchFile 39 sed -i "${lineEndMutableDrves}i\#MSUB -q $queueType" $batchFile 40 sed -i "${lineEndMutableDrves}i\#MSUB -A $projectName" $batchFile 41 sed -i "${lineEndMutableDrves}i\#MSUB -T $computationTime" $batchFile 42 sed -i "${lineEndMutableDrves}i\#MSUB -n $nbProcs" $batchFile 43 44 # insertion des directives specifiant les sorties des operations de pack 45 sed -i "${lineEndMutableDrves}i\#MSUB -e ${DETAILLED_OUTPUT}/pack_ipsl_%I.e" $batchFile 46 sed -i "${lineEndMutableDrves}i\#MSUB -o ${DETAILLED_OUTPUT}/pack_ipsl_%I.o" $batchFile 47 48 } 49 50 function check_machine 51 { 52 local host_name=`hostname ` 53 local isMachineTitane=`echo $host_name | grep "titane" | wc -l ` 54 local isMachineCurie=`echo $host_name | grep "curie" | wc -l ` 55 56 if [ "x${isMachineTitane}" == "x0" ] && [ "x${isMachineCurie}" == "x0" ] 57 then 58 echo "Ce programme doit etre lance a partir 'curie' ou 'titane'. STOP." 59 exit 1 60 fi 61 62 } 63 64 function getNumeroOfPreviousTry 65 { 66 local num_try="0" 67 ici=$PWD 68 cd $USER_OUTPUT_PROGRESS 69 70 tryDirs=`ls | grep -e 'TRY__[[:digit:]]\{1,2\}$' ` 71 for dir in $tryDirs 72 do 73 num=`echo $dir | awk -F"__" '{print $NF}' ` 74 if [ $num -gt $num_try ] 75 then 76 num_try=$num 77 fi 78 done 79 cd $ici 80 echo $num_try 81 82 } 2 83 3 84 ######## pour option -f ############# … … 17 98 ###################################### 18 99 19 export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM 20 21 ######### Si l'option -f est activee, on detruit tous les fichiers status ########## 100 # On charge les variables d'environnement 101 . load_ipslPack_env.sh 102 103 # On charge les directives batch 104 . load_batch_directives.sh 105 106 # on verifie que la machine est 'curie' ou 'titane' 107 check_machine 108 109 ######### On insert les directives batch en en-tete du script "launch_and_measureTime.sh" ########## 110 ######### lance plus loin. Seules les directives de nom du job et de sorties restent inchangees ########## 111 112 insertDirectives 113 114 # exit 0 # gpdebug : a virer 115 116 # export inputCmd="${USER_OUTPUT_PROGRESS}/inputCmd.list" 117 # export nextInputCmd="${USER_OUTPUT_PROGRESS}/nextInputCmd.list" 118 # export output="${USER_OUTPUT_PROGRESS}/packOutput.log" 119 # export reportFile="${USER_OUTPUT_PROGRESS}/report.log" 120 121 ########## Si l'option -f est activee, on detruit tous les fichiers status ########## 22 122 if [ "x$restartExecFromZero" == "x1" ] 23 123 then … … 41 141 echo "Deletion done." 42 142 fi 143 144 145 # Par ailleurs, on vide les fichiers de cmds, d'output et de rapport si option -f activee 146 if [ "x${restartExecFromZero}" == "x1" ] 147 then 148 rm -rf ${USER_OUTPUT_PROGRESS}/TRY__* 149 fi 150 151 # exit 0 # a virer 152 43 153 ##################################################################################### 44 154 … … 54 164 # fichier pour la transmission des messages d'erreur d'un fils au prog principal 55 165 export errorMsgFile="${PWD}/errorMsg.txt" 56 ############## gpdebug : fin ############################################################## 57 58 export timeHandlingFile="timeHandlingFile.txt" 166 ############## gpdebug : fin ############################################################## 167 168 check_nco_version # verification de la version de nco ####################### 169 170 # penser a arreter le present script si le module "libccc_user" n'a pas ete charge 171 172 export badFailureFile=${USER_OUTPUT_PROGRESS}/badFailure.txt 173 > $badFailureFile # nouvel essai, on vide le fichier d'erreur 174 tryNumFile=${USER_OUTPUT_PROGRESS}/numero_current_try.txt 175 numPreviousTry=$( getNumeroOfPreviousTry ) 176 # echo "numPreviousTry=$numPreviousTry" 177 numNewTry=$(( $numPreviousTry + 1 )) 178 179 # Pas de 4eme essai permis 180 # ---------------------------- 181 if [ $numNewTry -ge 3 ] 182 then 183 echo "Pas de 4eme essai permis" 184 exit 1 185 fi 186 187 # echo "numNewTry=$numNewTry" 188 mkdir -p ${USER_OUTPUT_PROGRESS}/TRY__${numNewTry} 189 echo $numNewTry > $tryNumFile 190 191 # exit 0 # a virer 192 193 194 195 export timeHandlingFile="${USER_OUTPUT_PROGRESS}/timeHandlingFile.txt" 59 196 > $timeHandlingFile 60 197 startTime=$( getDateMilliSeconds ) … … 65 202 DEM_log -0 "Demarrage de ${SCRIPT_NAME}" 66 203 67 check_nco_version # gpdebug : verification de la version de nco ####################### 68 69 ccc_msub -A tgcc0013 launch_and_measureTime.sh 70 71 204 # ccc_msub -A tgcc0013 launch_and_measureTime.sh 205 ccc_msub launch_and_measureTime.sh 72 206 73 207 DEM_log -0 "Fin de ${SCRIPT_NAME}" 208 209 210 elapsedTime=0 211 while [ $elapsedTime -lt 500 ] 212 do 213 sleep 5 214 elapsedTime=$(( $elapsedTime + 5 )) 215 isFailureFileEmpty=`cat $badFailureFile | wc -l ` 216 if [ "x${isFailureFileEmpty}" != "x0" ] 217 then 218 sleep 2 # on attend que le fichier soit correctement rempli 219 cat $badFailureFile 220 exit 0 221 fi 222 done 223 224 225 226 -
TOOLS/PACK_IPSL/process_list.sh
r1849 r1853 9 9 maxtries=3 10 10 11 #------------------------------------------------------ 12 # export INPUT_DMF_DATA=${SCRATCHDIR}/datasLabo/dataDMNFS_simple1 13 export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane 14 15 # export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE 16 export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE 17 18 # export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK 19 export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK 20 21 export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM 11 # On renseigne les variables d'environnement 12 . load_ipslPack_env.sh 22 13 23 14 dirin=$INPUT_DMF_DATA … … 30 21 #------------------------------------------------------ 31 22 23 baseNameOfListFile=$( basename $listToProcessFile ) 32 24 dirPathOfListFile=$( dirname $listToProcessFile ) 33 25 dirnameOfListFile=$( basename $dirPathOfListFile ) 34 26 35 echo "dirnameOfListFile=${dirnameOfListFile}|" 36 37 dirOK=0 38 39 if [ "$dirnameOfListFile" != "output_ncrcat" ] 40 then 41 dirOK=$(( $dirOK || 0 )) 42 else 43 dirOK=$(( $dirOK || 1 )) 44 fi 45 46 if [ "$dirnameOfListFile" != "output_tar" ] 47 then 48 dirOK=$(( $dirOK || 0 )) 49 else 50 dirOK=$(( $dirOK || 1 )) 51 fi 52 53 if [ "$dirnameOfListFile" != "restart_tar" ] 54 then 55 dirOK=$(( $dirOK || 0 )) 56 else 57 dirOK=$(( $dirOK || 1 )) 58 fi 59 60 if [ "$dirnameOfListFile" != "store_cp" ] 61 then 62 dirOK=$(( $dirOK || 0 )) 63 else 64 dirOK=$(( $dirOK || 1 )) 65 fi 66 67 if [ "$dirnameOfListFile" != "work_cp" ] 68 then 69 dirOK=$(( $dirOK || 0 )) 70 else 71 dirOK=$(( $dirOK || 1 )) 72 fi 73 74 if [ "$dirnameOfListFile" != "debug_tar" ] 75 then 76 dirOK=$(( $dirOK || 0 )) 77 else 78 dirOK=$(( $dirOK || 1 )) 79 fi 80 81 if [ "$dirnameOfListFile" != "other_tar" ] 82 then 83 dirOK=$(( $dirOK || 0 )) 84 else 85 dirOK=$(( $dirOK || 1 )) 86 fi 87 88 # echo "dirOK=$dirOK" 89 90 if [ "$dirOK" == "0" ] 91 then 92 echo "probleme : le rep du fichier liste est mauvais 2." # gpdebug : a modifier 27 echo "dirnameOfListFile ==> $dirnameOfListFile" 28 29 30 if ( \ 31 [ $dirnameOfListFile != "output_ncrcat" ] && \ 32 [ $dirnameOfListFile != "output_tar" ] && \ 33 [ $dirnameOfListFile != "restart_tar" ] && \ 34 [ $dirnameOfListFile != "store_cp" ] && \ 35 [ $dirnameOfListFile != "work_cp" ] && \ 36 [ $dirnameOfListFile != "debug_tar" ] && \ 37 [ $dirnameOfListFile != "other_tar" ] \ 38 ) \ 39 && \ 40 [ $baseNameOfListFile != "tar_full_simul.list" ] 41 then 42 echo "probleme : le rep du fichier liste est mauvais." # gpdebug : a modifier 93 43 exit 1 94 44 fi … … 142 92 statusfile=${set%%.list}.status 143 93 logfile=${set%%.list}_${datestr}.log 144 94 95 # echo "output_ncrcat : blabla 0" 96 145 97 #----------------------------------- 146 98 # Create status file if not exists … … 148 100 echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile 149 101 fi 150 102 # echo "output_ncrcat : blabla 1" 151 103 #----------------------------------- 152 104 # Switch to tar command … … 157 109 exit 0 158 110 fi 159 111 # echo "output_ncrcat : blabla 2" 160 112 #----------------------------------- 161 113 # Skip the set if last line of the status file is "COMPLETED" or "DELEGATE" … … 165 117 exit 0 # gpdebug : modif 166 118 fi 119 120 # echo "output_ncrcat : blabla 3" 167 121 168 122 #----------------------------------- … … 182 136 outputfile=$diroutputfile/${fileout} 183 137 mkdir -p $diroutputfile 184 echo "Output file to write: $outputfile "138 echo "Output file to write: $outputfile output_ncrcat" 185 139 186 140 #----------------------------------- … … 248 202 cp $set $PATH_SIMU/output_tar # gpdebug : a retablir 249 203 fi 204 exit 1 250 205 fi 251 206 fi … … 299 254 outputfile=$diroutputfile/${fileout} 300 255 mkdir -p $diroutputfile 301 echo "Output file to write: $outputfile "256 echo "Output file to write: $outputfile output_tar" 302 257 303 258 #----------------------------------- … … 333 288 echo "====> FAILED at try #$nbtries" 334 289 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 335 290 exit 1 336 291 fi 337 292 rm -f $set".local" … … 381 336 outputfile=$diroutputfile/${fileout} 382 337 mkdir -p $diroutputfile 383 echo "Output file to write: $outputfile "338 echo "Output file to write: $outputfile restart_tar" 384 339 385 340 #----------------------------------- … … 410 365 echo "====> FAILED at try #$nbtries" 411 366 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 412 367 exit 1 413 368 fi 414 369 … … 458 413 outputfile=$diroutputfile/${fileout} 459 414 mkdir -p $diroutputfile 460 echo "Output file to write: $outputfile "415 echo "Output file to write: $outputfile debug_tar" 461 416 462 417 #----------------------------------- … … 486 441 echo "====> FAILED at try #$nbtries" 487 442 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 488 443 exit 1 489 444 fi 490 445 … … 532 487 diroutputfile=`dirname $file | sed -e "s%$dirin%$dirout%"` 533 488 mkdir -p $diroutputfile 534 echo "Output file to write: $diroutputfile/$( basename $file ) "489 echo "Output file to write: $diroutputfile/$( basename $file ) store_cp" 535 490 536 491 #----------------------------------- … … 556 511 echo "====> FAILED at try #$nbtries" 557 512 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile 558 513 exit 1 559 514 fi 560 515 … … 602 557 diroutputfile=`dirname $file | sed -e "s%$dirin%$dirout_work%"` 603 558 mkdir -p $diroutputfile 604 echo "Output file to write: $diroutputfile/$( basename $file ) "559 echo "Output file to write: $diroutputfile/$( basename $file ) work_cp" 605 560 606 561 #----------------------------------- … … 625 580 echo "====> FAILED at try #$nbtries" 626 581 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile 627 582 exit 1 628 583 fi 629 584 … … 632 587 fi 633 588 634 635 636 637 638 639 640 641 642 643 644 645 589 # gpdebug : traitement des simu < 1 Go ou de type create_etat0 590 # il n'est censé n'y avoir qu'un seul fichier tar_full_simul.list par simu. 591 # d'ou le "if" et non le "for" 592 # pense bete : 593 # * implication dans showPackProgress.sh (fichier status) ? 594 if [ "$baseNameOfListFile" == "tar_full_simul.list" ] 595 then 596 # set="${PATH_SIMU}/tar_full_simul.list" # gpdebug : foireux ? 597 #----------------------------------- 598 echo "#-------------------" 599 echo "Set: $set" 600 datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"` 601 datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 602 statusfile=${set%%.list}.status 603 logfile=${set%%.list}_${datestr}.log 604 605 #----------------------------------- 606 # Create status file if not exists 607 if [ ! -e $statusfile ] ; then 608 echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile 609 fi 610 611 #----------------------------------- 612 # Skip the set if last line of the status file is "COMPLETED" or "DELEGATE" 613 if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then 614 printf "====> " 615 tail -1 $statusfile 616 exit 0 617 fi 618 619 #----------------------------------- 620 # Set output file name from list name 621 # echo "PATH_SIMU=$PATH_SIMU" 622 dirOfOutputFile=`echo $PATH_SIMU | sed "s;${IGCM_DEM};${OUTPUT_STORE};" ` 623 fileout=${dirnameOfListFile}.tar 624 # echo "dirnameOfListFile=$dirnameOfListFile" 625 outputfile=$dirOfOutputFile/${fileout} 626 mkdir -p $dirOfOutputFile 627 echo "Output file to write: $outputfile tar_full_simul" 628 629 # exit 0 # a virer 630 631 #----------------------------------- 632 # Try 1 time before fire "FAILED" 633 # Waiting for CCRT command 634 tarcmd=tar 635 taroptions="--format=posix -W -cf" 636 # taroptions="--format=posix -cf" 637 638 filefirst=`head -n 1 $set` 639 dirinputfile=`dirname $filefirst` 640 cd $dirinputfile 641 642 set_local=${set%%.list}.local 643 > $set_local 644 for file in $( cat $set) ; do 645 basename $file >> $set_local 646 done 647 # ls 648 649 startTime=$( getDateMilliSeconds ) # gpdebug : time 650 resCmd=0 651 $tarcmd $taroptions $outputfile --dereference --files-from $set_local > $logfile 2>&1 # gpdebug : a retablir 652 resCmd=$? 653 meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time 654 655 # resultCmd=$( gives_0_or_1 ) 656 # if [ $resultCmd -eq 0 ] ; then 657 if [ $resCmd -eq 0 ] ; then 658 sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time 659 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 660 echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile 661 echo "====> COMPLETED at try #$nbtries (at 1st shot on 1)" 662 echo "COMPLETED at try #$nbtries (at 1st shot on 1)" >> $statusfile 663 else 664 datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"` 665 echo "====> FAILED at try #$nbtries" 666 echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile 667 exit 1 668 fi 669 670 #----------------------------------- 671 fi 672 673 674 675 676 677 678 679 680 681 682 -
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 -
TOOLS/PACK_IPSL/write_liste_tar.sh
r1846 r1853 39 39 rm -f ${IGCM_DEM_SIMU}/tar_no_output_files.txt 40 40 rm -f ${IGCM_DEM_SIMU}/tar_no_restart_files.txt 41 rm -f ${IGCM_DEM_SIMU}/work_cp/* 42 rm -f ${IGCM_DEM_SIMU}/store_cp/* 43 rm -f ${IGCM_DEM_SIMU}/other_tar/* 41 42 43 # gpdebug : traitement des simu < 1 Go ou de type create_etat0 : il faut virer ces rep 44 # (et pas slt leur contenu) pour pouvoir integrer le traitement specifique 45 # de ces simu dans "enlarge_my_files.sh" (sequentiel) et "process_list.sh" (parallele) 46 # rm -f ${IGCM_DEM_SIMU}/work_cp/* 47 # rm -f ${IGCM_DEM_SIMU}/store_cp/* 48 # rm -f ${IGCM_DEM_SIMU}/other_tar/* 49 50 rm -rf ${IGCM_DEM_SIMU}/work_cp 51 rm -rf ${IGCM_DEM_SIMU}/store_cp 52 rm -rf ${IGCM_DEM_SIMU}/other_tar 44 53 45 54 DEM_write_state ${IGCM_DEM}/config_card.liste ${config_card} WriteListTarDone
Note: See TracChangeset
for help on using the changeset viewer.