Changeset 82 for palm/trunk/SCRIPTS
- Timestamp:
- Apr 16, 2007 3:40:52 PM (18 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/mbuild
r75 r82 87 87 # adjustments for running under pdksh, local ip-addres 88 88 # is not determined any more 89 # 30/03/07 - Siggi - cpp-directives/options + netcdf-options are read 90 # from configuration file 91 # host identifier (local_host) is read from config file 89 92 90 93 … … 159 162 160 163 161 # LOKALEN RECHNER ERMITTELN162 local_host_real_name=$(hostname)163 # local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')164 165 case $local_host_real_name in166 (atmos) local_host=lcide;;167 (berte) local_host=t3eb;;168 (bora|breva|gregale|irifi|levanto|maestro|orkan|ostria|quanero|scirocco) local_host=lcmuk;;169 (fimm.bccs.uib.no) local_host=lcmuk;;170 (gate) local_host=neck;;171 (gfdl3.yonsei.ac.kr) local_host=decalpha;;172 (gfdl5) local_host=ibmy;;173 (gwdk081.gwdg.de) local_host=ibm;;174 (hreg01a-en0|hreg02a-en0) local_host=ibmh;;175 (nobel|nobela) local_host=ibms;;176 (tgg*) local_host=lctit;;177 (t3e) local_host=t3eh;;178 (zam003) local_host=t3ej2;;179 (zam005) local_host=t3ej5;;180 (*) printf "\n +++ local host \"$local_host_real_name\" not admitted for mbuild \n"181 locat=local_host; exit;;182 esac183 184 [[ $local_host_real_name = scirocco ]] && scirocco=true185 [[ $local_host_real_name = fimm.bccs.uib.no ]] && fimm=true186 187 188 189 164 # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN 190 165 if [[ ! -f $config_file ]] … … 195 170 locat=configuration; exit 196 171 fi 172 173 174 175 # LOKALEN RECHNER ERMITTELN 176 local_host_real_name=$(hostname) 177 # local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}') 178 179 180 181 # HOST-IDENTIFIER (local_host) AUS KONFIGURATIONSDATEI BESTIMMEN 182 line="" 183 grep "%host_identifier" $config_file > tmp_mbuild 184 while read line 185 do 186 if [[ "$line" != "" || $(echo $line | cut -c1) != "#" ]] 187 then 188 HOSTNAME=`echo $line | cut -d" " -s -f2` 189 host_identifier=`echo $line | cut -d" " -s -f3` 190 if [[ "$HOSTNAME" = $local_host_real_name ]] 191 then 192 local_host=$host_identifier 193 break 194 fi 195 fi 196 done < tmp_mbuild 197 198 if [[ "$local_host" = "" ]] 199 then 200 printf "\n +++ no host identifier found in configuration file \"$config_file\"" 201 printf "\n for local host \"$local_host_real_name\"." 202 printf "\n Please add line" 203 printf "\n \"\%host_identifier $local_host_real_name <identifier>\"" 204 printf "\n to the configuration file." 205 locat=local_host; exit 206 fi 207 208 209 # case $local_host_real_name in 210 # (atmos) local_host=lcide;; 211 # (berte) local_host=t3eb;; 212 # (bora|breva|gregale|irifi|levanto|maestro|orkan|ostria|quanero|scirocco) local_host=lcmuk;; 213 # (fimm.bccs.uib.no) local_host=lcmuk;; 214 # (gate) local_host=neck;; 215 # (gfdl3.yonsei.ac.kr) local_host=decalpha;; 216 # (gfdl5) local_host=ibmy;; 217 # (gwdk081.gwdg.de) local_host=ibm;; 218 # (hreg01a-en0|hreg02a-en0) local_host=ibmh;; 219 # (nobel|nobela) local_host=ibms;; 220 # (tgg*) local_host=lctit;; 221 # (t3e) local_host=t3eh;; 222 # (zam003) local_host=t3ej2;; 223 # (zam005) local_host=t3ej5;; 224 # (*) printf "\n +++ local host \"$local_host_real_name\" not admitted for mbuild \n" 225 # locat=local_host; exit;; 226 # esac 227 228 [[ $local_host_real_name = scirocco ]] && scirocco=true 229 [[ $local_host_real_name = fimm.bccs.uib.no ]] && fimm=true 230 231 232 197 233 if [[ $local_host != ibms ]] 198 234 then … … 214 250 fi 215 251 done < tmp_mbuild 252 216 253 217 254 if [[ "$local_username" = "" ]] … … 673 710 fi 674 711 712 netcdf_inc="" 713 netcdf_lib="" 675 714 676 715 # AUF HLRN-RECHNER NUR EINMAL UEBERSETZEN … … 700 739 netcdf_support=false 701 740 case $remote_host in 702 (lcmuk) remote_addres=130.75.105.3 ; cpp_options=""741 (lcmuk) remote_addres=130.75.105.3 703 742 netcdf_support=true 704 743 if [[ $scirocco = true ]] … … 939 978 940 979 980 # PRAEPROZESSOR-OPTIONEN/DIREKTIVEN ERMITTELN 981 line="" 982 grep "$remote_host_string" $config_file | grep "%cpp_options" > tmp_mbuild 983 while read line1 984 do 985 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 986 then 987 line="$line1" 988 fi 989 done < tmp_mbuild 990 if [[ "$line" = "" || $(echo $line | cut -c1) = "#" ]] 991 then 992 printf "\n +++ no preprocessor options found in configuration file" 993 printf "\n for \"$remote_host_string\" " 994 locat=config_file; exit 995 else 996 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 997 cpp_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 998 fi 999 1000 # RECHNERSPEZIFISCHE CPP-DIREKTIVEN HINZUFUEGEN 1001 for string in $remote_host_string 1002 do 1003 if [[ $(echo $remote_host | cut -c1-2) = lc && $(echo $string | cut -c1-2) = lc ]] 1004 then 1005 cpp_options="$cpp_options -D__lc " 1006 else 1007 cpp_options="$cpp_options -D__$string " 1008 fi 1009 done 1010 1011 1012 1013 # NETCDF-OPTIONEN ERMITTELN 1014 line="" 1015 grep "$remote_host_string" $config_file | grep "%netcdf_inc" > tmp_mbuild 1016 while read line1 1017 do 1018 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 1019 then 1020 line="$line1" 1021 fi 1022 done < tmp_mbuild 1023 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 1024 then 1025 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 1026 netcdf_inc=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 1027 fi 1028 1029 line="" 1030 grep "$remote_host_string" $config_file | grep "%netcdf_lib" > tmp_mbuild 1031 while read line1 1032 do 1033 if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]] 1034 then 1035 line="$line1" 1036 fi 1037 done < tmp_mbuild 1038 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 1039 then 1040 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN 1041 netcdf_lib=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 1042 fi 1043 1044 1045 941 1046 # COMPILEROPTIONEN ERMITTELN 942 1047 line="" … … 957 1062 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN 958 1063 compiler_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 959 fi 1064 1065 # NETCDF-INCLUDEVERZEICHNIS HINZUFUEGEN 1066 compiler_options="$compiler_options $netcdf_inc" 1067 fi 1068 960 1069 if [[ $netcdf_support = true ]] 961 1070 then … … 965 1074 (ibms) compiler_options="-I /applic/netcdf64/src/f90 $compiler_options";; 966 1075 (ibmy) compiler_options="-I ${netcdf_path}/include $compiler_options";; 967 (lcmuk) compiler_options="-I ${netcdf_path}/include $compiler_options";;968 1076 (lctit) compiler_options="-I ${netcdf_path}/include $compiler_options";; 969 1077 (nech|neck) compiler_options="-I ${netcdf_path}/include $compiler_options";; 970 1078 esac 971 1079 fi 972 973 1080 974 1081 … … 992 1099 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN 993 1100 loader_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 994 fi 1101 1102 # NETCDF-LIBRARY HINZUFUEGEN 1103 loader_options="$loader_options $netcdf_lib" 1104 fi 1105 995 1106 if [[ $netcdf_support = true ]] 996 1107 then 997 1108 case $remote_host in 998 (decalpha) 999 (ibmb|ibmh| lcmuk|nech|neck) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;1000 (ibms) 1001 (ibmy) 1002 (lctit) 1109 (decalpha) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1110 (ibmb|ibmh|nech|neck) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1111 (ibms) loader_options="$loader_options -L${netcdf_path} -lnetcdf";; 1112 (ibmy) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1113 (lctit) loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";; 1003 1114 esac 1004 1115 fi -
palm/trunk/SCRIPTS/mrun
r79 r82 114 114 # 29/03/07 - Siggi - global revision transfered to batch job by new 115 115 # option -G 116 # 30/03/07 - Siggi - compilation "by hand" removed, cpp-directives/options 117 # + netcdf/dvrp-options are read from configuration 118 # file, host identifier (local_host) is read from 119 # config file, code related to ftp filetransfer 120 # removed (incl. option -f) 116 121 117 122 … … 135 140 config_file=.mrun.config 136 141 cpp_opts="" 142 cpp_options="" 137 143 cpumax=0 138 144 cpurest=0 … … 148 154 executable="" 149 155 execution_error=false 150 filetransfer_protocol=""151 156 fimm=false 152 157 fname=test … … 172 177 done 173 178 module_files="" 174 MODULE_OPTIONS=""175 179 mrun_script_name=$mc 180 netcdf_inc="" 181 netcdf_lib="" 176 182 netcdf_support=false 177 183 node_usage=default … … 213 219 transfer_problems=false 214 220 usern=$LOGNAME 215 use_makefile=""216 221 working_directory=`pwd` 217 222 TOPT="" … … 335 340 336 341 337 # EVTL. NAMEN DES LOKALEN RECHNERS MIT UEBERGREIFENDEM NAMEN VERSEHEN 338 case $localhost_realname in 339 (atmos) localhost=lcide;; 340 (bora|breva|elephanta|gallego|gregale|hababai|irifi|levanto|maestro|orkan|ostria|poniente|quanero|scirocco|vorias) localhost=lcmuk;; 341 (breg*-en0|berni*-en0) localhost=ibmb; archive_system=tivoli;; 342 (cs*) localhost=nech; archive_system=ut;; 343 (fimm.bccs.uib.no) localhost=lcmuk;; 344 (gate|n-sx) PATH=$PALM_BIN:$PATH:/usr/bin/nqsII; localhost=neck;; 345 (ground.yonsei.ac.kr) localhost=decalpha;; 346 (gfdl3.yonsei.ac.kr) localhost=decalpha;; 347 (gfdl5) localhost=ibmy;; 348 (hreg*-en0|hanni*-en0) localhost=ibmh; archive_system=tivoli;; 349 (nobel*) localhost=ibms;; 350 (sun1|sun2) localhost=unics;; 351 (tgg*) localhost=lctit;; 352 (*) printf "\n +++ Host \"$localhost_realname\" not admitted for mrun \n" 353 locat=localhost; exit;; 354 esac 355 356 [[ $localhost_realname = scirocco ]] && scirocco=true 357 [[ $localhost_realname = fimm.bccs.uib.no ]] && fimm=true 358 359 360 342 361 343 # SHELLSCRIPT-OPTIONEN EINLESEN UND KOMMANDO NEU ZUSAMMENSETZEN, FALLS ES 362 344 # FUER FOLGEJOBS BENOETIGT WIRD 363 while getopts :a:AbBc:Cd:D: f:FG:h:H:i:IkK:m:M:n:o:Op:P:q:r:R:s:St:T:u:U:vxX: option345 while getopts :a:AbBc:Cd:D:FG:h:H:i:IkK:m:M:n:o:Op:P:q:r:R:s:St:T:u:U:vxX: option 364 346 do 365 347 case $option in … … 372 354 (d) fname=$OPTARG; mc="$mc -d$OPTARG";; 373 355 (D) cpp_opts="$cpp_opts $OPTARG"; mc="$mc -D$OPTARG";; 374 (f) filetransfer_protocol=$OPTARG; mc="$mc -f$OPTARG";;375 356 (F) job_on_file="-D"; mc="$mc -F";; 376 357 (G) global_revision=$OPTARG; mc="$mc -G'$OPTARG'";; … … 426 407 printf "\n -d base name of files attached to program test" 427 408 printf "\n -D preprocessor(cpp)-directives \"\" " 428 printf "\n -f filetransfer protocol (ftp or scp) depending on -h"429 409 printf "\n -F create remote job file only ---" 430 410 printf "\n -h execution host $localhost_realname" … … 472 452 473 453 454 455 # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN 456 if [[ ! -f $config_file ]] 457 then 458 printf "\n\n +++ configuration file: " 459 printf "\n $config_file" 460 printf "\n does not exist" 461 locat=connect; exit 462 fi 463 464 465 # HOST-IDENTIFIER (local_host) AUS KONFIGURATIONSDATEI BESTIMMEN 466 line="" 467 grep "%host_identifier" $config_file > tmp_mrun 468 while read line 469 do 470 if [[ "$line" != "" || $(echo $line | cut -c1) != "#" ]] 471 then 472 HOSTNAME=`echo $line | cut -d" " -s -f2` 473 host_identifier=`echo $line | cut -d" " -s -f3` 474 if [[ "$HOSTNAME" = $localhost_realname ]] 475 then 476 localhost=$host_identifier 477 break 478 fi 479 fi 480 done < tmp_mrun 481 482 if [[ "$localhost" = "" ]] 483 then 484 printf "\n\n +++ no host identifier found in configuration file \"$config_file\"" 485 printf "\n for local host \"$localhost_realname\"." 486 printf "\n Please add line" 487 printf "\n \"\%host_identifier $localhost_realname <identifier>\"" 488 printf "\n to the configuration file." 489 locat=localhost; exit 490 fi 491 492 493 494 # HOSTSPEZIFISCHE VARIABLEN SETZEN 495 case $localhost_realname in 496 (breg*-en0|berni*-en0) archive_system=tivoli;; 497 (cs*) archive_system=ut;; 498 (fimm.bccs.uib.no) fimm=true;; 499 (gate|n-sx) PATH=$PALM_BIN:$PATH:/usr/bin/nqsII;; 500 (hreg*-en0|hanni*-en0) archive_system=tivoli;; 501 (scirocco) scirocco=true;; 502 esac 503 504 505 474 506 # BASISNAME DER INPUT-DATEIEN GLEICH ALLGEMEINEM BASISNAMEN SETZEN, 475 507 # WENN NICHT VOM BENUTZER ANDERS BESTIMMT … … 555 587 556 588 557 # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN558 if [[ ! -f $config_file ]]559 then560 printf "\n\n +++ configuration file: "561 printf "\n $config_file"562 printf "\n does not exist"563 locat=connect; exit564 fi565 566 567 589 568 590 # LESEN UND INTERPRETIEREN DER KONFIGURATIONS-DATEI VOM SHELLSCRIPT AUS … … 1030 1052 fi 1031 1053 1032 # DEFAULT-DATEITRANSFER-PROTOKOLL FESTLEGEN1033 if [[ "$filetransfer_protocol" = "" ]]1034 then1035 case $host in1036 (nech|neck|ibm|ibmb|ibmh|ibms|ibmy|lctit) filetransfer_protocol=scp;;1037 (*) filetransfer_protocol=ftp;;1038 esac1039 fi1040 1041 # PRUEFEN, OB ZULAESSIGES DATEITRANSFER-PROTOKOLL GEWAEHLT WURDE1042 if [[ "$filetransfer_protocol" != ftp && "$filetransfer_protocol" != scp ]]1043 then1044 printf "\n"1045 printf "\n +++ illegal value \"$filetransfer_protocol\" for Option -f"1046 printf "\n only \"ftp\" or \"scp\" are allowed"1047 locat=options; exit1048 fi1049 1054 1050 1055 … … 1075 1080 1076 1081 # EVTL. NETCDF-UNTERSTUETZUNG SETZEN 1077 case $host in 1078 (decalpha) netcdf_support=true 1079 netcdf_path=/usr/local/netcdf-3.5.1;; 1080 (ibmb|ibmh) netcdf_support=true 1081 netcdf_path=/aws/dataformats/netcdf-3.6.0-p1/64-32;; 1082 (ibms) netcdf_support=true 1083 netcdf_path=/applic/lib/NETCDF64;; 1084 (ibmy) netcdf_support=true 1085 netcdf_path=/usr1/users/raasch/pub/netcdf-3.6.0-p1;; 1086 (lcmuk) netcdf_support=true 1087 if [[ $scirocco = true ]] 1088 then 1089 netcdf_path=/opt/netcdf/3.6.2-beta4 1090 elif [[ $fimm = true ]] 1091 then 1092 netcdf_path=/local/netcdf 1093 else 1094 netcdf_path=/muksoft/packages/netcdf/linux 1095 fi;; 1096 (lctit) netcdf_support=true 1097 netcdf_path=/home2/usr5/mkanda/netcdf-3.6.2;; 1098 (nech) netcdf_support=true 1099 netcdf_path=/pool/SX-6/netcdf/netcdf-3.6.0-p1;; 1100 (neck) netcdf_support=true 1101 netcdf_path=/home/DSRC/NC/tatuyama/pub/netcdf-3.6.0-p1;; 1102 esac 1082 # case $host in 1083 # (decalpha) netcdf_support=true 1084 # netcdf_path=/usr/local/netcdf-3.5.1;; 1085 # (ibmb|ibmh) netcdf_support=true 1086 # netcdf_path=/aws/dataformats/netcdf-3.6.0-p1/64-32;; 1087 # (ibms) netcdf_support=true 1088 # netcdf_path=/applic/lib/NETCDF64;; 1089 # (ibmy) netcdf_support=true 1090 # netcdf_path=/usr1/users/raasch/pub/netcdf-3.6.0-p1;; 1091 # (lcmuk) if [[ $scirocco = true ]] 1092 # then 1093 # netcdf_path=/opt/netcdf/3.6.2-beta4 1094 # elif [[ $fimm = true ]] 1095 # then 1096 # netcdf_path=/local/netcdf 1097 # else 1098 # netcdf_path=/muksoft/packages/netcdf/linux 1099 # fi;; 1100 # (lctit) netcdf_support=true 1101 # netcdf_path=/home2/usr5/mkanda/netcdf-3.6.2;; 1102 # (nech) netcdf_support=true 1103 # netcdf_path=/pool/SX-6/netcdf/netcdf-3.6.0-p1;; 1104 # (neck) netcdf_support=true 1105 # netcdf_path=/home/DSRC/NC/tatuyama/pub/netcdf-3.6.0-p1;; 1106 # esac 1103 1107 1104 1108 … … 1626 1630 # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN 1627 1631 # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN... 1628 if [[ "$ use_makefile" = true && "$restart_run" != true ]]1632 if [[ "$restart_run" != true ]] 1629 1633 then 1630 1634 [[ "$makefile" = "" ]] && makefile=$source_path/Makefile … … 1632 1636 then 1633 1637 printf "\n +++ file \"$makefile\" does not exist" 1634 printf "\n provide this file or set \"use_makefile=false\" in configuration file\n"1635 1638 locat=make; exit 1636 1639 else … … 1651 1654 if [[ $(echo $localhost | cut -c1-3) = ibm ]] 1652 1655 then 1653 PPOPTS=-Dibm=ibm1656 cpp_options="${cpp_options},-D__ibm=__ibm" 1654 1657 elif [[ $(echo $localhost | cut -c1-3) = nec ]] 1655 1658 then 1656 PPOPTS=-Dnec 1659 cpp_options="$cpp_options -D__nec" 1660 elif [[ $(echo $localhost | cut -c1-2) = lc ]] 1661 then 1662 cpp_options="$cpp_options -D__lc" 1657 1663 else 1658 PPOPTS=-D$localhost1664 cpp_options="$cpp_options -D__$localhost" 1659 1665 fi 1660 1666 if [[ $(echo $localhost | cut -c1-3) = ibm ]] 1661 1667 then 1662 [[ -n $cond1 ]] && PPOPTS="$PPOPTS -D$cond1=$cond1"1663 [[ -n $cond2 ]] && PPOPTS="$PPOPTS -D$cond2=$cond2"1664 if [[ $netcdf_support = true ]]1665 then1666 PPOPTS="$PPOPTS -Dnetcdf=netcdf"1667 [[ $localhost != ibms ]] && PPOPTS="$PPOPTS -Dnetcdf_64bit=netcdf_64bit"1668 fi1669 if [[ $localhost = ibmy ]]1670 then1671 PPOPTS="$PPOPTS -Dibmy_special=ibmy_special"1672 fi1668 [[ -n $cond1 ]] && cpp_options="${cpp_options},-D__$cond1=__$cond1" 1669 [[ -n $cond2 ]] && cpp_options="${cpp_options},-D__$cond2=__$cond2" 1670 # if [[ $netcdf_support = true ]] 1671 # then 1672 # PPOPTS="$PPOPTS -Dnetcdf=netcdf" 1673 # [[ $localhost != ibms ]] && PPOPTS="$PPOPTS -Dnetcdf_64bit=netcdf_64bit" 1674 # fi 1675 # if [[ $localhost = ibmy ]] 1676 # then 1677 # PPOPTS="$PPOPTS -Dibmy_special=ibmy_special" 1678 # fi 1673 1679 else 1674 [[ -n $cond1 ]] && PPOPTS="$PPOPTS -D$cond1"1675 [[ -n $cond2 ]] && PPOPTS="$PPOPTS -D$cond2"1676 if [[ $netcdf_support = true ]]1677 then1678 PPOPTS="$PPOPTS -Dnetcdf"1679 [[ $localhost != decalpha && $localhost != lctit ]] && PPOPTS="$PPOPTS -Dnetcdf_64bit"1680 fi1680 [[ -n $cond1 ]] && cpp_options="$cpp_options -D__$cond1" 1681 [[ -n $cond2 ]] && cpp_options="$cpp_options -D__$cond2" 1682 # if [[ $netcdf_support = true ]] 1683 # then 1684 # PPOPTS="$PPOPTS -Dnetcdf" 1685 # [[ $localhost != decalpha && $localhost != lctit ]] && PPOPTS="$PPOPTS -Dnetcdf_64bit" 1686 # fi 1681 1687 fi 1682 1688 if [[ -n $package_list ]] … … 1688 1694 if [[ $package != "dvrp_graphics+1PE" ]] 1689 1695 then 1690 PPOPTS="$PPOPTS -D$package=$package"1696 cpp_options="${cpp_options},-D__$package=__$package" 1691 1697 else 1692 PPOPTS="$PPOPTS -Ddvrp_graphics"1698 cpp_options="${cpp_options},-D__dvrp_graphics=__dvrp_graphics" 1693 1699 export use_seperate_pe_for_dvrp_output=true 1694 1700 fi … … 1696 1702 if [[ $package != "dvrp_graphics+1PE" ]] 1697 1703 then 1698 PPOPTS="$PPOPTS -D$package"1704 cpp_options="$cpp_options -D__$package" 1699 1705 else 1700 PPOPTS="$PPOPTS -Ddvrp_graphics"1706 cpp_options="$cpp_options -D__dvrp_graphics" 1701 1707 export use_seperate_pe_for_dvrp_output=true 1702 1708 fi … … 1708 1714 for popts in $cpp_opts 1709 1715 do 1710 PPOPTS="$PPOPTS -D$popts" 1716 if [[ $(echo $localhost | cut -c1-3) = ibm ]] 1717 then 1718 cpp_options="${cpp_options},-D__$popts=__$popts" 1719 else 1720 cpp_options="$cpp_options -D__$popts" 1721 fi 1711 1722 done 1712 1723 fi 1713 1724 1714 # -D ARGUMENTEN EINEN DOPPELTEN UNTERSTRICH VORANSTELLEN1715 PPOPTS=`echo " $PPOPTS" | sed 's/ -D/ -D__/g'`1716 1717 1725 # OPTION ZUM EINSCHALTEN DES PRAEPROZESSORS HINZUFUEGEN 1718 if [[ $host = decalpha ]]1719 then1720 C_PPOPTS="-cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION $PPOPTS"1721 elif [[ $(echo $host | cut -c1-3) = ibm ]]1722 then1723 # blanks in PPOPTS muessen durch "," ersetzt werden1724 PPOPTS=`echo $PPOPTS | sed 's/ -/,-/g'`1725 C_PPOPTS="-qsuffix=cpp=f90 -WF,-DMPI_REAL=MPI_DOUBLE_PRECISION,$PPOPTS"1726 elif [[ $host = lcmuk ]]1727 then1728 C_PPOPTS="$PPOPTS -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION"1729 elif [[ $host = lctit ]]1730 then1731 C_PPOPTS="$PPOPTS -Mpreprocess -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION"1732 elif [[ $(echo $host | cut -c1-3) = nec ]]1733 then1734 C_PPOPTS="-Ep -DMPI_REAL=MPI_REAL8 -DMPI_2REAL=MPI_2REAL8 -DSCFFT=dzfft -DCSFFT=zdfft $PPOPTS"1735 else1736 C_PPOPTS="$PPOPTS"1737 fi1726 # if [[ $host = decalpha ]] 1727 # then 1728 # C_PPOPTS="-cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION $PPOPTS" 1729 # elif [[ $(echo $host | cut -c1-3) = ibm ]] 1730 # then 1731 # # blanks in PPOPTS muessen durch "," ersetzt werden 1732 # PPOPTS=`echo $PPOPTS | sed 's/ -/,-/g'` 1733 # C_PPOPTS="-qsuffix=cpp=f90 -WF,-DMPI_REAL=MPI_DOUBLE_PRECISION,$PPOPTS" 1734 # elif [[ $host = lcmuk ]] 1735 # then 1736 # C_PPOPTS="$PPOPTS -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION" 1737 # elif [[ $host = lctit ]] 1738 # then 1739 # C_PPOPTS="$PPOPTS -Mpreprocess -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION" 1740 # elif [[ $(echo $host | cut -c1-3) = nec ]] 1741 # then 1742 # C_PPOPTS="-Ep -DMPI_REAL=MPI_REAL8 -DMPI_2REAL=MPI_2REAL8 -DSCFFT=dzfft -DCSFFT=zdfft $PPOPTS" 1743 # else 1744 # C_PPOPTS="$PPOPTS" 1745 # fi 1738 1746 1739 1747 else … … 1766 1774 if [[ "$compiler_name" = "" ]] 1767 1775 then 1768 case $localhost in 1769 (unics) compiler_name=f77;; 1770 (lcmuk) if [[ "$cond1" = parallel || "$cond2" = parallel ]] 1771 then 1772 compiler_name=mpif90 1773 else 1774 compiler_name=ifc 1775 fi;; 1776 (lctit) if [[ "$cond1" = parallel || "$cond2" = parallel ]] 1777 then 1778 compiler_name=mpif90 1779 echo ">>> compiler=mpif90" 1780 else 1781 compiler_name=pgf95 1782 echo ">>> compiler=pgf95" 1783 fi;; 1784 (nech) compiler_name=sxmpif90;; 1785 (decalpha) compiler_name=f95;; 1786 (ibm|ibmb|ibmh|ibms|ibmy) compiler_name=mpxlf95_r;; 1787 (*) printf "\n +++ unknown host name: $localhost \n"; 1788 locat=localhost; exit;; 1789 esac 1776 1777 printf "\n +++ no compiler specified for \"$localhost $cond1 $cond2\"" 1778 locat=compiler_name; exit 1779 1780 # case $localhost in 1781 # (unics) compiler_name=f77;; 1782 # (lctit) if [[ "$cond1" = parallel || "$cond2" = parallel ]] 1783 # then 1784 # compiler_name=mpif90 1785 # echo ">>> compiler=mpif90" 1786 # else 1787 # compiler_name=pgf95 1788 # echo ">>> compiler=pgf95" 1789 # fi;; 1790 # (nech) compiler_name=sxmpif90;; 1791 # (decalpha) compiler_name=f95;; 1792 # (ibm|ibmb|ibmh|ibms|ibmy) compiler_name=mpxlf95_r;; 1793 # (*) printf "\n +++ unknown host name: $localhost \n"; 1794 # locat=localhost; exit;; 1795 # esac 1790 1796 fi 1791 1797 … … 1846 1852 1847 1853 # COMPILE- UND LINK-OPTIONEN BESTIMMEN 1848 FOPTS="$fopts"1849 LOPTS="$lopts"1854 fopts="$fopts $netcdf_inc $dvrp_inc" 1855 lopts="$lopts $netcdf_lib $dvrp_lib" 1850 1856 ROPTS="$ropts" 1851 1857 if [[ ( $(echo $host | cut -c1-3) = nec || $(echo $host | cut -c1-3) = ibm || $host = lctit ) && -n $numprocs ]] … … 1857 1863 # BEI VERWENDUNG VON DVRP-SOFTWARE MUSS ENTSPECHENDE GRAFIK-BIBLIOTHEK 1858 1864 # MIT EINGEBUNDEN WERDEN 1859 if [[ -n $package_list ]]1860 then1861 if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]]1862 then1863 1864 # DVRP-GRAFIK GIBT ES NUR AUF DER IBM AM HLRN, AUF NECH/NECK UND1865 # DEM NOTEBOOK SCIROCCO1866 if [[ $host != ibmh && $host != nech && $host != neck && $host != lcmuk && "$local_compile" != true ]]1867 then1868 printf "\n"1869 printf "\n +++ option -p with package \"dvrp_graphics\" only allowed on nech and ibmh"1870 locat=parameter; exit1871 fi1872 if [[ $host = ibmh ]]1873 then1874 if [[ $cond1 = debug || $cond2 = debug ]]1875 then1876 FOPTS="-I/home/h/hzazchmi/lib/debug $FOPTS"1877 LOPTS="$LOPTS-L/home/h/hzazchmi/lib/debug -lDVRP2 -lftp"1878 else1879 FOPTS="-I/home/h/nikevita/lib_stable/optimize $FOPTS"1880 LOPTS="$LOPTS-L/home/h/nikevita/lib_stable/optimize -lDVRP2 -lftp"1881 fi1882 elif [[ $host = nech ]]1883 then1884 FOPTS="-I/import/ds9b/ipf2/b/b323014/lib/optimize $FOPTS"1885 LOPTS="$LOPTS-L/import/ds9b/ipf2/b/b323014/lib/optimize -lDVRP2 -lftp"1886 elif [[ $host = neck ]]1887 then1888 FOPTS="-I/home/DSRC/NC/tatuyama/pub/dvrp $FOPTS"1889 LOPTS="$LOPTS-L/home/DSRC/NC/tatuyama/pub/dvrp -lDVRP2 -lftp"1890 elif [[ $host = lcmuk ]]1891 then1892 FOPTS="-I/usr/local/lib/dvrp/optimize $FOPTS"1893 LOPTS="$LOPTS-L/usr/local/lib/dvrp/optimize -lDVRP2 -lftp"1894 fi1895 fi1896 fi1865 # if [[ -n $package_list ]] 1866 # then 1867 # if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] 1868 # then 1869 # 1870 # # DVRP-GRAFIK GIBT ES NUR AUF DER IBM AM HLRN, AUF NECH/NECK UND 1871 # # DEM NOTEBOOK SCIROCCO 1872 # if [[ $host != ibmh && $host != nech && $host != neck && $host != lcmuk && "$local_compile" != true ]] 1873 # then 1874 # printf "\n" 1875 # printf "\n +++ option -p with package \"dvrp_graphics\" only allowed on nech and ibmh" 1876 # locat=parameter; exit 1877 # fi 1878 # if [[ $host = ibmh ]] 1879 # then 1880 # if [[ $cond1 = debug || $cond2 = debug ]] 1881 # then 1882 # fopts="-I/home/h/hzazchmi/lib/debug $fopts" 1883 # lopts="$lopts -L/home/h/hzazchmi/lib/debug -lDVRP2 -lftp" 1884 # else 1885 # fopts="-I/home/h/nikevita/lib_stable/optimize $fopts" 1886 # lopts="$lopts -L/home/h/nikevita/lib_stable/optimize -lDVRP2 -lftp" 1887 # fi 1888 # elif [[ $host = nech ]] 1889 # then 1890 # fopts="-I/import/ds9b/ipf2/b/b323014/lib/optimize $fopts" 1891 # lopts="$lopts -L/import/ds9b/ipf2/b/b323014/lib/optimize -lDVRP2 -lftp" 1892 # elif [[ $host = neck ]] 1893 # then 1894 # fopts="-I/home/DSRC/NC/tatuyama/pub/dvrp $fopts" 1895 # lopts="$lopts -L/home/DSRC/NC/tatuyama/pub/dvrp -lDVRP2 -lftp" 1896 # elif [[ $host = lcmuk ]] 1897 # then 1898 # fopts="-I/usr/local/lib/dvrp/optimize $fopts" 1899 # lopts="$lopts -L/usr/local/lib/dvrp/optimize -lDVRP2 -lftp" 1900 # fi 1901 # fi 1902 # fi 1897 1903 1898 1904 1899 1905 # EVTL. EINBINDEN DER NETCDF-BIBLIOTHEK 1900 if [[ $netcdf_support = true ]]1901 then1902 case $host in1903 (decalpha) FOPTS="-I${netcdf_path}/include $FOPTS"1904 LOPTS="$LOPTS-L${netcdf_path}/lib -lnetcdf";;1905 (ibmb|ibmh) FOPTS="-I ${netcdf_path}/include-64 $FOPTS"1906 LOPTS="$LOPTS-L${netcdf_path}/lib -lnetcdf";;1907 (ibms) FOPTS="-I /applic/netcdf64/src/f90 $FOPTS"1908 LOPTS="$LOPTS-L${netcdf_path} -lnetcdf";;1909 (ibmy) FOPTS="-I ${netcdf_path}/include $FOPTS"1910 LOPTS="$LOPTS-L${netcdf_path}/lib -lnetcdf";;1911 (lcmuk|nech|neck) FOPTS="-I ${netcdf_path}/include $FOPTS"1912 LOPTS="$LOPTS-L${netcdf_path}/lib -lnetcdf";;1913 (lctit) FOPTS="-I ${netcdf_path}/include $FOPTS"1914 LOPTS="$LOPTS-L${netcdf_path}/lib -lnetcdf";;1915 1916 esac1917 fi1906 # if [[ $netcdf_support = true ]] 1907 # then 1908 # case $host in 1909 # (decalpha) fopts="-I${netcdf_path}/include $fopts" 1910 # lopts="$lopts -L${netcdf_path}/lib -lnetcdf";; 1911 # (ibmb|ibmh) fopts="-I ${netcdf_path}/include-64 $fopts" 1912 # lopts="$lopts -L${netcdf_path}/lib -lnetcdf";; 1913 # (ibms) fopts="-I /applic/netcdf64/src/f90 $fopts" 1914 # lopts="$lopts -L${netcdf_path} -lnetcdf";; 1915 # (ibmy) fopts="-I ${netcdf_path}/include $fopts" 1916 # lopts="$lopts -L${netcdf_path}/lib -lnetcdf";; 1917 # (nech|neck) fopts="-I ${netcdf_path}/include $fopts" 1918 # lopts="$lopts -L${netcdf_path}/lib -lnetcdf";; 1919 # (lctit) fopts="-I ${netcdf_path}/include $fopts" 1920 # lopts="$lopts -L${netcdf_path}/lib -lnetcdf";; 1921 # 1922 # esac 1923 # fi 1918 1924 1919 1925 # PRUEFEN DER CPU-ZEIT. (CPUMAX WIRD ALS ENV-VARIABLE VOM HAUTPRO- … … 2014 2020 if [[ $do_compile = true ]] 2015 2021 then 2016 spalte1=cpp-directives:; spalte2=$ C_PPOPTS2022 spalte1=cpp-directives:; spalte2=$cpp_options 2017 2023 printf "| $spalte1$spalte2 | \n" 2018 zeile=$(echo "$ C_PPOPTS" | cut -c41-)2024 zeile=$(echo "$cpp_options" | cut -c41-) 2019 2025 while [[ "$zeile" != "" ]] 2020 2026 do … … 2025 2031 done 2026 2032 2027 spalte1=compiler-options:; spalte2="$ FOPTS $MODULE_OPTIONS"2033 spalte1=compiler-options:; spalte2="$fopts" 2028 2034 printf "| $spalte1$spalte2 | \n" 2029 zeile=$(echo "$ FOPTS $MODULE_OPTIONS" | cut -c41-)2035 zeile=$(echo "$fopts" | cut -c41-) 2030 2036 while [[ "$zeile" != "" ]] 2031 2037 do … … 2036 2042 done 2037 2043 2038 spalte1=linker-options:; spalte2=$ LOPTS2044 spalte1=linker-options:; spalte2=$lopts 2039 2045 printf "| $spalte1$spalte2 | \n" 2040 zeile=$(echo "$ LOPTS" | cut -c41-)2046 zeile=$(echo "$lopts" | cut -c41-) 2041 2047 while [[ "$zeile" != "" ]] 2042 2048 do … … 2049 2055 spalte1="main program":; spalte2=$mainprog 2050 2056 printf "| $spalte1$spalte2 | \n" 2051 if [[ "$use_makefile" = true ]]2052 then2053 spalte1="using \"make\" for com"; spalte2="piling and linking"2054 printf "| $spalte1$spalte2 | \n"2055 fi2056 # if [[ $vtk_graphics = true ]]2057 # then2058 # spalte1=""; spalte2="wird in C++ - Programm eingebunden (vtk)"2059 # printf "| $spalte1$spalte2 | \n"2060 # fi2061 2057 else 2062 2058 spalte1=executable:; spalte2=$executable … … 2212 2208 fi 2213 2209 2214 if [[ "$use_makefile" = true ]] 2215 then 2216 2217 # PFADNAMEN FUER DAS MAKE-DEPOSITORY ERMITTELN 2218 line="" 2219 grep "%depository_path" $config_file > tmp_mrun 2220 while read line 2221 do 2222 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 2223 then 2224 if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]] 2225 then 2226 global_depository_path=`echo $line | cut -d" " -s -f2` 2227 fi 2228 fi 2229 done < tmp_mrun 2230 2231 line="" 2232 grep " $localhost" $config_file | grep "%depository_path" > tmp_mrun 2233 while read line 2234 do 2235 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 2236 then 2237 local_depository_path=`echo $line | cut -d" " -s -f2` 2238 fi 2239 done < tmp_mrun 2240 2241 if [[ "$local_depository_path" = "" ]] 2242 then 2243 if [[ "$global_depository_path" != "" ]] 2244 then 2245 local_depository_path=$global_depository_path 2246 else 2247 printf "\n\n +++ no depository path found in configuration file" 2248 printf "\n for local host \"$localhost\" " 2249 printf "\n please set \"\%depository_path\" in configuration file\n" 2250 locat=config_file; exit 2251 fi 2252 fi 2253 eval local_depository_path=$local_depository_path 2254 2255 basename=`print $mainprog | cut -f1 -d"."` 2256 eval make_depository=${local_depository_path}/${basename}_current_version.tar 2257 if [[ ! -f $make_depository ]] 2258 then 2259 printf "\n" 2260 printf "\n *** WARNING: make depository \"$make_depository\" not found" 2261 printf "\n \"make\" will fail, if the Makefile or other source files are missing\n" 2210 2211 # PFADNAMEN FUER DAS MAKE-DEPOSITORY ERMITTELN 2212 line="" 2213 grep "%depository_path" $config_file > tmp_mrun 2214 while read line 2215 do 2216 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 2217 then 2218 if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]] 2219 then 2220 global_depository_path=`echo $line | cut -d" " -s -f2` 2221 fi 2222 fi 2223 done < tmp_mrun 2224 2225 line="" 2226 grep " $localhost" $config_file | grep "%depository_path" > tmp_mrun 2227 while read line 2228 do 2229 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 2230 then 2231 local_depository_path=`echo $line | cut -d" " -s -f2` 2232 fi 2233 done < tmp_mrun 2234 2235 if [[ "$local_depository_path" = "" ]] 2236 then 2237 if [[ "$global_depository_path" != "" ]] 2238 then 2239 local_depository_path=$global_depository_path 2262 2240 else 2263 cp $make_depository $TEMPDIR_COMPILE 2264 cd $TEMPDIR_COMPILE 2265 tar -xf $make_depository > /dev/null 2>&1 2266 cd - > /dev/null 2267 fi 2268 2269 cp SOURCES_FOR_RUN_$fname/* $TEMPDIR_COMPILE 2270 2271 # FALLS USER-INTERFACE VORHANDEN UND AUF DATEI MIT ANDEREM NAMEN 2272 # ALS user_interface.f90 LIEGT, DIESEN GEAENDERTEN NAMEN INS 2273 # MAKEFILE EINTRAGEN 2241 printf "\n\n +++ no depository path found in configuration file" 2242 printf "\n for local host \"$localhost\" " 2243 printf "\n please set \"\%depository_path\" in configuration file\n" 2244 locat=config_file; exit 2245 fi 2246 fi 2247 eval local_depository_path=$local_depository_path 2248 2249 basename=`print $mainprog | cut -f1 -d"."` 2250 eval make_depository=${local_depository_path}/${basename}_current_version.tar 2251 if [[ ! -f $make_depository ]] 2252 then 2253 printf "\n" 2254 printf "\n *** WARNING: make depository \"$make_depository\" not found" 2255 printf "\n \"make\" will fail, if the Makefile or other source files are missing\n" 2256 else 2257 cp $make_depository $TEMPDIR_COMPILE 2274 2258 cd $TEMPDIR_COMPILE 2275 interface_file=`grep -l "END SUBROUTINE user_parin" $source_list` 2276 if [[ "$interface_file" != "" ]] 2277 then 2278 interface_file=`echo $interface_file | cut -d"." -f1` 2279 mv Makefile Makefile_old 2280 sed "s/user_interface/$interface_file/g" Makefile_old > Makefile 2281 fi 2259 tar -xf $make_depository > /dev/null 2>&1 2282 2260 cd - > /dev/null 2283 2261 fi 2262 2263 cp SOURCES_FOR_RUN_$fname/* $TEMPDIR_COMPILE 2264 2265 # FALLS USER-INTERFACE VORHANDEN UND AUF DATEI MIT ANDEREM NAMEN 2266 # ALS user_interface.f90 LIEGT, DIESEN GEAENDERTEN NAMEN INS 2267 # MAKEFILE EINTRAGEN 2268 cd $TEMPDIR_COMPILE 2269 interface_file=`grep -l "END SUBROUTINE user_parin" $source_list` 2270 if [[ "$interface_file" != "" ]] 2271 then 2272 interface_file=`echo $interface_file | cut -d"." -f1` 2273 mv Makefile Makefile_old 2274 sed "s/user_interface/$interface_file/g" Makefile_old > Makefile 2275 fi 2276 cd - > /dev/null 2284 2277 else 2285 2278 cp $executable ${TEMPDIR}/a.out … … 2315 2308 2316 2309 # COMPILING WITH MAKE (ON NEC COMPILER IS CALLED ON HOST CROSS) 2317 if [[ "$use_makefile" = true ]] 2318 then 2319 printf "\n\n\n *** compilation starts \n$striche\n" 2320 printf " *** compilation with make using following options:\n" 2321 printf " compilername: $compiler_name\n" 2322 printf " options: $FOPTS\n" 2323 printf " preprocessor-directives: $C_PPOPTS \n" 2324 printf " linker-options: $LOPTS \n" 2325 printf " source code files: $source_list \n" 2326 2327 if [[ $localhost = nech ]] 2328 then 2329 ssh 136.172.44.192 -l $usern ". /SX/opt/etc/initsx.sh; cd \$HOME/work/${usern}.$kennung; sxmake -f Makefile PROG=a.out F90=$compiler_name COPT=\"$C_PPOPTS\" F90FLAGS=\"$FOPTS\" LDFLAGS=\"$LOPTS\" " 2330 cp $TEMPDIR_COMPILE/a.out . 2331 [[ $? != 0 ]] && compile_error=true 2332 rm -rf $TEMPDIR_COMPILE 2333 else 2334 make -f Makefile PROG=a.out F90=$compiler_name COPT="$C_PPOPTS" F90FLAGS="$FOPTS" LDFLAGS="$LOPTS" 2335 fi 2336 2337 # UEBERSETZUNG "VON HAND" (OHNE MAKE) 2310 printf "\n\n\n *** compilation starts \n$striche\n" 2311 printf " *** compilation with make using following options:\n" 2312 printf " compilername: $compiler_name\n" 2313 printf " options: $fopts\n" 2314 printf " preprocessor-directives: $cpp_options \n" 2315 printf " linker-options: $lopts \n" 2316 printf " source code files: $source_list \n" 2317 2318 if [[ $localhost = nech ]] 2319 then 2320 ssh 136.172.44.192 -l $usern ". /SX/opt/etc/initsx.sh; cd \$HOME/work/${usern}.$kennung; sxmake -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " 2321 cp $TEMPDIR_COMPILE/a.out . 2322 [[ $? != 0 ]] && compile_error=true 2323 rm -rf $TEMPDIR_COMPILE 2338 2324 else 2339 2340 2341 # UEBERSETZUNG DER QUELLTEXT-DATEIEN UND DES HAUPTPROGRAMMS 2342 # $CPPOPTS FUER CPP-PRAEPROZESSOR WURDEN OBEN BESTIMMT 2343 printf "\n\n\n *** compilation starts \n$striche\n" 2344 2345 2346 # VORWEG EVTL. UEBERSETZUNG VON PROGRAMMTEILEN MIT SPEZIELLEN 2347 # COMPILERN UND/ODER COMPILEROPTIONEN. DIESE WERDEN BEI DER SPAETEREN 2348 # EIGENTLICHEN UEBERSETZUNG ALS OBJECT-FILES EINGEBUNDEN 2349 new_source_list="" 2350 for filename in $source_list 2351 do 2352 2353 basename=`print $filename | cut -f1 -d"."` 2354 2355 # EVTL. SPEZIELLEN COMPILER FUER UP BESTIMMEN 2356 comp_var=$(eval echo \$comp_$basename) # \$ liefert evtl. fuer source alternativ vereinbarten Compiler 2357 comp_opt_var=$(eval echo \$$basename) # \$$ liefert evtl. fuer source vereinbarte Compiler-Environment-Variable 2358 2359 if [[ "$comp_var" = "" && "$comp_opt_var" = "" ]] 2360 then 2361 new_source_list="$new_source_list "$filename 2362 else 2363 2364 if [[ "$comp_var" = "" ]] 2365 then 2366 SPECIAL_COMPILER=$compiler_name 2367 else 2368 SPECIAL_COMPILER=$comp_var 2369 fi 2370 2371 if [[ "$comp_opt_var" = "" ]] 2372 then 2373 SPECIAL_FOPTS=$FOPTS 2374 else 2375 SPECIAL_FOPTS="$parallel_options $(eval echo \$$comp_opt_var)" 2376 fi 2377 2378 printf " *** compiling of $filename with special compiler call: $SPECIAL_COMPILER $CPPOPTS -c $SPECIAL_FOPTS \n" 2379 $SPECIAL_COMPILER $C_PPOPTS -c $SPECIAL_FOPTS $MODULE_OPTIONS $filename 2380 if [[ $? != 0 ]] 2381 then 2382 printf "\n +++ compiling error occured" 2383 locat=compile 2384 exit 2385 fi 2386 new_source_list="$new_source_list "${basename}.o 2387 fi 2388 done 2389 source_list="$new_source_list" 2390 2391 2392 # EIGENTLICHE UEBERSETZUNG MIT DEN NORMALEN OPTIONEN 2393 printf " *** compilation with standard options: $compiler_name $FOPTS $MODULE_OPTIONS \n" 2394 printf " preprocessor-directives: $C_PPOPTS \n" 2395 printf " linker-options: $LOPTS \n" 2396 printf " source code files: $source_list \n" 2397 2398 $compiler_name $C_PPOPTS $FOPTS $MODULE_OPTIONS $LOPTS $source_list 2399 2400 fi 2325 make -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" 2326 fi 2327 2401 2328 if [[ $? != 0 || "$compile_error" = true || "$module_compile_error" = true ]] 2402 2329 then … … 2907 2834 2908 2835 fi 2909 elif [[ $ host = lcmuk]]2836 elif [[ $(echo $host | cut -c1-2) = lc && $host != lctit ]] 2910 2837 then 2911 2838 … … 3106 3033 echo "set -x" > transfer_${localout[$i]} 3107 3034 echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} 3108 if [[ $filetransfer_protocol = ftp ]] 3109 then 3110 if [[ $files_for_pes = true ]] 3111 then 3112 printf "\n +++ WARNING: no transfer of catalogs via ftpcopy\n" 3113 fi 3114 printf "\n >>> OUTPUT: ${localout[$i]} by FTP in seperate job to" 3115 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" 3116 printf "\n or higher cycle\n" 3117 echo "ftpcopy -b -m $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3118 else 3119 printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP in seperate job to" 3120 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst" 3121 printf "\n or higher cycle\n" 3122 echo "batch_scp $cps -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3123 fi 3035 3036 printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP in seperate job to" 3037 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst" 3038 printf "\n or higher cycle\n" 3039 echo "batch_scp $cps -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3040 3124 3041 echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} 3125 3042 3126 3043 if [[ $localhost = nech ]] 3127 3044 then 3128 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 -f $filetransfer_protocoltransfer_${localout[$i]}3045 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 transfer_${localout[$i]} 3129 3046 else 3130 3047 if [[ "$LOGNAME" = b323013 ]] 3131 3048 then 3132 subjob -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocoltransfer_${localout[$i]}3049 subjob -v -q c1 -X 0 -m 1000 -t 900 transfer_${localout[$i]} 3133 3050 else 3134 subjob -d -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocoltransfer_${localout[$i]}3051 subjob -d -v -q c1 -X 0 -m 1000 -t 900 transfer_${localout[$i]} 3135 3052 fi 3136 3053 fi … … 3140 3057 # TRANSFER INNERHALB DIESES JOBS 3141 3058 transfer_failed=false 3142 if [[ $filetransfer_protocol = ftp ]] 3143 then 3144 if [[ $files_for_pes = true ]] 3145 then 3146 printf "\n +++ WARNING: no transfer of catalogs via ftpcopy\n" 3147 fi 3148 printf "\n >>> OUTPUT: ${localout[$i]} by FTP to" 3149 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" 3150 ftpcopy -b -m $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3151 [[ $? != 0 ]] && transfer_failed=true 3152 else 3153 printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP to" 3154 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n" 3155 batch_scp $cps -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3156 [[ $? != 0 ]] && transfer_failed=true 3157 fi 3059 printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP to" 3060 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n" 3061 batch_scp $cps -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3062 [[ $? != 0 ]] && transfer_failed=true 3158 3063 3159 3064 # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF … … 3203 3108 echo "set -x" > transfer_${localout[$i]} 3204 3109 echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} 3205 if [[ $filetransfer_protocol = ftp ]] 3206 then 3207 printf "\n >>> OUTPUT: ${localout[$i]} append by FTP in seperate job to" 3208 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" 3209 printf "\n or higher cycle\n" 3210 echo "ftpcopy -A -b -m $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3211 else 3212 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP in seperate job to" 3213 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" 3214 printf "\n or higher cycle\n" 3215 echo "batch_scp -A -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3216 fi 3110 3111 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP in seperate job to" 3112 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" 3113 printf "\n or higher cycle\n" 3114 echo "batch_scp -A -b -m -u $return_username $return_addres $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} 3115 3217 3116 echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} 3218 3117 3219 3118 if [[ $localhost = nech ]] 3220 3119 then 3221 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 -f $filetransfer_protocoltransfer_${localout[$i]}3120 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 900 transfer_${localout[$i]} 3222 3121 else 3223 3122 if [[ $LOGNAME = b323013 ]] 3224 3123 then 3225 subjob -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocoltransfer_${localout[$i]}3124 subjob -v -q c1 -X 0 -m 1000 -t 900 transfer_${localout[$i]} 3226 3125 else 3227 subjob -d -v -q c1 -X 0 -m 1000 -t 900 -f $filetransfer_protocoltransfer_${localout[$i]}3126 subjob -d -v -q c1 -X 0 -m 1000 -t 900 transfer_${localout[$i]} 3228 3127 fi 3229 3128 fi … … 3233 3132 # TRANSFER INNERHALB DIESES JOBS 3234 3133 transfer_failed=false 3235 if [[ $filetransfer_protocol = ftp ]] 3236 then 3237 printf "\n >>> OUTPUT: ${localout[$i]} append by FTP to" 3238 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" 3239 ftpcopy -A -b -m $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3240 [[ $? != 0 ]] && transfer_failed=true 3241 else 3242 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to" 3243 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" 3244 batch_scp -A -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3245 [[ $? != 0 ]] && transfer_failed=true 3246 fi 3134 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to" 3135 printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" 3136 batch_scp -A -b -m -u $return_username $return_addres ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} 3137 [[ $? != 0 ]] && transfer_failed=true 3247 3138 3248 3139 # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF … … 3413 3304 if [[ $localhost = ibmh || $localhost = ibmb ]] 3414 3305 then 3415 subjob -d -v -q cdata -X 0 -m 1000 -t 7200 -f $filetransfer_protocolarchive_${frelout[$i]}3306 subjob -d -v -q cdata -X 0 -m 1000 -t 7200 archive_${frelout[$i]} 3416 3307 elif [[ $localhost = nech ]] 3417 3308 then 3418 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 7200 -f $filetransfer_protocolarchive_${frelout[$i]}3309 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 7200 archive_${frelout[$i]} 3419 3310 fi 3420 3311 printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" … … 3537 3428 fi 3538 3429 3539 subjob -v -d -q cdata -X 0 -m 1000 -t 7200 -f $filetransfer_protocolarchive_${frelout[$i]}3430 subjob -v -d -q cdata -X 0 -m 1000 -t 7200 archive_${frelout[$i]} 3540 3431 printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" 3541 3432 file_saved=true … … 3571 3462 fi 3572 3463 3573 subjob -v -c /pf/b/$usern/job_queue -d -q pp -X 0 -m 1000 -t 7200 -f $filetransfer_protocolarchive_${frelout[$i]}3464 subjob -v -c /pf/b/$usern/job_queue -d -q pp -X 0 -m 1000 -t 7200 archive_${frelout[$i]} 3574 3465 printf " Archiving of $tmp_data_catalog/${frelout[$i]} initiated (batch job submitted)\n" 3575 3466 file_saved=true … … 3754 3645 3755 3646 # MRUN-BEFEHL FUER REMOTE-MASCHINE ZUSAMMENSTELLEN 3756 mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname - f $filetransfer_protocol -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_addres -U $return_username -u $remote_username"3647 mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_addres -U $return_username -u $remote_username" 3757 3648 [[ "$cpp_opts" != "" ]] && mrun_com=${mrun_com}" -D \"$cpp_opts\"" 3758 3649 [[ "$global_revision" != "" ]] && mrun_com=${mrun_com}" -G \"$global_revision\"" … … 3827 3718 done 3828 3719 3829 if [[ "$use_makefile" = true ]] 3830 then 3831 # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN 3832 echo "cat > Makefile << \"%END%\"" >> $jobfile 3833 cat $source_catalog/Makefile >> $jobfile 3834 echo " " >> $jobfile 3835 echo "%END%" >> $jobfile 3836 echo " " >> $jobfile 3837 fi 3720 # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN 3721 echo "cat > Makefile << \"%END%\"" >> $jobfile 3722 cat $source_catalog/Makefile >> $jobfile 3723 echo " " >> $jobfile 3724 echo "%END%" >> $jobfile 3725 echo " " >> $jobfile 3838 3726 3839 3727 echo "cd - > /dev/null" >> $jobfile … … 3882 3770 echo "%END%" >> $jobfile 3883 3771 else 3884 if [[ $filetransfer_protocol = ftp ]] 3885 then 3886 echo "ftpcopy -b -o -g -s $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile 3887 else 3888 echo "batch_scp -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile 3889 fi 3772 echo "batch_scp -b -o -g -s -u $return_username $return_addres ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile 3890 3773 fi 3891 3774 … … 3936 3819 fi 3937 3820 3938 subjob $job_on_file -h $host -u $remote_username -q $queue -m $memory -N $node_usage -t $cpumax $XOPT $TOPT $OOPT -n $fname - f $filetransfer_protocol -v $jobfile3821 subjob $job_on_file -h $host -u $remote_username -q $queue -m $memory -N $node_usage -t $cpumax $XOPT $TOPT $OOPT -n $fname -v $jobfile 3939 3822 rm -rf $jobfile 3940 3823 -
palm/trunk/SCRIPTS/subjob
r69 r82 1 1 #!/bin/ksh 2 # subjob - Plot-Shellskript Version: @(#)SUBJOB 1.0 13/02/072 # subjob - Plot-Shellskript Version: @(#)SUBJOB 1.0 3 3 # $Id: subjob 54 2007-03-08 00:00:02Z raasch $ 4 4 … … 81 81 # 13/02/07 - Siggi - hpmuk releated code removed 82 82 # 01/03/07 - Siggi - adjustments for RIAM machines gate and NEC-SX8 (n-sx) 83 # 12/04/07 - Siggi - option -f (filetransfer protocol) removed, scp only 83 84 84 85 85 86 # VARIABLENVEREINBARUNGEN + DEFAULTWERTE 86 87 delete_dayfile=false 87 filetransfer_protocol=scp88 88 locat=normal 89 89 no_default_queue=none … … 180 180 181 181 # PROZEDUROPTIONEN EINLESEN 182 while getopts :c:dD f:h:m:n:N:O:q:t:T:u:vX: option182 while getopts :c:dDh:m:n:N:O:q:t:T:u:vX: option 183 183 do 184 184 case $option in … … 186 186 (d) delete_dayfile=true;; 187 187 (D) no_submit=true;; 188 (f) filetransfer_protocol=$OPTARG;;189 188 (h) remote_host=$OPTARG;; 190 189 (m) memory=$OPTARG;; … … 218 217 printf "\n -d no job-protocol will be created ---" 219 218 printf "\n -D only the job-file will be created ---" 220 printf "\n -f filetransfer protocol scp"221 219 printf "\n -h execution host, available hosts: $remote_host" 222 220 printf "\n ibm, ibmb, ibmh, ibms, ibmy, lcmuk," … … 897 895 then 898 896 [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." 899 if [[ $filetransfer_protocol = scp ]] 900 then 901 if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" 902 then 903 job_catalog_save=$job_catalog 904 job_catalog=job_queue 905 elif [[ $remote_host = nech ]] 906 then 907 job_catalog_save=$job_catalog 908 job_catalog=/hpf/b/${remote_user}/job_queue 909 fi 910 if [[ $local_host = decalpha ]] 911 then 912 # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE 913 # PASSWORT AB 914 /bin/scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 915 elif [[ $remote_host = nech ]] 916 then 917 # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ 918 # TRANSFERIERT WERDEN 919 scp $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost 920 else 921 scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 922 fi 923 if [[ $? = 1 ]] 924 then 925 locat=scp; exit 926 fi 927 if [[ $remote_host = ibms ]] 928 then 929 job_catalog=$job_catalog_save 930 fi 897 if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" 898 then 899 job_catalog_save=$job_catalog 900 job_catalog=job_queue 901 elif [[ $remote_host = nech ]] 902 then 903 job_catalog_save=$job_catalog 904 job_catalog=/hpf/b/${remote_user}/job_queue 905 fi 906 if [[ $local_host = decalpha ]] 907 then 908 # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE 909 # PASSWORT AB 910 /bin/scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 911 elif [[ $remote_host = nech ]] 912 then 913 # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ 914 # TRANSFERIERT WERDEN 915 scp $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost 931 916 else 932 ftpcopy -s -o $remote_addres $job_to_send "$job_catalog" $job_on_remhost 933 if [[ $? = 1 ]] 934 then 935 locat=ftpcopy; exit 936 fi 917 scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost 918 fi 919 if [[ $? = 1 ]] 920 then 921 locat=scp; exit 922 fi 923 if [[ $remote_host = ibms ]] 924 then 925 job_catalog=$job_catalog_save 937 926 fi 938 927 [[ $verify = true ]] && printf "\n >>> finished\n" … … 948 937 then 949 938 [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" 950 if [[ $filetransfer_protocol = scp ]] 951 then 952 if [[ $remote_host != lctit ]] 953 then 954 ssh $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" 955 else 956 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS 957 # MIT SSH, DESHALB AUFRUF PER PIPE 958 # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR 959 print "cd $job_catalog; chmod u+x $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 960 echo "first try" > send_protocol 961 while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]] 962 do 963 if [[ $(cat send_protocol | grep -c "first try") = 1 ]] 964 then 965 printf "\n trying to submit job to TIT cluster..." 966 else 967 printf "\n +++ failed ... trying to submit again ..." 968 fi 969 print "cd $job_catalog; $submcom $job_on_remhost" | ssh $remote_addres -l $remote_user > send_protocol 2>&1 970 cat send_protocol 971 done 972 sleep 10 973 print "cd $job_catalog; rm $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 974 echo "$submcom $job_on_remhost" 975 rm send_protocol 976 fi 939 if [[ $remote_host != lctit ]] 940 then 941 ssh $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" 977 942 else 978 if [[ $remote_host = ibms ]] 979 then 980 password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'` 981 echo "echo \"$remote_user\" " > telnet_script 982 echo "sleep 5" >> telnet_script 983 echo "echo \"$password\" " >> telnet_script 984 echo "sleep 10" >> telnet_script 985 echo "echo \"\" " >> telnet_script 986 echo "sleep 2" >> telnet_script 987 echo "echo \"cd $job_catalog; $submcom $job_on_remhost; rm -rf $job_on_remhost\" " >> telnet_script 988 echo "sleep 10" >> telnet_script 989 echo "echo \"exit\" " >> telnet_script 990 991 chmod u+x telnet_script 992 telnet_script | telnet $remote_addres 2>&1 | grep "llsubmit:" 993 rm telnet_script 994 elif [[ $remote_host = t3es ]] 995 then 996 password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'` 997 echo "printf \"$remote_user\\\n\" " > telnet_script 998 echo "sleep 10" >> telnet_script 999 echo "printf \"$password\\\n\" " >> telnet_script 1000 echo "sleep 10" >> telnet_script 1001 echo "printf \"\\\n\" " >> telnet_script 1002 echo "sleep 5" >> telnet_script 1003 echo "printf \"\\\n\" " >> telnet_script 1004 echo "sleep 5" >> telnet_script 1005 echo "printf \"cd $job_catalog; $submcom $job_on_remhost; rm -f $job_on_remhost\\\n\" " >> telnet_script 1006 echo "sleep 10" >> telnet_script 1007 echo "printf \"exit\\\n\" " >> telnet_script 1008 1009 chmod u+x telnet_script 1010 cat telnet_script 1011 telnet_script | telnet $remote_addres | grep $remote_user 1012 rm telnet_script 1013 else 1014 remcom.x $remote_addres "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" 1015 fi 1016 fi 943 # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS 944 # MIT SSH, DESHALB AUFRUF PER PIPE 945 # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR 946 print "cd $job_catalog; chmod u+x $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 947 echo "first try" > send_protocol 948 while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]] 949 do 950 if [[ $(cat send_protocol | grep -c "first try") = 1 ]] 951 then 952 printf "\n trying to submit job to TIT cluster..." 953 else 954 printf "\n +++ failed ... trying to submit again ..." 955 fi 956 print "cd $job_catalog; $submcom $job_on_remhost" | ssh $remote_addres -l $remote_user > send_protocol 2>&1 957 cat send_protocol 958 done 959 sleep 10 960 print "cd $job_catalog; rm $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 961 echo "$submcom $job_on_remhost" 962 rm send_protocol 963 fi 964 1017 965 [[ $verify = true ]] && printf " >>> o.k.\n" 1018 966 else
Note: See TracChangeset
for help on using the changeset viewer.