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