Changeset 2566
- Timestamp:
- Oct 20, 2017 8:50:47 AM (7 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmbuild
r2506 r2566 27 27 # ----------------- 28 28 # $Id$ 29 # informative messages switched of almost completely in silent mode 30 # two header blocks merged into one 31 # 32 # 2506 2017-09-29 08:30:37Z raasch 29 33 # option -V added to check for an existing SOURCES_FOR_RUN_... folder 30 34 # host configuration added to SOURCES_FOR_RUN_... folder name … … 82 86 exit 1 83 87 else 84 printf "\n\n *** palmbuild finished \n\n" 88 if [[ $silent = false ]] 89 then 90 printf "\n\n *** palmbuild finished \n\n" 91 fi 85 92 exit 0 86 93 fi … … 295 302 296 303 # HEADER-OUTPUT (PART1: MESSAGES CONCERNING THE LOCAL HOST) 297 calltime=$(date)298 printf "\n"299 printf "#------------------------------------------------------------------------# \n"300 printf "| %-40s%30s | \n" "$version" "$calltime"301 printf "| | \n"302 printf "| %-13s%-57s | \n" "called on:" "$(hostname) (IP:$local_ip)"303 column2=$(echo $config_file | cut -c1-57 )304 printf "| %-13s%-57s | \n" "config file:" "$column2"305 line=$(echo "$config_file" | cut -c58-)306 while [[ "$line" != "" ]]307 do308 column1=""309 column2=$(echo $line | cut -c1-57 )310 printf "| %-13s%-57s | \n" "$column1" "$column2"311 line=$(echo "$line" | cut -c58-)312 done313 column2=$(echo $makefile | cut -c1-57 )314 printf "| %-13s%-57s | \n" "makefile:" "$column2"315 line=$(echo "$makefile" | cut -c58-)316 while [[ "$line" != "" ]]317 do318 column1=""319 column2=$(echo $line | cut -c1-57 )320 printf "| %-13s%-57s | \n" "$column1" "$column2"321 line=$(echo "$line" | cut -c58-)322 done323 column2=$(echo $source_path | cut -c1-57 )324 printf "| %-13s%-57s | \n" "source path:" "$column2"325 line=$(echo "$source_path" | cut -c58-)326 while [[ "$line" != "" ]]327 do328 column1=""329 column2=$(echo $line | cut -c1-57 )330 printf "| %-13s%-57s | \n" "$column1" "$column2"331 line=$(echo "$line" | cut -c58-)332 done333 printf "#------------------------------------------------------------------------# \n"334 335 336 337 # TAR THE SOURCES AND MAKEFILES338 # UTILITIES ARE TEMPORARILY COPIED TO THE SOURCE DIRECTORY IN ORDER TO TAR339 # THEM TOO340 cd $source_path341 printf "\n\n *** tar of makefile and source files in"342 printf "\n $source_path"343 cp -p ../UTIL/combine_plot_fields.f90 .344 cp -p ../UTIL/compare_palm_logs.f90 .345 cp -p ../UTIL/Makefile_utilities .346 tar -cf ${program_name}_sources.tar Makefile* *.$suf347 rm combine_plot_fields.f90 compare_palm_logs.f90 Makefile_utilities348 printf "\n"349 350 351 352 # GET CONFIRMATION TO CONTINUE353 printf "\n *** update will be made for host configuration \"$host_configuration\" "354 355 356 304 if [[ $silent = false ]] 357 305 then 358 answer=dummy 359 printf "\n\n" 360 while [[ "$answer" != y && "$answer" != Y && "$answer" != n && "$answer" != N ]] 306 calltime=$(date) 307 printf "\n" 308 printf "#------------------------------------------------------------------------# \n" 309 printf "| %-40s%30s | \n" "$version" "$calltime" 310 printf "| | \n" 311 printf "| %-13s%-57s | \n" "called on:" "$(hostname) (IP:$local_ip)" 312 column2=$(echo $config_file | cut -c1-57 ) 313 printf "| %-13s%-57s | \n" "config file:" "$column2" 314 line=$(echo "$config_file" | cut -c58-) 315 while [[ "$line" != "" ]] 361 316 do 362 printf " >>> continue (y/n) ? " 363 read answer 317 column1="" 318 column2=$(echo $line | cut -c1-57 ) 319 printf "| %-13s%-57s | \n" "$column1" "$column2" 320 line=$(echo "$line" | cut -c58-) 364 321 done 365 if [[ $answer = n || $answer = N ]] 366 then 367 locat=user_abort; exit 368 fi 369 fi 370 371 372 373 374 printf "\n\n#------------------------------------------------------------------------# \n" 375 322 column2=$(echo $makefile | cut -c1-57 ) 323 printf "| %-13s%-57s | \n" "makefile:" "$column2" 324 line=$(echo "$makefile" | cut -c58-) 325 while [[ "$line" != "" ]] 326 do 327 column1="" 328 column2=$(echo $line | cut -c1-57 ) 329 printf "| %-13s%-57s | \n" "$column1" "$column2" 330 line=$(echo "$line" | cut -c58-) 331 done 332 column2=$(echo $source_path | cut -c1-57 ) 333 printf "| %-13s%-57s | \n" "source path:" "$column2" 334 line=$(echo "$source_path" | cut -c58-) 335 while [[ "$line" != "" ]] 336 do 337 column1="" 338 column2=$(echo $line | cut -c1-57 ) 339 printf "| %-13s%-57s | \n" "$column1" "$column2" 340 line=$(echo "$line" | cut -c58-) 341 done 342 printf "| | \n" 343 376 344 if [[ "$remote_ip" != "" ]] 377 345 then 378 346 column2="$host_configuration" 379 printf "| %-20s%-50s | \n" "host identifier:" "$column2" 380 printf "| | \n" 347 printf "| %-20s%-50s | \n" "host configuration:" "$column2" 381 348 column2=$(echo "$make_depository" | cut -c1-50 ) 382 349 printf "| %-20s%-50s | \n" "remote depository:" "$column2" … … 384 351 column2="$host_configuration" 385 352 printf "| %-20s%-50s | \n" "host identifier:" "$column2" 386 printf "| | \n"387 353 column2=$(echo "$make_depository" | cut -c1-50 ) 388 354 printf "| %-20s%-50s | \n" "local depository:" "$column2" … … 396 362 line=$(echo "$line" | cut -c51-) 397 363 done 398 364 399 365 if [[ "$remote_ip" != "" ]] 400 366 then … … 405 371 printf "| %-20s%-50s | \n" "address:" "$local_ip" 406 372 fi 407 373 408 374 printf "| %-20s%-50s | \n" "compiler:" "$compiler_name" 409 375 printf "| %-20s%-50s | \n" "serial compiler:" "$compiler_name_ser" 410 376 411 377 if [[ "$make_options" != "" ]] 412 378 then … … 471 437 printf "#------------------------------------------------------------------------# \n" 472 438 473 if [[ $silent = false ]] 474 then 475 answer=dummy 476 printf "\n\n" 477 while [[ "$answer" != y && "$answer" != Y && "$answer" != c && "$answer" != C && "$answer" != s && "$answer" != S && "$answer" != a && "$answer" != A ]] 478 do 479 printf " >>> continue (y(es)/c(ontinue)/a(bort)) ? " 480 read answer 481 done 482 if [[ $answer = a || $answer = A ]] 483 then 484 locat=user_abort; exit 485 fi 486 if [[ $answer = c || $answer = C ]] 487 then 488 silent=true 489 fi 490 fi 491 492 493 # MAKE ON REMOTE HOST 494 if [[ "$remote_ip" != "" ]] 495 then 496 497 # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... 498 if [[ "$fname" = "" ]] 499 then 500 501 # COPY CURRENT SOURCE CODE TO SOURCE-CODE DIRECTORY ON THE REMOTE HOST 502 # CREATE THIS DIRECTORY, IF IT DOES NOT EXIST 439 answer=dummy 440 printf "\n" 441 while [[ "$answer" != y && "$answer" != Y && "$answer" != c && "$answer" != C && "$answer" != s && "$answer" != S && "$answer" != a && "$answer" != A ]] 442 do 443 printf " >>> continue (y(es)/c(ontinue)/a(bort)) ? " 444 read answer 445 done 446 if [[ $answer = a || $answer = A ]] 447 then 448 locat=user_abort; exit 449 fi 450 if [[ $answer = c || $answer = C ]] 451 then 452 silent=true 453 fi 454 fi 455 456 457 # TAR THE SOURCES AND MAKEFILES 458 # UTILITIES ARE TEMPORARILY COPIED TO THE SOURCE DIRECTORY IN ORDER TO TAR 459 # THEM TOO 460 if [[ $silent = false ]] 461 then 462 printf "\n\n *** tar of makefile and source files in" 463 printf "\n $source_path\n" 464 fi 465 cd $source_path 466 cp -p ../UTIL/combine_plot_fields.f90 . 467 cp -p ../UTIL/compare_palm_logs.f90 . 468 cp -p ../UTIL/Makefile_utilities . 469 tar -cf ${program_name}_sources.tar Makefile* *.$suf 470 rm combine_plot_fields.f90 compare_palm_logs.f90 Makefile_utilities 471 472 473 # MAKE ON REMOTE HOST 474 if [[ "$remote_ip" != "" ]] 475 then 476 477 # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... 478 if [[ "$fname" = "" ]] 479 then 480 481 # COPY CURRENT SOURCE CODE TO SOURCE-CODE DIRECTORY ON THE REMOTE HOST 482 # CREATE THIS DIRECTORY, IF IT DOES NOT EXIST 483 if [[ $silent = false ]] 484 then 485 echo " " 503 486 echo " *** copying \"${program_name}_sources.tar\" to \"${remote_ip}:${make_depository}/\" " 504 487 echo "[[ ! -d ${make_depository} ]] && (echo \" *** ${make_depository} will be created\"; mkdir -p ${make_depository})" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 505 506 488 scp $ssh_key ${source_path}/${program_name}_sources.tar ${remote_username}@${remote_ip}:${make_depository}/${program_name}_sources.tar 507 508 509 510 # UNTAR PREVIOUS UPDATE ON REMOTE HOST, IF EXISTING 489 else 490 echo "[[ ! -d ${make_depository} ]] && mkdir -p ${make_depository}" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 491 scp $ssh_key ${source_path}/${program_name}_sources.tar ${remote_username}@${remote_ip}:${make_depository}/${program_name}_sources.tar > /dev/null 492 fi 493 494 495 496 497 # UNTAR PREVIOUS UPDATE ON REMOTE HOST, IF EXISTING 498 if [[ $silent = false ]] 499 then 511 500 echo " *** untar previous update on remote host, if existing" 512 echo "cd ${make_depository}; [[ -f ${program_name}_current_version.tar ]] && tar -xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 513 514 515 # UNTAR CURRENT SOURCES ON REMOTE HOST 501 fi 502 echo "cd ${make_depository}; [[ -f ${program_name}_current_version.tar ]] && tar -xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 503 504 505 # UNTAR CURRENT SOURCES ON REMOTE HOST 506 if [[ $silent = false ]] 507 then 516 508 echo " *** untar current sources on remote host" 517 echo "cd ${make_depository}; tar -xf ${program_name}_sources.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 518 519 520 # CREATE INIT AND MODULE COAMMNDS 509 fi 510 echo "cd ${make_depository}; tar -xf ${program_name}_sources.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 511 512 513 # CREATE INIT AND MODULE COAMMNDS 514 [[ "$login_init_cmd" != "" ]] && login_init_cmd=${login_init_cmd}";" 515 [[ "$module_commands" != "" ]] && module_commands=${module_commands}";" 516 517 518 # FIRST CREATE EXECUTABLES FOR THE UTILITY ROUTINES 519 if [[ $silent = false ]] 520 then 521 echo " " 522 echo " *** creating utilities on remote host" 523 fi 524 make_call_string="make -f Makefile_utilities $make_options F90=$compiler_name F90_SER=$compiler_name_ser COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 525 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol 526 527 if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]] 528 then 529 printf "\a\n +++ error(s) occurred during compiling or linking of utilities" 530 printf "\n for host configuration \"$host_configuration\" " 531 if [[ $silent = false ]] 532 then 533 answer=dummy 534 printf "\n" 535 while [[ "$answer" != c && "$answer" != k ]] 536 do 537 printf " >>> continue / list errors / kill palmbuild (c/l/k) ? " 538 read answer 539 if [[ "$answer" = l ]] 540 then 541 more ${host_configuration}_last_make_protocol 542 fi 543 done 544 if [[ $answer = k ]] 545 then 546 locat=user_abort; exit 547 fi 548 else 549 # ABORT ANYWAY 550 locat=user_abort; exit 551 fi 552 fi 553 554 555 # NOW COMPILE THE PALM CODE 556 # COMMANDS WILL BE COMMUNICATED TO SSH VIA PIPE, SINCE THIS WAY THE SYSTEM- AND 557 # USER-PROFILES OF THE SHELL ARE COMPLETELY EXECUTED (OTHERWISE, MAKE 558 # MAY E.G. MISS THE COMPILER-PATHS) 559 if [[ $silent = false ]] 560 then 561 echo " " 562 echo " *** compile PALM sources on remote host" 563 fi 564 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 565 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol 566 567 if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]] 568 then 569 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 570 if [[ $silent = false ]] 571 then 572 answer=dummy 573 printf "\n" 574 while [[ "$answer" != c && "$answer" != k ]] 575 do 576 printf " >>> continue / list errors / kill palmbuild (c/l/k) ? " 577 read answer 578 if [[ "$answer" = l ]] 579 then 580 more ${host_configuration}_last_make_protocol 581 fi 582 done 583 if [[ $answer = k ]] 584 then 585 locat=user_abort; exit 586 fi 587 else 588 # ABORT ANYWAY 589 locat=user_abort; exit 590 fi 591 fi 592 593 # TAR UPDATED VERSION ON THE REMOTE HOST 594 if [[ $silent = false ]] 595 then 596 printf "\n *** tar update on remote host ..." 597 fi 598 echo "cd ${make_depository}; chmod u+w *; tar -cf ${program_name}_current_version.tar ${program_name} *.f90 *.o *.mod *.x" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 599 600 601 # NOW COMES THE BRANCH FOR CREATING THE EXECUTABLE FOR THE CURRENT RUN 602 # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS 603 # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_... 604 elif [[ "$fname" != "" ]] 605 then 606 607 # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS 608 # AND ASK, IF THEY SHALL BE USED 609 echo "[[ -d ${fast_io_catalog}/${sources_for_run_catalog} ]] && echo sources for run found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 > ${host_configuration}_last_make_protocol 610 if [[ $(grep -c "sources for run found" ${host_configuration}_last_make_protocol) != 0 && $use_existing_sources_folder = true ]] 611 then 612 printf "\a\n *** compiled sources for run \"$fname\" found on remote host in folder" 613 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 614 printf "\n will be used!" 615 exit 616 fi 617 618 # COPY MAKE DEPOSITORY ON REMOTE MACHINE TO SOURCES_FOR_RUN_... 619 if [[ $silent = false ]] 620 then 621 printf "\n *** copy MAKE_DEPOSITORY_${host_configuration} on remote host to $sources_for_run_catalog \n" 622 fi 623 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}; mkdir -p ${fast_io_catalog}/${sources_for_run_catalog}; cp ${make_depository}/${program_name}_current_version.tar ${fast_io_catalog}/${sources_for_run_catalog}; cd ${fast_io_catalog}/${sources_for_run_catalog}; tar xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 624 625 626 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... ON THE REMOTE MACHINE 627 if [[ $silent = false ]] 628 then 629 printf "\n *** copy ${base_directory}/${sources_for_run_catalog}" 630 printf "\n to $sources_for_run_catalog on remote host \n" 631 fi 632 scp -q $ssh_key ${base_directory}/${sources_for_run_catalog}/{*,.[!.]*} ${remote_username}@${remote_ip}:${fast_io_catalog}/${sources_for_run_catalog} 633 634 635 # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY 636 if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]] 637 then 638 639 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 521 640 [[ "$login_init_cmd" != "" ]] && login_init_cmd=${login_init_cmd}";" 522 641 [[ "$module_commands" != "" ]] && module_commands=${module_commands}";" 523 524 525 # FIRST CREATE EXECUTABLES FOR THE UTILITY ROUTINES 526 echo " " 527 echo " *** creating utilities on remote host" 528 make_call_string="make -f Makefile_utilities $make_options F90=$compiler_name F90_SER=$compiler_name_ser COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 529 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol 530 531 if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]] 532 then 533 printf "\a\n +++ error(s) occurred during compiling or linking of utilities" 534 printf "\n for host configuration \"$host_configuration\" " 535 if [[ $silent = false ]] 536 then 537 answer=dummy 538 printf "\n" 539 while [[ "$answer" != c && "$answer" != k ]] 540 do 541 printf " >>> continue / list errors / kill palmbuild (c/l/k) ? " 542 read answer 543 if [[ "$answer" = l ]] 544 then 545 more ${host_configuration}_last_make_protocol 546 fi 547 done 548 if [[ $answer = k ]] 549 then 550 locat=user_abort; exit 551 fi 552 else 553 # ABORT ANYWAY 554 locat=user_abort; exit 555 fi 556 fi 557 558 559 # NOW COMPILE THE PALM CODE 560 # COMMANDS WILL BE COMMUNICATED TO SSH VIA PIPE, SINCE THIS WAY THE SYSTEM- AND 561 # USER-PROFILES OF THE SHELL ARE COMPLETELY EXECUTED (OTHERWISE, MAKE 562 # MAY E.G. MISS THE COMPILER-PATHS) 563 echo " " 564 echo " *** compile PALM sources on remote host" 565 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 566 echo "$login_init_cmd $module_commands cd ${make_depository}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol 642 if [[ $silent = false ]] 643 then 644 echo " *** execute \"make\" on remote host" 645 fi 646 echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/${sources_for_run_catalog}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol 567 647 568 648 if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]] … … 584 664 if [[ $answer = k ]] 585 665 then 666 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 586 667 locat=user_abort; exit 587 668 fi 588 669 else 589 670 # ABORT ANYWAY 671 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 590 672 locat=user_abort; exit 591 673 fi 592 674 fi 593 675 594 # TAR UPDATED VERSION ON THE REMOTE HOST 595 printf "\n *** tar update on remote host ..." 596 echo "cd ${make_depository}; chmod u+w *; tar -cf ${program_name}_current_version.tar ${program_name} *.f90 *.o *.mod *.x" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 597 598 599 # NOW COMES THE BRANCH FOR CREATING THE EXECUTABLE FOR THE CURRENT RUN 600 # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS 601 # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_... 602 elif [[ "$fname" != "" ]] 603 then 604 605 # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS 606 # AND ASK, IF THEY SHALL BE USED 607 echo "[[ -d ${fast_io_catalog}/${sources_for_run_catalog} ]] && echo sources for run found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 > ${host_configuration}_last_make_protocol 608 if [[ $(grep -c "sources for run found" ${host_configuration}_last_make_protocol) != 0 && $use_existing_sources_folder = true ]] 609 then 610 printf "\a\n *** compiled sources for run \"$fname\" found on remote host in folder" 611 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 612 printf "\n will be used!" 613 exit 614 fi 615 616 # COPY MAKE DEPOSITORY ON REMOTE MACHINE TO SOURCES_FOR_RUN_... 617 printf "\n *** copy MAKE_DEPOSITORY_${host_configuration} on remote host to $sources_for_run_catalog \n" 618 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}; mkdir -p ${fast_io_catalog}/${sources_for_run_catalog}; cp ${make_depository}/${program_name}_current_version.tar ${fast_io_catalog}/${sources_for_run_catalog}; cd ${fast_io_catalog}/${sources_for_run_catalog}; tar xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 619 620 621 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... ON THE REMOTE MACHINE 622 printf "\n *** copy ${base_directory}/${sources_for_run_catalog}" 623 printf "\n to $sources_for_run_catalog on remote host \n" 624 scp -q $ssh_key ${base_directory}/${sources_for_run_catalog}/{*,.[!.]*} ${remote_username}@${remote_ip}:${fast_io_catalog}/${sources_for_run_catalog} 625 626 627 # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY 628 if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]] 629 then 630 631 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 632 [[ "$login_init_cmd" != "" ]] && login_init_cmd=${login_init_cmd}";" 633 [[ "$module_commands" != "" ]] && module_commands=${module_commands}";" 634 echo " *** execute \"make\" on remote host" 635 echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/${sources_for_run_catalog}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protocol 636 637 if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]] 638 then 639 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 640 if [[ $silent = false ]] 641 then 642 answer=dummy 643 printf "\n" 644 while [[ "$answer" != c && "$answer" != k ]] 645 do 646 printf " >>> continue / list errors / kill palmbuild (c/l/k) ? " 647 read answer 648 if [[ "$answer" = l ]] 649 then 650 more ${host_configuration}_last_make_protocol 651 fi 652 done 653 if [[ $answer = k ]] 654 then 655 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 656 locat=user_abort; exit 657 fi 658 else 659 # ABORT ANYWAY 660 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 661 locat=user_abort; exit 662 fi 663 fi 664 665 else 666 667 echo " *** nothing to compile for this run" 668 669 fi 670 671 fi 672 673 rm -rf ${source_path}/${host_configuration}_last_make_protocol 674 675 676 # MAKE ON LOCAL HOST 677 else 678 679 680 # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... ON THE 681 # LOCAL HOST 682 if [[ "$fname" = "" ]] 683 then 684 685 # SET THE ENVIRONMENT (EXECUTE INIT AND MODULE COMMANDS) 686 if [[ "$login_init_cmd" != "" ]] 687 then 688 $login_init_cmd 689 fi 690 691 if [[ "$module_commands" != "" ]] 692 then 693 $module_commands 694 fi 695 696 697 # CREATE MAKE-DEPOSITORY, IF IT DOES NOT EXIST 698 eval make_depository=$make_depository 699 if [[ ! -d $make_depository ]] 700 then 701 if mkdir -p $make_depository 676 else 677 678 echo " *** nothing to compile for this run" 679 680 fi 681 682 fi 683 684 rm -rf ${source_path}/${host_configuration}_last_make_protocol 685 686 687 # MAKE ON LOCAL HOST 688 else 689 690 691 # NEXT IS THE BRANCH FOR CREATING THE MAKE_DEPOSITORY_... ON THE 692 # LOCAL HOST 693 if [[ "$fname" = "" ]] 694 then 695 696 # SET THE ENVIRONMENT (EXECUTE INIT AND MODULE COMMANDS) 697 if [[ "$login_init_cmd" != "" ]] 698 then 699 $login_init_cmd 700 fi 701 702 if [[ "$module_commands" != "" ]] 703 then 704 $module_commands 705 fi 706 707 708 # CREATE MAKE-DEPOSITORY, IF IT DOES NOT EXIST 709 eval make_depository=$make_depository 710 if [[ ! -d $make_depository ]] 711 then 712 if mkdir -p $make_depository 713 then 714 if [[ $silent = false ]] 702 715 then 703 716 printf "\n\n *** directory for local make depository:" 704 717 printf "\n $make_depository" 705 718 printf "\n was created\n" 706 else707 printf "\n +++ directory for local make depository:"708 printf "\n $make_depository"709 printf "\n cannot be created"710 locat=local_depository; exit711 719 fi 712 fi 713 714 # COPY SOURCE-CODE FROM REPOSITORY TO MAKE-DEPOSITORY 720 else 721 printf "\n +++ directory for local make depository:" 722 printf "\n $make_depository" 723 printf "\n cannot be created" 724 locat=local_depository; exit 725 fi 726 fi 727 728 # COPY SOURCE-CODE FROM REPOSITORY TO MAKE-DEPOSITORY 729 if [[ $silent = false ]] 730 then 715 731 echo " " 716 732 echo " *** untar current source sources on local host in" 717 733 echo " $make_depository" 718 cd $make_depository 719 cp $source_path/${program_name}_sources.tar . 720 tar xf ${program_name}_sources.tar 721 722 723 # FIRST CREATE EXECUTABLES FOR THE UTILITY ROUTINES 734 fi 735 cd $make_depository 736 cp $source_path/${program_name}_sources.tar . 737 tar xf ${program_name}_sources.tar 738 739 740 # FIRST CREATE EXECUTABLES FOR THE UTILITY ROUTINES 741 if [[ $silent = false ]] 742 then 724 743 echo " " 725 744 echo " *** creating utilities on local host" 726 make -f Makefile_utilities $make_options F90=$compiler_name F90_SER=$compiler_name_ser COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 727 728 729 # CALL MAKE ON LOCAL HOST USING THE OPTIONS DETERMINED FURTHER ABOVE 745 fi 746 make -f Makefile_utilities $make_options F90=$compiler_name F90_SER=$compiler_name_ser COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 747 748 749 # CALL MAKE ON LOCAL HOST USING THE OPTIONS DETERMINED FURTHER ABOVE 750 if [[ $silent = false ]] 751 then 730 752 echo " " 731 753 echo " *** compile PALM sources on local host" 732 733 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 2>&1 | tee ${host_configuration}_last_make_protocol 754 fi 755 756 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 2>&1 | tee ${host_configuration}_last_make_protocol 757 758 if [[ $? != 0 ]] 759 then 760 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 761 if [[ $silent = false ]] 762 then 763 answer=dummy 764 printf "\n" 765 while [[ "$answer" != c && "$answer" != k ]] 766 do 767 printf " >>> continue / list errors / kill palmbuild (c/l/k) ? " 768 read answer 769 if [[ "$answer" = l ]] 770 then 771 more ${host_configuration}_last_make_protocol 772 fi 773 done 774 if [[ $answer = k ]] 775 then 776 locat=user_abort; exit 777 fi 778 else 779 # ABORT ANYWAY 780 locat=user_abort; exit 781 fi 782 fi 783 784 785 # TAR NEW VERSION ON LOCAL HOST 786 if [[ $silent = false ]] 787 then 788 printf "\n *** tar update on local host ..." 789 fi 790 tar -cf ${program_name}_current_version.tar ${program_name} *.$suf *.o *.mod *.x 791 792 else 793 794 # NOW COMES THE BRANCH FOR CREATING THE EXECUTABLE FOR THE CURRENT RUN 795 # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS 796 # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_... 797 798 # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS 799 # AND ASK, IF THEY SHALL BE USED 800 if [[ -d ${fast_io_catalog}/${sources_for_run_catalog} && $use_existing_sources_folder = true ]] 801 then 802 printf "\a\n *** compiled sources for run \"$fname\" found on local host in folder" 803 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 804 printf "\n will be used!" 805 exit 806 fi 807 808 # SECOND CHECK, IF A DEPOSITORY EXISTS ON THE LOCAL MACHINE 809 if [[ ! -d ${make_depository} ]] 810 then 811 printf "\n +++ directory for local make depository:" 812 printf "\n $make_depository" 813 printf "\n not found. Please run \"palmbuild -h $host_configuration\" " 814 locat=make_depository; exit 815 fi 816 817 818 # COPY MAKE DEPOSITORY ON LOCAL MACHINE TO SOURCES_FOR_RUN_... 819 if [[ $silent = false ]] 820 then 821 printf "\n *** copy MAKE_DEPOSITORY_${host_configuration} on local host to " 822 printf "\n ${fast_io_catalog}/${sources_for_run_catalog} \n" 823 fi 824 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 825 mkdir -p ${fast_io_catalog}/${sources_for_run_catalog} 826 cp ${make_depository}/${program_name}_current_version.tar ${fast_io_catalog}/${sources_for_run_catalog} 827 cd $fast_io_catalog/${sources_for_run_catalog} 828 tar xf ${program_name}_current_version.tar 829 830 831 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... 832 # IN THE FAST_IO_CATALOG ON THE LOCAL MACHINE 833 if [[ $silent = false ]] 834 then 835 printf "\n *** copy ${base_directory}/${sources_for_run_catalog} to" 836 printf "\n ${fast_io_catalog}/${sources_for_run_catalog} on local host \n" 837 fi 838 cp ${base_directory}/${sources_for_run_catalog}/{*,.[!.]*} ${fast_io_catalog}/${sources_for_run_catalog} 839 840 841 # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY 842 if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]] 843 then 844 845 if [[ $silent = false ]] 846 then 847 echo " *** execute \"make\" on local host" 848 fi 849 [[ "$login_init_cmd" != "" ]] && $login_init_cmd 850 [[ "$module_commands" != "" ]] && $module_commands 851 852 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 734 853 735 854 if [[ $? != 0 ]] 736 855 then 856 737 857 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 738 858 if [[ $silent = false ]] … … 742 862 while [[ "$answer" != c && "$answer" != k ]] 743 863 do 744 printf " >>> continue / list errors / kill palmbuild (c/l/k) ? "864 printf " >>> continue / kill palmbuild (c/k) ? " 745 865 read answer 746 if [[ "$answer" = l ]]747 then748 more ${host_configuration}_last_make_protocol749 fi750 866 done 751 867 if [[ $answer = k ]] 752 868 then 869 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 753 870 locat=user_abort; exit 754 871 fi 755 872 else 756 873 # ABORT ANYWAY 874 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 757 875 locat=user_abort; exit 758 876 fi 759 877 fi 760 878 761 762 # TAR NEW VERSION ON LOCAL HOST763 printf "\n *** tar update on local host ..."764 tar -cf ${program_name}_current_version.tar ${program_name} *.$suf *.o *.mod *.x765 766 879 else 767 880 768 # NOW COMES THE BRANCH FOR CREATING THE EXECUTABLE FOR THE CURRENT RUN 769 # INCLUDING E.G. USER-INTERFACE ROUTINES. ALSO ADD OTHER UTILITY EXECUTABLES. EVERYTHING IS 770 # COLLECTED IN DIRECTORY SOURCES_FOR_RUN_... 771 772 # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS 773 # AND ASK, IF THEY SHALL BE USED 774 if [[ -d ${fast_io_catalog}/${sources_for_run_catalog} && $use_existing_sources_folder = true ]] 775 then 776 printf "\a\n *** compiled sources for run \"$fname\" found on local host in folder" 777 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 778 printf "\n will be used!" 779 exit 780 fi 781 782 # SECOND CHECK, IF A DEPOSITORY EXISTS ON THE LOCAL MACHINE 783 if [[ ! -d ${make_depository} ]] 784 then 785 printf "\n +++ directory for local make depository:" 786 printf "\n $make_depository" 787 printf "\n not found. Please run \"palmbuild -h $host_configuration\" " 788 locat=make_depository; exit 789 fi 790 791 792 # COPY MAKE DEPOSITORY ON LOCAL MACHINE TO SOURCES_FOR_RUN_... 793 printf "\n *** copy MAKE_DEPOSITORY_${host_configuration} on local host to " 794 printf "\n ${fast_io_catalog}/${sources_for_run_catalog} \n" 795 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 796 mkdir -p ${fast_io_catalog}/${sources_for_run_catalog} 797 cp ${make_depository}/${program_name}_current_version.tar ${fast_io_catalog}/${sources_for_run_catalog} 798 cd $fast_io_catalog/${sources_for_run_catalog} 799 tar xf ${program_name}_current_version.tar 800 801 802 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... 803 # IN THE FAST_IO_CATALOG ON THE LOCAL MACHINE 804 printf "\n *** copy ${base_directory}/${sources_for_run_catalog} to" 805 printf "\n ${fast_io_catalog}/${sources_for_run_catalog} on local host \n" 806 cp ${base_directory}/${sources_for_run_catalog}/{*,.[!.]*} ${fast_io_catalog}/${sources_for_run_catalog} 807 808 809 # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY 810 if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]] 811 then 812 813 echo " *** execute \"make\" on local host" 814 [[ "$login_init_cmd" != "" ]] && $login_init_cmd 815 [[ "$module_commands" != "" ]] && $module_commands 816 817 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 818 819 if [[ $? != 0 ]] 820 then 821 822 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 823 if [[ $silent = false ]] 824 then 825 answer=dummy 826 printf "\n" 827 while [[ "$answer" != c && "$answer" != k ]] 828 do 829 printf " >>> continue / kill palmbuild (c/k) ? " 830 read answer 831 done 832 if [[ $answer = k ]] 833 then 834 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 835 locat=user_abort; exit 836 fi 837 else 838 # ABORT ANYWAY 839 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 840 locat=user_abort; exit 841 fi 842 fi 843 844 else 845 846 echo " *** nothing to compile for this run" 847 848 fi 849 850 fi 851 fi 881 echo " *** nothing to compile for this run" 882 883 fi 884 885 fi 886 fi -
palm/trunk/SCRIPTS/palmrun
r2551 r2566 27 27 # ----------------- 28 28 # $Id$ 29 # execute command for combine_plot_fields added 30 # "TEMPDIR" renamed "tempdir" 31 # temporary working directory for local batch jobs is created immediately within 32 # the user's palmrun call, due to a requirement of the "grid engine" batch 33 # system, where the working directory is given with batch directive -wd and must 34 # already exist when the job is submitted, 35 # informative messages in non-trace mode reduced and partly reformatted 36 # 37 # 2551 2017-10-18 07:25:11Z raasch 29 38 # TEMPDIR added as replacement string to be used in batch directives 30 39 # … … 137 146 tasks_per_node=0 138 147 threads_per_task=1 139 tmpcreate=false140 148 transfer_problems=false 141 149 user_source_path="" … … 161 169 eval ${err_command[$i]} 162 170 done 163 [[ $delete_temporary_catalog = true ]] && (cd; rm -rf $ TEMPDIR)171 [[ $delete_temporary_catalog = true ]] && (cd; rm -rf $tempdir) 164 172 printf "\n\n+++ palmrun killed \n\n" 165 173 elif [[ $locat != control_c ]] 166 174 then 167 printf "\n\n --> palmrun finished\n\n" 168 if [[ $running_on_remote = true ]] 169 then 170 printf " Bye, bye $remote_username !!\n\n" 171 else 172 printf " Bye, bye $local_username !!\n\n" 173 fi 175 printf "\n --> palmrun finished\n\n" 174 176 fi' exit 175 177 176 178 177 179 # ACTIONS IN CASE OF TERMINAL-BREAK (CONTROL-C): 178 trap 'cd; rm -rf $ TEMPDIR180 trap 'cd; rm -rf $tempdir 179 181 printf "\n+++ palmrun killed by \"^C\" \n\n" 180 182 locat=control_c … … 1189 1191 job_id=${fname}.$run_id 1190 1192 1191 TEMPDIR=$fast_io_catalog/$job_id1193 tempdir=$fast_io_catalog/$job_id 1192 1194 fi 1193 1195 … … 1523 1525 if [[ $create_batch_job = true || $create_remote_batch_job = true ]] 1524 1526 then 1525 printf " *** batch-job will be created and submitted"1527 printf "\n *** batch-job will be created and submitted" 1526 1528 else 1527 printf " *** PALMRUN will now continue to execute on this machine"1529 printf "\n *** PALMRUN will now continue to execute on this machine" 1528 1530 fi 1529 1531 fi … … 1537 1539 if [[ $create_batch_job = true || $create_remote_batch_job = true ]] 1538 1540 then 1539 printf "\n\n *** creating executable and other sources for the remote host "1541 printf "\n\n *** creating executable and other sources for the remote host\n" 1540 1542 else 1541 printf "\n\n *** creating executable and other sources for the local host "1543 printf "\n\n *** creating executable and other sources for the local host\n" 1542 1544 fi 1543 1545 … … 1593 1595 fi 1594 1596 1595 palmbuild -v -h $host_configuration 1597 if [[ $do_trace = true ]] 1598 then 1599 palmbuild -h $host_configuration 1600 else 1601 palmbuild -v -h $host_configuration 1602 fi 1596 1603 1597 1604 if [[ $? != 0 ]] … … 1608 1615 fi 1609 1616 1617 # NOW CREATE THE SOURCES_FOR_RUN FOLDER 1610 1618 palmbuild -v $use_existing_sources_folder -h $host_configuration -d $fname 1611 1619 … … 1621 1629 else 1622 1630 1623 printf " \n$dashes\n*** executable and other sources created\n"1631 printf " *** executable and other sources created\n" 1624 1632 rm -rf $sources_for_run_catalog 1625 1633 … … 1639 1647 # CREATE THE DIRECTORY AND COPY FILES FROM SOURCES_FOR_RUN_... TO THAT 1640 1648 # FOLDER 1641 mkdir -p $TEMPDIR 1642 chmod go+rx $TEMPDIR 1643 tmpcreate=true 1644 cd $TEMPDIR 1645 cp ${fast_io_catalog}/${sources_for_run_catalog}/{*,.[!.]*} $TEMPDIR 1646 printf "\n *** changed to temporary directory: $TEMPDIR" 1649 mkdir -p $tempdir 1650 chmod go+rx $tempdir 1651 cd $tempdir 1652 cp ${fast_io_catalog}/${sources_for_run_catalog}/{*,.[!.]*} $tempdir 1653 printf "\n *** changed to temporary directory: $tempdir" 1647 1654 1648 1655 else 1649 1656 1650 1657 # IN BATCH MODE PALMRUN IS CALLED FROM TEMPDIR 1651 printf "\n *** running in temporary directory: $ TEMPDIR"1658 printf "\n *** running in temporary directory: $tempdir" 1652 1659 1653 1660 fi … … 1724 1731 for file in $(ls *) 1725 1732 do 1726 ln $file $ TEMPDIR/${localin[$i]}1733 ln $file $tempdir/${localin[$i]} 1727 1734 done >|/dev/null 2>&1 1728 cd $ TEMPDIR1735 cd $tempdir 1729 1736 fi 1730 1737 … … 1788 1795 ln -f $file ${localin[$i]} 1789 1796 done 1790 cd $ TEMPDIR1797 cd $tempdir 1791 1798 fi 1792 1799 … … 1862 1869 # STARTING THE EXECUTABLE 1863 1870 printf "\n\n *** execution starts in directory\n \"`pwd`\"\n$dashes\n" 1864 PATH=$PATH:$ TEMPDIR1871 PATH=$PATH:$tempdir 1865 1872 1866 1873 … … 1873 1880 1874 1881 # EXECUTION COMMAND FOR COMBINE_PLOT_FIELDS 1875 eval line2=\"$line2\" 1876 execute_command_for_combine="$line2" 1882 if [[ "$execute_command_for_combine" = "" ]] 1883 then 1884 eval line2=\"$line2\" 1885 execute_command_for_combine="$line2" 1886 fi 1887 1877 1888 1878 1889 … … 1993 2004 done 1994 2005 1995 1996 # IN TRACE-MODE PRINT CONTENTS OF THE CURRENT (TEMPORARY) WORKING DIRECTORY1997 if [[ $do_trace = true ]]1998 then1999 printf "\n\n"2000 ls -al2001 fi2002 2003 2006 2004 2007 # COPY LOCAL OUTPUT-FILES TO THEIR PERMANENT DESTINATIONS … … 2123 2126 if [[ "$remote_loginnode" != "" ]] 2124 2127 then 2125 echo "cd $ TEMPDIR; ${fast_io_catalog}/${sources_for_run_catalog}/batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${host_configuration}_${fname}${endout[$i]} ${extout[$i]}" | ssh -q $remote_username@$remote_loginnode2128 echo "cd $tempdir; ${fast_io_catalog}/${sources_for_run_catalog}/batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${host_configuration}_${fname}${endout[$i]} ${extout[$i]}" | ssh -q $remote_username@$remote_loginnode 2126 2129 else 2127 2130 batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address ${localout[$i]} "${pathout[$i]}" ${host_configuration}_${fname}${endout[$i]} ${extout[$i]} … … 2241 2244 ln -f $file ${pathout[$i]} 2242 2245 done >|/dev/null 2>&1 2243 cd $ TEMPDIR2246 cd $tempdir 2244 2247 fi 2245 2248 … … 2342 2345 # ALL ACTIONS FINISHED, TEMPORARY WORKING-DIRECTORY CAN BE DELETED 2343 2346 cd $HOME 2344 [[ $delete_temporary_catalog = true ]] && rm -rf $ TEMPDIR2347 [[ $delete_temporary_catalog = true ]] && rm -rf $tempdir 2345 2348 2346 2349 … … 2405 2408 do 2406 2409 (( i = i + 1 )) 2407 line=`echo "${batch_directive[$i]}" | sed 's/{{JOB_ID}}/$job_id/g' | sed 's/{{JOBFILE}}/$job_protocol_file/g' | sed 's/{{CPU_HOURS}}/$cpu_hours/g' | sed 's/{{CPU_MINUTES}}/$cpu_minutes/g' | sed 's/{{CPU_SECONDS}}/$cpu_seconds/g' | sed 's/{{NODES}}/$nodes/g' | sed 's/{{CORES}}/$cores/g' | sed 's/{{TASKS_PER_NODE}}/$tasks_per_node/g' | sed 's/{{HOST_CONFIGURATION}}/${host_configuration}/g' | sed 's/{{FNAME}}/$fname/g' | sed 's/{{QUEUE}}/$queue/g' | sed 's/{{MEMORY}}/$memory/g' | sed 's/{{PROJECT_ACCOUNT}}/$project_account/g' | sed 's/{{PREVIOUS_JOB}}/$previous_job/g' | sed 's/{{TEMPDIR}}/$ TEMPDIR/g'`2410 line=`echo "${batch_directive[$i]}" | sed 's/{{JOB_ID}}/$job_id/g' | sed 's/{{JOBFILE}}/$job_protocol_file/g' | sed 's/{{CPU_HOURS}}/$cpu_hours/g' | sed 's/{{CPU_MINUTES}}/$cpu_minutes/g' | sed 's/{{CPU_SECONDS}}/$cpu_seconds/g' | sed 's/{{NODES}}/$nodes/g' | sed 's/{{CORES}}/$cores/g' | sed 's/{{TASKS_PER_NODE}}/$tasks_per_node/g' | sed 's/{{HOST_CONFIGURATION}}/${host_configuration}/g' | sed 's/{{FNAME}}/$fname/g' | sed 's/{{QUEUE}}/$queue/g' | sed 's/{{MEMORY}}/$memory/g' | sed 's/{{PROJECT_ACCOUNT}}/$project_account/g' | sed 's/{{PREVIOUS_JOB}}/$previous_job/g' | sed 's/{{TEMPDIR}}/$tempdir/g'` 2408 2411 eval line=\"$line\" 2409 2412 echo "$line" >> $jobfile … … 2466 2469 2467 2470 # CREATE TEMPORARY DIRECTORY AND SWITCH TO IT 2468 echo "mkdir $TEMPDIR" >> $jobfile 2469 echo "cd $TEMPDIR" >> $jobfile 2470 echo "export TEMPDIR=$TEMPDIR" >> $jobfile 2471 if [[ $create_remote_batch_job = true ]] 2472 then 2473 echo "mkdir $tempdir" >> $jobfile 2474 echo "chmod go+rx $tempdir" >> $jobfile 2475 else 2476 # DIRECTORY FOR LOCAL BATCH JOBS IS CREATED NOW, DUE TO A 2477 # REQUIREMENT OF THE GRID ENGINE BATCH SYSTEM (WORKING DIR IS GIVEN IN 2478 # BATCH DIRECTIVE -wd AND MUST ALREADY EXIST WHEN THE JOB IS SUBMITTED) 2479 mkdir $tempdir 2480 chmod go+rx $tempdir 2481 fi 2482 echo "cd $tempdir" >> $jobfile 2483 echo "export tempdir=$tempdir" >> $jobfile 2471 2484 echo "cp ${fast_io_catalog}/${sources_for_run_catalog}/{*,.[!.]*} ." >> $jobfile 2472 2485 echo "export PATH=.:\$PATH" >> $jobfile … … 2533 2546 2534 2547 echo " " 2535 echo " 2548 echo " *** transfer of job to remote host via scp" 2536 2549 if [[ $do_trace = true ]] 2537 2550 then 2538 2551 echo " scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_configuration}_${job_id}" 2539 2552 fi 2540 scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_configuration}_${job_id} 2541 2542 echo " " 2543 echo " *** submit the job (output of submit command, e.g. the job-id, may follow)" 2553 scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_configuration}_${job_id} > /dev/null 2554 2555 printf " *** submit the job (output of submit command, e.g. the job-id, may follow)" 2544 2556 if [[ $do_trace = true ]] 2545 2557 then
Note: See TracChangeset
for help on using the changeset viewer.