Changeset 2506 for palm/trunk/SCRIPTS
- Timestamp:
- Sep 29, 2017 8:30:37 AM (7 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmbuild
r2500 r2506 27 27 # ----------------- 28 28 # $Id$ 29 # option -V added to check for an existing SOURCES_FOR_RUN_... folder 30 # host configuration added to SOURCES_FOR_RUN_... folder name 31 # SOURCES_FOR_RUN_... folder is deleted in case of compilation errors 32 # host_identifier renamed host_configuration 33 # 34 # 2500 2017-09-25 11:10:03Z raasch 29 35 # bugfix for r2492 30 36 # … … 52 58 column1="" 53 59 column2="" 54 host_ identifier=default60 host_configuration=default 55 61 locat=normal 56 62 makefile="" … … 62 68 ssh_key="" 63 69 suf=f90 70 use_existing_sources_folder=false 64 71 version="palmbuild 1.0 Rev$Rev: 2316 $" 65 72 working_directory=`pwd` … … 69 76 # ERROR HANDLING 70 77 # IN CASE OF EXIT: 71 trap 'if [[ $locat != normal ]] 78 trap 'rm -rf ${source_path}/${host_configuration}_last_make_protocol 79 if [[ $locat != normal ]] 72 80 then 73 81 printf "\n\n +++ palmbuild killed \n\n" … … 77 85 exit 0 78 86 fi 79 rm ${source_path}/${host_identifier}_last_make_protocol80 87 ' exit 81 88 … … 83 90 # IN CASE OF TERMINAL-BREAK: 84 91 trap 'printf "\n\n +++ palmbuild killed by \"^C\" \n\n" 85 rm ${source_path}/${host_ identifier}_last_make_protocol92 rm ${source_path}/${host_configuration}_last_make_protocol 86 93 exit 87 94 ' 2 … … 90 97 91 98 # READ SHELLSCRIPT-OPTIONS 92 while getopts :d:h:m:s:S:uv option99 while getopts :d:h:m:s:S:uvV option 93 100 do 94 101 case $option in 95 102 (d) fname=$OPTARG;; 96 (h) host_ identifier=$OPTARG;;103 (h) host_configuration=$OPTARG;; 97 104 (m) makefile=$OPTARG;; 98 105 (s) suf=$OPTARG;; 99 106 (S) source_list="$OPTARG";; 100 107 (v) silent=true;; 108 (V) use_existing_sources_folder=true;; 101 109 (\?) printf "\n +++ unknown option $OPTARG \n"; 102 110 locat=parameter; exit;; … … 105 113 106 114 107 # BUILD THE CONFIGURATION-FILE NAME 108 config_file=.palm.config.$host_identifier 115 # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME 116 config_file=.palm.config.$host_configuration 117 sources_for_run_catalog=SOURCES_FOR_RUN_${host_configuration}_$fname 109 118 110 119 … … 277 286 278 287 line=`grep %base_directory $config_file` 279 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host_ identifier}288 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host_configuration} 280 289 281 290 else 282 291 283 make_depository=${base_directory}/MAKE_DEPOSITORY_${host_ identifier}292 make_depository=${base_directory}/MAKE_DEPOSITORY_${host_configuration} 284 293 285 294 fi … … 342 351 343 352 # GET CONFIRMATION TO CONTINUE 344 printf "\n *** update will be made for host \"$host_identifier\" "353 printf "\n *** update will be made for host configuration \"$host_configuration\" " 345 354 346 355 … … 367 376 if [[ "$remote_ip" != "" ]] 368 377 then 369 column2="$host_ identifier"378 column2="$host_configuration" 370 379 printf "| %-20s%-50s | \n" "host identifier:" "$column2" 371 380 printf "| | \n" … … 373 382 printf "| %-20s%-50s | \n" "remote depository:" "$column2" 374 383 else 375 column2="$host_ identifier"384 column2="$host_configuration" 376 385 printf "| %-20s%-50s | \n" "host identifier:" "$column2" 377 386 printf "| | \n" … … 518 527 echo " *** creating utilities on remote host" 519 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\" " 520 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_ identifier}_last_make_protocol521 522 if [[ $(grep -c MAKE_ERROR ${host_ identifier}_last_make_protocol) != 0 ]]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 ]] 523 532 then 524 533 printf "\a\n +++ error(s) occurred during compiling or linking of utilities" 525 printf "\n for host \"$host_identifier\" "534 printf "\n for host configuration \"$host_configuration\" " 526 535 if [[ $silent = false ]] 527 536 then … … 534 543 if [[ "$answer" = l ]] 535 544 then 536 more ${host_ identifier}_last_make_protocol545 more ${host_configuration}_last_make_protocol 537 546 fi 538 547 done … … 555 564 echo " *** compile PALM sources on remote host" 556 565 make_call_string="make $make_options PROG=$program_name F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$compiler_options\" LDFLAGS=\"$linker_options\" " 557 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_ identifier}_last_make_protocol558 559 if [[ $(grep -c MAKE_ERROR ${host_ identifier}_last_make_protocol) != 0 ]]560 then 561 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" "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 567 568 if [[ $(grep -c MAKE_ERROR ${host_configuration}_last_make_protocol) != 0 ]] 569 then 570 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 562 571 if [[ $silent = false ]] 563 572 then … … 570 579 if [[ "$answer" = l ]] 571 580 then 572 more ${host_ identifier}_last_make_protocol581 more ${host_configuration}_last_make_protocol 573 582 fi 574 583 done … … 596 605 # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS 597 606 # AND ASK, IF THEY SHALL BE USED 598 echo "[[ -d $ fast_io_catalog/SOURCES_FOR_RUN_$fname ]] && echo sources for run found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 > ${host_identifier}_last_make_protocol599 if [[ $(grep -c "sources for run found" ${host_ identifier}_last_make_protocol) != 0]]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 ]] 600 609 then 601 610 printf "\a\n *** compiled sources for run \"$fname\" found on remote host in folder" 602 printf "\n $fast_io_catalog/SOURCES_FOR_RUN_$fname" 603 answer=dummy 604 printf "\n\n" 605 while [[ "$answer" != y && "$answer" != n ]] 606 do 607 printf " >>> shall they be used (y/n) ? " 608 read answer 609 done 610 if [[ $answer = y ]] 611 then 612 exit 613 fi 611 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 612 printf "\n will be used!" 613 exit 614 614 fi 615 615 616 616 # COPY MAKE DEPOSITORY ON REMOTE MACHINE TO SOURCES_FOR_RUN_... 617 printf "\n *** copy MAKE_DEPOSITORY_${host_ identifier} on remote host to SOURCES_FOR_RUN_$fname\n"618 echo "rm -rf $ fast_io_catalog/SOURCES_FOR_RUN_$fname; mkdir -p $fast_io_catalog/SOURCES_FOR_RUN_$fname; cp ${make_depository}/${program_name}_current_version.tar $fast_io_catalog/SOURCES_FOR_RUN_$fname; cd $fast_io_catalog/SOURCES_FOR_RUN_$fname; tar xf ${program_name}_current_version.tar" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1617 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 619 620 620 621 621 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... ON THE REMOTE MACHINE 622 printf "\n *** copy $ base_directory/SOURCES_FOR_RUN_$fname"623 printf "\n to SOURCES_FOR_RUN_$fnameon remote host \n"624 scp -q $ssh_key $ base_directory/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ${remote_username}@${remote_ip}:${fast_io_catalog}/SOURCES_FOR_RUN_$fname622 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 625 626 626 627 627 # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY 628 if [[ $(ls -1 $ base_directory/SOURCES_FOR_RUN_$fname/ | grep -c .$suf) != 0 ]]628 if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]] 629 629 then 630 630 … … 633 633 [[ "$module_commands" != "" ]] && module_commands=${module_commands}";" 634 634 echo " *** execute \"make\" on remote host" 635 echo "$login_init_cmd $module_commands cd ${fast_io_catalog}/ SOURCES_FOR_RUN_$fname; 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_identifier}_last_make_protocol636 637 if [[ $(grep -c MAKE_ERROR ${host_ identifier}_last_make_protocol) != 0 ]]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 638 then 639 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" "639 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 640 640 if [[ $silent = false ]] 641 641 then … … 648 648 if [[ "$answer" = l ]] 649 649 then 650 more ${host_ identifier}_last_make_protocol650 more ${host_configuration}_last_make_protocol 651 651 fi 652 652 done 653 653 if [[ $answer = k ]] 654 654 then 655 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 655 656 locat=user_abort; exit 656 657 fi 657 658 else 658 659 # ABORT ANYWAY 660 echo "rm -rf ${fast_io_catalog}/${sources_for_run_catalog}" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 659 661 locat=user_abort; exit 660 662 fi … … 669 671 fi 670 672 671 rm -rf ${ host_identifier}_last_make_protocol673 rm -rf ${source_path}/${host_configuration}_last_make_protocol 672 674 673 675 … … 729 731 echo " *** compile PALM sources on local host" 730 732 731 make $make_options PROG=$program_name F90=$compiler_name COPT="$cpp_options" F90FLAGS="$compiler_options" LDFLAGS="$linker_options" 2>&1 | tee ${host_ identifier}_last_make_protocol733 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 732 734 733 735 if [[ $? != 0 ]] 734 736 then 735 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" "737 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 736 738 if [[ $silent = false ]] 737 739 then … … 744 746 if [[ "$answer" = l ]] 745 747 then 746 more ${host_ identifier}_last_make_protocol748 more ${host_configuration}_last_make_protocol 747 749 fi 748 750 done … … 770 772 # FIRST CHECK, IF COMPILED SOURCES FOR THIS RUN IDENTIFIER EXISTS 771 773 # AND ASK, IF THEY SHALL BE USED 772 if [[ -d $ fast_io_catalog/SOURCES_FOR_RUN_$fname ]]774 if [[ -d ${fast_io_catalog}/${sources_for_run_catalog} && $use_existing_sources_folder = true ]] 773 775 then 774 776 printf "\a\n *** compiled sources for run \"$fname\" found on local host in folder" 775 printf "\n $fast_io_catalog/SOURCES_FOR_RUN_$fname" 776 answer=dummy 777 printf "\n\n" 778 while [[ "$answer" != y && "$answer" != n ]] 779 do 780 printf " >>> shall they be used (y/n) ? " 781 read answer 782 done 783 if [[ $answer = y ]] 784 then 785 exit 786 fi 777 printf "\n ${fast_io_catalog}/${sources_for_run_catalog}" 778 printf "\n will be used!" 779 exit 787 780 fi 788 781 … … 792 785 printf "\n +++ directory for local make depository:" 793 786 printf "\n $make_depository" 794 printf "\n not found. Please run \"palmbuild -h $host_ identifier\" "787 printf "\n not found. Please run \"palmbuild -h $host_configuration\" " 795 788 locat=make_depository; exit 796 789 fi … … 798 791 799 792 # COPY MAKE DEPOSITORY ON LOCAL MACHINE TO SOURCES_FOR_RUN_... 800 printf "\n *** copy MAKE_DEPOSITORY_${host_ identifier} on local host to "801 printf "\n $ fast_io_catalog/SOURCES_FOR_RUN_$fname\n"802 rm -rf $ fast_io_catalog/SOURCES_FOR_RUN_$fname803 mkdir -p $ fast_io_catalog/SOURCES_FOR_RUN_$fname804 cp ${make_depository}/${program_name}_current_version.tar $ fast_io_catalog/SOURCES_FOR_RUN_$fname805 cd $fast_io_catalog/ SOURCES_FOR_RUN_$fname793 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} 806 799 tar xf ${program_name}_current_version.tar 807 800 … … 809 802 # COPY CONTENTS OF SOURCES_FOR_RUN_... TO SOURCES_FOR_RUN_... 810 803 # IN THE FAST_IO_CATALOG ON THE LOCAL MACHINE 811 printf "\n *** copy $ base_directory/SOURCES_FOR_RUN_$fnameto"812 printf "\n $ fast_io_catalog/SOURCES_FOR_RUN_$fnameon local host \n"813 cp $ base_directory/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ${fast_io_catalog}/SOURCES_FOR_RUN_$fname804 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} 814 807 815 808 816 809 # CREATE EXECUTABLE FROM THE NEW/MODIFIED SOURCE FILES, IF THERE ARE ANY 817 if [[ $(ls -1 $ base_directory/SOURCES_FOR_RUN_$fname/ | grep -c .$suf) != 0 ]]810 if [[ $(ls -1 ${base_directory}/${sources_for_run_catalog}/ | grep -c .$suf) != 0 ]] 818 811 then 819 812 … … 827 820 then 828 821 829 printf "\a\n +++ error(s) occurred during compiling or linking for host \"$host_identifier\" "822 printf "\a\n +++ error(s) occurred during compiling or linking for host configuration \"$host_configuration\" " 830 823 if [[ $silent = false ]] 831 824 then … … 834 827 while [[ "$answer" != c && "$answer" != k ]] 835 828 do 836 printf " >>> continue / list errors /kill palmbuild (c/k) ? "829 printf " >>> continue / kill palmbuild (c/k) ? " 837 830 read answer 838 831 done 839 832 if [[ $answer = k ]] 840 833 then 834 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 841 835 locat=user_abort; exit 842 836 fi 843 837 else 844 838 # ABORT ANYWAY 839 rm -rf ${fast_io_catalog}/${sources_for_run_catalog} 845 840 locat=user_abort; exit 846 841 fi -
palm/trunk/SCRIPTS/palmrun
r2501 r2506 27 27 # ----------------- 28 28 # $Id$ 29 # option -V added to check for an existing SOURCES_FOR_RUN_... folder 30 # host configuration added to SOURCES_FOR_RUN_... folder name 31 # host_identifier renamed host_configuration 32 # option -W added to allow for job dependencies 33 # 34 # 2501 2017-09-26 11:41:55Z raasch 29 35 # default value for number of cores (option -X) set to 1 30 36 # bugfix for mechanism which overwrites configuration file settings with values … … 76 82 cpp_options="" 77 83 cpumax=0 84 create_batch_job=false 78 85 create_jobfile_only=false 79 delete_temporary_catalog=true80 create_batch_job=false81 86 create_remote_batch_job=false 82 87 dashes=" ----------------------------------------------------------------------------" 83 88 defaultqueue="" 89 delete_temporary_catalog=true 84 90 do_compile=true 85 91 do_trace=false … … 90 96 fname=test 91 97 global_revision="" 92 host_ identifier="default"98 host_configuration="default" 93 99 hostfile="" 94 100 hp="" … … 107 113 done 108 114 module_calls="" 115 palmrun_memory="" 109 116 palmrun_script_name=$prc 110 117 openmp=false 118 previous_job="" 111 119 project_account="" 112 120 queue=none … … 126 134 transfer_problems=false 127 135 user_source_path="" 136 use_existing_sources_folder="" 128 137 use_openmp=false 129 138 version="palmrun 1.0 Rev$Rev: 2303 $" … … 170 179 # READ SHELLSCRIPT-OPTIONS AND REBUILD THE PALMRUN-COMMAND STRING (prc), 171 180 # WHICH WILL BE USED TO START RESTART-JOBS 172 while getopts :a:A:bBCd:FG:h:jkm:M:O:q:r:R:s:t:T:u:U:v w:xX:yY:Z option181 while getopts :a:A:bBCd:FG:h:jkm:M:O:q:r:R:s:t:T:u:U:vVw:W:xX:yY:Z option 173 182 do 174 183 case $option in … … 181 190 (F) create_jobfile_only=true;; 182 191 (G) global_revision=$OPTARG; prc="$prc -G'$OPTARG'";; 183 (h) host_ identifier=$OPTARG; prc="$prc -h$OPTARG";;192 (h) host_configuration=$OPTARG; prc="$prc -h$OPTARG";; 184 193 (j) running_in_batch_mode=true;; 185 194 (k) keep_data_from_previous_run=true; prc="$prc -k";; … … 196 205 (U) return_username=$OPTARG; prc="$prc -U$OPTARG";; 197 206 (v) silent=true; prc="$prc -v";; 207 (V) use_existing_sources_folder="-V";; 198 208 (w) max_par_io_str=$OPTARG; prc="$prc -w$OPTARG";; 209 (W) previous_job=$OPTARG;; 199 210 (x) do_trace=true;set -x; prc="$prc -x";; 200 211 (X) palmrun_cores=$OPTARG; prc="$prc -X$OPTARG";; … … 225 236 printf "\n -d base name of files attached to program test" 226 237 printf "\n -F create batch job file only ---" 227 printf "\n -h configuration identifier\"default\" "238 printf "\n -h host configuration \"default\" " 228 239 printf "\n -k keep data from previous run" 229 240 printf "\n -m memory demand in MB (batch-jobs) 0 MB" … … 239 250 printf "\n -u username on remote machine \"\" " 240 251 printf "\n -v no prompt for confirmation ---" 252 printf "\n -V check if SOURCES_FOR_RUN_... exists ---" 241 253 printf "\n -w maximum parallel io streams as given by -X" 254 printf "\n -W name of job to wait for ---" 242 255 printf "\n -x tracing of palmrun for debug purposes ---" 243 256 printf "\n -X # of processors (on parallel machines) 1" … … 266 279 267 280 268 # BUILD THE CONFIGURATION-FILE NAME 269 config_file=.palm.config.$host_identifier 281 # BUILD THE CONFIGURATION-FILE NAME AND THE SOURCES_FOR_RUN-FOLDER NAME 282 config_file=.palm.config.$host_configuration 283 sources_for_run_catalog=SOURCES_FOR_RUN_${host_configuration}_$fname 270 284 271 285 … … 574 588 575 589 # VALUES OF PALMRUN-OPTIONS OVERWRITE THOSE FROM THE CONFIGURATION-FILE 576 [[ $palmrun_memory != 0]] && memory=$palmrun_memory590 [[ $palmrun_memory != "" ]] && memory=$palmrun_memory 577 591 [[ $palmrun_cpumax != "" ]] && cpumax=$palmrun_cpumax 578 592 [[ "$palmrun_cores" != "" ]] && cores=$palmrun_cores … … 609 623 then 610 624 611 if [[ ! -d ${fast_io_catalog}/ SOURCES_FOR_RUN_$fname]]612 then 613 printf "\n +++ directory ${fast_io_catalog}/ SOURCES_FOR_RUN_$fnameis missing"625 if [[ ! -d ${fast_io_catalog}/${sources_for_run_catalog} ]] 626 then 627 printf "\n +++ directory ${fast_io_catalog}/${sources_for_run_catalog} is missing" 614 628 printf "\n Please check the output of the palmrun-call" 615 629 printf "\n that you did on your local host." … … 634 648 fi 635 649 636 rm -rf SOURCES_FOR_RUN_$fname637 mkdir -p SOURCES_FOR_RUN_$fname650 rm -rf $sources_for_run_catalog 651 mkdir -p $sources_for_run_catalog 638 652 639 653 if [[ "$source_list" = LM ]] … … 677 691 for filename in $Filenames 678 692 do 679 cp $filename $ working_directory/SOURCES_FOR_RUN_$fname693 cp $filename ${working_directory}/${sources_for_run_catalog} 680 694 source_list=$source_list"$filename " 681 695 done … … 707 721 locat=source; exit 708 722 else 709 cp $filename $ working_directory/SOURCES_FOR_RUN_$fname723 cp $filename ${working_directory}/${sources_for_run_catalog} 710 724 fi 711 725 … … 723 737 locat=make; exit 724 738 else 725 cp $makefile SOURCES_FOR_RUN_$fname/Makefile739 cp $makefile ${sources_for_run_catalog}/Makefile 726 740 fi 727 741 … … 762 776 763 777 cd - > /dev/null 764 cd SOURCES_FOR_RUN_$fname778 cd $sources_for_run_catalog 765 779 766 780 # COPY MAKEFILE IF EXISTING … … 818 832 819 833 # COPY CONFIGURATION FILES 820 cp $config_file SOURCES_FOR_RUN_$fname821 cp $fileconnection_file SOURCES_FOR_RUN_$fname834 cp $config_file $sources_for_run_catalog 835 cp $fileconnection_file $sources_for_run_catalog 822 836 823 837 # COPY SHELLSCRIPTS 824 cp ${source_path}/../SCRIPTS/palmrun SOURCES_FOR_RUN_$fname825 cp ${source_path}/../SCRIPTS/batch_scp SOURCES_FOR_RUN_$fname838 cp ${source_path}/../SCRIPTS/palmrun $sources_for_run_catalog 839 cp ${source_path}/../SCRIPTS/batch_scp $sources_for_run_catalog 826 840 827 841 fi … … 1260 1274 if [[ $create_remote_batch_job = true ]] 1261 1275 then 1262 column1="execution on:"; column2="$host_ identifier(username: $remote_username)"1276 column1="execution on:"; column2="$host_configuration (username: $remote_username)" 1263 1277 else 1264 1278 if [[ $running_on_remote = true ]] 1265 1279 then 1266 column1="execution on:"; column2="$host_ identifier(IP:$remote_ip)"1280 column1="execution on:"; column2="$host_configuration (IP:$remote_ip)" 1267 1281 else 1268 column1="execution on:"; column2="$host_ identifier(IP:$local_ip)"1282 column1="execution on:"; column2="$host_configuration (IP:$local_ip)" 1269 1283 fi 1270 1284 fi … … 1327 1341 if [[ $create_batch_job = true || $create_remote_batch_job = true || $running_in_batch_mode = true ]] 1328 1342 then 1343 column1="memory demand / PE":; column2="$memory MB" 1344 printf "| %-25s%-45s | \n" "$column1" "$column2" 1329 1345 column1="job cpu time (h:m:s):"; column2="$timestring" 1330 1346 printf "| %-25s%-45s | \n" "$column1" "$column2" … … 1419 1435 fi 1420 1436 1421 if [[ $create_batch_job = true || "$LOADLBATCH" = yes ]]1422 then1423 column1="memory demand / PE":; column2="$memory MB"1424 printf "| %-25s%-45s | \n" "$column1" "$column2"1425 column1=CPU-time:; column2="$cpu_hours:$cpu_minutes:$cpu_seconds"1426 printf "| %-25s%-45s | \n" "$column1" "$column2"1427 fi1428 1429 1437 if [[ "$source_list" != "" ]] 1430 1438 then … … 1535 1543 1536 1544 line=`grep %base_directory $config_file` 1537 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host_identifier} 1538 echo "make_depository=$make_depository" 1539 echo "[[ ! -d ${make_depository} ]] && echo depository not found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_identifier}_last_make_protokoll 1540 1541 if [[ $(grep -c "depository not found" ${host_identifier}_last_make_protokoll) != 0 ]] 1545 make_depository=`echo $line | cut -d" " -s -f2`/MAKE_DEPOSITORY_${host_configuration} 1546 echo "[[ ! -d ${make_depository} ]] && echo depository not found" | ssh -q $ssh_key ${remote_username}@${remote_ip} 2>&1 | tee ${host_configuration}_last_make_protokoll 1547 1548 if [[ $(grep -c "depository not found" ${host_configuration}_last_make_protokoll) != 0 ]] 1542 1549 then 1543 1550 printf "\n\n +++ make depository \"${make_depository}\"" … … 1545 1552 ask_for_make_depository=true 1546 1553 fi 1547 rm ${host_ identifier}_last_make_protokoll1554 rm ${host_configuration}_last_make_protokoll 1548 1555 1549 1556 else 1550 1557 1551 1558 # CHECK FOR MAKE_DEPOSITORY ON THE LOCAL HOST 1552 make_depository=${base_directory}/MAKE_DEPOSITORY_${host_ identifier}1559 make_depository=${base_directory}/MAKE_DEPOSITORY_${host_configuration} 1553 1560 if [[ ! -d ${make_depository} ]] 1554 1561 then … … 1580 1587 fi 1581 1588 1582 palmbuild -v -h $host_ identifier1589 palmbuild -v -h $host_configuration 1583 1590 1584 1591 if [[ $? != 0 ]] … … 1595 1602 fi 1596 1603 1597 palmbuild -v -h $host_identifier-d $fname1604 palmbuild -v $use_existing_sources_folder -h $host_configuration -d $fname 1598 1605 1599 1606 if [[ $? != 0 ]] … … 1603 1610 printf "\n +++ error while creating executable and/or other sources" 1604 1611 locat=execution 1605 rm -rf SOURCES_FOR_RUN_$fname1612 rm -rf $sources_for_run_catalog 1606 1613 exit 1607 1614 … … 1609 1616 1610 1617 printf "\n$dashes\n *** executable and other sources created\n" 1611 rm -rf SOURCES_FOR_RUN_$fname1618 rm -rf $sources_for_run_catalog 1612 1619 1613 1620 fi … … 1630 1637 tmpcreate=true 1631 1638 cd $TEMPDIR 1632 cp $ fast_io_catalog/SOURCES_FOR_RUN_$fname/{*,.[!.]*} $TEMPDIR1639 cp ${fast_io_catalog}/${sources_for_run_catalog}/{*,.[!.]*} $TEMPDIR 1633 1640 printf "\n *** changed to temporary directory: $TEMPDIR" 1634 1641 … … 1837 1844 # (FILE ENVPAR WILL BE READ BY PALM) 1838 1845 cat > ENVPAR << EOF 1839 &envpar run_identifier = '$fname', host = '$host_ identifier',1846 &envpar run_identifier = '$fname', host = '$host_configuration', 1840 1847 write_binary = .${write_binary}., tasks_per_node = $tasks_per_node, 1841 1848 maximum_parallel_io_streams = $maximum_parallel_io_streams, … … 2105 2112 transfer_failed=false 2106 2113 printf "\n >>> OUTPUT: ${localout[$i]}$catalog_string $append_string by SCP to" 2107 printf "\n ${pathout[$i]}/${host_ identifier}_${fname}${endout[$i]}$catalog_string\n"2114 printf "\n ${pathout[$i]}/${host_configuration}_${fname}${endout[$i]}$catalog_string\n" 2108 2115 2109 2116 # TRANSFER VIA SCP 2110 2117 if [[ "$remote_loginnode" != "" ]] 2111 2118 then 2112 echo "cd $TEMPDIR; ${fast_io_catalog}/ SOURCES_FOR_RUN_${fname}/batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${host_identifier}_${fname}${endout[$i]} ${extout[$i]}" | ssh -q $remote_username@$remote_loginnode2119 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 2113 2120 else 2114 batch_scp $PORTOPT $catalog_option $append_option -b -m $usecycle_option -u $local_username $return_address ${localout[$i]} "${pathout[$i]}" ${host_ identifier}_${fname}${endout[$i]} ${extout[$i]}2121 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]} 2115 2122 fi 2116 2123 [[ $? != 0 ]] && transfer_failed=true … … 2121 2128 then 2122 2129 printf " +++ transfer failed. Trying to save a copy on this host under:\n" 2123 printf " ${pathout[$i]}/${host_ identifier}_${fname}${endout[$i]}_$run_id\n"2130 printf " ${pathout[$i]}/${host_configuration}_${fname}${endout[$i]}_$run_id\n" 2124 2131 2125 2132 # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY … … 2131 2138 mkdir -p $local_catalog 2132 2139 fi 2133 eval cp ${localout[$i]} ${pathout[$i]}/${host_ identifier}_${fname}${endout[$i]}_$run_id2140 eval cp ${localout[$i]} ${pathout[$i]}/${host_configuration}_${fname}${endout[$i]}_$run_id 2134 2141 transfer_problems=true 2135 2142 fi … … 2339 2346 2340 2347 # BUILD THE PALMRUN-COMMAND TO BE CALLED IN THE BATCH-JOB 2341 palmrun_com="$palmrun_script_name -d $fname -h $host_ identifier-m $memory -t $cpumax -q $queue -r $run_id -U $local_username"2348 palmrun_com="$palmrun_script_name -d $fname -h $host_configuration -m $memory -t $cpumax -q $queue -r $run_id -U $local_username" 2342 2349 [[ "$activation_string_list" != "" ]] && palmrun_com=${palmrun_com}" -a \"$activation_string_list\"" 2343 2350 [[ "$global_revision" != "" ]] && palmrun_com=${palmrun_com}" -G \"$global_revision\"" … … 2372 2379 # DETERMINE THE FULL PATHS FOR THE JOB PROTOCOL FILES ON THE LOCAL AND 2373 2380 # REMOTE HOST 2374 job_protocol_file_local=${local_jobcatalog}/${host_ identifier}_${job_id}2381 job_protocol_file_local=${local_jobcatalog}/${host_configuration}_${job_id} 2375 2382 job_protocol_file=$job_protocol_file_local 2376 2383 if [[ $create_remote_batch_job = true ]] 2377 2384 then 2378 job_protocol_file_remote=${remote_jobcatalog}/${host_ identifier}_${job_id}2385 job_protocol_file_remote=${remote_jobcatalog}/${host_configuration}_${job_id} 2379 2386 job_protocol_file=$job_protocol_file_remote 2380 2387 job_transfer_protocol_file=${remote_jobcatalog}/last_job_transfer_protocol … … 2392 2399 do 2393 2400 (( i = i + 1 )) 2394 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_ IDENTIFIER}}/${host_identifier}/g' | sed 's/{{FNAME}}/$fname/g' | sed 's/{{QUEUE}}/$queue/g' | sed 's/{{MEMORY}}/$memory/g' | sed 's/{{PROJECT_ACCOUNT}}/$project_account/g'`2401 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'` 2395 2402 eval line=\"$line\" 2396 2403 echo "$line" >> $jobfile … … 2414 2421 do 2415 2422 (( i = i + 1 )) 2416 line=`echo "${batch_directive_transfer[$i]}" | sed 's/{{JOB_ID}}/$job_id/g' | sed 's/{{JOBFILE}}/$job_protocol_file/g' | sed 's/{{JOB_TRANSFER_PROTOCOL_FILE}}/$job_transfer_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/{{TASKS_PER_NODE}}/$tasks_per_node/g' | sed 's/{{HOST_ IDENTIFIER}}/${host_identifier}/g' | sed 's/{{FNAME}}/$fname/g' | sed 's/{{PROJECT_ACCOUNT}}/$project_account/g'`2423 line=`echo "${batch_directive_transfer[$i]}" | sed 's/{{JOB_ID}}/$job_id/g' | sed 's/{{JOBFILE}}/$job_protocol_file/g' | sed 's/{{JOB_TRANSFER_PROTOCOL_FILE}}/$job_transfer_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/{{TASKS_PER_NODE}}/$tasks_per_node/g' | sed 's/{{HOST_CONFIGURATION}}/${host_configuration}/g' | sed 's/{{FNAME}}/$fname/g' | sed 's/{{PROJECT_ACCOUNT}}/$project_account/g'` 2417 2424 eval line=\"$line\" 2418 2425 echo "$line" >> $jobfile … … 2421 2428 2422 2429 echo "set -x" >> $jobfile 2423 echo "${fast_io_catalog}/ SOURCES_FOR_RUN_${fname}/batch_scp $PORTOPT -d -w 10 -u $local_username $local_ip $job_protocol_file_remote \"$local_jobcatalog\" ${host_identifier}_${fname}" >> $jobfile2430 echo "${fast_io_catalog}/${sources_for_run_catalog}/batch_scp $PORTOPT -d -w 10 -u $local_username $local_ip $job_protocol_file_remote \"$local_jobcatalog\" ${host_configuration}_${fname}" >> $jobfile 2424 2431 echo "%%END%%" >> $jobfile 2425 2432 echo "echo \" *** submitting job for transfering the job protocol file to $local_ip\" " >> $jobfile … … 2456 2463 echo "cd $TEMPDIR" >> $jobfile 2457 2464 echo "export TEMPDIR=$TEMPDIR" >> $jobfile 2458 echo "cp $ fast_io_catalog/SOURCES_FOR_RUN_$fname/{*,.[!.]*} ." >> $jobfile2465 echo "cp ${fast_io_catalog}/${sources_for_run_catalog}/{*,.[!.]*} ." >> $jobfile 2459 2466 echo "export PATH=.:\$PATH" >> $jobfile 2460 2467 echo "export execute_palmrun=true" >> $jobfile … … 2486 2493 echo " echo \" \" " >> $jobfile 2487 2494 echo " echo \"+++ file ${remotepathin[$i]} could not be created\" " >> $jobfile 2488 echo " echo \" please check, if directory exists on $host_ identifier!\" " >> $jobfile2495 echo " echo \" please check, if directory exists on $host_configuration!\" " >> $jobfile 2489 2496 echo " echo \"+++ PALMRUN will not be continued\" " >> $jobfile 2490 2497 echo " execute_palmrun=false" >> $jobfile … … 2523 2530 if [[ $do_trace = true ]] 2524 2531 then 2525 echo " scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_ identifier}_${job_id}"2526 fi 2527 scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_ identifier}_${job_id}2532 echo " scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_configuration}_${job_id}" 2533 fi 2534 scp $ssh_key $PORTOPT $jobfile ${remote_username}@${remote_ip}:${remote_jobcatalog}/${host_configuration}_${job_id} 2528 2535 2529 2536 echo " " … … 2531 2538 if [[ $do_trace = true ]] 2532 2539 then 2533 echo " cd $remote_jobcatalog; $submit_command ${host_ identifier}_${job_id}; rm ${host_identifier}_${job_id} | ssh -q $ssh_key $SSH_PORTOPT ${remote_username}@${remote_ip} 2>&1"2534 fi 2535 echo "cd $remote_jobcatalog; $submit_command ${host_ identifier}_${job_id}; rm ${host_identifier}_${job_id}" | ssh -q $ssh_key $SSH_PORTOPT ${remote_username}@${remote_ip} 2>&12540 echo " cd $remote_jobcatalog; $submit_command ${host_configuration}_${job_id}; rm ${host_configuration}_${job_id} | ssh -q $ssh_key $SSH_PORTOPT ${remote_username}@${remote_ip} 2>&1" 2541 fi 2542 echo "cd $remote_jobcatalog; $submit_command ${host_configuration}_${job_id}; rm ${host_configuration}_${job_id}" | ssh -q $ssh_key $SSH_PORTOPT ${remote_username}@${remote_ip} 2>&1 2536 2543 2537 2544 elif [[ $create_batch_job = true ]] … … 2539 2546 2540 2547 eval local_jobcatalog=$local_jobcatalog 2541 cp $jobfile ${local_jobcatalog}/${host_ identifier}_${job_id}2548 cp $jobfile ${local_jobcatalog}/${host_configuration}_${job_id} 2542 2549 cd $local_jobcatalog 2543 2550 echo " " … … 2545 2552 if [[ $do_trace = true ]] 2546 2553 then 2547 echo "$submit_command ${host_ identifier}_${job_id}"2548 fi 2549 $submit_command ${host_ identifier}_${job_id}2550 rm ${host_ identifier}_${job_id}2554 echo "$submit_command ${host_configuration}_${job_id}" 2555 fi 2556 $submit_command ${host_configuration}_${job_id} 2557 rm ${host_configuration}_${job_id} 2551 2558 cd - > /dev/null 2552 2559
Note: See TracChangeset
for help on using the changeset viewer.