Changeset 623 for trunk/libIGCM/libIGCM_sys
- Timestamp:
- 03/30/12 16:57:50 (12 years ago)
- Location:
- trunk/libIGCM/libIGCM_sys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
r622 r623 14 14 #========================================================= 15 15 # The documentation of this file can be automatically generated 16 # if you use the prefix #D- for comments to be extracted. 16 # if you use the prefix #D- for comments to be extracted. 17 17 # Extract with command: cat lib* | grep "^#D-" | cut -c "4-" 18 18 #========================================================= 19 19 20 20 #D-#================================================== 21 #D-LibIGCM_sys for Titane22 #D-#================================================== 23 #D- 24 #D- This ksh library if a layer under some usefull 21 #D-LibIGCM_sys for Curie 22 #D-#================================================== 23 #D- 24 #D- This ksh library if a layer under some usefull 25 25 #D-environment variables and shell commands. 26 26 #D-All those definitions depend on host particularities. … … 80 80 typeset -r RSYNC_opt="-va" 81 81 # ie storage filesystem 82 typeset -r RHOST=curie82 typeset -r STOREHOST=${MASTER} 83 83 84 84 #==================================================== … … 101 101 #==================================================== 102 102 103 # ============ CESIUM START ============ # 104 105 #==================================================== 106 #- Mirror libIGCM from titane to cesium if needed 107 #ROOTSYS=$( echo ${libIGCM} | gawk -F"/" '{print $3}' ) 108 #if [ ! ${ROOTSYS} = "home" ] ; then 109 # typeset -r MirrorlibIGCM=${MirrorlibIGCM:=true} 110 #else 111 # typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false} 112 #fi 113 114 #==================================================== 115 #- libIGCM_POST 116 #if ( ${MirrorlibIGCM} ) ; then 117 # PATHlibIGCM=$( echo ${libIGCM} | gawk -F"${LOGIN}/" '{print $2}' | sed -e "s&/libIGCM&&" ) 118 # typeset -r libIGCM_POST=${HOME}/MIRROR/${PATHlibIGCM}/libIGCM 119 #else 120 # typeset -r libIGCM_POST=${libIGCM} 121 #fi 122 123 # ============ CESIUM END ============ # 124 125 #==================================================== 126 #- MirrorlibIGCM for frontend 127 typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false} 128 129 #==================================================== 130 #- libIGCM_POST for frontend 131 typeset -r libIGCM_POST=${libIGCM} 132 103 133 #==================================================== 104 134 #- R_EXE (==> BIN_DIR = ${MODIPSL}/bin ) … … 110 140 111 141 #==================================================== 112 #- ARCHIVE 142 #- ARCHIVE (dedicated to large files) 113 143 typeset -r ARCHIVE=${CCCSTOREDIR} 114 144 115 #==================================================== 116 typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false} 117 118 #==================================================== 119 #- libIGCM_POST 120 typeset -r libIGCM_POST=${libIGCM} 145 #- ARCHIVE (dedicated to small/medium files) 146 typeset -r STORAGE=${CCCWORKDIR} 121 147 122 148 #==================================================== … … 126 152 127 153 #==================================================== 128 #- OUT154 #- R_OUT 129 155 typeset -r R_OUT=${ARCHIVE}/IGCM_OUT 130 156 131 157 #==================================================== 132 #- OUT_SCR (ONLY FOR double copy an scratch) 133 typeset -r R_OUT_SCR=${SCRATCHDIR}/IGCM_OUT 158 #- R_FIG (hosting figures : monitoring and atlas, and/or small files) 159 typeset -r R_FIG=${STORAGE}/IGCM_OUT 160 161 #==================================================== 162 #- R_BUF (ONLY FOR double copy an scratch) 163 typeset -r R_BUF=${SCRATCHDIR}/IGCM_OUT 164 165 #==================================================== 166 #- BIG_DIR : BIG_DIR to store files waiting for rebuild 167 typeset -r BIG_DIR=${BIG_DIR:=${SCRATCHDIR}/REBUILD} 134 168 135 169 #==================================================== 136 170 #- OUT_POST 137 typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT _POST171 typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT 138 172 139 173 #==================================================== 140 174 #- RUN_DIR_PATH : Temporary working directory (=> TMP) 141 175 if [ ! X${BRIDGE_MSUB_NPROC} = X1 ] ; then 142 176 typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/RUN_DIR/${BRIDGE_MSUB_JOBID}} 143 177 else 144 178 typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/TMPDIR_IGCM/${BRIDGE_MSUB_JOBID}} 145 179 fi 146 147 #====================================================148 #- BIG_DIR : BIG_DIR to store files waiting for rebuild149 typeset -r BIG_DIR=${BIG_DIR:=${SCRATCHDIR}/REBUILD}150 180 151 181 #==================================================== … … 157 187 UNIX_MAX_LIMIT=360 158 188 189 #==================================================== 190 #- set PackDefault true on curie 191 PackDefault=true 192 159 193 NUM_COREPERNODE=8 160 194 195 #==================================================== 196 #- Default number of MPI task for IPSL coupled model 197 #- required for backward compatibility 198 #- 199 DEFAULT_NUM_PROC_OCE=5 200 DEFAULT_NUM_PROC_CPL=1 201 DEFAULT_NUM_PROC_ATM=26 202 DEFAULT_NUM_PROC_TOTAL=32 161 203 162 204 #D-#================================================== 163 205 #D-function IGCM_sys_RshMaster 164 #D-* Purpose: Just a fake command to wrapp 165 #D- IGCM_card call in post-treatment 166 #D- Ulam do not see brodie filesystem 167 #D- Cesium do not see all mercure filesystem 168 #D- That's why we need this hack. 206 #D-* Purpose: Connection to frontend machine. 169 207 #D-* Examples: 170 208 #D- 171 209 function IGCM_sys_RshMaster { 172 173 210 IGCM_debug_PushStack "IGCM_sys_RshMaster" $@ 211 /bin/ksh <<-EOF 174 212 export libIGCM=${libIGCM} 175 213 export DEBUG_debug=${DEBUG_debug} … … 178 216 ${@} 179 217 EOF 180 181 182 183 184 218 if [ $? -gt 0 ] ; then 219 echo "IGCM_sys_RshMaster : erreur." 220 IGCM_debug_Exit "IGCM_sys_RshMaster" 221 fi 222 IGCM_debug_PopStack "IGCM_sys_RshMaster" 185 223 } 186 224 … … 191 229 #D- 192 230 function IGCM_sys_RshArchive { 193 194 231 IGCM_debug_PushStack "IGCM_sys_RshArchive" $@ 232 /bin/ksh <<-EOF 195 233 ${@} 196 234 EOF 197 198 199 200 201 235 if [ $? -gt 0 ] ; then 236 echo "IGCM_sys_RshArchive : erreur." 237 IGCM_debug_Exit "IGCM_sys_RshArchive" 238 fi 239 IGCM_debug_PopStack "IGCM_sys_RshArchive" 202 240 } 203 241 … … 208 246 #D- 209 247 function IGCM_sys_RshPost { 210 IGCM_debug_PushStack "IGCM_sys_RshPost" $@ 211 if ( $DEBUG_sys ) ; then 212 echo "IGCM_sys_RshPost :" $@ 213 fi 214 215 /bin/ksh ${@} 216 if [ $? -gt 0 ] ; then 217 echo "IGCM_sys_RshPost : erreur." 218 IGCM_debug_Exit "IGCM_sys_RshPost" 219 fi 220 IGCM_debug_PopStack "IGCM_sys_RshPost" 248 IGCM_debug_PushStack "IGCM_sys_RshPost" $@ 249 if ( $DEBUG_sys ) ; then 250 echo "IGCM_sys_RshPost :" $@ 251 fi 252 253 #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL 254 #cat tmp_IGCM_sys_RshPost_$$ 255 # keep standard input (stdin) for the loop onto temporary file 256 cat >tmp_IGCM_sys_RshPost_$$ 257 258 # ============ FRONTEND START ============ # 259 260 /bin/ksh <tmp_IGCM_sys_RshPost_$$ 261 if [ $? -gt 0 ] ; then 262 echo "IGCM_sys_RshPost : erreur." 263 IGCM_debug_Exit "IGCM_sys_RshPost" 264 fi 265 # delete temporary file 266 \rm tmp_IGCM_sys_RshPost_$$ 267 268 # ============ FRONTEND END ============ # 269 270 # ============ CESIUM START ============ # 271 # typeset NB_ESSAI DELAI status i 272 # if [ "X$( grep rebuild_from tmp_IGCM_sys_RshPost_$$ )" != "X" ] ; then 273 # #little hack so that rebuild submission is done on titane not an cesium 274 # 275 # libIGCM_POST_sed=$( echo $libIGCM_POST | sed 's/\//\\\//g' ) 276 # POST_DIR_sed=$( echo ${POST_DIR} | sed 's/\//\\\//g' ) 277 # sed "s/IGCM_sys_QsubPost/IGCM_sys_Qsub/g" tmp_IGCM_sys_RshPost_$$ > tmp.txt 278 # sed "s/ rebuild_fromWorkdir/ ${libIGCM_POST_sed}\/rebuild_fromWorkdir.job/g" tmp.txt > tmp_IGCM_sys_RshPost_$$ 279 # sed "s/ rebuild_fromArchive/ ${libIGCM_POST_sed}\/rebuild_fromArchive.job/g" tmp_IGCM_sys_RshPost_$$ > tmp.txt 280 # sed "s/Script_Post_Output=/Script_Output=${POST_DIR_sed}\//g" tmp.txt > tmp_IGCM_sys_RshPost_$$ 281 # \mv tmp.txt tmp_IGCM_sys_RshPost_$$ 282 # 283 # echo cat tmp_IGCM_sys_RshPost_$$ AFTER 284 # cat tmp_IGCM_sys_RshPost_$$ 285 # 286 # /bin/ksh <tmp_IGCM_sys_RshPost_$$ 287 # if [ $? -gt 0 ] ; then 288 # echo "IGCM_sys_RshPost : erreur." 289 # IGCM_debug_Exit "IGCM_sys_RshPost" 290 # fi 291 # # delete temporary file 292 # \rm tmp_IGCM_sys_RshPost_$$ 293 # 294 # else 295 # # number of tentative 296 # NB_ESSAI=10 297 # # time delay between tentative 298 # DELAI=10 299 # i=0 300 # while [ $i -ne $NB_ESSAI ] ; do 301 # ssh -t titane996 ssh cesium /bin/ksh <tmp_IGCM_sys_RshPost_$$ 302 # status=$? 303 # if [ ${status} -ne 0 ]; 304 # then 305 # sleep $DELAI 306 # else 307 # break 308 # fi 309 # let i=$i+1 310 # done 311 # # delete temporary file 312 # \rm tmp_IGCM_sys_RshPost_$$ 313 # 314 # if [ ${status} -gt 0 ] ; then 315 # echo "IGCM_sys_RshPost : erreur." 316 # IGCM_debug_Exit "IGCM_sys_RshPost" 317 # fi 318 # fi 319 320 # ============ CESIUM END ============ # 321 322 IGCM_debug_PopStack "IGCM_sys_RshPost" 221 323 } 222 324 … … 227 329 #D- 228 330 function IGCM_sys_SendMail { 229 230 231 232 233 234 235 236 237 238 239 240 331 IGCM_debug_PushStack "IGCM_sys_SendMail" $@ 332 if ( $DEBUG_sys ) ; then 333 echo "IGCM_sys_SendMail :" $@ 334 fi 335 336 if ( ${ExitFlag} ) ; then 337 status=failed 338 else 339 status=completed 340 fi 341 342 cat << END_MAIL > job_end.mail 241 343 Dear ${LOGIN}, 242 344 … … 245 347 Job ended : ${DateEnd} 246 348 Output files are available in ${R_SAVE} 349 Files to be rebuild are temporarily available in ${REBUILD_DIR} 350 Pre-packed files are temporarily available in ${R_BUFR} 247 351 Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR} 248 352 END_MAIL 249 353 250 354 if [ ! -z ${config_UserChoices_MailName} ] ; then 251 355 mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail 252 356 elif [ -f ~/.forward ] ; then 253 254 else255 mail -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail256 fi257 258 259 260 261 262 357 mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 358 fi 359 sleep 10 360 rm -f job_end.mail 361 362 if [ $? -gt 0 ] ; then 363 echo "IGCM_sys_SendMail : erreur." 364 IGCM_debug_Exit "IGCM_sys_SendMail" 365 fi 366 IGCM_debug_PopStack "IGCM_sys_SendMail" 263 367 } 264 368 … … 269 373 #D- 270 374 function IGCM_sys_Mkdir { 271 272 273 274 275 276 277 278 279 280 281 282 # verification :283 284 285 286 287 375 IGCM_debug_PushStack "IGCM_sys_Mkdir" $@ 376 if ( $DEBUG_sys ) ; then 377 echo "IGCM_sys_Mkdir :" $@ 378 fi 379 if [ ! -d ${1} ]; then 380 \mkdir -p $1 381 if [ $? -gt 0 ] ; then 382 echo "IGCM_sys_Mkdir : erreur." 383 IGCM_debug_Exit "IGCM_sys_Mkdir" 384 fi 385 fi 386 # vérification : 387 if [ ! -d ${1} ] ; then 388 echo "IGCM_sys_Mkdir : erreur." 389 IGCM_debug_Exit "IGCM_sys_Mkdir" 390 fi 391 IGCM_debug_PopStack "IGCM_sys_Mkdir" 288 392 } 289 393 … … 294 398 #D- 295 399 function IGCM_sys_MkdirArchive { 296 297 298 299 300 301 if [ ! -d ${1} ]; then302 303 304 305 306 307 308 400 IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@ 401 if ( $DEBUG_sys ) ; then 402 echo "IGCM_sys_MkdirArchive :" $@ 403 fi 404 #- creation de repertoire sur le serveur fichier 405 if [ ! -d ${1} ]; then 406 \mkdir -p $1 407 if [ $? -gt 0 ] ; then 408 echo "IGCM_sys_MkdirArchive : erreur." 409 IGCM_debug_Exit "IGCM_sys_MkdirArchive" 410 fi 411 fi 412 IGCM_debug_PopStack "IGCM_sys_MkdirArchive" 309 413 } 310 414 … … 315 419 #D- 316 420 function IGCM_sys_MkdirWork { 317 318 319 320 321 322 if [ ! -d ${1} ]; then323 324 325 326 327 328 329 421 IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@ 422 if ( $DEBUG_sys ) ; then 423 echo "IGCM_sys_MkdirWork :" $@ 424 fi 425 #- creation de repertoire sur le serveur fichier 426 if [ ! -d ${1} ]; then 427 \mkdir -p $1 428 if [ $? -gt 0 ] ; then 429 echo "IGCM_sys_MkdirWork : erreur." 430 IGCM_debug_Exit "IGCM_sys_MkdirWork" 431 fi 432 fi 433 IGCM_debug_PopStack "IGCM_sys_MkdirWork" 330 434 } 331 435 … … 336 440 #D- 337 441 function IGCM_sys_Cd { 338 339 340 341 342 343 344 345 346 347 442 IGCM_debug_PushStack "IGCM_sys_Cd" $@ 443 if ( $DEBUG_sys ) ; then 444 echo "IGCM_sys_Cd :" $@ 445 fi 446 \cd $1 447 if [ $? -gt 0 ] ; then 448 echo "IGCM_sys_Cd : erreur." 449 IGCM_debug_Exit "IGCM_sys_Cd" 450 fi 451 IGCM_debug_PopStack "IGCM_sys_Cd" 348 452 } 349 453 … … 354 458 #D- 355 459 function IGCM_sys_Chmod { 356 357 358 359 360 361 362 363 364 365 366 367 368 369 460 IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@ 461 if ( $DEBUG_sys ) ; then 462 echo "IGCM_sys_Chmod :" $@ 463 fi 464 if [ $DRYRUN -le 1 ]; then 465 \chmod $@ 466 if [ $? -gt 0 ] ; then 467 echo "IGCM_sys_Chmod : erreur." 468 IGCM_debug_Exit "IGCM_sys_Chmod" 469 fi 470 else 471 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 472 fi 473 IGCM_debug_PopStack "IGCM_sys_Chmod" 370 474 } 371 475 … … 376 480 #D- 377 481 function IGCM_sys_FileSize { 378 379 380 381 382 383 384 385 386 387 482 IGCM_debug_PushStack "IGCM_sys_FileSize" $@ 483 484 typeset sizeF 485 set +A sizeF -- $( ls -la ${1} ) 486 if [ $? -gt 0 ] ; then 487 IGCM_debug_Exit "IGCM_sys_FileSize" 488 fi 489 eval ${2}=${sizeF[4]} 490 491 IGCM_debug_PopStack "IGCM_sys_FileSize" 388 492 } 389 493 … … 394 498 #D- 395 499 function IGCM_sys_TestDir { 396 397 398 399 400 401 402 403 404 500 IGCM_debug_PushStack "IGCM_sys_TestDir" $@ 501 if ( $DEBUG_sys ) ; then 502 echo "IGCM_sys_TestDir :" $@ 503 fi 504 typeset ExistFlag 505 ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 ) 506 IGCM_debug_PopStack "IGCM_sys_TestDir" 507 508 return ${ExistFlag} 405 509 } 406 510 … … 411 515 #D- 412 516 function IGCM_sys_TestDirArchive { 413 IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@ 414 if ( $DEBUG_sys ) ; then 415 echo "IGCM_sys_TestDirArchive :" $@ 416 fi 417 typeset ExistFlag 418 ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 ) 419 IGCM_debug_PopStack "IGCM_sys_TestDirArchive" 420 421 return ${ExistFlag} 517 IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@ 518 if ( $DEBUG_sys ) ; then 519 echo "IGCM_sys_TestDirArchive :" $@ 520 fi 521 typeset ExistFlag 522 ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 ) 523 IGCM_debug_PopStack "IGCM_sys_TestDirArchive" 524 525 return ${ExistFlag} 526 } 527 528 #D-#================================================== 529 #D-function IGCM_sys_IsFileArchived 530 #D-* Purpose: Test file that must NOT EXISTS on Archive 531 #D-* Examples: 532 #D- 533 function IGCM_sys_IsFileArchived { 534 IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@ 535 if ( $DEBUG_sys ) ; then 536 echo "IGCM_sys_IsFileArchived :" $@ 537 fi 538 typeset IsArchivedFlag 539 IsArchivedFlag=$( [ X$( echo $1 | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 ) 540 IGCM_debug_PopStack "IGCM_sys_IsFileArchived" 541 542 return ${IsArchivedFlag} 422 543 } 423 544 … … 428 549 #D- 429 550 function IGCM_sys_TestFileArchive { 430 IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@ 431 typeset ExistFlag 432 ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 ) 433 IGCM_debug_PopStack "IGCM_sys_TestFileArchive" 434 435 return ${ExistFlag} 551 IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@ 552 if ( $DEBUG_sys ) ; then 553 echo "IGCM_sys_TestFileArchive :" $@ 554 fi 555 typeset ExistFlag 556 ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 ) 557 IGCM_debug_PopStack "IGCM_sys_TestFileArchive" 558 559 return ${ExistFlag} 560 } 561 562 #D-#================================================== 563 #D-function IGCM_sys_TestFileBuffer 564 #D-* Purpose: Test file that must NOT EXISTS on Buffer 565 #D-* Examples: 566 #D- 567 function IGCM_sys_TestFileBuffer { 568 IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@ 569 typeset ExistFlag 570 ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 ) 571 IGCM_debug_PopStack "IGCM_sys_TestFileBuffer" 572 573 return ${ExistFlag} 436 574 } 437 575 … … 442 580 #D- 443 581 function IGCM_sys_CountFileArchive { 444 IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@ 445 ls ${@} 2>/dev/null | wc -l 446 if [ $? -gt 0 ] ; then 447 echo "IGCM_sys_CountFileArchive : erreur." 448 fi 449 IGCM_debug_PopStack "IGCM_sys_CountFileArchive" 582 IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@ 583 ls ${@} 2>/dev/null | wc -l 584 if [ $? -gt 0 ] ; then 585 echo "IGCM_sys_CountFileArchive : erreur." 586 fi 587 IGCM_debug_PopStack "IGCM_sys_CountFileArchive" 588 } 589 590 #D-#================================================== 591 #D-function IGCM_sys_CountFileBuffer 592 #D-* Purpose: Count files on Scratch filesystem 593 #D-* Examples: 594 #D- 595 function IGCM_sys_CountFileBuffer { 596 IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@ 597 ls ${@} 2>/dev/null | wc -l 598 if [ $? -gt 0 ] ; then 599 echo "IGCM_sys_CountFileBuffer : erreur." 600 fi 601 IGCM_debug_PopStack "IGCM_sys_CountFileBuffer" 450 602 } 451 603 … … 456 608 #D- 457 609 function IGCM_sys_Tree { 458 459 460 461 462 463 464 465 610 IGCM_debug_PushStack "IGCM_sys_Tree" $@ 611 if ( $DEBUG_sys ) ; then 612 echo "IGCM_sys_Tree :" $@ 613 fi 614 615 \ls -lR ${@} 616 617 IGCM_debug_PopStack "IGCM_sys_Tree" 466 618 } 467 619 468 620 #D-#================================================== 469 621 #D-function IGCM_sys_Tar 470 #D-* Purpose: master un-tar command622 #D-* Purpose: master tar command 471 623 #D-* Examples: 472 624 #D- 473 625 function IGCM_sys_Tar { 474 475 476 477 478 \tar xvf $1479 480 481 482 483 626 IGCM_debug_PushStack "IGCM_sys_Tar" $@ 627 if ( $DEBUG_sys ) ; then 628 echo "IGCM_sys_Tar :" $@ 629 fi 630 \tar cf $@ 631 if [ $? -gt 0 ] ; then 632 echo "IGCM_sys_Tar : erreur." 633 IGCM_debug_Exit "IGCM_sys_Tar" 634 fi 635 IGCM_debug_PopStack "IGCM_sys_Tar" 484 636 } 485 637 … … 490 642 #D- 491 643 function IGCM_sys_UnTar { 492 493 494 495 496 497 498 499 500 501 644 IGCM_debug_PushStack "IGCM_sys_UnTar" $@ 645 if ( $DEBUG_sys ) ; then 646 echo "IGCM_sys_UnTar :" $@ 647 fi 648 \tar xvf $1 649 if [ $? -gt 0 ] ; then 650 echo "IGCM_sys_UnTar : erreur." 651 IGCM_debug_Exit "IGCM_sys_UnTar" 652 fi 653 IGCM_debug_PopStack "IGCM_sys_UnTar" 502 654 } 503 655 … … 508 660 #D- 509 661 function IGCM_sys_Qsub { 510 IGCM_debug_PushStack "IGCM_sys_Qsub" $@ 511 if ( $DEBUG_sys ) ; then 512 echo "IGCM_sys_Qsub :" $@ 513 fi 514 515 if [ ${config_UserChoices_JobName}.${CumulPeriod} = "." ] ; then 516 /usr/bin/ccc_msub -o ${Script_Output} -e ${Script_Output} < $1 517 else 518 /usr/bin/ccc_msub -o ${Script_Output} -e ${Script_Output} -r ${config_UserChoices_JobName}.${CumulPeriod} < $1 519 fi 520 521 if [ $? -gt 0 ] ; then 522 echo "IGCM_sys_Qsub : erreur " $@ 523 IGCM_debug_Exit "IGCM_sys_Qsub" 524 fi 525 IGCM_debug_PopStack "IGCM_sys_Qsub" 662 IGCM_debug_PushStack "IGCM_sys_Qsub" $@ 663 if ( $DEBUG_sys ) ; then 664 echo "IGCM_sys_Qsub :" $@ 665 fi 666 typeset options 667 if [ ${config_UserChoices_JobName}.${CumulPeriod} = "." ] ; then 668 options=" -o ${Script_Output} -e ${Script_Output}" 669 else 670 options=" -o ${Script_Output} -e ${Script_Output} -r ${config_UserChoices_JobName}.${CumulPeriod}" 671 fi 672 673 /usr/local/bin/ccc_msub ${options} < $1 674 if [ $? -gt 0 ] ; then 675 echo "IGCM_sys_Qsub : erreur ${options} $1" 676 IGCM_debug_Exit "IGCM_sys_Qsub" 677 fi 678 IGCM_debug_PopStack "IGCM_sys_Qsub" 526 679 } 527 680 … … 532 685 #D- 533 686 function IGCM_sys_QsubPost { 534 535 536 537 538 539 540 541 542 543 687 IGCM_debug_PushStack "IGCM_sys_QsubPost" $@ 688 if ( $DEBUG_sys ) ; then 689 echo "IGCM_sys_QsubPost :" $@ 690 fi 691 /usr/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.out ${libIGCM_POST}/$1.job 692 if [ $? -gt 0 ] ; then 693 echo "IGCM_sys_QsubPost : erreur " $@ 694 IGCM_debug_Exit "IGCM_sys_QsubPost" 695 fi 696 IGCM_debug_PopStack "IGCM_sys_QsubPost" 544 697 } 545 698 546 699 #D-************************* 547 #D- File transfer functions 700 #D- File transfer functions 548 701 #D-************************* 549 702 #D- … … 555 708 #D- Error values and explanations can depend on your system version. 556 709 function IGCM_sys_Rsync_out { 557 RET=$1 558 if [ ! $RET ] ; then 559 echo "rsync error !" 560 fi 561 562 if [ $MYLANG = "fr" ]; then 563 case $RET in 564 0) return ;; 565 1) echo "Erreur de rsync ; RERR_SYNTAX : " 566 echo "Erreur de syntaxe ou d'utilisation." 567 return;; 568 2) echo "Erreur de rsync ; RERR_PROTOCOL : " 569 echo "Incompatibilité de protocole." 570 return;; 571 3) echo "Erreur de rsync ; RERR_FILESELECT 3" 572 echo "Erreurs lors de la sélection des fichiers d'entrée sortie et" 573 echo "répertoires" 574 return;; 575 4) echo "Erreur de rsync ; RERR_UNSUPPORTED" 576 echo "Action demandée non supportée : une tentative de manipulation de" 577 echo "fichiers 64-bits sur une plate-forme qui ne les supporte pas a" 578 echo "été faite ; ou une option qui est supportée par le client mais" 579 echo "pas par le serveur a été spécifiée." 580 return;; 581 10) echo "Erreur de rsync ; RERR_SOCKETIO" 582 echo "Erreur dans le socket d'entrée sortie" 583 return;; 584 11) echo "Erreur de rsync ; RERR_FILEIO" 585 echo "Erreur d'entrée sortie fichier" 586 return;; 587 12) echo "Erreur de rsync ; RERR_STREAMIO" 588 echo "Erreur dans flux de donnée du protocole rsync" 589 return;; 590 13) echo "Erreur de rsync ; RERR_MESSAGEIO" 591 echo "Erreur avec les diagnostics du programme" 592 return;; 593 14) echo "Erreur de rsync ; RERR_IPC" 594 echo "Erreur dans le code IPC" 595 return;; 596 20) echo "Erreur de rsync ; RERR_SIGNAL" 597 echo "SIGUSR1 ou SIGINT reçu" 598 return;; 599 21) echo "Erreur de rsync ; RERR_WAITCHILD" 600 echo "Une erreur retournée par waitpid()" 601 return;; 602 22) echo "Erreur de rsync ; RERR_MALLOC" 603 echo "Erreur lors de l'allocation des tampons de mémoire de coeur" 604 return;; 605 23) echo "" 606 echo "Erreur fichier inexistant" 607 return;; 608 30) echo "Erreur de rsync ; RERR_TIMEOUT" 609 echo "Temps d'attente écoulé dans l'envoi/réception de données" 610 return;; 611 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 612 return;; 613 esac 614 elif [ $MYLANG = "en" ] ; then 615 case $RET in 616 0) return;; 617 1) echo "rsync error : Syntax or usage error " 618 return;; 619 2) echo "rsync error : Protocol incompatibility " 620 return;; 621 3) echo "rsync error : Errors selecting input/output files, dirs" 622 return;; 623 4) echo "rsync error : Requested action not supported: an attempt" 624 echo "was made to manipulate 64-bit files on a platform that cannot support" 625 echo "them; or an option was specified that is supported by the client and" 626 echo "not by the server." 627 return;; 628 5) echo "rsync error : Error starting client-server protocol" 629 return;; 630 10) echo "rsync error : Error in socket I/O " 631 return;; 632 11) echo "rsync error : Error in file I/O " 633 return;; 634 12) echo "rsync error : Error in rsync protocol data stream " 635 return;; 636 13) echo "rsync error : Errors with program diagnostics " 637 return;; 638 14) echo "rsync error : Error in IPC code " 639 return;; 640 20) echo "rsync error : Received SIGUSR1 or SIGINT " 641 return;; 642 21) echo "rsync error : Some error returned by waitpid() " 643 return;; 644 22) echo "rsync error : Error allocating core memory buffers " 645 return;; 646 23) echo "rsync error : Partial transfer due to error" 647 return;; 648 24) echo "rsync error : Partial transfer due to vanished source files" 649 return;; 650 30) echo "rsync error : Timeout in data send/receive " 651 return;; 652 *) echo "rsync error : return code of rsync unknown :" $RET 653 return;; 654 esac 655 else 656 echo "unknown language $MYLANG." 657 return 658 fi 659 } 660 710 RET=$1 711 if [ ! $RET ] ; then 712 echo "rsync error !" 713 fi 714 715 if [ $MYLANG = "fr" ]; then 716 case $RET in 717 0) return ;; 718 1) echo "Erreur de rsync ; RERR_SYNTAX : " 719 echo "Erreur de syntaxe ou d'utilisation." 720 return;; 721 2) echo "Erreur de rsync ; RERR_PROTOCOL : " 722 echo "Incompatibilité de protocole." 723 return;; 724 3) echo "Erreur de rsync ; RERR_FILESELECT 3" 725 echo "Erreurs lors de la sélection des fichiers d'entrée sortie et" 726 echo "répertoires" 727 return;; 728 4) echo "Erreur de rsync ; RERR_UNSUPPORTED" 729 echo "Action demandée non supportée : une tentative de manipulation de" 730 echo "fichiers 64-bits sur une plate-forme qui ne les supporte pas a" 731 echo "été faite ; ou une option qui est supportée par le client mais" 732 echo "pas par le serveur a été spécifiée." 733 return;; 734 10) echo "Erreur de rsync ; RERR_SOCKETIO" 735 echo "Erreur dans le socket d'entrée sortie" 736 return;; 737 11) echo "Erreur de rsync ; RERR_FILEIO" 738 echo "Erreur d'entrée sortie fichier" 739 return;; 740 12) echo "Erreur de rsync ; RERR_STREAMIO" 741 echo "Erreur dans flux de donnée du protocole rsync" 742 return;; 743 13) echo "Erreur de rsync ; RERR_MESSAGEIO" 744 echo "Erreur avec les diagnostics du programme" 745 return;; 746 14) echo "Erreur de rsync ; RERR_IPC" 747 echo "Erreur dans le code IPC" 748 return;; 749 20) echo "Erreur de rsync ; RERR_SIGNAL" 750 echo "SIGUSR1 ou SIGINT reçu" 751 return;; 752 21) echo "Erreur de rsync ; RERR_WAITCHILD" 753 echo "Une erreur retournée par waitpid()" 754 return;; 755 22) echo "Erreur de rsync ; RERR_MALLOC" 756 echo "Erreur lors de l'allocation des tampons de mémoire de coeur" 757 return;; 758 23) echo "" 759 echo "Erreur fichier inexistant" 760 return;; 761 30) echo "Erreur de rsync ; RERR_TIMEOUT" 762 echo "Temps d'attente écoulé dans l'envoi/réception de données" 763 return;; 764 *) echo "Erreur de rsync : code de retour de rsync inconnu :" $RET 765 return;; 766 esac 767 elif [ $MYLANG = "en" ] ; then 768 case $RET in 769 0) return;; 770 1) echo "rsync error : Syntax or usage error " 771 return;; 772 2) echo "rsync error : Protocol incompatibility " 773 return;; 774 3) echo "rsync error : Errors selecting input/output files, dirs" 775 return;; 776 4) echo "rsync error : Requested action not supported: an attempt" 777 echo "was made to manipulate 64-bit files on a platform that cannot support" 778 echo "them; or an option was specified that is supported by the client and" 779 echo "not by the server." 780 return;; 781 5) echo "rsync error : Error starting client-server protocol" 782 return;; 783 10) echo "rsync error : Error in socket I/O " 784 return;; 785 11) echo "rsync error : Error in file I/O " 786 return;; 787 12) echo "rsync error : Error in rsync protocol data stream " 788 return;; 789 13) echo "rsync error : Errors with program diagnostics " 790 return;; 791 14) echo "rsync error : Error in IPC code " 792 return;; 793 20) echo "rsync error : Received SIGUSR1 or SIGINT " 794 return;; 795 21) echo "rsync error : Some error returned by waitpid() " 796 return;; 797 22) echo "rsync error : Error allocating core memory buffers " 798 return;; 799 23) echo "rsync error : Partial transfer due to error" 800 return;; 801 24) echo "rsync error : Partial transfer due to vanished source files" 802 return;; 803 30) echo "rsync error : Timeout in data send/receive " 804 return;; 805 *) echo "rsync error : return code of rsync unknown :" $RET 806 return;; 807 esac 808 else 809 echo "unknown language $MYLANG." 810 return 811 fi 812 } 661 813 662 814 #D-#================================================== … … 666 818 #D- 667 819 function IGCM_sys_Mirror_libIGCM { 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 820 IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM" 821 if ( $DEBUG_sys ) ; then 822 echo "IGCM_sys_Mirror_libIGCM" 823 fi 824 825 typeset RET DEST 826 827 mkdir -p ${HOME}/MIRROR/${PATHlibIGCM} 828 829 echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1 830 ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1 831 RET=$? 832 833 if [ ${RET} -gt 0 ] ; then 834 echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium." 835 cat out_rsync 836 fi 837 IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM" 686 838 } 687 839 … … 689 841 #- Call IGCM_sys_Mirror_libIGCM now ! 690 842 if ( $MirrorlibIGCM ) ; then 691 843 IGCM_sys_Mirror_libIGCM 692 844 fi 693 845 … … 698 850 #D- 699 851 function IGCM_sys_Cp { 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 852 IGCM_debug_PushStack "IGCM_sys_Cp" $@ 853 if ( $DEBUG_sys ) ; then 854 echo "IGCM_sys_Cp :" $@ 855 fi 856 857 typeset RET 858 859 echo cp $@ > out_rsync 2>&1 860 \cp $@ >> out_rsync 2>&1 861 RET=$? 862 863 if [ ${RET} -gt 0 ] ; then 864 echo "IGCM_sys_Cp : error." 865 cat out_rsync 866 IGCM_debug_Exit "IGCM_sys_Cp" 867 else 868 \rm out_rsync 869 fi 870 IGCM_debug_PopStack "IGCM_sys_Cp" 719 871 } 720 872 … … 725 877 #D- 726 878 function IGCM_sys_Rm { 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 879 IGCM_debug_PushStack "IGCM_sys_Rm" -- $@ 880 if ( $DEBUG_sys ) ; then 881 echo "IGCM_sys_Rm :" $@ 882 fi 883 884 typeset RET 885 886 echo rm $@ > out_rsync 2>&1 887 \rm $@ >> out_rsync 2>&1 888 RET=$? 889 890 if [ ${RET} -gt 0 ] ; then 891 echo "IGCM_sys_Rm : error." 892 cat out_rsync 893 IGCM_debug_Exit "IGCM_sys_Rm" 894 else 895 \rm out_rsync 896 fi 897 IGCM_debug_PopStack "IGCM_sys_Rm" 746 898 } 747 899 … … 753 905 #D- 754 906 function IGCM_sys_RmRunDir { 755 IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@ 756 if ( $DEBUG_sys ) ; then 757 echo "IGCM_sys_RmRunDir :" $@ 758 fi 759 760 typeset RET 761 762 echo rm $@ > out_rsync 2>&1 763 \rm $@ >> out_rsync 2>&1 764 RET=$? 765 766 if [ ${RET} -gt 0 ] ; then 767 echo "IGCM_sys_RmRunDir : error." 768 cat out_rsync 769 IGCM_debug_Exit "IGCM_sys_RmRunDir" 770 else 771 \rm out_rsync 772 fi 773 774 IGCM_debug_PopStack "IGCM_sys_RmRunDir" 907 IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@ 908 if ( $DEBUG_sys ) ; then 909 echo "IGCM_sys_RmRunDir :" $@ 910 fi 911 912 typeset RET 913 914 echo rm $@ > out_rsync 2>&1 915 \rm $@ >> out_rsync 2>&1 916 RET=$? 917 918 if [ ${RET} -gt 0 ] ; then 919 echo "IGCM_sys_RmRunDir : error." 920 cat out_rsync 921 IGCM_debug_Exit "IGCM_sys_RmRunDir" 922 else 923 \rm out_rsync 924 fi 925 IGCM_debug_PopStack "IGCM_sys_RmRunDir" 775 926 } 776 927 … … 781 932 #D- 782 933 function IGCM_sys_Mv { 783 IGCM_debug_PushStack "IGCM_sys_Mv" $@ 784 if ( $DEBUG_sys ) ; then 785 echo "IGCM_sys_Mv :" $@ 786 fi 787 788 if [ $DRYRUN = 0 ]; then 789 790 typeset RET 791 792 echo mv $@ > out_rsync 2>&1 793 \mv $@ >> out_rsync 2>&1 794 RET=$? 795 796 if [ ${RET} -gt 0 ] ; then 797 echo "IGCM_sys_Mv : error in mv." 798 cat out_rsync 799 IGCM_debug_Exit "IGCM_sys_Mv" 800 else 801 \rm out_rsync 802 fi 934 IGCM_debug_PushStack "IGCM_sys_Mv" $@ 935 if ( $DEBUG_sys ) ; then 936 echo "IGCM_sys_Mv :" $@ 937 fi 938 939 if [ $DRYRUN = 0 ]; then 940 941 typeset RET 942 943 echo mv $@ > out_rsync 2>&1 944 \mv $@ >> out_rsync 2>&1 945 RET=$? 946 947 if [ ${RET} -gt 0 ] ; then 948 echo "IGCM_sys_Mv : error in mv." 949 cat out_rsync 950 IGCM_debug_Exit "IGCM_sys_Mv" 803 951 else 804 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 805 fi 806 807 IGCM_debug_PopStack "IGCM_sys_Mv" 952 \rm out_rsync 953 fi 954 else 955 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 956 fi 957 958 IGCM_debug_PopStack "IGCM_sys_Mv" 808 959 } 809 960 … … 814 965 #D- 815 966 function IGCM_sys_Put_Dir { 816 IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@ 817 if ( $DEBUG_sys ) ; then 818 echo "IGCM_sys_Put_Dir :" $@ 819 fi 820 if [ $DRYRUN = 0 ]; then 821 if [ ! -d ${1} ] ; then 822 echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ." 823 IGCM_debug_PopStack "IGCM_sys_Put_Dir" 824 return 825 fi 826 827 typeset RET 828 829 # Only if we use rsync 830 #IGCM_sys_TestDirArchive $( dirname $2 ) 831 # 832 #USUAL WAY 833 \cp -r $1 $2 > out_rsync 2>&1 834 RET=$? 835 836 if [ ${RET} -gt 0 ] ; then 837 echo "IGCM_sys_Put_Dir : error." 838 cat out_rsync 839 IGCM_debug_Exit "IGCM_sys_Put_Dir" 840 else 841 \rm out_rsync 842 fi 967 IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@ 968 if ( $DEBUG_sys ) ; then 969 echo "IGCM_sys_Put_Dir :" $@ 970 fi 971 if [ $DRYRUN = 0 ]; then 972 if [ ! -d ${1} ] ; then 973 echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ." 974 IGCM_debug_PopStack "IGCM_sys_Put_Dir" 975 return 976 fi 977 978 typeset RET 979 980 # Only if we use rsync 981 #IGCM_sys_TestDirArchive $( dirname $2 ) 982 # 983 #USUAL WAY 984 \cp -r $1 $2 > out_rsync 2>&1 985 RET=$? 986 987 if [ ${RET} -gt 0 ] ; then 988 echo "IGCM_sys_Put_Dir : error." 989 cat out_rsync 990 IGCM_debug_Exit "IGCM_sys_Put_Dir" 843 991 else 844 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 845 fi 846 IGCM_debug_PopStack "IGCM_sys_Put_Dir" 992 \rm out_rsync 993 fi 994 else 995 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 996 fi 997 IGCM_debug_PopStack "IGCM_sys_Put_Dir" 847 998 } 848 999 849 1000 #D-#================================================== 850 1001 #D-function IGCM_sys_Get_Dir 851 #D-* Purpose: Copy a complete directory from $ (ARCHIVE)1002 #D-* Purpose: Copy a complete directory from ${ARCHIVE} 852 1003 #D-* Examples: 853 1004 #D- 854 1005 function IGCM_sys_Get_Dir { 855 856 857 858 859 860 # 861 # 862 # 863 # 864 # 865 866 867 868 869 870 871 1006 IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@ 1007 if ( $DEBUG_sys ) ; then 1008 echo "IGCM_sys_Get_Dir :" $@ 1009 fi 1010 if [ $DRYRUN = 0 ]; then 1011 # if [ ! -d ${1} ] ; then 1012 # echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ." 1013 # IGCM_debug_PopStack "IGCM_sys_Get_Dir" 1014 # return 1015 # fi 1016 1017 typeset RET 1018 1019 # Only if we use rsync 1020 #IGCM_sys_TestDirArchive $( dirname $2 ) 1021 # 1022 #USUAL WAY 872 1023 # add get (to demigrate all offline files) to reduce time of this command : 873 ccc_hsm get $1/* 874 \cp -r $1 $2 > out_rsync 2>&1 875 RET=$? 876 877 if [ ${RET} -gt 0 ] ; then 878 echo "IGCM_sys_Get_Dir : error." 879 cat out_rsync 880 IGCM_debug_Exit "IGCM_sys_Get_Dir" 881 else 882 \rm out_rsync 883 fi 1024 ccc_hsm get $1/* 1025 \cp -r $1 $2 > out_rsync 2>&1 1026 RET=$? 1027 1028 if [ ${RET} -gt 0 ] ; then 1029 echo "IGCM_sys_Get_Dir : error." 1030 cat out_rsync 1031 IGCM_debug_Exit "IGCM_sys_Get_Dir" 884 1032 else 885 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 886 fi 887 IGCM_debug_PopStack "IGCM_sys_Get_Dir" 1033 \rm out_rsync 1034 fi 1035 else 1036 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1037 fi 1038 IGCM_debug_PopStack "IGCM_sys_Get_Dir" 888 1039 } 889 1040 … … 894 1045 #D- 895 1046 function IGCM_sys_Get_Master { 896 IGCM_debug_PushStack "IGCM_sys_Get_Master" $@ 897 if ( $DEBUG_sys ) ; then 898 echo "IGCM_sys_Get_Master :" $@ 899 fi 900 if [ $DRYRUN = 0 ]; then 901 if [ ! -d ${1} ] ; then 902 echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ." 903 IGCM_debug_PopStack "IGCM_sys_Get_Master" 904 return 905 fi 906 907 typeset RET 908 909 #USUAL WAY 910 \cp -r $1 $2 > out_rsync 2>&1 911 RET=$? 912 913 if [ ${RET} -gt 0 ] ; then 914 echo "IGCM_sys_Get_Master : error." 915 cat out_rsync 916 IGCM_debug_Exit "IGCM_sys_Get_Master" 917 fi 1047 IGCM_debug_PushStack "IGCM_sys_Get_Master" $@ 1048 if ( $DEBUG_sys ) ; then 1049 echo "IGCM_sys_Get_Master :" $@ 1050 fi 1051 if [ $DRYRUN = 0 ]; then 1052 if [ ! -d ${1} ] ; then 1053 echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ." 1054 IGCM_debug_PopStack "IGCM_sys_Get_Master" 1055 return 1056 fi 1057 1058 typeset RET 1059 1060 #USUAL WAY 1061 \cp -r $1 $2 > out_rsync 2>&1 1062 RET=$? 1063 1064 if [ ${RET} -gt 0 ] ; then 1065 echo "IGCM_sys_Get_Master : error." 1066 cat out_rsync 1067 IGCM_debug_Exit "IGCM_sys_Get_Master" 918 1068 else 919 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 920 fi 921 IGCM_debug_PopStack "IGCM_sys_Get_Master" 1069 \rm out_rsync 1070 fi 1071 else 1072 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1073 fi 1074 IGCM_debug_PopStack "IGCM_sys_Get_Master" 922 1075 } 923 1076 924 1077 #D-#================================================== 925 1078 #D-function IGCM_sys_Put_Rest 926 #D-* Purpose: Put computied restarts on $ (ARCHIVE).1079 #D-* Purpose: Put computied restarts on ${ARCHIVE}. 927 1080 #D- File and target directory must exist. 928 1081 #D-* Examples: 929 1082 #D- 930 1083 function IGCM_sys_Put_Rest { 931 IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@ 932 if ( $DEBUG_sys ) ; then 933 echo "IGCM_sys_Put_Rest :" $@ 934 fi 935 if [ $DRYRUN = 0 ]; then 936 if [ ! -f ${1} ] ; then 937 echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 938 IGCM_debug_Exit "IGCM_sys_Put_Rest" 939 fi 940 941 typeset RET 942 # 943 if [ X${JobType} = XRUN ] ; then 944 IGCM_sys_Chmod 444 ${1} 945 fi 946 # 947 IGCM_sys_TestDirArchive $( dirname $2 ) 948 # 949 # USUAL WAY 950 \cp $1 $2 > out_rsync 2>&1 951 RET=$? 952 953 # #RSYNC WITH NETWORK SSH CALL 954 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1 955 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1 956 957 # #RSYNC WITH NFS USE 958 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 959 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 960 961 # RET=$? 962 # IGCM_sys_Rsync_out $RET 963 964 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 965 # (( RET=RET+$? )) 966 967 if [ ${RET} -gt 0 ] ; then 968 echo "IGCM_sys_Put_Rest : error." 969 cat out_rsync 970 IGCM_debug_Exit "IGCM_sys_Put_Rest" 971 else 972 \rm out_rsync 973 fi 1084 IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@ 1085 if ( $DEBUG_sys ) ; then 1086 echo "IGCM_sys_Put_Rest :" $@ 1087 fi 1088 if [ $DRYRUN = 0 ]; then 1089 if [ ! -f ${1} ] ; then 1090 echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 1091 IGCM_debug_Exit "IGCM_sys_Put_Rest" 1092 fi 1093 1094 typeset RET 1095 # 1096 if [ X${JobType} = XRUN ] ; then 1097 IGCM_sys_Chmod 444 ${1} 1098 fi 1099 1100 # 1101 # USUAL WAY 1102 \cp $1 $2 > out_rsync 2>&1 1103 RET=$? 1104 1105 # #RSYNC WITH NETWORK SSH CALL 1106 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 1107 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 1108 1109 # #RSYNC WITH NFS USE 1110 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 1111 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1112 1113 # RET=$? 1114 # IGCM_sys_Rsync_out $RET 1115 1116 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1117 # (( RET=RET+$? )) 1118 1119 if [ ${RET} -gt 0 ] ; then 1120 echo "IGCM_sys_Put_Rest : error." 1121 cat out_rsync 1122 IGCM_debug_Exit "IGCM_sys_Put_Rest" 974 1123 else 975 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 976 fi 977 IGCM_debug_PopStack "IGCM_sys_Put_Rest" 1124 \rm out_rsync 1125 fi 1126 else 1127 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1128 fi 1129 IGCM_debug_PopStack "IGCM_sys_Put_Rest" 1130 } 1131 1132 #D-#================================================== 1133 #D-function IGCM_sys_PutBuffer_Rest 1134 #D-* Purpose: Put computied restarts on ${SCRATCHDIR}. 1135 #D- File and target directory must exist. 1136 #D-* Examples: 1137 #D- 1138 function IGCM_sys_PutBuffer_Rest { 1139 IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@ 1140 if ( $DEBUG_sys ) ; then 1141 echo "IGCM_sys_PutBuffer_Rest :" $@ 1142 fi 1143 if [ $DRYRUN = 0 ]; then 1144 if [ ! -f ${1} ] ; then 1145 echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ." 1146 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 1147 fi 1148 1149 typeset RET 1150 # 1151 if [ X${JobType} = XRUN ] ; then 1152 IGCM_sys_Chmod 444 ${1} 1153 fi 1154 1155 # 1156 # USUAL WAY 1157 \cp $1 $2 > out_rsync 2>&1 1158 RET=$? 1159 1160 if [ ${RET} -gt 0 ] ; then 1161 echo "IGCM_sys_PutBuffer_Rest : error." 1162 cat out_rsync 1163 IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 1164 else 1165 \rm out_rsync 1166 fi 1167 else 1168 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1169 fi 1170 IGCM_debug_PopStack "IGCM_sys_PutBuffer_Rest" 978 1171 } 979 1172 980 1173 #D-#================================================== 981 1174 #D-function IGCM_sys_Put_Out 982 #D-* Purpose: Copy a file on $ (ARCHIVE) after havechmod it in readonly1175 #D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly 983 1176 #D-* Examples: 984 1177 #D- 985 1178 function IGCM_sys_Put_Out { 986 IGCM_debug_PushStack "IGCM_sys_Put_Out" $@ 987 if ( $DEBUG_sys ) ; then 988 echo "IGCM_sys_Put_Out :" $@ 989 fi 990 if [ $DRYRUN = 0 ]; then 991 if [ ! -f ${1} ] ; then 992 echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ." 993 IGCM_debug_PopStack "IGCM_sys_Put_Out" 994 return 1 995 fi 996 # 997 IGCM_sys_MkdirArchive $( dirname $2 ) 998 # 999 typeset RET 1000 1001 #===================================================== 1002 # COMMENT OUT DOUBLE COPY ON SCRATCHDIR 1003 #===================================================== 1004 1005 #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1 1006 #if [ $? -eq 0 ] ; then 1007 # typeset WORKPATH FILEPATH 1008 # WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_OUT_SCR}|" ) 1009 # IGCM_sys_MkdirWork ${WORKPATH} 1010 # FILEPATH=${WORKPATH}/$( basename $2 ) 1011 # # 1012 # IGCM_sys_Cp ${1} ${FILEPATH} 1013 #fi 1014 1015 if [ X${JobType} = XRUN ] ; then 1016 if [ X${3} = X ] ; then 1017 IGCM_sys_Chmod 444 ${1} 1018 fi 1019 fi 1020 # 1021 # USUAL WAY 1022 \cp $1 $2 > out_rsync 2>&1 1023 RET=$? 1024 1025 # #RSYNC WITH NETWORK SSH CALL 1026 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1 1027 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1 1028 1029 # #RSYNC WITH NFS USE 1030 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 1031 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1032 1033 # RET=$? 1034 # IGCM_sys_Rsync_out $RET 1035 1036 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1037 # (( RET=RET+$? )) 1038 1039 if [ ${RET} -gt 0 ] ; then 1040 echo "IGCM_sys_Put_Out : error." 1041 cat out_rsync 1042 IGCM_debug_Exit "IGCM_sys_Put_Out" 1043 else 1044 \rm out_rsync 1045 fi 1179 IGCM_debug_PushStack "IGCM_sys_Put_Out" $@ 1180 if ( $DEBUG_sys ) ; then 1181 echo "IGCM_sys_Put_Out :" $@ 1182 fi 1183 if [ $DRYRUN = 0 ]; then 1184 if [ ! -f ${1} ] ; then 1185 echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ." 1186 IGCM_debug_PopStack "IGCM_sys_Put_Out" 1187 return 1 1188 fi 1189 # 1190 IGCM_sys_MkdirArchive $( dirname $2 ) 1191 # 1192 typeset RET 1193 1194 #===================================================== 1195 # COMMENT OUT DOUBLE COPY ON SCRATCHDIR 1196 #===================================================== 1197 1198 #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1 1199 #if [ $? -eq 0 ] ; then 1200 # typeset WORKPATH FILEPATH 1201 # WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" ) 1202 # IGCM_sys_MkdirWork ${WORKPATH} 1203 # FILEPATH=${WORKPATH}/$( basename $2 ) 1204 # # 1205 # IGCM_sys_Cp ${1} ${FILEPATH} 1206 #fi 1207 1208 if [ X${JobType} = XRUN ] ; then 1209 if [ X${3} = X ] ; then 1210 IGCM_sys_Chmod 444 ${1} 1211 fi 1212 fi 1213 # 1214 # USUAL WAY 1215 \cp $1 $2 > out_rsync 2>&1 1216 RET=$? 1217 1218 # #RSYNC WITH NETWORK SSH CALL 1219 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 1220 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 1221 1222 # #RSYNC WITH NFS USE 1223 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 1224 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1225 1226 # RET=$? 1227 # IGCM_sys_Rsync_out $RET 1228 1229 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1230 # (( RET=RET+$? )) 1231 1232 if [ ${RET} -gt 0 ] ; then 1233 echo "IGCM_sys_Put_Out : error." 1234 cat out_rsync 1235 IGCM_debug_Exit "IGCM_sys_Put_Out" 1046 1236 else 1047 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1048 fi 1049 IGCM_debug_PopStack "IGCM_sys_Put_Out" 1050 return 0 1237 \rm out_rsync 1238 fi 1239 else 1240 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1241 fi 1242 IGCM_debug_PopStack "IGCM_sys_Put_Out" 1243 return 0 1244 } 1245 1246 #D-#================================================== 1247 #D-function IGCM_sys_PutBuffer_Out 1248 #D-* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly 1249 #D-* Examples: 1250 #D- 1251 function IGCM_sys_PutBuffer_Out { 1252 IGCM_debug_PushStack "IGCM_sys_PutBuffer_Out" $@ 1253 if ( $DEBUG_sys ) ; then 1254 echo "IGCM_sys_PutBuffer_Out :" $@ 1255 fi 1256 if [ $DRYRUN = 0 ]; then 1257 if [ ! -f ${1} ] ; then 1258 echo "WARNING : IGCM_sys_PutBuffer_Out ${1} DOES NOT EXIST ." 1259 IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out" 1260 return 1 1261 fi 1262 # 1263 IGCM_sys_Mkdir $( dirname $2 ) 1264 # 1265 typeset RET 1266 1267 if [ X${JobType} = XRUN ] ; then 1268 if [ X${3} = X ] ; then 1269 IGCM_sys_Chmod 444 ${1} 1270 fi 1271 fi 1272 # 1273 # USUAL WAY 1274 \cp $1 $2 > out_rsync 2>&1 1275 RET=$? 1276 1277 if [ ${RET} -gt 0 ] ; then 1278 echo "IGCM_sys_PutBuffer_Out : error." 1279 cat out_rsync 1280 IGCM_debug_Exit "IGCM_sys_PutBuffer_Out" 1281 else 1282 \rm out_rsync 1283 fi 1284 else 1285 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1286 fi 1287 IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out" 1288 return 0 1051 1289 } 1052 1290 … … 1057 1295 #D- IGCM_sys_Get /l Array_contain_myfiles /destpath/ 1058 1296 function IGCM_sys_Get { 1059 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1060 1061 typeset DEST RET dm_liste ifile target file_work 1062 1063 if ( $DEBUG_sys ) ; then 1064 echo "IGCM_sys_Get :" $@ 1065 fi 1066 if [ $DRYRUN -le 2 ]; then 1067 if [ X${1} = X'/l' ] ; then 1068 # test if the first file is present in the old computation : 1069 eval set +A dm_liste \${${2}} 1070 else 1071 eval set +A dm_liste ${1} 1072 fi 1073 eval DEST=\${${#}} 1074 1075 #===================================================== 1076 # COMMENT OUT DOUBLE COPY ON SCRATCHDIR 1077 #===================================================== 1078 1079 # Is it an R_OUT file (not R_IN) ? 1080 #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1 1081 #if [ $? -eq 0 ] ; then 1082 # # Yes ? then we try to get it in SCRATCHDIR 1083 # set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|g" ) 1084 # if [ -f ${file_work[0]} ] ; then 1085 # IGCM_sys_Cp ${file_work[*]} ${DEST} 1086 # IGCM_debug_PopStack "IGCM_sys_Get" 1087 # return 1088 # fi 1089 #fi 1090 1091 # test if the (first) file is present in the old computation : 1092 IGCM_sys_TestFileArchive ${dm_liste[0]} 1093 RET=$? 1094 if [ ${RET} -gt 0 ] ; then 1095 echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 1096 IGCM_debug_Exit "IGCM_sys_Get" 1097 fi 1098 1099 ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1 1100 RET=$? 1101 1102 if [ ${RET} -gt 0 ] ; then 1103 echo "WARNING IGCM_sys_Get : demigration error." 1104 cat out_rsync 1105 echo "WARNING IGCM_sys_Get : will stop later if the cp fails." 1106 fi 1107 1108 #if [ ${RET} -gt 0 ] ; then 1109 # if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then 1110 # cat out_rsync 1111 # echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : " 1112 # sleep 30 1113 # echo "We try another time" 1114 # dmget ${dm_liste[*]} > out_rsync 2>&1 1115 # RET=$? 1116 # if [ ${RET} -gt 0 ] ; then 1117 # echo "ERROR IGCM_sys_Get : again demigration error :" 1118 # cat out_rsync 1119 # IGCM_debug_Exit "IGCM_sys_Get" 1120 # fi 1121 # else 1122 # echo "ERROR IGCM_sys_Get : demigration error :" 1123 # cat out_rsync 1124 # IGCM_debug_Exit "IGCM_sys_Get" 1125 # fi 1126 #fi 1127 1128 #USUAL WAY 1129 if [ X${1} = X'/l' ] ; then 1130 (( RET=0 )) 1131 for target in ${dm_liste[*]} ; do 1132 local_file=$( basename ${target} ) 1133 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1134 (( RET = RET + $? )) 1135 done 1136 else 1137 \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 1138 RET=$? 1139 fi 1140 1141 # #RSYNC WITH NETWORK SSH CALL 1142 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 1143 # ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 1144 1145 # #RSYNC WITH NFS USE 1146 # echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 1147 # ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 1148 1149 # RET=$? 1150 # IGCM_sys_Rsync_out $RET 1151 1152 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1153 # (( RET=RET+$? )) 1154 1155 if [ ${RET} -gt 0 ] ; then 1156 echo "IGCM_sys_Get : copy error." 1157 cat out_rsync 1158 IGCM_debug_Exit "IGCM_sys_Get" 1159 else 1160 \rm out_rsync 1161 fi 1297 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1298 1299 typeset DEST RET dm_liste ifile target file_work 1300 1301 if ( $DEBUG_sys ) ; then 1302 echo "IGCM_sys_Get :" $@ 1303 fi 1304 if [ $DRYRUN -le 2 ]; then 1305 if [ X${1} = X'/l' ] ; then 1306 # test if the first file is present in the old computation : 1307 eval set +A dm_liste \${${2}} 1162 1308 else 1163 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1164 fi 1165 IGCM_debug_PopStack "IGCM_sys_Get" 1166 } 1167 1168 ############################################################## A FINIR !! 1309 eval set +A dm_liste ${1} 1310 fi 1311 eval DEST=\${${#}} 1312 1313 #===================================================== 1314 # COMMENT OUT DOUBLE COPY ON SCRATCHDIR 1315 #===================================================== 1316 1317 # Is it an R_OUT file (not R_IN) ? 1318 #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1 1319 #if [ $? -eq 0 ] ; then 1320 # # Yes ? then we try to get it in SCRATCHDIR 1321 # set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" ) 1322 # if [ -f ${file_work[0]} ] ; then 1323 # IGCM_sys_Cp ${file_work[*]} ${DEST} 1324 # IGCM_debug_PopStack "IGCM_sys_Get" 1325 # return 1326 # fi 1327 #fi 1328 1329 # test if the (first) file is present in the old computation : 1330 IGCM_sys_TestFileArchive ${dm_liste[0]} 1331 RET=$? 1332 if [ ${RET} -gt 0 ] ; then 1333 echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ." 1334 IGCM_debug_Exit "IGCM_sys_Get" 1335 fi 1336 1337 ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1 1338 RET=$? 1339 if [ ${RET} -gt 0 ] ; then 1340 echo "WARNING IGCM_sys_Get : demigration error." 1341 cat out_rsync 1342 echo "WARNING IGCM_sys_Get : will stop later if the cp fails." 1343 fi 1344 1345 #if [ ${RET} -gt 0 ] ; then 1346 # if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then 1347 # cat out_rsync 1348 # echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : " 1349 # sleep 30 1350 # echo "We try another time" 1351 ## dmget ${dm_liste[*]} > out_rsync 2>&1 1352 # ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1 1353 # RET=$? 1354 # if [ ${RET} -gt 0 ] ; then 1355 # echo "ERROR IGCM_sys_Get : again demigration error :" 1356 # cat out_rsync 1357 # IGCM_debug_Exit "IGCM_sys_Get" 1358 # fi 1359 # else 1360 # echo "ERROR IGCM_sys_Get : demigration error :" 1361 # cat out_rsync 1362 # IGCM_debug_Exit "IGCM_sys_Get" 1363 # fi 1364 #fi 1365 1366 #USUAL WAY 1367 if [ X${1} = X'/l' ] ; then 1368 (( RET=0 )) 1369 for target in ${dm_liste[*]} ; do 1370 local_file=$( basename ${target} ) 1371 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1372 (( RET = RET + $? )) 1373 done 1374 else 1375 \cp ${dm_liste} ${DEST} >> out_rsync 2>&1 1376 RET=$? 1377 fi 1378 1379 # #RSYNC WITH NETWORK SSH CALL 1380 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 1381 # ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 1382 1383 # #RSYNC WITH NFS USE 1384 # echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 1385 # ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 1386 1387 # RET=$? 1388 # IGCM_sys_Rsync_out $RET 1389 1390 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1391 # (( RET=RET+$? )) 1392 1393 if [ ${RET} -gt 0 ] ; then 1394 echo "IGCM_sys_Get : copy error." 1395 cat out_rsync 1396 IGCM_debug_Exit "IGCM_sys_Get" 1397 else 1398 \rm out_rsync 1399 fi 1400 else 1401 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1402 fi 1403 IGCM_debug_PopStack "IGCM_sys_Get" 1404 } 1405 1406 #D-#================================================== 1407 #D-function IGCM_sys_GetBuffer 1408 #D-* Purpose: Get a file from ${SCRATCHDIR} 1409 #D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX 1410 #D- IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/ 1411 function IGCM_sys_GetBuffer { 1412 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1413 1414 typeset DEST RET buf_liste ifile target file_work 1415 1416 if ( $DEBUG_sys ) ; then 1417 echo "IGCM_sys_GetBuffer :" $@ 1418 fi 1419 if [ $DRYRUN -le 2 ]; then 1420 if [ X${1} = X'/l' ] ; then 1421 # test if the first file is present in the old computation : 1422 eval set +A buf_liste \${${2}} 1423 else 1424 eval set +A buf_liste ${1} 1425 fi 1426 eval DEST=\${${#}} 1427 1428 #USUAL WAY 1429 if [ X${1} = X'/l' ] ; then 1430 (( RET=0 )) 1431 for target in ${buf_liste[*]} ; do 1432 local_file=$( basename ${target} ) 1433 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1434 (( RET = RET + $? )) 1435 done 1436 else 1437 \cp ${buf_liste} ${DEST} >> out_rsync 2>&1 1438 RET=$? 1439 fi 1440 1441 if [ ${RET} -gt 0 ] ; then 1442 echo "IGCM_sys_GetBuffer : copy error." 1443 cat out_rsync 1444 IGCM_debug_Exit "IGCM_sys_GetBuffer" 1445 else 1446 \rm out_rsync 1447 fi 1448 else 1449 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1450 fi 1451 IGCM_debug_PopStack "IGCM_sys_GetBuffer" 1452 } 1169 1453 1170 1454 #D-#================================================== … … 1174 1458 #D- 1175 1459 function IGCM_sys_GetDate_FichWork { 1176 IGCM_debug_PushStack "IGCM_sys_FichWork" $@ 1177 if ( $DEBUG_sys ) ; then 1178 echo "IGCM_sys_GetDate_FichWork :" $@ 1179 fi 1460 IGCM_debug_PushStack "IGCM_sys_FichWork" $@ 1461 if ( $DEBUG_sys ) ; then 1462 echo "IGCM_sys_GetDate_FichWork :" $@ 1463 fi 1464 typeset dateF 1465 set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} ) 1466 eval ${2}=${dateF[5]} 1467 1180 1468 # donne la date filesys d'un fichier sur la machine work 1181 1469 IGCM_debug_PopStack "IGCM_sys_FichWork" 1182 1470 } 1183 1471 1184 1472 #D-#================================================== 1185 1473 #D-function IGCM_sys_GetDate_FichArchive 1186 #D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 1474 #D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 1187 1475 #D-* Examples: 1188 1476 #D- 1189 1477 function IGCM_sys_GetDate_FichArchive { 1190 IGCM_debug_PushStack "IGCM_sys_FichArchive" $@ 1191 if ( $DEBUG_sys ) ; then 1192 echo "IGCM_sys_GetDate_FichArchive :" $@ 1193 fi 1194 IGCM_debug_PopStack "IGCM_sys_FichArchive" 1478 IGCM_debug_PushStack "IGCM_sys_FichArchive" $@ 1479 if ( $DEBUG_sys ) ; then 1480 echo "IGCM_sys_GetDate_FichArchive :" $@ 1481 fi 1482 typeset dateF 1483 set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} ) 1484 eval ${2}=${dateF[5]} 1485 1486 IGCM_debug_PopStack "IGCM_sys_FichArchive" 1487 } 1488 1489 #D-#================================================== 1490 #D-function IGCM_sys_Dods_Rm 1491 #D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole. 1492 #D-* Examples: 1493 #D- 1494 function IGCM_sys_Dods_Rm { 1495 if ( $DEBUG_sys ) ; then 1496 echo "IGCM_sys_Dods_Rm :" $@ 1497 fi 1498 typeset RET 1499 RET=0 1500 if [ $DRYRUN = 0 ]; then 1501 1502 # if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then 1503 # echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ." 1504 # echo "Nothing has been done." 1505 # return 1506 # fi 1507 1508 /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1 1509 RET=$? 1510 1511 # if [ ${RET} -gt 0 ] ; then 1512 # echo "IGCM_sys_Dods_Rm : error." 1513 # cat out_dods_rm 1514 # IGCM_debug_Exit "IGCM_sys_Dods_Rm" 1515 # else 1516 # rm out_dods_rm 1517 # fi 1518 1519 else 1520 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1521 fi 1522 return $RET 1523 } 1524 1525 #D-#================================================== 1526 #D-function IGCM_sys_Dods_Cp 1527 #D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole. 1528 #D-* Examples: 1529 #D- 1530 function IGCM_sys_Dods_Cp { 1531 if ( $DEBUG_sys ) ; then 1532 echo "IGCM_sys_Dods_Cp :" $@ 1533 fi 1534 typeset RET 1535 RET=0 1536 if [ $DRYRUN = 0 ]; then 1537 1538 # if [ ! -d ${R_SAVE}/${1} ] ; then 1539 # echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ." 1540 # echo "Nothing has been done." 1541 # return 1542 # fi 1543 1544 /ccc/cont003/home/dsm/p86maf/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1 1545 RET=$? 1546 1547 # if [ ${RET} -gt 0 ] ; then 1548 # echo "IGCM_sys_Dods_Cp : error." 1549 # cat out_dods_cp 1550 # IGCM_debug_Exit "IGCM_sys_Dods_Cp" 1551 # else 1552 # rm out_dods_cp 1553 # fi 1554 1555 else 1556 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1557 fi 1558 return $RET 1559 } 1560 1561 #D-#================================================== 1562 #D-function IGCM_sys_Put_Dods 1563 #D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole. 1564 #D-* Examples: 1565 #D- 1566 function IGCM_sys_Put_Dods { 1567 IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@ 1568 if ( $DEBUG_sys ) ; then 1569 echo "IGCM_sys_Put_Dods :" $@ 1570 fi 1571 set -vx 1572 typeset RET 1573 if [ $DRYRUN = 0 ]; then 1574 if ( [ ! -d ${R_SAVE}/${1} ] && [ ! -d ${R_FIGR}/${1} ] ) ; then 1575 echo "WARNING IGCM_sys_Put_Dods : None of the following directories exist. Exactly one should." 1576 echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} DOES NOT EXIST." 1577 echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} DOES NOT EXIST." 1578 IGCM_debug_PopStack "IGCM_sys_Put_Dods" 1579 return 1580 fi 1581 1582 if ( [ -d ${R_SAVE}/${1} ] && [ -d ${R_FIGR}/${1} ] ) ; then 1583 echo "WARNING IGCM_sys_Put_Dods : Both of the following directories exist. Exactly one should." 1584 echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} EXISTS." 1585 echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} EXISTS." 1586 IGCM_debug_PopStack "IGCM_sys_Put_Dods" 1587 return 1588 fi 1589 # 1590 if [ -d ${R_SAVE}/${1} ] ; then 1591 cd ${R_SAVE} 1592 elif [ -d ${R_FIGR}/${1} ] ; then 1593 cd ${R_FIGR} 1594 fi 1595 1596 IGCM_sys_Dods_Rm ${1} 1597 IGCM_sys_Dods_Cp ${1} 1598 RET=0 1599 1600 if [ ${RET} -gt 0 ] ; then 1601 echo "IGCM_sys_Put_Dods : error." 1602 IGCM_debug_Exit "IGCM_sys_Put_Dods" 1603 fi 1604 else 1605 ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack 1606 fi 1607 IGCM_debug_PopStack "IGCM_sys_Put_Dods" 1195 1608 } 1196 1609 … … 1199 1612 1200 1613 function IGCM_sys_rebuild { 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1614 IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@ 1615 if ( $DEBUG_sys ) ; then 1616 echo "IGCM_sys_rebuild :" $@ 1617 fi 1618 ~p86ipsl/CESIUM/bin/rebuild -f -o $@ 1619 if [ $? -gt 0 ] ; then 1620 echo "IGCM_sys_rebuild : erreur ${@}." 1621 IGCM_debug_Exit "rebuild" 1622 fi 1623 1624 IGCM_debug_PopStack "IGCM_sys_rebuild" 1212 1625 } 1213 1626 … … 1216 1629 1217 1630 function IGCM_sys_activ_variables { 1218 1219 1220 1221 1222 1223 1224 1225 1631 IGCM_debug_PushStack "IGCM_sys_activ_variables" 1632 if ( $DEBUG_sys ) ; then 1633 echo "IGCM_sys_activ_variables" 1634 fi 1635 1636 ulimit -s unlimited 1637 1638 IGCM_debug_PopStack "IGCM_sys_activ_variables" 1226 1639 } 1227 1640 … … 1230 1643 1231 1644 function IGCM_sys_desactiv_variables { 1232 IGCM_debug_PushStack "IGCM_sys_desactiv_variables" 1233 if ( $DEBUG_sys ) ; then 1234 echo "IGCM_sys_desactiv_variables" 1235 fi 1236 IGCM_debug_PopStack "IGCM_sys_desactiv_variables" 1237 } 1238 1645 IGCM_debug_PushStack "IGCM_sys_desactiv_variables" 1646 if ( $DEBUG_sys ) ; then 1647 echo "IGCM_sys_desactiv_variables" 1648 fi 1649 IGCM_debug_PopStack "IGCM_sys_desactiv_variables" 1650 } 1651 1652 ############################################################ 1653 # Build MPI/OMP scripts run file (dummy function) 1239 1654 1240 1655 function IGCM_sys_build_run_file { 1241 ############################################################ 1242 # Build run file 1243 1244 IGCM_debug_Print 1 "Dummy IGCM_sys_build_run_file" 1656 1657 IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file " 1245 1658 1246 1659 } … … 1248 1661 ############################################################ 1249 1662 # Build MPI/OMP scripts 1250 function IGCM_sys_build_execution_scripts 1663 function IGCM_sys_build_execution_scripts 1251 1664 { 1252 1253 1254 1255 1665 IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@ 1666 if ( $DEBUG_sys ) ; then 1667 echo "IGCM_sys_build_execution_scripts " $@ 1668 fi 1256 1669 1257 1670 # Verification with MSUB parameter 1258 1259 1260 1261 1262 1263 1264 1265 1671 EXECUTION=${HOST_MPIRUN_COMMAND} 1672 1673 if ( ${OK_PARA_MPMD} ) ; then 1674 1675 if [ -f run_file ] ; then 1676 IGCM_sys_Rm -f run_file 1677 fi 1678 touch run_file 1266 1679 1267 1680 # run_file construction … … 1272 1685 for comp in ${config_ListOfComponents[*]} ; do 1273 1686 1274 1275 1687 eval ExeNameIn=\${config_Executable_${comp}[0]} 1688 eval ExeNameOut=\${config_Executable_${comp}[1]} 1276 1689 1277 1690 # for CPL component only 1278 1279 1280 1281 1282 1283 1691 if [ "X${comp}" = "XCPL" ] ; then 1692 1693 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1694 eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 1695 echo "${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file 1696 fi 1284 1697 done 1285 1698 … … 1288 1701 for comp in ${config_ListOfComponents[*]} ; do 1289 1702 1290 1291 1703 eval ExeNameIn=\${config_Executable_${comp}[0]} 1704 eval ExeNameOut=\${config_Executable_${comp}[1]} 1292 1705 1293 1706 # Only if we really have an executable for the component and not the coupler ie oasis: 1294 1295 1296 1297 1298 1299 1707 if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then 1708 1709 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1710 eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 1711 echo "${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file 1712 fi 1300 1713 done 1301 1714 … … 1308 1721 fi 1309 1722 1310 else # Only one executable. launch it.1311 1312 # 1723 else # Only one executable. launch it. 1724 1725 # 1313 1726 for comp in ${config_ListOfComponents[*]} ; do 1314 1727 1315 eval ExeNameIn=\${config_Executable_${comp}[0]} 1316 eval ExeNameOut=\${config_Executable_${comp}[1]} 1317 1318 if [ "X${ExeNameOut}" != X\"\" ] ; then 1319 if ( ${OK_PARA_MPI} ) ; then 1320 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1321 EXECUTION="${EXECUTION} -n ${comp_proc_mpi_loc} ./${ExeNameOut}" 1322 else 1323 EXECUTION="${EXECUTION} ./${ExeNameOut}" 1324 fi 1325 if ( ${OK_PARA_OMP} ) ; then 1326 eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 1327 EXECUTION="export OMP_NUM_THREADS=${comp_proc_omp_loc} ; ${EXECUTION} " 1328 fi 1728 eval ExeNameIn=\${config_Executable_${comp}[0]} 1729 eval ExeNameOut=\${config_Executable_${comp}[1]} 1730 1731 if [ "X${ExeNameOut}" != X\"\" ] ; then 1732 if ( ${OK_PARA_MPI} ) ; then 1733 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1734 EXECUTION="${EXECUTION} -n ${comp_proc_mpi_loc} ./${ExeNameOut}" 1735 else 1736 EXECUTION="${EXECUTION} ./${ExeNameOut}" 1329 1737 fi 1738 if ( ${OK_PARA_OMP} ) ; then 1739 eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 1740 EXECUTION="export OMP_NUM_THREADS=${comp_proc_omp_loc} ; ${EXECUTION} " 1741 fi 1742 fi 1330 1743 1331 1744 done 1332 1745 1333 fi 1334 1335 IGCM_debug_Print 1 "sys Curie : execution command is " 1336 IGCM_debug_Print 1 "$EXECUTION" 1337 1338 IGCM_debug_PopStack "IGCM_sys_build_execution_scripts" 1339 } 1340 1341 1746 fi 1747 1748 IGCM_debug_Print 1 "sys Curie : execution command is " 1749 IGCM_debug_Print 1 "$EXECUTION" 1750 1751 IGCM_debug_PopStack "IGCM_sys_build_execution_scripts" 1752 } 1342 1753 1343 1754 ############################################################## 1344 1755 # NCO OPERATOR 1345 1756 1757 function IGCM_sys_ncap2 { 1758 IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ 1759 if ( $DEBUG_sys ) ; then 1760 echo "IGCM_sys_ncap2 :" $@ 1761 fi 1762 ncap2 "$@" 1763 if [ $? -gt 0 ] ; then 1764 echo "IGCM_sys_ncap2 : erreur ${@}." 1765 IGCM_debug_Exit "ncap2" 1766 fi 1767 1768 IGCM_debug_PopStack "IGCM_sys_ncap2" 1769 } 1770 1346 1771 function IGCM_sys_ncatted { 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1772 IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@ 1773 if ( $DEBUG_sys ) ; then 1774 echo "IGCM_sys_ncatted :" $@ 1775 fi 1776 ncatted "$@" 1777 if [ $? -gt 0 ] ; then 1778 echo "IGCM_sys_ncatted : erreur ${@}." 1779 IGCM_debug_Exit "ncatted" 1780 fi 1781 1782 IGCM_debug_PopStack "IGCM_sys_ncatted" 1358 1783 } 1359 1784 1360 1785 function IGCM_sys_ncbo { 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1786 IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@ 1787 if ( $DEBUG_sys ) ; then 1788 echo "IGCM_sys_ncbo :" $@ 1789 fi 1790 ncbo $@ 1791 if [ $? -gt 0 ] ; then 1792 echo "IGCM_sys_ncbo : erreur ${@}." 1793 IGCM_debug_Exit "ncbo" 1794 fi 1795 1796 IGCM_debug_PopStack "IGCM_sys_ncbo" 1372 1797 } 1373 1798 1374 1799 function IGCM_sys_ncdiff { 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1800 IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@ 1801 if ( $DEBUG_sys ) ; then 1802 echo "IGCM_sys_ncdiff :" $@ 1803 fi 1804 ncdiff $@ 1805 if [ $? -gt 0 ] ; then 1806 echo "IGCM_sys_ncdiff : erreur ${@}." 1807 IGCM_debug_Exit "ncdiff" 1808 fi 1809 1810 IGCM_debug_PopStack "IGCM_sys_ncdiff" 1386 1811 } 1387 1812 1388 1813 function IGCM_sys_ncea { 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1814 IGCM_debug_PushStack "IGCM_sys_ncea" -- $@ 1815 if ( $DEBUG_sys ) ; then 1816 echo "IGCM_sys_ncea :" $@ 1817 fi 1818 ncea $@ 1819 if [ $? -gt 0 ] ; then 1820 echo "IGCM_sys_ncea : erreur ${@}." 1821 IGCM_debug_Exit "ncea" 1822 fi 1823 1824 IGCM_debug_PopStack "IGCM_sys_ncea" 1400 1825 } 1401 1826 1402 1827 function IGCM_sys_ncecat { 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1828 IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@ 1829 if ( $DEBUG_sys ) ; then 1830 echo "IGCM_sys_ncecat :" $@ 1831 fi 1832 ncecat $@ 1833 if [ $? -gt 0 ] ; then 1834 echo "IGCM_sys_ncecat : erreur ${@}." 1835 IGCM_debug_Exit "ncecat" 1836 fi 1837 1838 IGCM_debug_PopStack "IGCM_sys_ncecat" 1414 1839 } 1415 1840 1416 1841 function IGCM_sys_ncflint { 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1842 IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@ 1843 if ( $DEBUG_sys ) ; then 1844 echo "IGCM_sys_ncflint :" $@ 1845 fi 1846 ncflint $@ 1847 if [ $? -gt 0 ] ; then 1848 echo "IGCM_sys_ncflint : erreur ${@}." 1849 IGCM_debug_Exit "ncflint" 1850 fi 1851 1852 IGCM_debug_PopStack "IGCM_sys_ncflint" 1428 1853 } 1429 1854 1430 1855 function IGCM_sys_ncks { 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1856 IGCM_debug_PushStack "IGCM_sys_ncks" -- $@ 1857 if ( $DEBUG_sys ) ; then 1858 echo "IGCM_sys_ncks :" $@ 1859 fi 1860 ncks $@ 1861 if [ $? -gt 0 ] ; then 1862 echo "IGCM_sys_ncks : erreur ${@}." 1863 IGCM_debug_Exit "ncks" 1864 fi 1865 1866 IGCM_debug_PopStack "IGCM_sys_ncks" 1442 1867 } 1443 1868 1444 1869 function IGCM_sys_ncpdq { 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1870 IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@ 1871 if ( $DEBUG_sys ) ; then 1872 echo "IGCM_sys_ncpdq :" $@ 1873 fi 1874 ncpdq $@ 1875 if [ $? -gt 0 ] ; then 1876 echo "IGCM_sys_ncpdq : erreur ${@}." 1877 IGCM_debug_Exit "ncpdq" 1878 fi 1879 1880 IGCM_debug_PopStack "IGCM_sys_ncpdq" 1456 1881 } 1457 1882 1458 1883 function IGCM_sys_ncra { 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1884 IGCM_debug_PushStack "IGCM_sys_ncra" -- $@ 1885 if ( $DEBUG_sys ) ; then 1886 echo "IGCM_sys_ncra :" $@ 1887 fi 1888 ncra $@ 1889 if [ $? -gt 0 ] ; then 1890 echo "IGCM_sys_ncra : erreur ${@}." 1891 IGCM_debug_Exit "ncra" 1892 fi 1893 1894 IGCM_debug_PopStack "IGCM_sys_ncra" 1470 1895 } 1471 1896 1472 1897 function IGCM_sys_ncrcat { 1473 1474 1475 1476 1477 1478 1479 1898 IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@ 1899 if ( $DEBUG_sys ) ; then 1900 echo "IGCM_sys_ncrcat :" $@ 1901 fi 1902 ncrcat $@ 1903 if [ $? -gt 0 ] ; then 1904 echo "IGCM_sys_ncrcat : erreur ${@}." 1480 1905 # IGCM_debug_Exit "ncrcat" 1481 1482 1483 1906 fi 1907 1908 IGCM_debug_PopStack "IGCM_sys_ncrcat" 1484 1909 } 1485 1910 1486 1911 function IGCM_sys_ncrename { 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1912 IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@ 1913 if ( $DEBUG_sys ) ; then 1914 echo "IGCM_sys_ncrename :" $@ 1915 fi 1916 ncrename $@ 1917 if [ $? -gt 0 ] ; then 1918 echo "IGCM_sys_ncrename : erreur ${@}." 1919 IGCM_debug_Exit "ncrename" 1920 fi 1921 1922 IGCM_debug_PopStack "IGCM_sys_ncrename" 1498 1923 } 1499 1924 1500 1925 function IGCM_sys_ncwa { 1501 IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@ 1502 if ( $DEBUG_sys ) ; then 1503 echo "IGCM_sys_ncwa :" $@ 1504 fi 1505 ncwa $@ 1506 if [ $? -gt 0 ] ; then 1507 echo "IGCM_sys_ncwa : erreur ${@}." 1508 IGCM_debug_Exit "ncwa" 1509 fi 1510 1511 IGCM_debug_PopStack "IGCM_sys_ncwa" 1512 } 1926 IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@ 1927 if ( $DEBUG_sys ) ; then 1928 echo "IGCM_sys_ncwa :" $@ 1929 fi 1930 ncwa $@ 1931 if [ $? -gt 0 ] ; then 1932 echo "IGCM_sys_ncwa : erreur ${@}." 1933 IGCM_debug_Exit "ncwa" 1934 fi 1935 1936 IGCM_debug_PopStack "IGCM_sys_ncwa" 1937 } 1938 1939 ############################################################## 1940 # CDO OPERATOR 1941 1942 function IGCM_sys_cdo { 1943 IGCM_debug_PushStack "IGCM_sys_cdo" -- $@ 1944 if ( $DEBUG_sys ) ; then 1945 echo "IGCM_sys_cdo :" $@ 1946 fi 1947 \cdo $@ 1948 if [ $? -gt 0 ] ; then 1949 echo "IGCM_sys_cdo : erreur ${@}." 1950 IGCM_debug_PopStack "IGCM_sys_cdo" 1951 return 1 1952 else 1953 IGCM_debug_PopStack "IGCM_sys_cdo" 1954 return 0 1955 fi 1956 1957 IGCM_debug_PopStack "IGCM_sys_cdo" 1958 } -
trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
r621 r623 14 14 #========================================================= 15 15 # The documentation of this file can be automatically generated 16 # if you use the prefix #D- for comments to be extracted. 16 # if you use the prefix #D- for comments to be extracted. 17 17 # Extract with command: cat lib* | grep "^#D-" | cut -c "4-" 18 18 #========================================================= … … 22 22 #D-#================================================== 23 23 #D- 24 #D- This ksh library if a layer under some usefull 24 #D- This ksh library if a layer under some usefull 25 25 #D-environment variables and shell commands. 26 26 #D-All those definitions depend on host particularities. … … 42 42 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE ! 43 43 # ------------------------------------------------------------------------------------- 44 # | DRYRUN= | Date computations, | sys_Get| Exe | sys_Put_Out; sys_Put_Rest |45 # | | Cp/Exe param files || Chmod | |46 # | | Qsub | 44 # | DRYRUN= | Date computations, | sys_Get | Exe | sys_Put_Out; sys_Put_Rest | 45 # | | Cp/Exe param files | | Chmod | | 46 # | | Qsub | | | | 47 47 # ------------------------------------------------------------------------------------- 48 # | 0 | yes | yes| yes | yes |48 # | 0 | yes | yes | yes | yes | 49 49 # ------------------------------------------------------------------------------------- 50 # | 1 | yes | yes| yes | no |50 # | 1 | yes | yes | yes | no | 51 51 # ------------------------------------------------------------------------------------- 52 # | 2 | yes | yes| no | no |52 # | 2 | yes | yes | no | no | 53 53 # ------------------------------------------------------------------------------------- 54 # | 3 | yes | no| no | no |54 # | 3 | yes | no | no | no | 55 55 # ------------------------------------------------------------------------------------- 56 56 … … 194 194 195 195 NUM_COREPERNODE=8 196 196 197 197 #==================================================== 198 198 #- Default number of MPI task for IPSL coupled model … … 274 274 # if [ "X$( grep rebuild_from tmp_IGCM_sys_RshPost_$$ )" != "X" ] ; then 275 275 # #little hack so that rebuild submission is done on titane not an cesium 276 # 276 # 277 277 # libIGCM_POST_sed=$( echo $libIGCM_POST | sed 's/\//\\\//g' ) 278 278 # POST_DIR_sed=$( echo ${POST_DIR} | sed 's/\//\\\//g' ) … … 282 282 # sed "s/Script_Post_Output=/Script_Output=${POST_DIR_sed}\//g" tmp.txt > tmp_IGCM_sys_RshPost_$$ 283 283 # \mv tmp.txt tmp_IGCM_sys_RshPost_$$ 284 # 284 # 285 285 # echo cat tmp_IGCM_sys_RshPost_$$ AFTER 286 286 # cat tmp_IGCM_sys_RshPost_$$ … … 355 355 356 356 if [ ! -z ${config_UserChoices_MailName} ] ; then 357 357 mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail 358 358 elif [ -f ~/.forward ] ; then 359 359 mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 360 360 fi 361 361 sleep 10 … … 405 405 fi 406 406 #- creation de repertoire sur le serveur fichier 407 if [ ! -d ${1} ]; then 407 if [ ! -d ${1} ]; then 408 408 \mkdir -p $1 409 409 if [ $? -gt 0 ] ; then … … 426 426 fi 427 427 #- creation de repertoire sur le serveur fichier 428 if [ ! -d ${1} ]; then 428 if [ ! -d ${1} ]; then 429 429 \mkdir -p $1 430 430 if [ $? -gt 0 ] ; then … … 716 716 # fi 717 717 # (( i = i + 1 )) 718 # done 718 # done 719 719 # ============ CESIUM END ============ # 720 720 … … 727 727 728 728 #D-************************* 729 #D- File transfer functions 729 #D- File transfer functions 730 730 #D-************************* 731 731 #D- … … 796 796 elif [ $MYLANG = "en" ] ; then 797 797 case $RET in 798 0) return;; 798 0) return;; 799 799 1) echo "rsync error : Syntax or usage error " 800 800 return;; … … 969 969 970 970 typeset RET 971 971 972 972 echo mv $@ > out_rsync 2>&1 973 973 \mv $@ >> out_rsync 2>&1 974 974 RET=$? 975 975 976 976 if [ ${RET} -gt 0 ] ; then 977 977 echo "IGCM_sys_Mv : error in mv." … … 1132 1132 RET=$? 1133 1133 1134 # 1135 # 1136 # 1137 1138 # 1139 # 1140 # 1141 1142 # 1143 # 1144 1145 # 1146 # 1134 # #RSYNC WITH NETWORK SSH CALL 1135 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 1136 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 1137 1138 # #RSYNC WITH NFS USE 1139 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 1140 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1141 1142 # RET=$? 1143 # IGCM_sys_Rsync_out $RET 1144 1145 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1146 # (( RET=RET+$? )) 1147 1147 1148 1148 if [ ${RET} -gt 0 ] ; then … … 1229 1229 # typeset WORKPATH FILEPATH 1230 1230 # WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" ) 1231 # IGCM_sys_MkdirWork ${WORKPATH} 1231 # IGCM_sys_MkdirWork ${WORKPATH} 1232 1232 # FILEPATH=${WORKPATH}/$( basename $2 ) 1233 1233 # # … … 1237 1237 if [ X${JobType} = XRUN ] ; then 1238 1238 if [ X${3} = X ] ; then 1239 1239 IGCM_sys_Chmod 444 ${1} 1240 1240 fi 1241 1241 fi … … 1245 1245 RET=$? 1246 1246 1247 # 1248 # 1249 # 1250 1251 # 1252 # 1253 # 1254 1255 # 1256 # 1257 1258 # 1259 # 1247 # #RSYNC WITH NETWORK SSH CALL 1248 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1 1249 # ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1 1250 1251 # #RSYNC WITH NFS USE 1252 # echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1 1253 # ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1 1254 1255 # RET=$? 1256 # IGCM_sys_Rsync_out $RET 1257 1258 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1259 # (( RET=RET+$? )) 1260 1260 1261 1261 if [ ${RET} -gt 0 ] ; then … … 1296 1296 if [ X${JobType} = XRUN ] ; then 1297 1297 if [ X${3} = X ] ; then 1298 1298 IGCM_sys_Chmod 444 ${1} 1299 1299 fi 1300 1300 fi … … 1326 1326 IGCM_debug_PushStack "IGCM_sys_Get" $@ 1327 1327 1328 typeset DEST RET dm_liste ifile target file_work 1328 typeset DEST RET dm_liste ifile target file_work 1329 1329 1330 1330 if ( $DEBUG_sys ) ; then … … 1383 1383 # RET=$? 1384 1384 # if [ ${RET} -gt 0 ] ; then 1385 # 1386 # 1387 # 1385 # echo "ERROR IGCM_sys_Get : again demigration error :" 1386 # cat out_rsync 1387 # IGCM_debug_Exit "IGCM_sys_Get" 1388 1388 # fi 1389 1389 # else … … 1398 1398 (( RET=0 )) 1399 1399 for target in ${dm_liste[*]} ; do 1400 1401 1402 1400 local_file=$( basename ${target} ) 1401 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1402 (( RET = RET + $? )) 1403 1403 done 1404 1404 else … … 1407 1407 fi 1408 1408 1409 # 1410 # 1411 # 1412 1413 # 1414 # 1415 # 1416 1417 # 1418 # 1419 1420 # 1421 # 1409 # #RSYNC WITH NETWORK SSH CALL 1410 # echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1 1411 # ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1 1412 1413 # #RSYNC WITH NFS USE 1414 # echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1 1415 # ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1 1416 1417 # RET=$? 1418 # IGCM_sys_Rsync_out $RET 1419 1420 # ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync 1421 # (( RET=RET+$? )) 1422 1422 1423 1423 if [ ${RET} -gt 0 ] ; then … … 1442 1442 IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@ 1443 1443 1444 typeset DEST RET buf_liste ifile target file_work 1444 typeset DEST RET buf_liste ifile target file_work 1445 1445 1446 1446 if ( $DEBUG_sys ) ; then … … 1460 1460 (( RET=0 )) 1461 1461 for target in ${buf_liste[*]} ; do 1462 1463 1464 1462 local_file=$( basename ${target} ) 1463 \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1 1464 (( RET = RET + $? )) 1465 1465 done 1466 1466 else … … 1502 1502 #D-#================================================== 1503 1503 #D-function IGCM_sys_GetDate_FichArchive 1504 #D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 1504 #D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 1505 1505 #D-* Examples: 1506 1506 #D- … … 1538 1538 /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1 1539 1539 RET=$? 1540 1540 1541 1541 # if [ ${RET} -gt 0 ] ; then 1542 # 1543 # 1544 # 1542 # echo "IGCM_sys_Dods_Rm : error." 1543 # cat out_dods_rm 1544 # IGCM_debug_Exit "IGCM_sys_Dods_Rm" 1545 1545 # else 1546 # 1546 # rm out_dods_rm 1547 1547 # fi 1548 1548 … … 1575 1575 RET=$? 1576 1576 1577 # 1578 # 1579 # 1580 # 1581 # 1582 # 1583 # 1577 # if [ ${RET} -gt 0 ] ; then 1578 # echo "IGCM_sys_Dods_Cp : error." 1579 # cat out_dods_cp 1580 # IGCM_debug_Exit "IGCM_sys_Dods_Cp" 1581 # else 1582 # rm out_dods_cp 1583 # fi 1584 1584 1585 1585 else … … 1627 1627 IGCM_sys_Dods_Cp ${1} 1628 1628 RET=0 1629 1629 1630 1630 if [ ${RET} -gt 0 ] ; then 1631 1631 echo "IGCM_sys_Put_Dods : error." … … 1670 1670 (( max_omp = 0 )) 1671 1671 for comp in ${config_ListOfComponents[*]} ; do 1672 1672 1673 1673 eval ExeNameIn=\${config_Executable_${comp}[0]} 1674 1674 eval ExeNameOut=\${config_Executable_${comp}[1]} 1675 1675 1676 1676 # Only if we really have an executable for the component : 1677 1677 if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then … … 1711 1711 ############################################################ 1712 1712 # Build MPI/OMP scripts 1713 function IGCM_sys_build_execution_scripts 1713 function IGCM_sys_build_execution_scripts 1714 1714 { 1715 1715 IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@ … … 1717 1717 echo "IGCM_sys_build_execution_scripts " $@ 1718 1718 fi 1719 typeset nodes listnodes init_node start_num init_exec comp ExeNameIn ExeNameOut 1720 typeset node_num_current node_current comp_proc_mpi_loc comp_proc_omp_loc 1719 typeset nodes listnodes init_node start_num init_exec comp ExeNameIn ExeNameOut 1720 typeset node_num_current node_current comp_proc_mpi_loc comp_proc_omp_loc 1721 1721 typeset num_corempi nombre_restant_node nombre_restant_comp 1722 1722 … … 1737 1737 1738 1738 ${HOST_MPIRUN_COMMAND} hostname | sort | uniq > hosts.tmp 1739 1739 1740 1740 i=0 1741 1741 rm -f hosts … … 1748 1748 done 1749 1749 rm -f hosts.tmp 1750 1750 1751 1751 listnodes=${host[*]} 1752 1753 EXECUTION="${HOST_MPIRUN_COMMAND} -hostfile hosts" 1754 1752 1753 EXECUTION="${HOST_MPIRUN_COMMAND} -hostfile hosts" 1754 1755 1755 # Initialisation 1756 1756 … … 1761 1761 1762 1762 # Test : if oasis is there, we put it at the first position 1763 1763 1764 1764 for comp in ${config_ListOfComponents[*]} ; do 1765 1765 1766 1766 if [ "X${comp}" = "XCPL" ] ; then 1767 1767 1768 1768 eval ExeNameIn=\${config_Executable_${comp}[0]} 1769 1769 eval ExeNameOut=\${config_Executable_${comp}[1]} 1770 1770 1771 1771 echo "#!/bin/ksh" > script_${ExeNameOut}.ksh 1772 1772 echo "" >> script_${ExeNameOut}.ksh … … 1776 1776 echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> script_${ExeNameOut}.ksh 1777 1777 IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 1778 1778 1779 1779 init_node=n 1780 1780 1781 1781 (( nombre_restant_node = NUM_COREPERNODE - 1 )) 1782 1782 node_num_current=0 1783 1783 node_current=${host[${node_num_current}]} 1784 1785 EXECUTION="${EXECUTION} -H ${node_current} -np 1 ./script_${ExeNameOut}.ksh" 1786 1784 1785 EXECUTION="${EXECUTION} -H ${node_current} -np 1 ./script_${ExeNameOut}.ksh" 1786 1787 1787 init_exec=y 1788 1788 start_num=1 1789 1789 1790 1790 fi 1791 1791 1792 1792 done 1793 1793 1794 1794 # Then loop on the components (except for oasis) 1795 1795 1796 1796 for comp in ${config_ListOfComponents[*]} ; do 1797 1797 1798 1798 eval ExeNameIn=\${config_Executable_${comp}[0]} 1799 1799 eval ExeNameOut=\${config_Executable_${comp}[1]} 1800 1800 1801 1801 # Only if we really have an executable for the component : 1802 1802 if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then … … 1804 1804 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1805 1805 eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 1806 1806 1807 1807 echo "#!/bin/ksh" > script_${ExeNameOut}.ksh 1808 1808 # echo "set -vx" >> script_${ExeNameOut}.ksh … … 1815 1815 echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${MYMPIRANK} 2>out_${ExeNameOut}.err.\${MYMPIRANK}" >> script_${ExeNameOut}.ksh 1816 1816 IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 1817 1817 1818 1818 node_num=0 1819 1820 # We define the number of MPI process to be assigned for the component 1819 1820 # We define the number of MPI process to be assigned for the component 1821 1821 1822 1822 nombre_restant_comp=${comp_proc_mpi_loc} 1823 1823 1824 1824 # Loop on the allocated nodes 1825 1825 … … 1829 1829 if [ ${node_num} = ${node_num_current} ] ; then 1830 1830 1831 1832 1833 # If first time on the node : initialisation 1831 node_current=${host[${node_num_current}]} 1832 1833 # If first time on the node : initialisation 1834 1834 1835 1835 if [ ${init_node} = y ] ; then 1836 1836 nombre_restant_node=${NUM_COREPERNODE} 1837 1838 1837 fi 1838 1839 1839 # Test on the number of OMP threads 1840 1840 1841 1841 if [ ${comp_proc_omp_loc} -gt ${nombre_restant_node} ] ; then 1842 1842 (( node_num = node_num + 1 )) 1843 1843 node_num_current=${node_num} … … 1849 1849 1850 1850 (( num_corempi = nombre_restant_node / comp_proc_omp_loc )) 1851 1852 1851 1852 if [ ${num_corempi} -gt ${nombre_restant_comp} ] ; then 1853 1853 num_corempi=${nombre_restant_comp} 1854 1854 fi 1855 1855 1856 1856 (( nombre_restant_node = nombre_restant_node - num_corempi * comp_proc_omp_loc )) 1857 1858 1859 1857 (( nombre_restant_comp = nombre_restant_comp - num_corempi )) 1858 1859 if [ ${init_exec} = y ] ; then 1860 1860 EXECUTION="${EXECUTION} : -H ${node_current} -np ${num_corempi} ./script_${ExeNameOut}.ksh" 1861 else 1861 else 1862 1862 EXECUTION="${EXECUTION} -H ${node_current} -np ${num_corempi} ./script_${ExeNameOut}.ksh" 1863 1863 init_exec=y … … 1865 1865 1866 1866 (( start_num = num_corempi + start_num )) 1867 1867 1868 1868 else 1869 1870 (( node_num = node_num + 1 )) 1871 1869 1870 (( node_num = node_num + 1 )) 1871 continue 1872 1872 fi 1873 1874 # Test on the number of core/process remaining on the node/component 1875 1873 1874 # Test on the number of core/process remaining on the node/component 1875 1876 1876 if [ ${nombre_restant_node} = 0 ] ; then 1877 1877 (( node_num = node_num + 1 )) 1878 1879 1878 node_num_current=${node_num} 1879 init_node=y 1880 1880 1881 1881 if [ ${nombre_restant_comp} = 0 ] ; then … … 1885 1885 1886 1886 node_num_current=${node_num} 1887 1888 1889 1890 1891 1887 init_node=n 1888 1889 if [ ${nombre_restant_comp} = 0 ] ; then 1890 break 1 1891 fi 1892 1892 fi 1893 1893 done 1894 1894 fi 1895 1895 done 1896 1896 1897 1897 else 1898 1898 … … 1900 1900 1901 1901 ## the coupler ie oasis must be the first one 1902 1903 1904 1905 1906 1907 1908 1909 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1910 1911 1902 for comp in ${config_ListOfComponents[*]} ; do 1903 1904 eval ExeNameOut=\${config_Executable_${comp}[1]} 1905 1906 # for CPL component only 1907 if [ "X${comp}" = "XCPL" ] ; then 1908 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1909 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1910 fi 1911 done 1912 1912 1913 1913 # Then second loop on the components 1914 1914 1915 1916 1917 1918 1915 for comp in ${config_ListOfComponents[*]} ; do 1916 1917 eval ExeNameOut=\${config_Executable_${comp}[1]} 1918 1919 1919 # Only if we really have an executable for the component and not the coupler ie oasis: 1920 1921 1922 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1923 1924 1925 1926 1927 1928 1920 if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then 1921 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1922 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1923 fi 1924 done 1925 IGCM_sys_Chmod u+x run_file 1926 1927 EXECUTION="${HOST_MPIRUN_COMMAND} --app ./run_file" 1928 1929 1929 fi 1930 1930 … … 1934 1934 1935 1935 # Only if we really have an executable for the component : 1936 1937 if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then 1938 1939 1940 1941 if ( ${OK_PARA_OMP} ) ; then 1942 1943 echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh 1944 1945 if ( ${OK_PARA_MPI} ) ; then 1936 eval ExeNameOut=\${config_Executable_${comp}[1]} 1937 if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then 1938 1939 echo "#!/bin/ksh" > script_${ExeNameOut}.ksh 1940 echo "" >> script_${ExeNameOut}.ksh 1941 if ( ${OK_PARA_OMP} ) ; then 1942 eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 1943 echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh 1944 fi 1945 if ( ${OK_PARA_MPI} ) ; then 1946 1946 # Default : mpirun used if nb_proc gt 1 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1947 # pour sortie out/err par process 1948 # echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${OMPI_COMM_WORLD_RANK} 2>out_${ExeNameOut}.err.\${OMPI_COMM_WORLD_RANK}" >> script_${ExeNameOut}.ksh 1949 echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh 1950 IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 1951 EXECUTION="${HOST_MPIRUN_COMMAND} ./script_${ExeNameOut}.ksh" 1952 else 1953 # Default : mpirun is NOT used if nb_proc eq 1 1954 # pour sortie out/err par process 1955 # echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> script_${ExeNameOut}.ksh 1956 echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh 1957 IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 1958 EXECUTION="time ./script_${ExeNameOut}.ksh" 1959 fi 1960 fi 1961 1961 done 1962 1962 1963 1963 fi 1964 1964
Note: See TracChangeset
for help on using the changeset viewer.