Changeset 1289 for palm/trunk
- Timestamp:
- Mar 4, 2014 7:12:34 AM (11 years ago)
- Location:
- palm/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/mbuild
r1275 r1289 22 22 # Current revisions: 23 23 # ------------------ 24 # 24 # comments translated from German to English 25 # fimm-, scirocco-, ibmy-, and sgi-specific code removed 25 26 # 26 27 # Former revisions: … … 85 86 compile_utility_programs=false 86 87 config_file=.mrun.config 87 fimm=false88 88 host=all 89 89 host_found=false … … 92 92 module_calls="" 93 93 util_compiled_localhost=false 94 scirocco=false95 94 silent=false 96 95 suf=f90 … … 189 188 190 189 191 192 [[ $local_host_real_name = scirocco ]] && scirocco=true193 [[ $local_host_real_name = fimm.bccs.uib.no ]] && fimm=true194 195 196 197 190 if [[ $local_host != ibms ]] 198 191 then … … 203 196 204 197 205 # determine the block conditions198 # DETERMINE THE BLOCK CONDITIONS 206 199 if [[ $block_conditions != none ]] 207 200 then … … 422 415 423 416 424 # GENER IERUNG DER AKTUELLEN MODELLVERSION FUER ALLE RECHNER-/UEBERSETZUNGS-425 # VERSIONEN, DIE IN DER KONFIGURATIONSDATEI GEFUNDEN WERDEN417 # GENERATE MODEL-VERSIONS FOR ALL HOST-BLOCKS 418 # FOUND IN THE CONFIGURATION-FILE 426 419 printf "\n *** scanning configuration file for host(s) ..." 427 420 … … 429 422 while read line 430 423 do 431 # KOMMENTARZEILEN UEBERSPRINGEN424 # SKIP COMMENT-LINES 432 425 [[ $(echo $line | cut -c1) = "#" ]] && continue 433 426 (( ihost = ihost + 1 )) … … 441 434 (( ih = ih + 1 )) 442 435 443 # determine remote host and conditions for the respective block444 # continue, only if this host has been chosen via -h option and if445 # conditions have been chosen via -K option436 # DETERMINE REMOTE HOST AND CONDITIONS FOR THE RESPECTIVE BLOCK 437 # CONTINUE, ONLY IF THIS HOST HAS BEEN CHOSEN VIA -h OPTION AND IF 438 # CONDITIONS HAVE BEEN CHOSEN VIA -K OPTION 446 439 remote_host_string=`echo ${hostline[$ih]} | cut -d" " -s -f3-` 447 440 remote_host=`echo $remote_host_string | cut -d" " -f1` … … 475 468 make_options="" 476 469 477 # IP-ADRESSE DES REMOTE-RECHNERS BESTIMMEN470 # DETERMINE IP-ADDRES OF THE REMOTE-HOST 478 471 case $remote_host in 479 472 (lccrayb) remote_addres=130.73.233.1;; … … 484 477 (lcrte) remote_addres=133.5.185.60;; 485 478 (lcsb) remote_addres=147.46.30.151;; 486 (lcsgib) remote_addres=130.73.232.102;;487 (lcsgih) remote_addres=130.75.4.101;;488 479 (lck) remote_addres=165.132.26.61;; 489 480 (lckiaps) remote_addres=118.128.66.223;; … … 496 487 (ibmku) remote_addres=133.5.4.129;; 497 488 (ibms) remote_addres=150.183.5.101;; 498 (ibmy) remote_addres=165.132.26.58;;499 489 (nech) remote_addres=136.172.44.192;; 500 490 (neck) remote_addres=133.5.178.11;; … … 509 499 510 500 511 # REMOTE-USERNAMEN ERMITTELN501 # DETERMINE REMOTE-USERNAME 512 502 line="" 513 503 found=false … … 537 527 538 528 539 # REMOTE-QUELLTEXTPFAD ERMITTELN529 # DETERMINE REMOTE-SOURCE-CODE-PATH 540 530 line="" 541 531 remote_source_path="" … … 572 562 573 563 574 # REMOTE-PFAD FUER MAKE-DEPOSITORY ERMITTELN564 # DETERMINE REMOTE-PATH FOR MAKE-DEPOSITORY 575 565 remote_md="" 576 566 line="" … … 611 601 612 602 613 # COMPILERNAMEN ERMITTELN603 # DETERMINE COMPILERNAME 614 604 line="" 615 605 found=false … … 639 629 640 630 641 # BEI BENUTZUNG EINES PARALLELEN COMPILERS MUSS AUCH EIN642 # SERIELLER COMPILERNAME ERMITTELT WERDEN631 # IN CASE OF PARALLEL EXECUTION (COMPILER FOR PARALLEL EXECUTION), 632 # A SERIAL COMPILERNAME MUST BE DETERMINED ALSO 643 633 if [[ $(echo $remote_host_string | grep -c parallel) = 1 ]] 644 634 then … … 674 664 675 665 676 # PRAEPROZESSOR-OPTIONEN/DIREKTIVEN ERMITTELN666 # DETERMINE PREPROCESSOR-OPTIONS AND DIRECTIVES 677 667 line="" 678 668 found=false … … 688 678 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 689 679 then 690 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN680 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 691 681 cpp_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 692 682 found=true … … 703 693 704 694 705 # RECHNERSPEZIFISCHE CPP-DIREKTIVEN HINZUFUEGEN695 # ADD HOST-SPECIFIC PREPROCESSOR-DIRECTIVES 706 696 for string in $remote_host_string 707 697 do … … 727 717 728 718 729 # get netCDF options719 # GET netCDF OPTIONS 730 720 line="" 731 721 grep "$remote_host_string" $config_file | grep "%netcdf_inc" > $tmp_mbuild … … 740 730 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 741 731 then 742 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN732 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 743 733 netcdf_inc=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 744 734 fi … … 758 748 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 759 749 then 760 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN750 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 761 751 netcdf_lib=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 762 752 fi … … 766 756 767 757 768 # get fftw options758 # GET FFTW OPTIONS 769 759 line="" 770 760 grep "$remote_host_string" $config_file | grep "%fftw_inc" > $tmp_mbuild … … 779 769 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 780 770 then 781 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN771 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 782 772 fftw_inc=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 783 773 fi … … 797 787 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 798 788 then 799 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING ENTFERNEN789 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 800 790 fftw_lib=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 801 791 fi … … 805 795 806 796 807 # get make options797 # GET MAKE OPTIONS 808 798 line="" 809 799 found=false … … 819 809 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 820 810 then 821 # remove colons from directive string811 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 822 812 make_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 823 813 … … 828 818 829 819 830 # COMPILEROPTIONEN ERMITTELN820 # GET COMPILER OPTIONS 831 821 line="" 832 822 found=false … … 842 832 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 843 833 then 844 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN834 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 845 835 compiler_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 846 836 found=true 847 837 848 # add include paths for netCDF and fftw838 # ADD INCLUDE PATHS FOR netCDF AND FFTW 849 839 compiler_options="$compiler_options $netcdf_inc $fftw_inc" 850 840 fi … … 860 850 861 851 862 # get login init commands, "::" is replacing a space852 # GET LOGIN INIT COMMANDS 863 853 line="" 864 854 grep "$remote_host_string" $config_file | grep "%login_init_cmd" > $tmp_mbuild … … 873 863 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 874 864 then 875 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN865 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 876 866 init_cmds=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 877 867 init_cmds="${init_cmds};" … … 880 870 881 871 882 # get modules to be loaded872 # GET MODULES TO BE LOADED 883 873 line="" 884 874 grep "$remote_host_string" $config_file | grep "%modules" > $tmp_mbuild … … 893 883 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 894 884 then 895 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN885 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 896 886 modules=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 897 887 fi … … 900 890 901 891 902 # LADER-OPTIONEN ERMITTELN892 # GET LINKER OPTIONS 903 893 line="" 904 894 found=false … … 914 904 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 915 905 then 916 # EVENTUELLE DOPPELPUNKTE AUS DIREKTIVENSTRING ENTFERNEN906 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 917 907 loader_options=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 918 908 found=true 919 909 920 # add netCDF- and fftw-library910 # ADD netCDF- AND FFTW-LIBRARY 921 911 loader_options="$loader_options $netcdf_lib $fftw_lib" 922 912 fi … … 1043 1033 1044 1034 1045 # make on remote host1035 # MAKE ON REMOTE HOST 1046 1036 if [[ $remote_host != $local_host ]] 1047 1037 then … … 1049 1039 then 1050 1040 1051 # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN1052 # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT1041 # COPY CURRENT SOURCE CODE TO SOURCE-CODE DIRECTORY ON THE REMOTE HOST 1042 # CREATE THIS DIRECTORY, IF IT DOES NOT EXIST 1053 1043 echo " *** copying \"${mainprog}_sources.tar\" to \"${remote_addres}:${remote_md}/\" " 1054 1044 if [[ $remote_host != lctit ]] … … 1056 1046 ssh ${remote_username}@${remote_addres} "[[ ! -d ${remote_md} ]] && (echo \" *** ${remote_md} will be created\"; mkdir -p ${remote_md})" 1057 1047 else 1058 # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS 1059 # MIT SSH, DESHALB AUFRUF PER PIPE 1048 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS 1060 1049 print "[[ ! -d ${remote_md} ]] && (echo \" *** ${remote_md} will be created\"; mkdir -p ${remote_md})" | ssh ${remote_username}@${remote_addres} 2>&1 1061 1050 fi … … 1065 1054 1066 1055 1067 # FALLS VORHANDEN, LETZTE VERSION AUF DEM REMOTE-RECHNER AUSPACKEN1056 # UNTAR PREVIOUS UPDATE ON REMOTE HOST, IF EXISTING 1068 1057 echo " *** untar previous update on remote host, if existing" 1069 1058 if [[ $remote_host != lctit ]] … … 1071 1060 ssh ${remote_username}@${remote_addres} "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]] && tar -xf ${mainprog}_current_version.tar" 1072 1061 else 1073 # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS 1074 # MIT SSH, DESHALB AUFRUF PER PIPE 1062 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS 1075 1063 print "cd ${remote_md}; [[ -f ${mainprog}_current_version.tar ]] && tar -xf ${mainprog}_current_version.tar" | ssh ${remote_username}@${remote_addres} 2>&1 1076 1064 fi 1077 1065 1078 1066 1079 # AKTUELLE QUELLTEXTVERSION AUF REMOTE-RECHNER AUSPACKEN1080 echo " *** untar actualsources on remote host"1067 # UNTAR CURRENT SOURCES ON REMOTE HOST 1068 echo " *** untar current sources on remote host" 1081 1069 if [[ $remote_host != lctit ]] 1082 1070 then 1083 1071 ssh ${remote_username}@${remote_addres} "cd ${remote_md}; tar -xf ${mainprog}_sources.tar" 1084 1072 else 1085 # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS 1086 # MIT SSH, DESHALB AUFRUF PER PIPE 1073 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS 1087 1074 print "cd ${remote_md}; tar -xf ${mainprog}_sources.tar" | ssh ${remote_username}@${remote_addres} 2>&1 1088 1075 fi 1089 1076 1090 1077 1091 # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN1092 # KOMMANDOUEBERGABE AN SSH PER PIPE, DA SO DIE SYSTEM- UND1093 # BENUTZERPROFILE VOLLSTAENDIG AUSGEFUEHRT WERDEN (SONST FEHLENMAKE1094 # Z.B. DIE PFADE ZUM COMPILER)1078 # EXECUTE MAKE WITH THOSE OPTIONS DETERMINED ABOVE 1079 # COMMANDS WILL BE COMMUNICATED TO SSH VIA PIPE, SINCE THIS WAY THE SYSTEM- AND 1080 # USER-PROFILES OF THE SHELL ARE COMPLETELY EXECUTED (OTHERWISE, MAKE 1081 # WILL E.G. MISS THE COMPILER-PATHS) 1095 1082 echo " *** execute \"make\" on remote host" 1096 1083 1097 1084 1098 # generate make call with make options1085 # GENERATE MAKE CALL WITH MAKE OPTIONS 1099 1086 if [[ $remote_host = nech ]] 1100 1087 then … … 1104 1091 fi 1105 1092 1106 # generate command to load modules, if modules are given1093 # GENERATE COMMAND TO LOAD MODULES, IF MODULES ARE GIVEN 1107 1094 if [[ "$modules" != "" ]] 1108 1095 then … … 1113 1100 module_calls="module load ${modules};" 1114 1101 fi 1115 1116 # bugfix for wrong netcdf module1117 if [[ $remote_host = lcsgib || $remote_host = lcsgih ]]1118 then1119 if [[ $(echo $module_calls | grep -c netcdf/3.6.3-intel) != 0 ]]1120 then1121 module_calls="$module_calls export LD_LIBRARY_PATH=/sw/dataformats/netcdf/3.6.3-intel/lib:\$LD_LIBRARY_PATH;"1122 fi1123 fi1124 1102 else 1125 1103 module_calls="" 1126 1104 fi 1127 1105 1128 if [[ $remote_host = ibmkisti || $remote_host = ibms || $remote_host = ibmy]]1106 if [[ $remote_host = ibmkisti || $remote_host = ibms ]] 1129 1107 then 1130 1108 … … 1135 1113 1136 1114 print "$init_cmds $module_calls export OBJECT_MODE=64; cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll 1137 1138 elif [[ $remote_host = lcsgib || $remote_host = lcsgih ]]1139 then1140 # print ". /usr/share/modules/init/bash; $module_calls cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll1141 print "$init_cmds $module_calls cd ${remote_md}; echo $make_call_string > LAST_MAKE_CALL; chmod u+x LAST_MAKE_CALL; $make_call_string; [[ \$? != 0 ]] && echo MAKE_ERROR" | ssh ${remote_username}@${remote_addres} 2>&1 | tee ${remote_host}_last_make_protokoll1142 1115 1143 1116 elif [[ $remote_host = lctit ]] … … 1186 1159 1187 1160 1188 # NEUE VERSION AUF REMOTE-RECHNER ZUSAMMENPACKEN1161 # TAR UPDATED VERSION ON THE REMOTE HOST 1189 1162 printf "\n *** tar update on remote host ..." 1190 1163 if [[ $remote_host != lctit ]] … … 1192 1165 ssh ${remote_username}@${remote_addres} "cd ${remote_md}; chmod u+w *; tar -cf ${mainprog}_current_version.tar ${mainprog} *.f90 *.o *.mod" 1193 1166 else 1194 # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS 1195 # MIT SSH, DESHALB AUFRUF PER PIPE 1167 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS 1196 1168 print "cd ${remote_md}; chmod u+w *; tar -cf ${mainprog}_current_version.tar ${mainprog} *.f90 *.o *.mod" | ssh ${remote_username}@${remote_addres} 2>&1 1197 1169 fi 1198 1170 1199 1171 1200 # AKTUELLES VERSIONSVERZEICHNIS AUF REMOTE-RECHNER BEREINIGEN 1201 # printf "\n *** \"make clean\" on remote host ..." 1202 # ssh ${remote_username}@${remote_addres} "cd ${remote_md}; make clean; rm ${mainprog}_sources.tar; rm *.f90 Makefile" 1203 # printf "\n" 1204 1205 1206 1207 1208 # GLEICHE AKTIONEN FUER DIE UTILITY-PROGRAMME DURCHFUEHREN 1209 # AKTUELLE QUELLTEXTVERSION INS REMOTE-QUELLTEXTVERZEICHNIS KOPIEREN 1210 # FALLS DIESES NOCH NICHT EXISTIERT, WIRD ES ERZEUGT 1172 1173 # DO THE SAME THINGS FOR THE UTILITY-ROUTINES: 1174 # COPY CURRENT SOURCE CODE TO SOURCE-CODE DIRECTORY ON THE REMOTE HOST 1175 # CREATE THIS DIRECTORY, IF IT DOES NOT EXIST 1211 1176 elif [[ $compile_utility_programs = true ]] 1212 1177 then … … 1220 1185 ssh ${remote_username}@${remote_addres} "[[ ! -d ${remote_ud} ]] && (echo \" *** ${remote_ud} will be created\"; mkdir -p ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]] && (echo \" *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p ${remote_ud}/../SCRIPTS)" 1221 1186 else 1222 # TIT ERLAUBT NUR DIE AUSFUEHRUNG GANZ BESTIMMTER KOMMANDOS 1223 # MIT SSH, DESHALB AUFRUF PER PIPE 1187 # USING PIPE, BECAUSE TIT ALLOWS SSH TO EXECUTE ONLY SOME SELECTED COMMANDS 1224 1188 print "[[ ! -d ${remote_ud} ]] && (echo \" *** ${remote_ud} will be created\"; mkdir -p ${remote_ud}); [[ ! -d ${remote_ud}/../SCRIPTS ]] && (echo \" *** ${remote_ud}/../SCRIPTS will be created\"; mkdir -p ${remote_ud}/../SCRIPTS)" | ssh ${remote_username}@${remote_addres} 2>&1 1225 1189 fi 1226 1190 1227 # KOPIEREN DER SCRIPTE1191 # COPY SHELL-SCRIPTS 1228 1192 scp batch_scp mbuild mrun process_dvr_output .dvrserver.config subjob batch_nc2vdf nc2vdf nc2vdf.ncl nc2vdf.config ${remote_username}@${remote_addres}:${remote_ud}/../SCRIPTS > /dev/null 1229 1193 … … 1232 1196 1233 1197 1234 # KOPIEREN DER UTILITY-PROGRAMME1198 # COPY UTILITY-ROUTINES 1235 1199 scp Makefile *.f90 ${remote_username}@${remote_addres}:${remote_ud} > /dev/null 1236 1200 1237 1201 1238 1202 1239 # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF REMOTE RECHNER AUSFUEHREN1240 # KOMMANDOUEBERGABE AN SSH PER PIPE, DA SO DIE SYSTEM- UND1241 # BENUTZERPROFILE VOLLSTAENDIG AUSGEFUEHRT WERDEN (SONST FEHLENMAKE1242 # Z.B. DIE PFADE ZUM COMPILER)1203 # EXECUTE MAKE WITH THOSE OPTIONS DETERMINED ABOVE 1204 # COMMANDS WILL BE COMMUNICATED TO SSH VIA PIPE, SINCE THIS WAY THE SYSTEM- AND 1205 # USER-PROFILES OF THE SHELL ARE COMPLETELY EXECUTED (OTHERWISE, MAKE 1206 # WILL E.G. MISS THE COMPILER-PATHS) 1243 1207 echo " *** execute \"make\" on remote host" 1244 1208 … … 1250 1214 fi 1251 1215 1252 # generate command to load modules, if modules are given1216 # GENERATE COMMAND TO LOAD MODULES, IF MODULES ARE GIVEN 1253 1217 if [[ "$modules" != "" ]] 1254 1218 then … … 1259 1223 module_calls="module load ${modules};" 1260 1224 fi 1261 1262 # bugfix for wrong netcdf module1263 if [[ $remote_host = lcsgib || $remote_host = lcsgih ]]1264 then1265 if [[ $(echo $module_calls | grep -c netcdf/3.6.3-intel) != 0 ]]1266 then1267 module_calls="$module_calls export LD_LIBRARY_PATH=/sw/dataformats/netcdf/3.6.3-intel/lib:\$LD_LIBRARY_PATH;"1268 fi1269 fi1270 1225 else 1271 1226 module_calls="" … … 1273 1228 1274 1229 1275 if [[ $remote_host = ibms || $remote_host = ibmy]]1230 if [[ $remote_host = ibms ]] 1276 1231 then 1277 1232 … … 1303 1258 fi 1304 1259 1305 fi # END E UEBERSETZUNG DER UTILITY-PROGRAMME1260 fi # END OF COMPILING UTILITY-ROUTINES 1306 1261 1307 1262 rm -rf ${remote_host}_last_make_protokoll 1308 1263 1309 # make on local host1264 # MAKE ON LOCAL HOST 1310 1265 else 1311 1266 1312 # workaround forlcxe61267 # INIT WORKAROUND FOR lcxe6 1313 1268 if [[ $remote_host = lcxe6 || $remote_host = lccrayb || $remote_host = lccrayf || $remote_host = lccrayh ]] 1314 1269 then … … 1318 1273 fi 1319 1274 1320 # first load modules, if given1275 # FIRST LOAD MODULES, IF GIVEN 1321 1276 if [[ "$modules" != "" ]] 1322 1277 then … … 1336 1291 then 1337 1292 1338 # DEPOSITORY VERZEICHNIS ERZEUGEN, FALLS NOCH NICHT VORHANDEN1293 # CREATE MAKE-DEPOSITORY, IF IT DOES NOT EXIST 1339 1294 eval remote_md=$remote_md 1340 1295 if [[ ! -d $remote_md ]] … … 1353 1308 fi 1354 1309 1355 # QUELLTEXT-DATEIEN AUS REPOSITORY INS DEPOSITORY KOPIEREN1310 # COPY SOURCE-CODE FROM REPOSITORY TO MAKE-DEPOSITORY 1356 1311 echo " " 1357 1312 echo " *** updating sources in $remote_md" … … 1360 1315 tar xf ${mainprog}_sources.tar 1361 1316 1362 # MAKE MIT ZUVOR ERMITTELTEN OPTIONEN AUF LOKALEM RECHNER AUSFUEHREN1317 # CALL MAKE ON LOCAL HOST USING THE OPTIONS DETERMINED FURTHER ABOVE 1363 1318 echo " " 1364 1319 echo " *** execute \"make\" on local host" … … 1423 1378 fi 1424 1379 1425 # COMPILE CHECK_NAMELIST_FILES (ONLY FOR ONE BRANCH on LOCALHOST NEEDED) 1426 1380 # COMPILE CHECK_NAMELIST_FILES (ONLY FOR ONE BRANCH on LOCALHOST NEEDED) 1427 1381 printf "\n\n" 1428 1382 echo " *** compiling check_namelist_files ..." 1429 1383 1430 # GET CHECK OPTIONS1384 # GET CHECK OPTIONS 1431 1385 line="" 1432 1386 found=false … … 1442 1396 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 1443 1397 then 1444 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING UND ALLE -D ENTFERNEN1398 # REMOVE COLONS FROM THE OPTION-STRING, IF THERE ARE ANY 1445 1399 line="$line " 1446 1400 copts_check=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g' | sed 's/-D[^ ]* //g' | sed 's/ -D.*//g'` … … 1498 1452 rm -f hosts_found_in_config_file 1499 1453 rm -f ${local_source_path}/${mainprog}_sources_check.tar 1500 -
palm/trunk/SCRIPTS/mrun
r1282 r1289 22 22 # Current revisions: 23 23 # ------------------ 24 # 24 # comments translated to English 25 # necriam-, fimm-, ibmy-, and sgi-specific code removed 26 # export of variables for palm and interpret_config removed 25 27 # 26 28 # Former revisions: … … 143 145 144 146 145 # VARIABLENVEREINBARUNGEN + DEFAULTWERTE 146 147 set +o allexport # SICHERHEITSHALBER UNTERBINDEN, DA SONST EVTL. STAGEOUT 148 # NICHT LAUEFT (TOO MANY ARGUMENTS - PROBLEM) 149 set +o noclobber # EXISTIERENDE DATEIEN DUERFEN UEBERSCHRIEBEN WERDEN 147 # DECLARATION OF VARIABLES AND THEIR DEFUALT VALUES 148 149 set +o allexport # SUPPRESS EXPORT OF ALL VARIABLES, SINCE IN THE PAST THIS 150 # LES TO PROBLEMS IN ROUTINES CALLED BY MRUN 151 # (TOO MANY ARGUMENTS - PROBLEM) 152 set +o noclobber # EXISTING FILES ARE ALLOWED TO BE OVERWRITTEN 150 153 151 154 AddFilenames="" … … 182 185 fftw_lib="" 183 186 fftw_support=false 184 fimm=false 185 fname=test 187 fname=test 186 188 fromhost="" 187 189 global_revision="" … … 199 201 link_local_output=false 200 202 localhost_realname=$(hostname) 201 local_compile=false202 203 local_dvrserver_running=.FALSE. 203 204 locat=normal … … 223 224 output_list="" 224 225 package_list="" 225 punkte="..........................................................."226 226 queue=none 227 227 read_from_config="" … … 248 248 run_coupled_model=false 249 249 run_mode="" 250 scirocco=false251 250 store_on_archive_system=false 252 striche=" ----------------------------------------------------------------------------"251 dashes=" ----------------------------------------------------------------------------" 253 252 silent=false 254 253 source_list="" … … 261 260 usern=$LOGNAME 262 261 use_openmp=false 263 version="MRUN 2. 0Rev$Rev$"262 version="MRUN 2.1 Rev$Rev$" 264 263 working_directory=`pwd` 265 264 TOPT="" … … 268 267 269 268 typeset -i iec=0 iic=0 iin=0 ioc=0 iout=0 stagein_anz=0 stageout_anz=0 270 typeset -x -i memory=0 # has to be exported here, otherwise an unknown side271 # effect may cause data loss when getopts is reading the272 # script-option arguments269 typeset -x -i memory=0 # HAS TO BE EXPORTED HERE, OTHERWISE AN UNKNOWN SIDE 270 # SIDE EFFECT MAY CAUSE DATA LOSS WHEN GETOPTS IS READING THE 271 # SCRIPT-OPTION ARGUMENTS 273 272 typeset -i cputime i ii iia iii iio icycle inode ival jobges jobsek last_char_int maxcycle minuten nodes pes remaining_pes sekunden tp1 274 273 275 274 276 275 277 278 # EINZELNE VARIABLE FUER HAUPTPROGRAMM EXPORTIEREN 279 export cpurest fname host localhost return_addres return_username remotecall tasks_per_node 280 281 # FOLGENDE VARIABLEN MUESSEN FUER DIE INTERPRETATION DER KONFIGURATIONSDATEI 282 # EXPORTIERT WERDEN 283 export afname config_file cpp_opts cpumax do_batch do_trace fname fromhost 284 export group_number input_list numprocs output_list queue run_mode 285 286 287 288 # FEHLERBEHANDLUNG 289 # BEI EXIT: 276 # ERROR HANDLING IN CASE OF EXIT 290 277 trap 'rm -rf $working_directory/tmp_mrun 291 if [[ $locat != localhost ]] 292 then 293 # if [[ ! -f ${mrun_path}/statistik/mrun_statistik ]] 294 # then 295 # cat > ${mrun_path}/statistik/mrun_statistik << %STATEND% 296 #MRUN-calls on $localhost 297 # 298 #date and time user localhost remotehost termination mrun-command 299 #-------------------------------------------------------------------------------------------------------------------- 300 #%STATEND% 301 # chmod 666 ${mrun_path}/statistik/mrun_statistik 302 # fi 303 # 304 # # EINTRAG IN DIE STATISTIK-DATEI 305 # string1=`date` #-L35 306 # string2=$usern #-L12 307 # string3=$localhost_realname #-L12 308 # string4=$host #-L12 309 # string5=$locat #-L12 310 # if [[ "$job_on_file" = "" && $locat != control_c && $locat != user_abort ]] 311 # then 312 # if [[ $do_batch = true ]] 313 # then 314 # printf "$string1$string2$string3$string4$string5$mrun_com \n" >> ${mrun_path}/statistik/mrun_statistik 315 # else 316 # printf "$string1$string2$string3$string4$string5$mc \n" >> ${mrun_path}/statistik/mrun_statistik 317 # fi 318 # fi 319 echo " " > /dev/null 320 fi 321 322 if [[ $locat != normal && $locat != control_c && $locat != local_compile ]] 323 then 324 325 # EVENTUELLE ERROR-KOMMANDOS ABARBEITEN 278 if [[ $locat != normal && $locat != control_c ]] 279 then 280 281 # CARRY OUT ERROR-COMMANDS GIVEN IN THE CONFIGURATION FILE (EC:) 326 282 (( i = 0 )) 327 283 while (( i < iec )) … … 363 319 364 320 365 # BEI TERMINAL-BREAK:321 # ACTIONS IN CASE OF TERMINAL-BREAK (CONTROL-C): 366 322 trap 'rm -rf $working_directory/tmp_mrun 367 323 rm -rf $working_directory/tmp_check_namelist_files … … 394 350 395 351 396 # SHELLSCRIPT-OPTIONEN EINLESEN UND KOMMANDO NEU ZUSAMMENSETZEN, FALLS ES397 # FUER FOLGEJOBS BENOETIGT WIRD352 # READ SHELLSCRIPT-OPTIONS AND REBUILD THE MRUN-COMMAND STRING (MC), 353 # WHICH WILL BE USED TO START RESTART-JOBS 398 354 while getopts :a:AbBc:Cd:D:Fg:G:h:H:i:IkK:m:M:n:o:O:p:P:q:r:R:s:St:T:u:U:vw:xX:yY:zZ option 399 355 do … … 447 403 448 404 449 # EVTL. POSITIONSPARAMETER EINLESEN450 # ZUR ZEIT GIBT ES NUR DEN PARAMETER ? (=KURZINFO)405 # SKIP GIVEN OPTIONS TO READ POSITIONAL PARAMETER, IF GIVEN 406 # CURRENTLY ONLY PARAMETER ? (TO OUTPUT A SHORT COMMAND INFO) IS ALLOWED 451 407 (( to_shift = $OPTIND - 1 )) 452 408 shift $to_shift 453 409 454 # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN410 # PRINT SHORT DESCRIPTION OF MRUN OPTIONS 455 411 if [[ "$1" = "?" ]] 456 412 then … … 515 471 516 472 517 # KURZE STARTMELDUNG473 # SHORT STARTING MESSAGE 518 474 printf "\n*** $version " 519 475 printf "\n will be executed. Please wait ..." … … 521 477 522 478 523 # PRUEFEN, OB KONFIGURATIONS-DATEI VORHANDEN479 # CHECK, IF CONFIGURATION FILE EXISTS 524 480 if [[ ! -f $config_file ]] 525 481 then … … 531 487 532 488 533 # HOST-IDENTIFIER (local_host) AUS KONFIGURATIONSDATEI BESTIMMEN489 # DETERMINE THE HOST-IDENTIFIER (localhost) FROM THE CONFIGURATION FILE 534 490 line="" 535 491 grep "%host_identifier" $config_file > tmp_mrun … … 559 515 560 516 561 # HOSTSPEZIFISCHE VARIABLEN SETZEN517 # SET HOST-SPECIFIC VARIABLES 562 518 case $localhost_realname in 563 519 (r1*|r2*|h01*|b01*) archive_system=tivoli;; 564 520 (cs*) archive_system=ut;; 565 (fimm.bccs.uib.no) fimm=true;;566 (gate|n-sx) PATH=$PALM_BIN:$PATH:/usr/bin/nqsII;;567 (scirocco) scirocco=true;;568 521 esac 569 522 570 523 571 572 # BASISNAME DER INPUT-DATEIEN GLEICH ALLGEMEINEM BASISNAMEN SETZEN,573 # WENN NICHT VOM BENUTZER ANDERS BESTIMMT524 # ??? THIS SHOULD BE DECRIBED IN THE MRUN DOCUMENTATION ??? 525 # SET BASENAME OF THE INPUT-FILES TO THE GENERAL BASENAME (GIVEN BY OPTION -d), 526 # IF IT HAS NOT BEEN SET BY THE USER DIFFERENTLY (USING OPTION -a) 574 527 [[ "$afname" = "" ]] && afname=$fname 575 528 576 529 577 # EVTL. RUN-MODUS DEN I/O-LISTEN HINZUFUEGEN 530 # ADD RUN-FILE ACTIVATION STRINGS (GIVEN BY OPTION -r) TO THE 531 # RESPECTIVE LISTS FOR ACTIVATING THE INPUT/OUTPUT FILE CONNECTION 532 # STATEMENTS IN THE CONFIGURATION FILE 578 533 if [[ "$run_mode" != "" ]] 579 534 then … … 583 538 584 539 585 # RECHNERNAMEN ABSPEICHERN, VON DEM AUS JOB GESTARTET WIRD, 586 # ALLERDINGS NUR DANN, WENN NICHT PER OPTION -H BEREITS EIN WERT 587 # ZUGEWIESEN WURDE (MRUN MACHT DIES IMMER, WENN ES SELBST BATCH-JOBS 588 # STARTET) 540 # ??? is this (and the respective option -H) really required ??? 541 # STORE HOSTNAME, FROM WHICH THE JOB IS STARTED, 542 # BUT ONLY IF IT HASN'T BEEN ALREADY SET BY OPTION -H 543 # (MRUN IS AUTOMATICALLY SETTING THIS OPTION IN THE MRUN-CALLS WITHIN 544 # THOSE BATCH-JOBS, WHICH ARE CREATED BY MRUN ITSELF) 589 545 if [[ "$fromhost" = "" ]] 590 546 then … … 593 549 594 550 595 # PRUEFEN, OB AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL596 # WERT VON do_remote WIRD FUER DATEIVERBINDUNGEN BENOETIGT.597 # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR,598 # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS551 # CHECK, IF EXECUTION SHALL TO BE DONE ON THE REMOTE-MACHINE. 552 # VALUE OF do_remote IS IMPORTANT FOR THE FILE CONNECTIONS. 553 # IN CASE OF EXECUTION ON A REMOTE-MACHINE, A BATCH-JOB HAS 554 # TO BE SUBMITTED (I.E. do_bacth=true) 599 555 if [[ -n $host && "$host" != $localhost ]] 600 556 then … … 602 558 do_remote=true 603 559 case $host in 604 (ibm|ibmh|ibmkisti|ibmku|ibms| ibmy|nech|necriam|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|lcsgib|lcsgih|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;;560 (ibm|ibmh|ibmkisti|ibmku|ibms|nech|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; 605 561 (*) printf "\n" 606 562 printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" … … 613 569 614 570 615 # ZUSATZBEDINGUNGEN (OPTION -K) AUSWERTEN571 # EVALUATE ADDITIONAL CONDITIONS GIVEN BY OPTION -K 616 572 if [[ -n $additional_conditions ]] 617 573 then 618 # echo $additional_conditions | cut -d" " -f1-3 | read cond1 cond2 dummy619 574 cond1=`echo $additional_conditions | cut -d" " -f1` 620 575 cond2=`echo $additional_conditions | cut -d" " -s -f2` … … 630 585 631 586 632 # KOPPLUNGSEIGENSCHAFTEN (-Y) AUSWERTEN UND coupled_mode BESTIMMEN587 # EVALUATE MODEL COUPLING FEATURES (OPTION -Y) AND DETERMINE coupled_mode 633 588 if [[ $run_coupled_model = true ]] 634 589 then 635 590 636 if [[ -n $coupled_dist ]] 637 then 638 639 numprocs_atmos=`echo $coupled_dist | cut -d" " -s -f1` 640 numprocs_ocean=`echo $coupled_dist | cut -d" " -s -f2` 641 642 if (( $numprocs_ocean + $numprocs_atmos != $numprocs )) 643 then 644 645 printf "\n +++ number of processors does not fit to specification by \"-Y\"." 646 printf "\n PEs (total) : $numprocs" 647 printf "\n PEs (atmosphere): $numprocs_atmos" 648 printf "\n PEs (ocean) : $numprocs_ocean" 649 locat=coupling; exit 650 651 fi 652 653 else 654 655 (( numprocs_ocean = $numprocs / 2 )) 656 (( numprocs_atmos = $numprocs / 2 )) 657 658 fi 659 coupled_dist=`echo "$numprocs_atmos $numprocs_ocean"` 591 numprocs_atmos=`echo $coupled_dist | cut -d" " -s -f1` 592 numprocs_ocean=`echo $coupled_dist | cut -d" " -s -f2` 593 594 if (( $numprocs_ocean + $numprocs_atmos != $numprocs )) 595 then 596 597 printf "\n +++ number of processors does not fit to specification by \"-Y\"." 598 printf "\n PEs (total) : $numprocs" 599 printf "\n PEs (atmosphere): $numprocs_atmos" 600 printf "\n PEs (ocean) : $numprocs_ocean" 601 locat=coupling; exit 602 603 fi 604 660 605 661 606 # GET coupled_mode FROM THE CONFIG FILE … … 673 618 674 619 675 # PRUEFEN, OB EVTL. BEI VORHERGEHENDEM LAUF (KETTENJOB) EINE 676 # ARCHIVIERUNG FEHLGESCHLAGEN IST 620 # CHECK, IF FILE-ARCHIVING HAS FAILED IN PREVIOUS JOB (OF A JOB-CHAIN) 677 621 if [[ -f ~/job_queue/ARCHIVE_ERROR_$fname ]] 678 622 then … … 689 633 690 634 691 # WERTE VON MRUN-OPTIONEN SICHERN UND DAMIT GEGEBENENFALLS SPAETER DIE692 # IN DER KONFIGURAIONSDATEI ANGEGEBENEN WERTE UEBERSTEUERN635 # SAVE VALUES OF MRUN-OPTIONS SICHERN IN ORDER TO OVERWRITE 636 # THOSE VALUES GIVEN IN THE CONFIGURATION-FILE 693 637 mrun_memory=$memory 694 638 mrun_group_number=$group_number … … 697 641 698 642 699 # LESEN UND INTERPRETIEREN DER KONFIGURATIONS-DATEI VOM SHELLSCRIPT AUS700 # VORUEBERGEHEND ZWINGEND AUF LINUX-RECHNERN643 # READ AND EVALUATE THE CONFIGURATION-FILE FROM WITHIN THIS SHELLSCRIPT 644 # (OPTION -S). THE DEFAULT IS USING THE ROUTINE interpret_config 701 645 if [[ "$read_from_config" = false ]] 702 646 then 703 647 704 648 [[ $silent = false ]] && printf "\n Reading the configuration file... " 649 650 # READ THE CONFIGURATION FILE LINE BY LINE 705 651 while read zeile 706 652 do … … 708 654 709 655 710 # ZUERST EVENTUELL VORKOMMENDE ENVIRONMENT-VARIABLEN DURCH IHRE WERTE 711 # ERSETZEN 656 # FIRST REPLACE ENVIRONMENT-VARIABLES BY THEIR RESPECTIVE VALUES 712 657 eval zeile=\"$zeile\" 713 658 714 659 715 # INTERPRET ATION DER ZEILE660 # INTERPRET THE LINE 716 661 if [[ "$(echo $zeile)" = "" ]] 717 662 then 718 # LEERZEILE, KEINE AKTION663 # EMPTY LINE, NO ACTION 719 664 continue 720 665 … … 722 667 then 723 668 724 # ZEILE IST KOMMENTARZEILE669 # LINE IS A COMMENT LINE 725 670 true 726 671 … … 728 673 then 729 674 730 # ZEILE DEFINIERTENVIRONMENT-VARIABLE675 # LINE DEFINES AN ENVIRONMENT-VARIABLE 731 676 zeile=$(echo $zeile | cut -c2-) 732 # echo $zeile | cut -d" " -f1-5 | read var value for_host for_cond1 for_cond2733 677 var=`echo $zeile | cut -d" " -f1` 734 678 value=`echo $zeile | cut -d" " -s -f2` … … 740 684 then 741 685 742 # BEI COMPILER- CPP- ODER LINKEROPTIONEN EVTL ":" DURCH " "743 # ERSETZEN. "::" WIRD DURCH ":" ERSETZT.686 # REPLACE ":" BY " " IN COMPILER- CPP- OR LINKER-OPTIONS, 687 # "::" IS REPLACED BY ":". 744 688 value=`echo $value | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` 745 689 746 690 747 # ENVIRONMENT-VARIABLE WIRD WERT AUS KONFIGURATIONSDATEI748 # ZUGEWIESEN, WENN SIE SELBST NOCH KEINEN WERT UEBER DIE749 # ENTSPRECHENDE SCRIPT-OPTION ERHALTEN HAT. SOLCHE750 # VARIABLEN HAETTEN DANN DEN WERT "" ODER IM INTEGER-FALL DEN751 # WERT 0. ALLGEMEINE REGEL ALSO: SCRIPT-OPTION GEHT UEBER752 # KONFIGURATIONSDATEI691 # VALUE FROM THE CONFIGURATION-FILE IS ASSIGNED TO THE 692 # ENVIRONMENT-VARIABLE, BUT ONLY IF NO VALUE HAS BEEN ALREADY 693 # ASSIGNED WITHIN THIS SCRIPT (E.G. BY SCRIPT-OPTIONS). 694 # NON-ASSIGNED VARIABLES HAVE VALUE "" OR 0 (IN CASE OF INTEGER). 695 # HENCE THE GENERAL RULE IS: SCRIPT-OPTION OVERWRITES THE 696 # CONFIGURATION-FILE. 753 697 if [[ "$(eval echo \$$var)" = "" || "$(eval echo \$$var)" = "0" ]] 754 698 then 755 699 eval $var=\$value 756 700 757 # EVTL. BILDSCHIRMAUSGABEN DER ENVIRONMENT-VARIABLEN701 # TERMINAL OUTPUT OF ENVIRONMENT-VARIABLES, IF TRACEBACK IS SWITCHED on 758 702 if [[ $do_trace = true ]] 759 703 then … … 762 706 fi 763 707 764 # WENN ENVIRONMENT-VARIABLE HOST VEREINBART, DANN SOFORT AUSWERTEN765 # WERT VON do-remote WIRD BEI DATEIVERBINDUNGEN BENOETIGT766 # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR,767 # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS708 # IF AN ENVIRONMENT-VARIABLE DETERMINES THE HOST, THEN EVALUATE IT IMMEDIATELY: 709 # VALUE OF do-remote IS REQUIRED FOR THE FILE CONNECTIONS (COPY OF I/O FILES). 710 # IF EXECUTION IS SCHEDULED FOR A REMOTE-MASCHINE, A BATCH-JOB 711 # MUST HAVE TO BE STARTED 768 712 if [[ $var = host ]] 769 713 then … … 773 717 do_remote=true 774 718 case $host in 775 (ibm|ibmh|ibmkisti|ibmku|ibms| ibmy|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;;719 (ibm|ibmh|ibmkisti|ibmku|ibms|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|nech|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; 776 720 (*) printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" 777 721 printf "\n is not available" … … 783 727 fi 784 728 785 # VOM BENUTZER DEFINIERTE ENVIRONMENT VARIABLEN MUESSEN PRINZIPIELL786 # EXPORTIERT WERDEN, DA SIE VIELLEICHT IN WEITER UNTEN AUFZURUFEN-787 # DEN PROGRAMMEN BENOETIGT WERDEN729 # USER-DEFINED ENVIRONMENT VARIABLES MUST BE EXPORTED, 730 # BECAUSE THEY MAY BE REQUIRED IN OTHER SCRIPTS CALLED 731 # BY MRUN (E.G. subjob) 788 732 export $var 789 733 fi … … 795 739 then 796 740 797 # ZEILE DEFINIERT ERROR-KOMMANDO741 # LINE DEFINES ERROR-COMMAND 798 742 (( iec = iec + 1 )) 799 743 zeile=$(echo $zeile | cut -c4-) … … 803 747 then 804 748 805 # ZEILE DEFINIERT INPUT-KOMMANDO749 # LINE DEFINES INPUT-COMMAND 806 750 (( iic = iic + 1 )) 807 751 zeile=$(echo $zeile | cut -c4-) … … 811 755 then 812 756 813 # ZEILE DEFINIERT OUTPUT-KOMMANDO757 # LINE DEFINES OUTPUT-COMMAND 814 758 (( ioc = ioc + 1 )) 815 759 zeile=$(echo $zeile | cut -c4-) … … 818 762 else 819 763 820 # ZEILE DEFINIERT DATEIVERBINDUNG. EINLESEN DER DATEIEIGENSCHAFTEN 821 # s2a: in/out - Feld 822 # s2b: loc - Feld (optional) 823 # s2c: tr/ar - Feld (optional) 824 # echo $zeile | cut -d" " -f1-2 | read s1 s2 764 # LINE DEFINES FILE CONNECTION. READ THE FILE ATTRIBUTES. 765 # s2a: in/out - field 766 # s2b: loc - field (optional) 767 # s2c: tr/ar - field (optional) 825 768 s1=`echo $zeile | cut -d" " -f1` 826 769 s2=`echo $zeile | cut -d" " -s -f2` … … 831 774 s2c="" 832 775 else 833 # echo $s2 | cut -d":" -f2-3 | sed 's/:/ /g' | read s2b s2c834 776 s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'` 835 777 s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'` 836 778 fi 837 # echo $zeile | cut -d" " -f3-6 | read s3 s4 s5 s6838 779 s3=`echo $zeile | cut -d" " -f3` 839 780 s4=`echo $zeile | cut -d" " -s -f4` … … 842 783 843 784 844 # ABSPEICHERN DER DATEIVERBINDUNG, FALLS IN INPUT- ODER OUTPUT-LIST 845 # VERMERKT. VARIABLE S3 KANN AUCH LISTE ENTHALTEN (FELDTRENNER ":") 846 # DATEIVERBINDUNG WIRD DANN NICHT ABGESPEICHERT UND GEPRUEFT, WENN 847 # PROGRAMMLAUF AUF REMOTE-MASCHINE ERFOLGT UND DATEI NUR LOKAL VOR- 848 # HANDEN SEIN MUSS (D.H. s2b = loc) 785 # STORE FILE CONNECTION, IF ACTIVATED BY ACTIVATION-STRING FROM 786 # INPUT- OR OUTPUT-LIST. 787 # VARIABLE S3 MAY CONTAIN A LIST OF ACTIVATION STRINGS (FIELD-SEPERATOR ":"). 788 # IF EXECUTION IS SCHEDULED FOR A REMOTE-MACHINE AND THE FILE IS ONLY 789 # LOCALLY REQUIRED ON THAT MACHINE (I.E. s2b = loc), THE FILE CONNECTION 790 # IS NOT CHECKED AND STORED. 849 791 IFSALT="$IFS"; IFS="$IFS:" 850 792 if [[ "$s2a" = in && ! ( $do_remote = true && ( "$s2b" = loc || "$s2b" = locopt ) ) ]] … … 894 836 895 837 896 # INTERPRETATION DER KONFIGURATIONSDATEI MITTELS FORTRAN 90 - PROGRAMM838 # EVALUATE THE CONFIGURATION-FILE BY FORTRAN-PROGRAM 897 839 [[ $silent = false ]] && printf "..." 898 export cond1 cond2 config_file do_remote do_trace input_list localhost output_list 899 export interpreted_config_file=.icf.$RANDOM 900 901 902 903 # ENVIRONMENT-VARIABLEN FUER INTERPRET_CONFIG UEBER NAMELIST_DATEI ZUR 904 # VERFUEGUNG STELLEN 840 interpreted_config_file=.icf.$RANDOM 841 842 843 844 # PROVIDE VALUES OF ENVIRONMENT-VARIABLE FOR interpret_config VIA NAMELIST-FILE 905 845 cat > .mrun_environment << %%END%% 906 846 &mrun_environment cond1 = '$cond1', cond2 = '$cond2', … … 912 852 %%END%% 913 853 914 if [[ $localhost_realname = "sx-fep" ]] 915 then 916 /home/COAR/NC/raasch/pub/interpret_config_necriam.x 854 if [[ "$host" != $localhost ]] 855 then 856 857 # REMOTE JOB FROM LOCAL HOST: JUST TAKE THE FIRST EXECUTABLE FOUND 858 interpret_config_executable=`ls -1 ${PALM_BIN}/interpret_config*.x 2>/dev/null` 859 if [[ $? != 0 ]] 860 then 861 printf "\n\n +++ no interpret_config found" 862 printf "\n run \"mbuild -u -h ...\" to generate utilities for this host" 863 locat=interpret_config; exit 864 fi 865 interpret_config_executable=`echo $interpret_config_executable | cut -d" " -f1` 866 $interpret_config_executable 867 917 868 else 918 869 919 if [[ "$host" != $localhost ]] 920 then 921 922 # REMOTE JOB FROM LOCAL HOST: JUST TAKE THE FIRST EXECUTABLE FOUND 923 interpret_config_executable=`ls -1 ${PALM_BIN}/interpret_config*.x 2>/dev/null` 924 if [[ $? != 0 ]] 925 then 926 printf "\n\n +++ no interpret_config found" 927 printf "\n run \"mbuild -u -h ...\" to generate utilities for this host" 928 locat=interpret_config; exit 929 fi 930 interpret_config_executable=`echo $interpret_config_executable | cut -d" " -f1` 931 $interpret_config_executable 932 870 # CHECK, IF THERE IS AN EXECUTABLE FOR THE BLOCK 871 if [[ ! -f ${PALM_BIN}/interpret_config${block}.x ]] 872 then 873 printf "\n\n +++ no interpret_config found for given block \"$cond1 $cond2\"" 874 printf "\n run \"mbuild -u -h ...\" to generate utilities for this block" 875 locat=interpret_config; exit 933 876 else 934 935 # CHECK, IF THERE IS AN EXECUTABLE FOR THE BLOCK 936 if [[ ! -f ${PALM_BIN}/interpret_config${block}.x ]] 937 then 938 printf "\n\n +++ no interpret_config found for given block \"$cond1 $cond2\"" 939 printf "\n run \"mbuild -u -h ...\" to generate utilities for this block" 940 locat=interpret_config; exit 941 else 942 interpret_config${block}.x 943 fi 944 945 fi 877 interpret_config${block}.x 878 fi 879 946 880 fi 947 881 rm .mrun_environment 948 882 949 883 950 # AUSFUEHRUNG DER GENERIERTEN SHELL-KOMMANDOS IN DIESERSHELL884 # EXECUTE SHELL-COMMANDS GENERATED BY interpret_config WITHIN THIS SHELL 951 885 chmod u+x $interpreted_config_file 952 886 export PATH=$PATH:. … … 957 891 958 892 959 # OPTIONSWERTE UEBERSTEUERN KONFIGURATIONSDATEI893 # VALUES OF MRUN-OPTIONS OVERWRITE THOSE FROM THE CONFIGURATION-FILE 960 894 [[ $mrun_memory != 0 ]] && memory=$mrun_memory 961 895 [[ "$mrun_group_number" != "none" ]] && group_number=$mrun_group_number … … 966 900 967 901 968 # QUELLTEXTVERZEICHNIS AUF LOKALER MASCHINE AUS KONFIGURATIONSDATEI969 # BESTIMMEN (WUERDE SONST EVTL. DAS VERZEICHNIS DES JEWEILS UNTER -h970 # ANGEGEBENEN REMOTE-RECHNERS SEIN)971 # BE I BATCH-JOBS SIND DIE ZU UEBERSETZENDEN PROGRAMMTEILE SCHON KOMPLETT902 # ON THE LOCAL MACHINE, DETERMINE (FROM THE CONFIGURATION-FILE) THE PATH 903 # FOR SOURCE-FILES TO BE COMPILED. 904 # IN A BATCH-JOB, SOURCES (ROUTINES TO BE COMPILED) ARE COMPLETE ALREADY. 905 # BEFORE MRUN IS CALLED IN THE JOB, SOURCES_COMPLETE = true IS ASSIGNED (SEE FURTHER BELOW). 972 906 if [[ "$SOURCES_COMPLETE" = "" ]] 973 907 then 974 908 975 # ZUERST PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD FUER ALLE RECHNER976 # VEREINBART WURDE909 # FIRST CHECK, IF A GLOBAL SOURCE PATH (TO BE USED FOR ALL HOSTS) 910 # HAS BEEN DEFINED 977 911 source_path="" 978 912 line="" … … 1031 965 1032 966 1033 # G LOBALE REVISIONSNUMMER ERMITTELN (FORTSETZUNGSLAEUFEN WIRD DIESE1034 # DURCH OPTION -G MITGETEILT)1035 if [[ "$global_revision" = "" 967 # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY 968 # (HANDED OVER TO RESTART-RUNS USING OPTION -G) 969 if [[ "$global_revision" = "" && $host != "ibmkisti" ]] 1036 970 then 1037 971 global_revision=`svnversion $source_path 2>/dev/null` … … 1040 974 1041 975 1042 # NOCHMAL PRUEFEN, OB AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL 1043 # (HOST KANN IN KONFIGURATIONSDATEI ANDERS FESTGELEGT WORDEN SEIN) 1044 # WERT VON do_remote WIRD FUER DATEIVERBINDUNGEN BENOETIGT. 1045 # WENN AUF REMOTE-MASCHINE GERECHNET WIRD, IST GLEICHZEITIG KLAR, 1046 # DASS EIN BATCH-JOB GESTARTET WERDEN MUSS 976 # ??? das darf doch eigentlich garnicht passieren, weil optionen config-datei uebersteuern ??? 977 # CHECK AGAIN, IF EXECUTION SHALL BE DONE ON A REMOTE-HOST (BATCH-JOB). 978 # (HOST MAY HAVE CHANGED DUE TO SETTINGS IN THE CONFIGURATION-FILE) 1047 979 if [[ -n $host && "$host" != $localhost ]] 1048 980 then … … 1050 982 do_remote=true 1051 983 case $host in 1052 (ibm|ibmh|ibmkisti|ibmku|ibms| ibmy|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|lcsgib|lcsgih|nech|necriam|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;;984 (ibm|ibmh|ibmkisti|ibmku|ibms|lccrayb|lccrayh|lccrayf|lcflow|lckyoto|nech|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb) true;; 1053 985 (*) printf "\n" 1054 986 printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" … … 1061 993 1062 994 1063 # PRUEFUNG EINIGER PROZESSORZAHLANGABEN BEI RECHNUNGEN AUF PARALLELRECHNERN995 # IN CASE OF PARALLEL EXECUTION, CHECK SOME SPECIFICATIONS CONCERNING PROCESSOR NUMBERS 1064 996 if [[ "$cond1" = parallel || "$cond2" = parallel ]] 1065 997 then 1066 998 1067 # PRUEFEN, OB DIE ANZAHL DER ZU VERWENDENDEN PES ANGEGEBEN WURDE999 # CHECK, IF NUMBER OF CORES TO BE USED HAS BEEN GIVEN 1068 1000 if [[ ! -n $numprocs ]] 1069 1001 then … … 1076 1008 fi 1077 1009 1078 # PRUEFEN, OB DIE PROZESSORANZAHL PRO KNOTEN ANGEGEBEN WURDE (GGF. 1079 # DEFAULT-WERT SETZEN) UND OB SIE EIN GANZZAHLIGER TEILER DER 1080 # GESAMTPROZESSORANZAHL IST 1010 # CHECK, IF THE NUMBER OF CORES PER NODE HAS BEEN GIVEN UND IF IT IS AN 1011 # INTEGRAL DIVISOR OF THE TOTAL NUMBER OF CORES GIVEN BY OPTION -X 1081 1012 if [[ "$tasks_per_node" = "" && $host != lcflow && $host != lcxt5m ]] 1082 1013 then … … 1114 1045 1115 1046 1116 # IBMY HAT NUR EINEN KNOTEN1117 if [[ $host = ibmy ]]1118 then1119 if [[ "$tasks_per_node" != "" && "$tasks_per_node" != "$numprocs" ]]1120 then1121 printf "\n"1122 printf "\n +++ on ibmy, tasks per node (option \"-T\") must be equal to the"1123 printf "\n total number of processors (option \"-X\")"1124 printf "\n values of this mrun-call: \"-T $tasks_per_node\" \"-X $numprocs\""1125 locat=tasks_per_node; (( iec = 0 )); exit1126 fi1127 fi1128 1129 1130 1047 # SETTINGS FOR SUBJOB-COMMAND 1131 1048 OOPT="-O $threads_per_task" 1132 1049 1133 # GESAMTZAHL DER KNOTEN BESTIMMEN1050 # SET THE TOTAL NUMBER OF NODES, REQUIRED FOR THE SUBJOB-COMMAND (SEE FURTHER BELOW) 1134 1051 if [[ "$tasks_per_node" != "" ]] 1135 1052 then … … 1137 1054 fi 1138 1055 1139 # PRUEFEN, OB NODE USAGE EINEN ERLAUBTEN WERT HAT BZW. DEN DEFAULT 1140 # SETZEN 1056 # CHECK node_usage FOR ALLOWED VALUES AND SET DEFAULT VALUE, IF NECESSARY 1141 1057 if [[ $node_usage = default ]] 1142 1058 then … … 1144 1060 then 1145 1061 node_usage=shared 1146 elif [[ $(echo $host | cut -c1-5) = lcsgi ]]1147 then1148 node_usage=singlejob1149 1062 else 1150 1063 node_usage=not_shared … … 1162 1075 fi 1163 1076 1164 # PRUEFEN, OB HOSTFILE EXISTIERT1077 # CHECK IF HOSTFILE EXISTS 1165 1078 if [[ -n $hostfile ]] 1166 1079 then … … 1173 1086 fi 1174 1087 1175 # PRUEFEN, OB RHOSTS DATEI EXISTIERT. GEGEBENENFALLS ANLEGEN BZW. ERWEITERN 1176 if [[ $host = ibmy && $do_remote = false ]] 1177 then 1178 if [[ ! -f $HOME/.rhosts ]] 1179 then 1180 echo "gfdl5.yonsei.ac.kr" > $HOME/.rhosts 1181 printf "\n\n *** file:" 1182 printf "\n $HOME/.rhosts" 1183 printf "\n was created\n" 1184 fi 1185 if [[ $(grep -c gfdl5.yonsei.ac.kr $HOME/.rhosts) = 0 ]] 1186 then 1187 echo "gfdl5.yonsei.ac.kr" >> $HOME/.rhosts 1188 printf "\n\n *** file:" 1189 printf "\n $HOME/.rhosts" 1190 printf "\n was extended by the name of the current host\n" 1191 fi 1192 fi 1193 1194 1195 # Set default value for the maximum number of parallel io streams 1088 1089 # SET DEFAULT VALUE FOR THE MAXIMUM NUMBER OF PARALLEL IO STREAMS 1196 1090 if [[ "$maximum_parallel_io_streams" = "" ]] 1197 1091 then … … 1200 1094 1201 1095 1202 # S et port number option for calls of ssh/scp, subjob and batch_scp scripts1096 # SET PORT NUMBER OPTION FOR CALLS OF SSH/SCP, subjob AND batch_scp SCRIPTS 1203 1097 if [[ "$scp_port" != "" ]] 1204 1098 then … … 1208 1102 1209 1103 1210 # FALLS NICHT VORGEGEBEN, DEFAULT-QUEUE AUF DER ZIELMASCHINE FESTLEGEN1104 # SET DEFAULT-QUEUE, IF NOT GIVEN 1211 1105 if [[ $queue = none ]] 1212 1106 then … … 1214 1108 (ibmh) queue=cluster;; 1215 1109 (ibmkisti) queue=class.32plus;; 1216 (ibmy) queue=parallel;;1217 1110 (lckiaps) queue=normal;; 1218 1111 (lckyoto) queue=ph;; 1219 1112 (lckyuh) queue=fx-single;; 1220 1113 (lckyut) queue=cx-single;; 1221 (lcsgib) queue=testq;;1222 (lcsgih) queue=testq;;1223 1114 (lctit) queue=S;; 1224 1115 (nech) queue=none;; 1225 (necriam) queue=SP;;1226 1116 (unics) queue=unics;; 1227 1117 esac … … 1229 1119 1230 1120 1231 # VOLLSTAENDIGE DATEINAMEN DER INPUT-FILES BILDEN, 1232 # INPUT-DATEIEN AUF VORHANDENSEIN PRUEFEN UND EVTL. HOECHSTE ZYKLUSNUMMER 1233 # ERMITTELN 1121 # GENERATE FULL FILENAMES OF INPUT-FILES, INCLUDING THEIR PATH 1122 # CHECK, IF INPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST) 1234 1123 (( i = 0 )) 1235 1124 while (( i < iin )) … … 1238 1127 (( maxcycle = 0 )) 1239 1128 1240 # NAMENSBILDUNG (EVTL. IST FESTER DATEINAME VORGEGEBEN) 1129 # GENERATE PATH AND FULL FILE NAME (then-BRANCH: FIXED FULL NAME IS GIVEN, I.E. THE 1130 # FILE IDENTIFIER IS NOT PART OF THE FILENAME)) 1241 1131 if [[ "${actionin[$i]}" = di ]] 1242 1132 then 1243 remotepathin[$i]=${pathin[$i]}/${endin[$i]} # REMOTE-PFAD ERST AUF1244 # REM-MASCHINE AUSWERTEN1133 remotepathin[$i]=${pathin[$i]}/${endin[$i]} # EVALUATE REMOTE-PATH ON THE REMOTE 1134 # HOST ONLY 1245 1135 eval filename=${pathin[$i]}/${endin[$i]} 1246 1136 else 1247 remotepathin[$i]=${pathin[$i]}/${afname}${endin[$i]} # REMOTE-PFAD ERST AUF1248 # REM-MASCHINE AUSWERTEN1137 remotepathin[$i]=${pathin[$i]}/${afname}${endin[$i]} # EVALUATE REMOTE-PATH ON THE REMOTE 1138 # HOST ONLY 1249 1139 eval filename=${pathin[$i]}/${afname}${endin[$i]} 1250 1140 fi 1251 1141 eval pathname=${pathin[$i]} 1252 1142 1253 #SAVE INPUT FILE NAME FOR PARAMETER FILE CHECK1143 # SAVE INPUT FILE NAME FOR PARAMETER FILE CHECK 1254 1144 if [[ ("${transin[$i]}" = job) && (-f $filename) ]] 1255 1145 then … … 1257 1147 fi 1258 1148 1259 # PRUEFEN AUF VORHANDENSEIN1149 # CHECK IF FILE EXISTS 1260 1150 if [[ $(ls $filename* 2>&1 | grep -c "not found") = 1 || \ 1261 1151 $(ls $filename* 2>&1 | grep -c "nicht gefunden") = 1 || \ … … 1263 1153 $(ls $filename* 2>&1 | grep -c "does not exist") = 1 ]] 1264 1154 then 1265 # DATEIEN MIT EXTENSION (Z.B. NC) MUESSEN NICHT ZWINGEND VORHANDEN 1266 # SEIN, DESHALB IN SOLCHEN FAELLEN KEIN ABBRUCH. DIES IST NUR EINE 1267 # VORUEBERGEHENDE LOESUNG (OKT 05). NICHT ZWINGEND BENOETIGTE 1268 # EINGABEDATEIEN SOLLTEN EINE SPEZIELLE OPTION IN DER DATEI- 1269 # VERBINDUNGSANWEISUNG BEKOMMEN (Z.B. inopt?) 1155 1156 # FILES WITH ATTRIBUTE locopt ARE OPTIONAL. NO ABORT, IF THEY DO NOT EXIST. 1270 1157 if [[ "${transin[$i]}" != "locopt" ]] 1271 1158 then … … 1284 1171 else 1285 1172 1286 # ZYKLUSNUMMER FESTSTELLEN1173 # DETERMINE THE FILE'S CYCLE NUMBER 1287 1174 ls -1 -d $filename > filelist 2>/dev/null 1288 1175 ls -1 -d $filename.* >> filelist 2>/dev/null … … 1307 1194 rm filelist 1308 1195 1309 # EVTL. ZYKLUSNUMMER AN DATEINAMEN ANFUEGEN1196 # APPEND CYCLE NUMBER TO FILENAME 1310 1197 if (( maxcycle > 0 )) 1311 1198 then … … 1323 1210 fi 1324 1211 1325 # DATEINAMEN OHNE PFAD ABER MIT ZYKLUSNUMMER ABSPEICHERN,1326 # DA SPAETER BEI RUECKSPEICHERN VOM ARCHIVSYSTEM EVTL. BENOETIGT1212 # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER, 1213 # BECAUSE IT MIGHT BE REQUIRED LATER TO RESTORE THE FILE FROM AN ARCHIVE-SYSTEM 1327 1214 absnamein[$i]=$filename 1328 1215 if (( maxcycle > 0 )) … … 1346 1233 done 1347 1234 1348 # VOLLSTAENDIGE DATEINAMEN (OHNE $ ODER ~) DER OUTPUT-FILES BILDEN, 1349 # OUTPUT-DATEIEN AUF VORHANDENSEIN PRUEFEN UND EVTL. HOECHSTE ZYKLUSNUMMER 1350 # ERMITTELN ODER, FALLS NICHT VORHANDEN, PRUEFEN, OB SIE SICH ANLEGEN LASSEN 1351 # DIESE AKTIONEN FINDEN NICHT STATT, WENN PROGRAMM AUF REMOTE-MASCHINE 1352 # RECHNET UND DATEI ANSCHLIESSEND TRANSFERIERT WERDEN SOLL! 1235 # GENERATE FULL FILENAMES OF OUTPUT-FILES (WITHOUT $ OR ~), 1236 # CHECK, IF OUTPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST), 1237 # OR, IN CASE THAT FILE DOES NOT EXIST, CHECK, IF IT CAN BE CREATED 1238 # THESE ACTIONS ARE NOT CARRIED OUT, IF FILES SHALL BE TRASFERRED FROM THE REMOTE TO 1239 # THE LOCAL HOST (BECAUSE THEIR IS NO DIRECT ACCESS TO THE LOCAL DIRECTORIES FROM THE 1240 # REMOTE HOST) 1353 1241 (( i = 0 )) 1354 1242 while (( i < iout )) … … 1376 1264 then 1377 1265 1378 # OUTPUT-DATEI NICHT VORHANDEN. PRUEFEN, OB ANLEGEN MOEGLICH.1266 # IF OUTPUT-FILE DOES NOT EXIST CHECK, IF IT CAN BE CREATED 1379 1267 if cat /dev/null > $filename 1380 1268 then … … 1382 1270 else 1383 1271 1384 # PRUEFEN, OB KATALOG VORHANDEN UND EVTL. DIESEN ANLEGEN 1272 # CHECK, IF THE DIRECTORY WHERE FILE SHALL BE COPIED TO EXISTS 1273 # IF IT DOES NOT EXIST, TRY TO CREATE IT 1385 1274 if [[ ! -d $catalogname ]] 1386 1275 then … … 1408 1297 else 1409 1298 1410 # ZYKLUSNUMMER FESTSTELLEN1299 # DETERMINE THE CYCLE NUMBER 1411 1300 ls -1 -d $filename > filelist 2>/dev/null 1412 1301 ls -1 -d $filename.* >> filelist 2>/dev/null … … 1428 1317 fi 1429 1318 1430 # EVTL. ZYKLUSNUMMER AN DATEINAMEN ANFUEGEN UND PRUEFEN, OB SICH 1431 # DATEI AUCH WIRKLICH ANLEGEN LAESST. IM APPEND-FALL MUSS AN DEN 1432 # HOECHSTEN VORHANDENEN ZYKLUS-ANGEHAENGT WERDEN. ANLAGEPRUEFUNG 1433 # IST DANN NATUERLICH NICHT ZULAESSIG BZW. MOEGLICH 1319 # APPEND CYCLE NUMBER TO FILENAME AND CHECK, IF FILE CAN BE CREATED 1320 # IN CASE OF FILE-APPEND, FILE MUST BE APPENDED TO THE ONE WITH HIGHEST CYCLE NUMBER 1434 1321 if [[ "${actionout[$i]}" != a ]] 1435 1322 then … … 1455 1342 fi 1456 1343 1457 # DATEINAMEN OHNE PFAD ABER MIT ZYKLUSNUMMER ABSPEICHERN,1458 # DA SPAETER BEI ABLAGE AUF ARCHIVSYSTEM BZW. FUER1459 # DATEI OUTPUT_FILE_CONNECTIONS EVTL. BENOETIGT1344 # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER, 1345 # BECAUSE IT MIGHT BE REQUIRED LATER TO STORE THE FILE ON AN ARCHIVE-SYSTEM 1346 # OR TO PUT THIS FILENAME ON FILE OUTPUT_FILE_CONNECTIONS 1460 1347 pathout[$i]=$filename 1461 1348 if (( maxcycle > 0 )) … … 1470 1357 1471 1358 1472 # DAS DVR-PAKET ERFORDERT EINE ENTSPRECHENDE BIBLIOTHEK1359 # THE DVR-PACKAGE REQUIRES ITS OWN LIBRARY 1473 1360 if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] 1474 1361 then … … 1488 1375 1489 1376 1490 # PRUEFEN, OB ENTWEDER HAUPTPROGRAMM ODER NUR EIN AUSFUEHRBARES 1491 # PROGRAMM VEREINBART WURDE (IN DIESEM FALL BRAUCHT IM WEITEREN NICHT 1492 # UEBERSETZT ZU WERDEN) 1377 # CHECK, WETHER A MAIN PROGRAM OR AN EXECUTABLE HAVE BEEN DECLARED. 1378 # EXECUTABLES DO NOT NEED TO BE COMPILED. 1493 1379 if [[ "$mainprog" = "" && "$executable" = "" ]] 1494 1380 then … … 1505 1391 1506 1392 1507 # SOURCE-VERZEICHNIS ZUM AUFSAMMELN DER ZU UEBERSETZENDEN PROGRAMMTEILE 1508 # ERZEUGEN. HIERHIN WERDEN SPAETER IM FALL VON BATCH-JOBS AUCH DAS MRUN- 1509 # SCRIPTS SOWIE DIE KONFIGURATIONSDATEI KOPIERT 1393 # CREATE SOURCE-DIRECTORY TO COLLECT ROUTINES TO BE COMPILED. 1394 # LATER THE MRUN-SCRIPT AND CONFIGURATION-FILE WILL ALSO BE COPIED TO THIS DIRECTORY. 1510 1395 if [[ $restart_run != true && "$SOURCES_COMPLETE" = "" ]] 1511 1396 then … … 1515 1400 1516 1401 1517 # ALLE ZU UEBERSETZENDEN PROGRAMMTEILE ZUSAMMENSAMMELN 1518 # BEI BATCH-JOBS IST DIES NICHT NOETIG, WEIL DIE PROGRAMMTEILE BEREITS DURCH 1519 # DEN MRUN-AUFRUF ERMITTELT SIND, DER DEN BATCH-JOB GENERIERT HAT, UND 1520 # IM VERZEICHNIS SOURCES_FOR_RUN_... ABGELEGT SIND 1402 # COLLECT ALL ROUTINES TO BE COMPILED 1403 # THIS IS NOT REQUIRED WITHIN BATCH-JOBS, BECAUSE ROUTINES HAVE ALREADY BEEN COLLECTED 1404 # BY THE MRUN-CALL WHICH CREATED THE BATCH-JOB. 1521 1405 if [[ $do_compile = true && "$SOURCES_COMPLETE" = "" ]] 1522 1406 then … … 1527 1411 then 1528 1412 1529 # MODIFIZIERTE DATEIEN DER SVN-ARBEITSKOPIE BESTIMMEN1413 # DETERMINE MODIFIED FILES OF THE SVN WORKING COPY 1530 1414 source_list="" 1531 1415 cd $source_path 1532 1416 1533 1417 1534 # PRUEFEN, OB VERZEICHNIS UEBERHAUPT UNTER SVN-KONTROLLE STEHT1418 # CHECK, IF DIRECTORY IS UNDER SVN CONTROL 1535 1419 if [[ ! -d .svn ]] 1536 1420 then … … 1542 1426 1543 1427 1544 # ALLE MODIFIZIERTEN QUELLCODEDATEIEN AUFLISTEN1428 # LIST ALL MODIFIED SOURCE CODE FILES 1545 1429 Filenames="" 1546 1430 svn status > tmp_mrun … … 1560 1444 1561 1445 1562 # DATEIEN NACH SOURCES_FOR_RUN_... KOPIEREN1446 # COPY FILES TO SOURCES_FOR_RUN_... 1563 1447 for dateiname in $Filenames 1564 1448 do … … 1570 1454 1571 1455 1572 # MITTELS OPTION -s ANGEGEBENE DATEIEN NACH SOURCES_FOR_RUN_... KOPIEREN 1573 # BEI AUTOMATISCHEN FORTSETZUNGSLAEUFEN SIND DORT SCHON ALLE DATEIEN 1574 # VORHANDEN 1456 # COPY FILES GIVEN BY OPTION -s TO DIRECTORY SOURCES_FOR_RUN_... 1457 # AUTOMATIC RESTART RUNS JUST ACCESS THE DIRECTORY CREATED BY THE INITIAL RUN 1575 1458 elif [[ "$source_list" != "" && $restart_run != true ]] 1576 1459 then … … 1581 1464 do 1582 1465 1583 # QUELLTEXT-DATEI DARF KEINE PFADE BEINHALTEN1466 # SOURCE CODE FILE IS NOT ALLOWED TO INCLUDE PATH 1584 1467 if [[ $(echo $filename | grep -c "/") != 0 ]] 1585 1468 then … … 1605 1488 1606 1489 1607 # PRUEFEN, OB ENTWEDER HAUPTPROGRAMM VORHANDEN UND ES EVTL. IN DER 1608 # LISTE DER ZU UEBERSETZENDEN PROGRAMMTEILE MIT ENTHALTEN IST (WENN 1609 # NICHT, WIRD ES DIESER LISTE HINZUGEFUEGT) 1490 # CHECK, IF A MAIN PROGRAM EXISTS AND IF IT IS PART OF THE LIST OF FILES 1491 # TO BE COMPILED. IF NOT, ADD IT TO THE LIST. 1610 1492 if [[ $restart_run != true ]] 1611 1493 then … … 1627 1509 1628 1510 1629 # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN1630 # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN...1511 # CHECK, IF MAKEFILE EXISTS AND COPY IT TO THE SOURCES_FOR_RUN... DIRECTORY 1512 # NOT REQUIRED FOR RESTART RUNS, SOURCES_FOR_RUN... HAS BEEN CREATED BY THE INITIAL RUN 1631 1513 if [[ "$restart_run" != true ]] 1632 1514 then … … 1642 1524 1643 1525 1644 # DATEIEN AUS ZUSAETZLICHEM QUELLVERZEICHNIS HINZUFUEGEN1526 # COPY FILES FROM OPTIONAL SOURCE PATH GIVEN IN THE CONFIGURATION FILE 1645 1527 if [[ $restart_run != true && "$add_source_path" != "" ]] 1646 1528 then 1647 1529 1648 # GIBT ES DAS VERZEICHNIS UEBERHAUPT?1530 # DOES THE DIRECTORY EXIST? 1649 1531 if [[ ! -d $add_source_path ]] 1650 1532 then … … 1711 1593 else 1712 1594 1713 # Default User-Interface von der Liste entfernen, falls Datei1714 # ein User-Interface enthaelt1715 # if [[ $( cat $dateiname | grep -c "END SUBROUTINE user_parin" ) != 0 ]]1716 # then1717 # if [[ $dateiname != user_interface.f90 && -f user_interface.f90 ]]1718 # then1719 # rm -rf user_interface.f901720 # source_list=`echo $source_list | sed -e 's/user_interface.f90//'`1721 # printf "\n\n *** default \"user_interface.f90\" removed from the files to be translated"1722 # printf "\n since a user-interface is found in file"1723 # printf "\n \"$add_source_path/$dateiname\" \n"1724 # sleep 31725 # else1726 1595 if [[ $found = false ]] 1727 1596 then … … 1744 1613 1745 1614 1746 # A LLE UNTERPROGRAMME, DIE ZU VEREINBARTEN SOFTWAREPAKETEN GEHOEREN,1747 # DER LISTE DER ZU UEBERSETZENDEN DATEIEN HINZUFUEGEN1615 # ADD ALL ROUTINES BELONGING TO SOFTWARE PACKAGES (GIVEN BY OPTION -p) 1616 # TO THE LIST OF FILES TO BE COMPILED 1748 1617 if [[ $restart_run != true && -n $package_list ]] 1749 1618 then … … 1756 1625 [[ $package = "dvrp_graphics+1PE" ]] && package=dvrp_graphics 1757 1626 1758 # ERMITTELE ALLE DATEIEN, DIE ZUM PAKET GEHOEREN1759 # FEHLERMELDUNGEN WERDEN ABGEFANGEN, DA * AUCH VERZEICHNISSNAMEN1760 # LIEFERT1627 # DETERMINE FILES BELONGING TO THE PACKAGE 1628 # ERROR MESSAGE ARE REDIRECTED TO /dev/null, BECAUSE WILDCARD (*) ALSO GIVES 1629 # THE NAME OF THE DIRECTORY 1761 1630 package_source_list=`grep "defined( __$package " * 2>/dev/null | cut -f1 -d:` 1762 1631 1763 1632 1764 # FUEGE DIESE DATEIEN DER LISTE DER ZU UEBERSETZENDEN DATEIEN1765 # HINZU, FALLS SIE NOCH NICHT DAZUGEHOEREN1633 # ADD THESE FILES TO THE LIST OF FILES TO BE COMPILED, 1634 # IF THEY ARE NOT ALREADY PART OF THE LIST 1766 1635 for source_list_name in $package_source_list 1767 1636 do … … 1769 1638 then 1770 1639 1771 # NUR DATEIEN MIT GUELTIGEN ENDUNGEN VERWENDEN1640 # ONLY TAKE FILES WITH VALID SUFFIX 1772 1641 ending=`echo $source_list_name | cut -f2 -d.` 1773 1642 if [[ "$ending" = f90 || "$ending" = F90 || "$ending" = f || "$ending" = F || "$ending" = c ]] … … 1783 1652 fi 1784 1653 1785 1786 # MAKEFILE AUF VORHANDENSEIN PRUEFEN UND KOPIEREN1787 # BEI RESTART-LAEUFEN LIEGT ES SCHON IM VERZEICHNIS SOURCES_FOR_RUN...1788 # if [[ "$restart_run" != true ]]1789 # then1790 # [[ "$makefile" = "" ]] && makefile=$source_path/Makefile1791 # if [[ ! -f $makefile ]]1792 # then1793 # printf "\n +++ file \"$makefile\" does not exist"1794 # locat=make; exit1795 # else1796 # cp $makefile SOURCES_FOR_RUN_$fname/Makefile1797 # fi1798 # fi1799 1800 1654 fi # do_compile=true 1801 1655 1802 1656 1803 # FALLS PROGRAMMTEILE UEBERSETZT WERDEN SOLLEN, FOLGEN JETZT EINIGE1804 # UEBERPRUEFUNGEN UND DAS SETZEN DER PRAEPROZESSOR-DIREKTIVEN1657 # IF SOURCE CODE IS TO BE COMPILED, DO SOME MORE CHECKS 1658 # AND SET PRE-PROCESSOR DIRECTIVES 1805 1659 if [[ $do_compile = true || $create_executable_for_batch = true ]] 1806 1660 then 1807 1661 1808 # PRAEPROZESSOR-DIREKTIVEN ZUM SELEKTIVEN AUSWAEHLEN VON CODETEILEN 1809 # ZUSAMMENSETZEN 1810 # DIREKTIVEN ZUM AKTIVIEREN VON RECHNERSPEZIFISCHEM CODE 1662 # SET PREPROCESSOR-DIRECTIVES TO SELECT OPERATING SYSTEM SPECIFIC CODE 1811 1663 if [[ $(echo $localhost | cut -c1-3) = ibm ]] 1812 1664 then … … 1822 1674 fi 1823 1675 1824 # DIREKTIVEN DIE DURCH OPTION -K BESTIMMT WERDEN (Z.B. PARALLEL)1676 # SET DIRECTIVES GIVEN BY OPTION -K (E.G. parallel) 1825 1677 if [[ $(echo $localhost | cut -c1-3) = ibm ]] 1826 1678 then … … 1832 1684 fi 1833 1685 1834 # DIREKTIVEN DIE SOFTWAREPAKETE AKTIVIEREN(OPTION -p)1686 # SET DIRECTIVES FOR ACTIVATING SOFTWARE-PACKAGES (OPTION -p) 1835 1687 if [[ -n $package_list ]] 1836 1688 then … … 1858 1710 fi 1859 1711 1860 # DIREKTIVEN DIE DURCH OPTION -D FESTGELEGT SIND1712 # SET DIRECTIVES GIVEN BY OPTION -D 1861 1713 if [[ -n $cpp_opts ]] 1862 1714 then … … 1875 1727 1876 1728 1877 # BEI LOKALEN RECHNUNGEN PRUEFEN, OB EXECUTABLE VORHANDEN1729 # FOR LOCAL RUNS CHECK AGAIN, IF EXECUTABLE EXISTS 1878 1730 if [[ $do_remote = false ]] 1879 1731 then … … 1888 1740 1889 1741 1890 # JOBMODUS FESTSTELLEN1742 # DETERMINE THE JOB MODE 1891 1743 if [[ "$ENVIRONMENT" = BATCH ]] 1892 1744 then … … 1897 1749 1898 1750 1899 # no interactive runs on lctit1751 # NO INTERACTIVE RUNS ALLOWED ON LCTIT 1900 1752 if [[ $host = lctit && $jobmo = INTERACTIVE && $do_batch = false ]] 1901 1753 then … … 1906 1758 1907 1759 1908 # HOSTSPEZIFISCHE DEFAULT-COMPILER SETZEN, FALLS NICHT BEREITS 1909 # DURCH BENUTZER ANDERWEITIG VEREINBART 1760 # CHECK, IF USER DEFINED A COMPILER 1910 1761 if [[ "$compiler_name" = "" ]] 1911 1762 then … … 1917 1768 1918 1769 1919 # COMPILER AUF RIAMS NEC UEBERSCHREIBEN 1920 [[ $localhost = necriam ]] && compiler_name=mpif90 1921 1922 1923 1924 # TEMPORAEREN KATALOGNAMEN BESTIMMEN 1770 # DETERMINE THE NAME OF MRUN'S TEMPORARY WORKING DIRECTORY 1925 1771 kennung=$RANDOM 1926 1772 if [[ "$tmp_user_catalog" = "" ]] … … 1939 1785 1940 1786 1941 # KATALOGNAMEN FUER ZWISCHENSPEICHERUNG VON FORTSETZUNGSLAUFDATEIEN 1942 # BESTIMMEN 1787 # DETERMINE THE NAME OF THE DIRECTORY WHICH IS USED TO TEMPORARILY STORE DATA FOR RESTART RUNS 1943 1788 if [[ "$tmp_data_catalog" = "" ]] 1944 1789 then … … 1952 1797 1953 1798 1954 # EVENTUELL BEI LOKALEN RECHNUNGEN $-ZEICHEN IN ENVIRONMENT-VARIABLEN 1955 # ERSETZEN 1799 # IN CASE OF LOCAL RUNS REPLACE ENVIRONMENT VARIABLES BY THEIR VALUES 1956 1800 if [[ $do_remote = false && $do_compile = true || $create_executable_for_batch = true ]] 1957 1801 then … … 1962 1806 1963 1807 1964 # COMPILE- UND LINK-OPTIONEN BESTIMMEN1808 # DETERMINE COMPILE- AND LINK-OPTIONS 1965 1809 fopts="$fopts $netcdf_inc $fftw_inc $dvr_inc" 1966 1810 lopts="$lopts $netcdf_lib $fftw_lib $dvr_lib" 1967 1811 ROPTS="$ropts" 1968 # if [[ ( $(echo $host | cut -c1-3) = nec || $(echo $host | cut -c1-3) = ibm || $host = lckyoto || $host = lc sgih || $host = lcsgib || $host = lctit || $host = lcfimm|| $host = lcflow || $host = lcxe6 || $host = lcxt5m || $host = lck || $host = lckiaps || $host = lckordi || $host = lcsb || $host ) && -n $numprocs ]]1812 # if [[ ( $(echo $host | cut -c1-3) = nec || $(echo $host | cut -c1-3) = ibm || $host = lckyoto || $host = lctit || $host = lcflow || $host = lcxe6 || $host = lcxt5m || $host = lck || $host = lckiaps || $host = lckordi || $host = lcsb || $host ) && -n $numprocs ]] 1969 1813 # then 1970 1814 XOPT="-X $numprocs" … … 1973 1817 1974 1818 1975 # PRUEFEN DER CPU-ZEIT. (CPUMAX WIRD ALS ENV-VARIABLE VOM HAUTPRO-1976 # GRAMM BENOETIGT1819 # CHECK THE CPU-LIMIT. IT MUST BE GIVEN FOR BATCH-JOBS AND IS COMMUNICATED TO THE 1820 # EXECUTABLE VIA NAMELIST-PARAMETER cputime 1977 1821 done=false 1978 1822 while [[ $done = false ]] … … 2000 1844 2001 1845 2002 # PRUEFEN DER KERNSPEICHERANFORDERUNG1846 # CHECK THE MEMORY DEMAND 2003 1847 if [[ $do_batch = true ]] 2004 1848 then … … 2019 1863 2020 1864 2021 # PRUEFEN, OB FUER REMOTE-RECHNUNGEN EIN BENUTZERNAME ANGEGEBEN WURDE1865 # IN CASE OF REMOTE-JOBS CHECK, IF A USERNAME FOR THE REMOTE HOST IS GIVEN 2022 1866 if [[ $do_remote = true && -z $remote_username ]] 2023 1867 then … … 2039 1883 2040 1884 2041 # set module load command and export forsubjob1885 # SET THE MODULE-LOAD COMMAD AND EXPORT IT FOR subjob 2042 1886 if [[ "$modules" != "" ]] 2043 1887 then … … 2050 1894 fi 2051 1895 2052 # bugfix for wrong netcdf module and for netCDF4 usage in case of mpt 2053 if [[ $host = lcsgib || $host = lcsgih ]] 2054 then 2055 if [[ $(echo $module_calls | grep -c netcdf/3.6.3-intel) != 0 ]] 2056 then 2057 export module_calls="$module_calls export LD_LIBRARY_PATH=/sw/dataformats/netcdf/3.6.3-intel/lib:\$LD_LIBRARY_PATH;" 2058 fi 2059 # if [[ $(echo $module_calls | grep -c mpt) != 0 ]] 2060 # then 2061 # export module_calls="$module_calls export LD_LIBRARY_PATH=/sw/sgi/mpt/2011-02-07/lib:\$LD_LIBRARY_PATH;" 2062 # echo "*** module_calls = $module_calls" 2063 # fi 2064 fi 2065 2066 2067 # SET DEFAULT VALUE FOR MPI MODULE TO BE USED ON SGI-ALTIX 2068 if [[ $host = lcsgib || $host = lcsgih ]] 2069 then 2070 if [[ $(echo $modules | grep -c mpt ) != 0 ]] 2071 then 2072 mpilib=mpt 2073 elif [[ $(echo $modules | grep -c mvapich ) != 0 ]] 2074 then 2075 mpilib=mvapich 2076 elif [[ $(echo $modules | grep -c impi ) != 0 ]] 2077 then 2078 mpilib=impi 2079 fi 2080 fi 2081 2082 2083 2084 ########################################################################### 2085 # HEADER-AUSGABE 2086 ########################################################################### 2087 2088 1896 1897 1898 # OUTPUT OF THE MRUN-HEADER 2089 1899 calltime=$(date) 2090 1900 printf "\n" 2091 # [[ $silent = false ]] && clear2092 1901 printf "#------------------------------------------------------------------------# \n" 2093 1902 printf "| %-35s%35s | \n" "$version" "$calltime" … … 2095 1904 spalte1="called on:"; spalte2=$localhost_realname 2096 1905 printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" 2097 if [[ $local_compile = false ]] 2098 then 2099 if [[ $do_remote = true ]] 2100 then 2101 spalte1="execution on:"; spalte2="$host (username: $remote_username)" 2102 else 2103 spalte1="execution on:"; spalte2="$host ($localhost_realname)" 2104 fi 1906 if [[ $do_remote = true ]] 1907 then 1908 spalte1="execution on:"; spalte2="$host (username: $remote_username)" 2105 1909 else 2106 spalte1=" compiling test only!"; spalte2=""1910 spalte1="execution on:"; spalte2="$host ($localhost_realname)" 2107 1911 fi 2108 1912 printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" … … 2246 2050 2247 2051 2248 # BEDINGTE AUSGABE DER DATEIVERBINDUNGEN2052 # OUTPUT OF FILE CONNECTIONS IN CASE OF TRACEBACK 2249 2053 if [[ $do_trace = true ]] 2250 2054 then … … 2292 2096 2293 2097 2294 # ABFRAGEN BEI AUFRUF AUF LOKALER MASCHINE2098 # QUERY FOR CONTINUE (ON LOCAL MACHINES ONLY) 2295 2099 if [[ $remotecall = false && $silent = false && $jobmo != BATCH ]] 2296 2100 then … … 2315 2119 printf " >>> batch-job will be created and submitted" 2316 2120 else 2317 if [[ $local_compile = false ]] 2318 then 2319 printf " >>> MRUN will now continue to execute on this machine" 2320 else 2321 printf " >>> a test compilation will now be carried out on this machine" 2322 fi 2121 printf " >>> MRUN will now continue to execute on this machine" 2323 2122 fi 2324 2123 fi … … 2544 2343 if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] 2545 2344 then 2546 # EVENTUELLE DOPPELPUNKTE AUS OPTIONSSTRING UND ALLE -D ENTFERNEN2345 # REMOVE COLONS FROM OPTION-STRING, REMOVE ALL -D OPTIONS 2547 2346 line="$line " 2548 2347 copts_check=`echo $line | cut -d" " -s -f2 | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g' | sed 's/-D[^ ]* //g' | sed 's/ -D.*//g'` … … 2821 2620 2822 2621 2823 # FALLS AUF DIESER MASCHINE GERECHNET WERDEN SOLL, WERDEN JETZT ENTSPRE-2824 # CHENDE AKTIONEN DURCHGEFUEHRT2622 # NOW PERFORM THOSE ACTIONS REQUIRED TO EXECUTE THE PROGRAM (PALM) ON THIS MACHINE 2623 # (COMPILING/LINKING, EXECUTING, COPYING I/O FILES) 2825 2624 if [[ $do_batch = false ]] 2826 2625 then 2827 2626 2828 2627 2829 # TEMPORAEREN KATALOG ERZEUGEN2628 # CREATE THE TEMPORARY WORKING DIRECTORY 2830 2629 mkdir -p $TEMPDIR 2831 2630 chmod go+rx $TEMPDIR … … 2833 2632 2834 2633 2835 # SAEMTLICHE QUELLTEXT-DATEIEN BZW. AUSFUEHRBARES PROGRAMM IN2836 # TEMPORAERES VERZEICHNIS KOPIEREN2634 # COPY EITHER THE COMPLETE SOURCE CODE FILES TO BE COMPILED OR THE EXECUTABLE 2635 # INTO THE TEMPORARY WORKING DIRECTORY 2837 2636 if [[ $do_compile = true ]] 2838 2637 then … … 2878 2677 2879 2678 2880 # WECHSEL IN TEMPORAEREN KATALOG2679 # CHANGE TO THE TEMPORARY WORKING DIRECTORY 2881 2680 cd $TEMPDIR 2882 2681 printf "\n *** changed to temporary directory: $TEMPDIR" 2883 2682 2884 2683 2885 # OUTPUT-DATEI-VERBINDUNGEN AUF TEMPORAERER DATEI ABLEGEN2886 # DIESE DATEI KANN VON SPAETER AUFZURUFENDEN BENUTZERPROZEDUREN GELESEN2887 # WERDEN, UM ZU LOKALEN DATEINAMEN GEHOERENDE PERMANENTE NAMEN ZU2888 # ERMITTELN2684 # THE FOLLOWING IS REQUIRED FPR AVS-OUTPUT WITH PALM ??? REMOVE ??? 2685 # WRITE INFORMATIONS ABOUT THE OUTPUT-FILE CONNECTIONS TO A TEMPORARY FILE 2686 # THIS FILE CAN LATER BE READ FROM USER-DEFINED CODE TO DETERMINE THE 2687 # RELATION BETWEEN THE LOCAL TEMPORARY AND PERMANENT FILE NAMES 2889 2688 (( i = 0 )) 2890 2689 while (( i < iout )) … … 2900 2699 2901 2700 2902 # IF REQUIRED, START WITH COMPILING ACTIONS2701 # IF REQUIRED, START WITH COMPILING 2903 2702 if [[ $do_compile = true ]] 2904 2703 then … … 2915 2714 2916 2715 # COMPILING WITH MAKE (ON NEC COMPILER IS CALLED ON HOST CROSS) 2917 printf "\n\n\n *** compilation starts \n$ striche\n"2716 printf "\n\n\n *** compilation starts \n$dashes\n" 2918 2717 printf " *** compilation with make using following options:\n" 2919 2718 printf " make depository: $make_depository" … … 2943 2742 ssh $SSH_PORTOPT plogin1 -l $usern "$init_cmds export PATH=/sw/ibm/xlf/13.1.0.8/usr/bin:$PATH; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " 2944 2743 [[ ! -f a.out ]] && compile_error=true 2945 continue # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN 2946 elif [[ $localhost = lcsgib ]] 2947 then 2948 printf " compiler is called via ssh on \"bicegate0\" \n" 2949 ssh $SSH_PORTOPT bicegate0 -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " 2950 [[ ! -f a.out ]] && compile_error=true 2951 continue # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN 2952 elif [[ $localhost = lcsgih ]] 2953 then 2954 printf " compiler is called via ssh on \"hicegate0\" \n" 2955 ssh $SSH_PORTOPT hicegate0 -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" 2>&1 " 2956 [[ ! -f a.out ]] && compile_error=true 2957 continue # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN 2744 continue # STATUS=1, IF a.out EXISTS 2958 2745 elif [[ $localhost = lcflow ]] 2959 2746 then … … 2962 2749 check_for_file=`/usr/bin/ssh $SSH_PORTOPT flow02.hpc.uni-oldenburg.de -l $usern "ls $TEMPDIR/a.out 2> /dev/null"` 2963 2750 [[ "$check_for_file" = "" ]] && compile_error=true 2964 continue # ANDERENFALLS IST STATUS=1, FALLS A.OUT VORHANDEN2751 continue # STATUS=1, IF a.out EXISTS 2965 2752 elif [[ $localhost = lccrayb || $localhost = lccrayf || $localhost = lccrayh ]] 2966 2753 then … … 2979 2766 exit 2980 2767 else 2981 printf "$striche\n *** compilation finished \n" 2982 fi 2983 2984 fi 2985 2986 fi 2987 2988 2989 # FALLS NUR TESTWEISE KOMPILIERT WERDEN SOLLTE, IST MRUN JETZT FERTIG 2990 if [[ $local_compile = true ]] 2991 then 2992 cd $HOME 2993 rm -rf $TEMPDIR 2994 locat=local_compile; exit 2995 fi 2996 2997 2998 # BEREITSTELLEN DER INPUT-DATEIEN 2999 # SCHLEIFE UEBER ALLE VOM BENUTZER ANGEGEBENEN DATEIEN 2768 printf "$dashes\n *** compilation finished \n" 2769 fi 2770 2771 fi 2772 2773 fi 2774 2775 2776 # PROVIDE THE INPUT FILES 2777 # LOOP OVER ALL ACTIVATED FILES (LISTED IN THE CONFIGURATION FILE) 3000 2778 (( i = 0 )) 3001 2779 while (( i < iin )) … … 3004 2782 if (( i == 1 )) 3005 2783 then 3006 printf "\n\n *** providing INPUT-files:\n$ striche"3007 fi 3008 3009 3010 # OPTIONALE DATEIEN BEI NICHTVORHANDENSEIN UEBERGEHEN2784 printf "\n\n *** providing INPUT-files:\n$dashes" 2785 fi 2786 2787 2788 # SKIP OPTIONAL FILES, IF THEY DO NOT EXIST 3011 2789 if [[ "${transin[$i]}" = unavailable ]] 3012 2790 then … … 3022 2800 fi 3023 2801 3024 # PRUEFEN, OB EINZELDATEI ODER DATEI PRO PROZESSOR2802 # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION) 3025 2803 files_for_pes=false; datentyp=file 3026 2804 if [[ "${actionin[$i]}" = pe && -n $numprocs ]] … … 3054 2832 fi 3055 2833 3056 # INPUT-DATEI FUER EINEN FORTSETZUNGSLAUF. ES WIRD GEPRUEFT, 3057 # OB DIESE DATEI NOCH AUF DEM TEMPORAEREN DATENKATALOG VORHANDEN 3058 # IST. FALLS NICHT, WIRD VERSUCHT, SIE ANSCHLIESSEND VOM ARCHIV- 3059 # SERVER ZU HOLEN 2834 # INPUT-FILE FOR A RESTART RUN. 2835 # CHECK, IF THIS FILE STILL EXISTS ON THE TEMPORARY DATA DIRECTORY. 2836 # IF NOT, TRY TO GET IT FROM THE ARCHIVE SYSTEM 3060 2837 if [[ "${actionin[$i]}" = fl ]] 3061 2838 then … … 3104 2881 3105 2882 3106 # DATEI LIEGT AUF ARCHIV-SERVER2883 # FILE IS STORED ON THE ARCHIVE SYSTEM 3107 2884 if [[ "${actionin[$i]}" = ar ]] 3108 2885 then … … 3162 2939 if [[ $files_for_pes = false ]] 3163 2940 then 3164 if [[ $localhost = lcsgih ]] 3165 then 3166 ssh $SSH_PORTOPT $usern@hicedata.hlrn.de "cp $PERM/${frelin[$i]} $PWD" 3167 else 3168 ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cp $PERM/${frelin[$i]} $PWD" 3169 fi 2941 ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cp $PERM/${frelin[$i]} $PWD" 3170 2942 else 3171 2943 (( inode = 0 )) 3172 2944 while (( inode < nodes )) 3173 2945 do 3174 if [[ $localhost = lcsgih ]] 3175 then 3176 ssh $SSH_PORTOPT $usern@hicedata.hlrn.de "cd $PWD; tar xf $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar" 3177 else 3178 ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cd $PWD; tar xf $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar" 3179 fi 2946 ssh $SSH_PORTOPT $usern@bicedata.hlrn.de "cd $PWD; tar xf $PERM/${frelin[$i]}/${frelin[$i]}.node_$inode.tar" 3180 2947 (( inode = inode + 1 )) 3181 2948 done … … 3205 2972 then 3206 2973 3207 # DATEI AUCH AUF TEMPORAERES DATENVERZEICHNIS LEGEN, DAMIT3208 # SIE BEI WEITEREN ZUGRIFFEN NOCH VORHANDEN IST2974 # PUT FILE ON THE TEMPORARY DATA DIRECTORY TOO. 2975 # THIS WILL MAKE FILE ACCESS EASIER FOR LATER RUNS 3209 2976 [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog; chmod g+rx $tmp_data_catalog 3210 2977 if [[ $files_for_pes = false ]] … … 3217 2984 got_tmp[$i]=true 3218 2985 3219 # DATEI UNTER LOKALEM NAMEN ZUR VERFUEGUNG STELLEN2986 # PROVIDE THE FILE UNDER ITS LOCAL NAME 3220 2987 mv ${frelin[$i]} ${localin[$i]} 3221 2988 … … 3224 2991 3225 2992 3226 # DATEI LIEGT IM VOM BENUTZER ANGEGEBENEN VERZEICHNIS2993 # FILE IS STORED IN THE RESPECTIVE DIRECTORY GIVEN IN THE CONFIGURATION FILE 3227 2994 if [[ "${actionin[$i]}" = "" || "${actionin[$i]}" = "di" || "${actionin[$i]}" = "npe" ]] 3228 2995 then … … 3231 2998 then 3232 2999 3233 # DATEI WIRD FUER DIE PROZESSOREN EINES PARALLERECHNERS BEREITGESTELLT 3000 # FILE COPIES ARE PROVIDED FOR ALL CORES 3001 # EACH FILE GETS A UNIQUE FILENAME WITH A FOUR DIGIT NUMBER 3234 3002 printf "\n file will be provided for $numprocs processors" 3235 3003 mkdir ${localin[$i]} … … 3258 3026 then 3259 3027 3260 # DIE DEN PROZESSOREN EINES PARALLELRECHNERS ZUGEHOERIGEN 3261 # DATEIEN WERDEN BEREITGESTELLT, INDEM ZUERST DER GESAMTE 3262 # KATALOGINHALT KOPIERT UND DANN DIE EINZELNEN DATEIEN 3263 # PER MOVE UMBENANNT WERDEN 3028 # PROVIDE FILES FOR EACH CORE 3029 # FIRST CREATE THE LOCAL DIRECTORY, THEN COPY FILES 3030 # FROM THE PERMANENT DIRECTORY BY LINKING THEM TO THE LOCAL ONE 3264 3031 printf "\n providing $numprocs files for the respective processors" 3265 3032 mkdir ${localin[$i]} … … 3274 3041 cd $TEMPDIR 3275 3042 fi 3276 # If "ln -f" fails of if "$link_local_input = false" do a normal "cp -r" 3043 3044 # IF "ln -f" FAILED OR IF "$link_local_input = false" DO A NORMAL "cp -r" 3277 3045 if [[ ! -f "${localin[$i]}/_0000" ]] 3278 3046 then … … 3285 3053 3286 3054 else 3287 # BEREITSTELLUNG AUF EINPROZESSORRECHNERN 3055 3056 # PROVIDE FILE FOR RUNS ON A SINGLE CORE 3288 3057 if [[ $link_local_input = true ]] 3289 3058 then … … 3307 3076 if (( i != 0 )) 3308 3077 then 3309 printf "\n$ striche\n *** all INPUT-files provided \n"3310 fi 3311 3312 3313 # E VENTUELLE INPUT-KOMMANDOS ABARBEITEN3078 printf "\n$dashes\n *** all INPUT-files provided \n" 3079 fi 3080 3081 3082 # EXECUTE INPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE 3314 3083 (( i = 0 )) 3315 3084 while (( i < iic )) … … 3318 3087 if (( i == 1 )) 3319 3088 then 3320 printf "\n\n *** execution of INPUT-commands:\n$ striche"3089 printf "\n\n *** execution of INPUT-commands:\n$dashes" 3321 3090 fi 3322 3091 printf "\n >>> ${in_command[$i]}" … … 3324 3093 if (( i == iic )) 3325 3094 then 3326 printf "\n$ striche\n"3095 printf "\n$dashes\n" 3327 3096 fi 3328 3097 done 3329 3098 3330 3099 3331 # VERBLEIBENDE CPU-ZEIT BERECHNEN3100 # SET THE REMAINING CPU-TIME 3332 3101 cpurest=${cpumax}. 3333 3102 … … 3341 3110 printf "\n\n *** preparing the dvr streaming server configuration file" 3342 3111 3343 # C heck, if a dvr server is already running3112 # CHECK, IF A DVR SERVER IS ALREADY RUNNING 3344 3113 running_dvrserver_id=`echo $(ps -edaf | grep .dvrserver.config | grep -v grep) | cut -d" " -f2` 3345 3114 if [[ "$running_dvrserver_id" != "" ]] … … 3357 3126 cp ${PALM_BIN}/.dvrserver.config . 3358 3127 3359 # E ntering the BASEDIR, UID and GID into this file3128 # ENTERING THE BASEDIR, UID AND GID INTO THIS FILE 3360 3129 user_id=`id -u` 3361 3130 group_id=`id -g` 3362 # & is needed as seperator, because TEMPDIR contains / 3131 3132 # "&" IS REQUIRED AS A SEPERATOR, BECAUSE TEMPDIR CONTAINS "/" 3363 3133 sed "s&<replace by dvr data directory>&${TEMPDIR}&g" .dvrserver.config > .dvrserver.1 3364 3134 sed "s/<replace by user id>/$user_id/g" .dvrserver.1 > .dvrserver.2 … … 3367 3137 rm .dvrserver.1 .dvrserver.2 3368 3138 3369 # S tart dvr server in background, get his id and print on terminal3139 # START DVR SERVER IN BACKGROUND, GET HIS ID AND PRINT ON TERMINAL 3370 3140 $dvr_server .dvrserver.config >> DVR_LOGFILE 2>&1 & 3371 3141 dvrserver_id=`echo $(ps -edaf | grep .dvrserver.config) | cut -d" " -f2` … … 3387 3157 3388 3158 3389 # NAMELIST-DATEI MIT WERTEN VON ENVIRONMENT-VARIABLEN ERZEUGEN (ZU3390 # LESEN VONPALM)3159 # CREATE THE NAMELIST-FILE WITH VALUES OF ENVIRONMENT-VARIABLES REQUIRED BY PALM 3160 # (FILE ENVPAR WILL BE READ BY PALM) 3391 3161 cat > ENVPAR << %%END%% 3392 3162 &envpar run_identifier = '$fname', host = '$localhost', … … 3400 3170 3401 3171 3402 # PROGRAMMSTART3403 printf "\n\n *** execution starts in directory\n \"`pwd`\"\n$ striche\n"3172 # STARTING THE EXECUTABLE 3173 printf "\n\n *** execution starts in directory\n \"`pwd`\"\n$dashes\n" 3404 3174 PATH=$PATH:$TEMPDIR 3405 3175 3406 # MPI debug option (argument checking, slows down execution due to increased latency)3176 # MPI DEBUG OPTION (ARGUMENT CHECKING, SLOWS DOWN EXECUTION DUE TO INCREASED LATENCY) 3407 3177 if [[ "$mpi_debug" = true ]] 3408 3178 then … … 3423 3193 if [[ "$ENVIRONMENT" = BATCH ]] 3424 3194 then 3425 if [[ $(echo $localhost | cut -c1-5) != lcsgi ]] 3426 then 3427 printf "\n +++ debug is allowed in interactive mode only" 3428 locat=debug 3429 exit 3430 fi 3195 continue 3431 3196 fi 3432 3197 if [[ $localhost = ibmh ]] … … 3464 3229 totalview poe -a a.out -procs $numprocs -rmpool 0 -nodes 1 $ROPTS 3465 3230 fi 3466 elif [[ $(echo $localhost | cut -c1-5) = lcsgi ]] 3467 then 3468 # CURRENTLY NO DEBUGGER ON LCSGI 3469 if [[ $run_coupled_model = true ]] 3470 then 3471 printf "\n +++ no debug in coupled mode available on \"$localhost\" " 3472 locat=debug 3473 exit 3474 else 3475 echo "no_coupling" > runfile_atmos 3476 fi 3477 (( ii = $numprocs / $threads_per_task )) 3478 export OMP_NUM_THREADS=$threads_per_task 3479 echo "OMP_NUM_THREADS=$OMP_NUM_THREADS" 3480 if [[ $threads_per_task != 1 ]] 3481 then 3482 printf "\n threads per task: $threads_per_task" 3483 fi 3484 printf "\n\n" 3485 if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]] 3486 then 3487 # export MPI_LAUNCH_TIMEOUT=360 3488 if [[ "$totalview" = true ]] 3489 then 3490 printf "\n running totalview debugger" 3491 mpiexec_mpt $tv_opt -n $ii ./a.out $ROPTS < runfile_atmos 3492 else 3493 mpiexec_mpt -np $ii ./a.out $ROPTS < runfile_atmos 3494 fi 3495 elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]] 3496 then 3497 # ulimit -s 300000 # A too large stack size causes problems 3498 # export MV2_NUM_PORTS=2 3499 # export MV2_CPU_MAPPING=0:1:2:3 3500 if [[ "$totalview" = true ]] 3501 then 3502 printf "\n running totalview debugger" 3503 mpiexec $tv_opt ./a.out $ROPTS < runfile_atmos 3504 else 3505 mpiexec ./a.out $ROPTS < runfile_atmos 3506 fi 3507 fi 3508 else 3509 printf "\n +++ no debug available on \"$localhost\" " 3510 printf "\n or not implemented in mrun so far" 3511 locat=debug 3512 exit 3513 fi 3514 3515 # end debug mode 3231 3232 # END DEBUG MODE 3516 3233 else 3517 3234 3518 # normal execution3235 # NORMAL EXECUTION 3519 3236 if [[ -n $numprocs ]] 3520 3237 then 3238 3521 3239 # RUNNING THE PROGRAM ON PARALLEL MACHINES 3522 3240 if [[ $(echo $host | cut -c1-3) = ibm ]] 3523 3241 then 3242 3524 3243 # SETUP THE IBM MPI ENVIRONMENT 3525 3244 if [[ $host != ibmh && $host != ibmkisti ]] … … 3533 3252 # export MP_PRINTENV=yes 3534 3253 3535 # TUNING-VARIABLE N ZUR VERBESSERUNG DER KOMMUNIKATION3536 # ZEIGEN ABER DERZEIT (SEP 04, FEDERATION) KAUM WIRKUNG3254 # TUNING-VARIABLES TO IMPROVE COMMUNICATION SPEED 3255 # DO NOT SHOW SIGNIFICANT EFFECTS (SEP 04, FEDERATION-SWITCH) 3537 3256 export MP_WAIT_MODE=poll 3538 3257 [[ $node_usage = not_shared ]] && export MP_SINGLE_THREAD=yes … … 3581 3300 then 3582 3301 poe a.out -procs $numprocs -nodes 1 -rmpool 0 $ROPTS 3583 elif [[ $localhost = ibmkisti || $localhost = ibmku || $localhost = ibmy]]3302 elif [[ $localhost = ibmkisti || $localhost = ibmku ]] 3584 3303 then 3585 3304 if [[ -f $hostfile ]] … … 3611 3330 echo "coupled_run $iia $iio" > runfile_atmos 3612 3331 fi 3613 if [[ $localhost = ibmy ]] 3614 then 3615 ./a.out -procs $tasks_per_node $ROPTS < runfile_atmos 3616 else 3617 poe ./a.out -procs $numprocs $ROPTS < runfile_atmos 3618 fi 3332 3333 poe ./a.out -procs $numprocs $ROPTS < runfile_atmos 3619 3334 3620 3335 else … … 3631 3346 fi 3632 3347 fi 3633 elif [[ $host = nech || $host = necriam]]3348 elif [[ $host = nech ]] 3634 3349 then 3635 3350 (( ii = nodes )) … … 3689 3404 # COPY HOSTFILE FROM SOURCE DIRECTORY OR CREATE IT, IF IT 3690 3405 # DOES NOT EXIST 3691 if [[ $host != lccrayb &&$host != lccrayf && $host != lccrayh && $host != lc sgih && $host != lcsgib && $host != lckyuh && $host != lckyut ]]3406 if [[ $host != lccrayb &&$host != lccrayf && $host != lccrayh && $host != lckyuh && $host != lckyut ]] 3692 3407 then 3693 3408 if [[ -f $hostfile ]] … … 3709 3424 (( ii = $numprocs / $threads_per_task )) 3710 3425 export OMP_NUM_THREADS=$threads_per_task 3711 # echo "*** OMP_NUM_THREADS=$OMP_NUM_THREADS" 3426 3712 3427 if [[ $threads_per_task != 1 ]] 3713 3428 then 3714 # increase stack size to unlimited, because large runs3715 # may abort otherwise3429 # INCREASE STACK SIZE TO UNLIMITED, BECAUSE OTHERWISE LARGE RUNS 3430 # MAY ABORT 3716 3431 ulimit -Ss unlimited 3717 3432 printf "\n threads per task: $threads_per_task stacksize: unlimited" … … 3726 3441 fi 3727 3442 printf "\n\n" 3728 if [[ $host = lcsgih || $host = lcsgib ]] 3729 then 3730 if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]] 3731 then 3732 # MPI_DSM_DISTRIBUTE not necessary when MPI_DSM_CPULIST is set 3733 # export MPI_DSM_DISTRIBUTE=1 3734 # MPI_DSM_CPULIST: pin MPI processes to cores 3735 if [[ $use_openmp = false ]] 3736 then 3737 if [[ "$sgi_feature" = ice2 ]] 3738 then 3739 export MPI_DSM_CPULIST="0,4,1,5,2,6,3,7:allhosts" 3740 else 3741 export MPI_DSM_CPULIST="0,1,4,5,2,3,6,7:allhosts" 3742 fi 3743 else 3744 unset MPI_DSM_CPULIST 3745 fi 3746 # MPI_IB_RAILS: use both IB rails on ICE2 3747 export MPI_BUFS_PER_HOST=512 3748 export MPI_IB_RAILS=2 3749 # NECESSARY, IF MORE THAN 4096 PEs ARE USED 3750 export MPI_CONNECTIONS_THRESHOLD=8192 3751 # echo "*** MPI_DSM_CPULIST=$MPI_DSM_CPULIST" 3752 export MPI_TYPE_DEPTH=20 3753 # echo "*** MPI_TYPE_DEPTH=$MPI_TYPE_DEPTH" 3754 export MPI_GROUP_MAX=64 3755 # echo "*** MPI_GROUP_MAX=$MPI_GROUP_MAX" 3756 if [[ $use_openmp = true ]] 3757 then 3758 echo " mpiexec -npernode $tasks_per_node ./a.out $ROPTS < runfile_atmos" 3759 mpiexec -npernode $tasks_per_node $tv_opt ./a.out $ROPTS < runfile_atmos 3760 else 3761 mpiexec_mpt -np $ii $tv_opt ./a.out $ROPTS < runfile_atmos 3762 fi 3763 3764 # next is test for openmp usage 3765 # echo "mpiexec -npernode $tasks_per_node ./a.out $ROPTS < runfile_atmos" 3766 # mpiexec -npernode $tasks_per_node ./a.out $ROPTS < runfile_atmos 3767 elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]] 3768 then 3769 export MV2_NUM_PORTS=2 3770 # The default setting of MV2_CPU_MAPPING gives best results 3771 # export MV2_ENABLE_AFFINITY=1 3772 # export MV2_CPU_MAPPING=0,1,4,5,2,3,6,7 3773 # if [[ "$sgi_feature" = ice2 ]] 3774 # then 3775 # export MV2_CPU_MAPPING=0,4,1,5,2,6,3,7 3776 # else 3777 # export MV2_CPU_MAPPING=0,1,4,5,2,3,6,7 3778 # fi 3779 if [[ $use_openmp = true ]] 3780 then 3781 unset MV2_CPU_MAPPING 3782 export MV2_ENABLE_AFFINITY=0 3783 fi 3784 echo "*** MV2_CPU_MAPPING=$MV2_CPU_MAPPING" 3785 echo "*** MV2_ENABLE_AFFINITY=$MV2_ENABLE_AFFINITY" 3786 if [[ $use_openmp = true ]] 3787 then 3788 echo " mpiexec -npernode $tasks_per_node ./a.out $ROPTS < runfile_atmos" 3789 mpiexec -npernode $tasks_per_node $tv_opt ./a.out $ROPTS < runfile_atmos 3790 else 3791 mpiexec -np $ii $tv_opt ./a.out $ROPTS < runfile_atmos 3792 fi 3793 elif [[ "$mpilib" = impi ]] 3794 then 3795 echo "mpirun -np $ii inspxe-cl -r result -collect mi3 -- ./a.out < runfile_atmos" 3796 mpirun -np $ii inspxe-cl -r result -collect mi3 -- ./a.out < runfile_atmos 3797 fi 3798 elif [[ $host = lccrayb || $host = lccrayh ]] 3443 3444 if [[ $host = lccrayb || $host = lccrayh ]] 3799 3445 then 3800 3446 echo "--- aprun -n $ii -N $tasks_per_node a.out $ROPTS < runfile_atmos" … … 3824 3470 else 3825 3471 3826 # currently there is no full MPI-2 support on ICE andXT43472 # CURRENTLY THERE IS NO FULL MPI-2 SUPPORT ON ICE AND XT4 3827 3473 (( iia = $numprocs_atmos / $threads_per_task )) 3828 3474 (( iio = $numprocs_ocean / $threads_per_task )) … … 3835 3481 echo "atmosphere_to_ocean $iia $iio" > runfile_atmos 3836 3482 echo "ocean_to_atmosphere $iia $iio" > runfile_ocean 3837 if [[ $host = lcsgih || $host = lcsgib ]] 3838 then 3839 3840 if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]] 3841 then 3842 # export MPI_LAUNCH_TIMEOUT=360 3843 mpiexec_mpt -np $iia ./a.out $ROPTS < runfile_atmos & 3844 mpiexec_mpt -np $iio ./a.out $ROPTS < runfile_ocean & 3845 elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]] 3846 then 3847 # ulimit -s 300000 # A too large stack size causes problems 3848 # export MV2_NUM_PORTS=2 3849 # export MV2_CPU_MAPPING=0:1:2:3 3850 mpiexec -n $iia ./a.out $ROPTS < runfile_atmos & 3851 mpiexec -n $iio ./a.out $ROPTS < runfile_ocean & 3852 fi 3853 3854 elif [[ $host = lccrayf || $host = lcxe6 || $host = lcxt5m ]] 3483 3484 if [[ $host = lccrayf || $host = lcxe6 || $host = lcxt5m ]] 3855 3485 then 3856 3486 … … 3870 3500 3871 3501 echo "coupled_run $iia $iio" > runfile_atmos 3872 if [[ $host = lcsgih || $host = lcsgib ]] 3873 then 3874 3875 if [[ $( echo $mpilib | cut -c1-3 ) = mpt ]] 3876 then 3877 # export MPI_LAUNCH_TIMEOUT=360 3878 mpiexec_mpt -np $ii ./a.out $ROPTS < runfile_atmos 3879 elif [[ $( echo $mpilib | cut -c1-3 ) = mva ]] 3880 then 3881 # ulimit -s 300000 # A too large stack size causes problems 3882 # export MV2_NUM_PORTS=2 3883 # export MV2_CPU_MAPPING=0:1:2:3 3884 mpiexec ./a.out $ROPTS < runfile_atmos 3885 fi 3886 3887 elif [[ $host = lccrayf || $host = lcxe6 || $host = lcxt5m ]] 3502 3503 if [[ $host = lccrayf || $host = lcxe6 || $host = lcxt5m ]] 3888 3504 then 3889 3505 … … 3905 3521 3906 3522 fi 3523 3907 3524 elif [[ $host = lckyoto ]] 3908 3525 then … … 3930 3547 fi 3931 3548 set +xv 3549 3932 3550 elif [[ $host = lctit ]] 3933 3551 then … … 3947 3565 mpprun -n $numprocs a.out $ROPTS 3948 3566 fi 3949 [[ $? != 0 ]] && execution_error=true3950 3951 3952 # PERFORMANCE-AUSWERTUNG MIT APPRENTICE3953 if [[ "$cond1" = apprentice || "$cond2" = apprentice ]]3954 then3955 apprentice3956 fi3957 3567 else 3958 3568 a.out $ROPTS 3959 3569 fi 3960 3570 fi 3961 if [[ $? != 0 || $execution_error = true ]] 3962 then3963 3964 # ABBRUCH BEI LAUFZEITFEHLER 3965 # [[ ! ( "$cond1" = debug || "$cond2" = debug ) ]] && cat aout_output* 3571 3572 if [[ $? != 0 ]] 3573 then 3574 3575 # ABORT IN CASE OF RUNTIME ERRORS 3966 3576 printf "\n +++ runtime error occured" 3967 3577 locat=execution 3968 3578 exit 3579 3969 3580 else 3970 # [[ ! ( "$cond1" = debug || "$cond2" = debug ) ]] && cat aout_output* 3971 printf "\n$ striche\n *** execution finished \n"3972 3973 # S top the dvr streaming server and process the dvr output in order3974 # to create dvrs- and html-files containing all streams3581 3582 printf "\n$dashes\n *** execution finished \n" 3583 3584 # STOP THE DVR STREAMING SERVER AND PROCESS THE DVR OUTPUT IN ORDER 3585 # TO CREAT DVRS- AND HTML-FILES CONTAINING ALL STREAMS 3975 3586 if [[ "$dvrserver_id" != "" ]] 3976 3587 then … … 3978 3589 printf "\n *** dvr server with id=$dvrserver_id has been stopped" 3979 3590 3980 # I f there is a directory, data have been output by the3981 # streaming server. Otherwise, user has chosendvrp_output=local3591 # IF THERE IS A DIRECTORY, DATA HAVE BEEN OUTPUT BY THE 3592 # STREAMING SERVER. OTHERWISE, USER HAS CHOSEN dvrp_output=local 3982 3593 if [[ -d DATA_DVR ]] 3983 3594 then 3984 3595 3985 # A dd the current dvr configuration file to the dvr output3986 # directory3596 # ADD THE CURRENT DVR CONFIGURATION FILE TO THE DVR OUTPUT 3597 # DIRECTORY 3987 3598 cp .dvrserver.config DATA_DVR 3988 3599 3989 # P rocess the dvr output (option -s for also generating3990 # sequence mode data)3600 # PROCESS THE DVR OUTPUT (OPTION -s FOR GENERATING 3601 # SEQUENCE MODE DATA TOO) 3991 3602 process_dvr_output -d DATA_DVR -f $fname -s 3992 3603 3993 3604 else 3994 3605 3995 # P rocess the local output3606 # PROCESS THE LOCAL OUTPUT 3996 3607 process_dvr_output -l -d DATA_DVR -f $fname 3997 3608 … … 4001 3612 then 4002 3613 4003 # P rocess dvr output generated in local mode(dvrp_output=local)3614 # PROCESS DVR OUTPUT GENERATD IN LOCAL MODE (dvrp_output=local) 4004 3615 process_dvr_output -l -d DATA_DVR -f $fname 4005 3616 … … 4009 3620 4010 3621 4011 # C all of combine_plot_fields in order to merge single files written4012 # by each PE into one file.3622 # CALL OF combine_plot_fields IN ORDER TO MERGE SINGLE FILES WRITTEN 3623 # BY EACH CORE INTO ONE FILE 4013 3624 if [[ ! -f ${PALM_BIN}/combine_plot_fields${block}.x ]] 4014 3625 then … … 4027 3638 fi 4028 3639 else 4029 # Temporary solution to skip combine_plot_fields. This is necessary in case of huge amount of 4030 # data output. To do: extend this branch by creating a batch job for combine_plot_fields. 3640 3641 # TEMPORARY SOLUTION TO SKIP combine_plot_fields. THIS IS REQUIRED IN CASE OF HUGE AMOUNT OF 3642 # DATA OUTPUT. TO DO: EXTEND THIS BRANCH BY CREATING A BATCH JOB for combine_plot_fields. 3643 # ??? koennen wir das streichen ??? 4031 3644 printf "\n\n\n *** post-processing: skipping combine_plot_fields (-Z option set) ..." 4032 3645 fi … … 4034 3647 4035 3648 4036 # E VENTUELLE OUTPUT-KOMMANDOS ABARBEITEN3649 # EXECUTE OUTPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE 4037 3650 (( i = 0 )) 4038 3651 while (( i < ioc )) … … 4041 3654 if (( i == 1 )) 4042 3655 then 4043 printf "\n\n *** execution of OUTPUT-commands:\n$ striche"3656 printf "\n\n *** execution of OUTPUT-commands:\n$dashes" 4044 3657 fi 4045 3658 printf "\n >>> ${out_command[$i]}" … … 4047 3660 if (( i == ioc )) 4048 3661 then 4049 printf "\n$ striche\n"3662 printf "\n$dashes\n" 4050 3663 fi 4051 3664 done 4052 3665 4053 3666 4054 # EVTL. INHALT DES AKTUELLEN VERZEICHNISSES AUSGEBEN3667 # IN TRACE-MODE PRINT CONTENTS OF THE CURRENT (TEMPORARY) WORKING DIRECTORY 4055 3668 if [[ $do_trace = true ]] 4056 3669 then … … 4061 3674 4062 3675 4063 # OUTPUT-DATEIEN AN IHRE ZIELORTE KOPIEREN3676 # COPY LOCAL OUTPUT-FILES TO THEIR PERMANENT DESTINATIONS 4064 3677 (( i = 0 )) 4065 3678 while (( i < iout )) … … 4068 3681 if (( i == 1 )) 4069 3682 then 4070 printf "\n\n *** saving OUTPUT-files:\n$ striche"4071 fi 4072 4073 # PRUEFEN, OB EINZELDATEI ODER DATEI PRO PROZESSOR3683 printf "\n\n *** saving OUTPUT-files:\n$dashes" 3684 fi 3685 3686 # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION) 4074 3687 files_for_pes=false; filetyp=file 4075 3688 if [[ "${actionout[$i]}" = pe && -n $numprocs ]] … … 4112 3725 4113 3726 4114 # KOPIEREN PER FTP/SCP (IMMER IM BINAERMODUS, -M: FALLS ZIELKATALOG 4115 # NICHT VORHANDEN, WIRD VERSUCHT, IHN ANZULEGEN), ABER NUR BEI 4116 # REMOTE-RECHNUNGEN 3727 # COPY VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m) 3728 # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT 4117 3729 if [[ "${actionout[$i]}" = tr ]] 4118 3730 then … … 4130 3742 then 4131 3743 4132 # TRANSFER IN EIGENSTAENDIGEMJOB4133 # ZUERST KOPIE DER DATEI INS TEMPORAERE DATENVERZEICHNIS3744 # TRANSFER IN SEPERATE JOB 3745 # FIRST COPY FILE TO TEMPORY DATA DIRECTORY 4134 3746 [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER 4135 3747 file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung … … 4166 3778 else 4167 3779 4168 # TRANSFER INNERHALB DIESES JOBS3780 # TRANSFER WITHIN THIS JOB 4169 3781 transfer_failed=false 4170 3782 printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP to" … … 4181 3793 [[ $? != 0 ]] && transfer_failed=true 4182 3794 4183 # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF 4184 # LOKALER MASCHINE ANLEGEN 3795 # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE 4185 3796 if [[ $transfer_failed = true ]] 4186 3797 then 4187 printf " +++ transfer failed. Trying to save a copy on th e localhost under:\n"3798 printf " +++ transfer failed. Trying to save a copy on this host under:\n" 4188 3799 printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" 4189 3800 4190 # ERSTMAL PRUEFEN, OB VERZEICHNIS EXISTIERT. GEGEBENENFALLS 4191 # ANLEGEN. 3801 # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY 4192 3802 eval local_catalog=${pathout[$i]} 4193 3803 if [[ ! -d $local_catalog ]] … … 4203 3813 else 4204 3814 4205 # WERTZUWEISUNG, SO DASS WEITER UNTEN NUR KOPIERT WIRD3815 # UNSET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE COPIED ON THIS MACHINE 4206 3816 actionout[$i]="" 4207 3817 fi … … 4209 3819 4210 3820 4211 # APPEND PER FTP/SCP (IMMER IM BINAERMODUS, -M: FALLS ZIELKATALOG 4212 # NICHT VORHANDEN, WIRD VERSUCHT, IHN ANZULEGEN), ABER NUR BEI 4213 # REMOTE-RECHNUNGEN 3821 # APPEND VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m) 3822 # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT 4214 3823 if [[ "${actionout[$i]}" = tra ]] 4215 3824 then … … 4219 3828 then 4220 3829 4221 # TRANSFER IN EIGENSTAENDIGEMJOB4222 # ZUERST KOPIE DER DATEI INS TEMPORAERE DATENVERZEICHNIS3830 # TRANSFER IN SEPERATE JOB 3831 # FIRST COPY FILE TO TEMPORY DATA DIRECTORY 4223 3832 [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER 4224 3833 file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung … … 4249 3858 else 4250 3859 4251 # TRANSFER INNERHALB DIESES JOBS3860 # TRANSFER WITHIN THIS JOB 4252 3861 transfer_failed=false 4253 3862 printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to" … … 4264 3873 [[ $? != 0 ]] && transfer_failed=true 4265 3874 4266 # BEI FEHLGESCHLAGENEM TRANSFER SICHERUNGSKOPIE AUF 4267 # LOKALER MASCHINE ANLEGEN 3875 # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE 4268 3876 if [[ $transfer_failed = true ]] 4269 3877 then 4270 printf " +++ transfer failed. Trying to save a copy on th e localhost under:\n"3878 printf " +++ transfer failed. Trying to save a copy on this host under:\n" 4271 3879 printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" 4272 3880 4273 # ERSTMAL PRUEFEN, OB VERZEICHNIS EXISTIERT. GEGEBENENFALLS 4274 # ANLEGEN 3881 # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY 4275 3882 eval local_catalog=${pathout[$i]} 4276 3883 if [[ ! -d $local_catalog ]] … … 4287 3894 else 4288 3895 4289 # WERTZUWEISUNG, SO DASS WEITER UNTEN NUR APPEND AUF 4290 # LOKALER MASCHINE DURCHGEFUEHRT WIRD 3896 # RESET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE APPENDED ON THIS MACHINE 4291 3897 actionout[$i]=a 4292 3898 fi … … 4294 3900 4295 3901 4296 # OUTPUT- DATEI FUER EINEN FORTSETZUNGSLAUF. DATEI WIRD PER4297 # LINK AUF DEN TEMPORAEREN DATENKATALOG GELEGT. OPTION -f WIRD4298 # VERWENDET, FALLS DORT NOCH EINE DATEI GLEICHEN NAMENS VORHANDEN4299 # SEIN SOLLTE. ANSCHLIESSEND WIRD SEINE ARCHIVIERUNG ANGESTOSSEN3902 # OUTPUT-FILE FOR A RESTART-RUN. 3903 # FILE IS MOVED TO THE TEMPORARY DATA DIRECTORY USING link COMMAND. 3904 # OPTION -f IS USED TO OVERWRITE EXISTING FILES. 3905 # AS LAST ACTION, ARCHIVING IS INITIATED. 4300 3906 if [[ "${actionout[$i]}" = fl ]] 4301 3907 then … … 4320 3926 4321 3927 4322 # ARCHIVIERUNGSJOB WIRD ERZEUGT UND ABGESCHICKT3928 # CREATE AND SUBMIT ARCHIVING-JOB 4323 3929 if [[ $store_on_archive_system = true ]] 4324 3930 then … … 4360 3966 exit 4361 3967 else 3968 # ??? nicht benötigte Archiv-Systeme entfernen ??? 4362 3969 # FUER RECHNER IN JUELICH. DORT KOENNTEN AUCH 4363 3970 # EINZELNE DATEIEN GESICHERT WERDEN (SPAETER KORR.) … … 4370 3977 if [[ $files_for_pes = false ]] 4371 3978 then 4372 # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN3979 # REMOVE EXISTING OLD FILES FROM THE ARCHIVE 4373 3980 echo "set -x" >> archive_${frelout[$i]} 4374 3981 echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} … … 4386 3993 while (( inode < nodes )) 4387 3994 do 4388 # echo "*** all_files = \"$all_files\" "4389 3995 files=`echo $all_files | cut -d" " -f1-$tasks_per_node` 4390 3996 all_files=`echo $all_files | cut -d" " -f$tp1-` 4391 # echo "*** tasks_per_node = \"$tasks_per_node\" " 4392 # echo "*** files = \"$files\" " 4393 # echo "*** all_files = \"$all_files\" " 4394 echo "tar cvf \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]} 4395 ### echo "tar cvf ${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]} 4396 ### echo "cp ${frelout[$i]}.node_$inode.tar \$PERM/${frelout[$i]}/" >> archive_${frelout[$i]} 4397 ###echo "rm ${frelout[$i]}.node_$inode.tar" >> archive_${frelout[$i]} 4398 # echo "dsmc incremental \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar" >> archive_${frelout[$i]} 4399 # echo "dsmmigrate \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar" >> archive_${frelout[$i]} 3997 echo "tar cvf \$PERM/${frelout[$i]}/${frelout[$i]}.node_$inode.tar $files" >> archive_${frelout[$i]} 4400 3998 (( inode = inode + 1 )) 4401 3999 done 4402 # echo "rm -rf \$PERM/${frelout[$i]}.tar" >> archive_${frelout[$i]}4403 # echo "tar cvf \$PERM/${frelout[$i]}.tar ${frelout[$i]}" >> archive_${frelout[$i]}4404 4000 fi 4405 4001 elif [[ $archive_system = ut ]] … … 4408 4004 if [[ $files_for_pes = false ]] 4409 4005 then 4410 # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN4006 # REMOVE EXISTING OLD FILES FROM THE ARCHIVE 4411 4007 echo "set -x" >> archive_${frelout[$i]} 4412 4008 echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]} … … 4437 4033 if [[ $archive_system != none ]] 4438 4034 then 4439 if [[ $localhost = lcsgih || $localhost = lcsgib ]] 4440 then 4441 # subjob -d -v -q cdata -X 0 -m 1000 -t 43200 -c $job_catalog $PORTOPT archive_${frelout[$i]} 4442 subjob -v -q permq -X 1 -T 1 -m 1000 -t 172800 -c $job_catalog $PORTOPT archive_${frelout[$i]} 4443 elif [[ $localhost = nech ]] 4035 if [[ $localhost = nech ]] 4444 4036 then 4445 4037 subjob -d -c /pf/b/$usern/job_queue -v -q pp -X 0 -m 1000 -t 7200 $PORTOPT archive_${frelout[$i]} … … 4452 4044 4453 4045 4454 # LEERDATEI IM BENUTZERVERZEICHNIS ANLEGEN, DAMIT BEKANNT IST, 4455 # WIE DIE HOECHSTE ZYKLUSNUMMER AUF DEM ARCHIV-SYSTEM LAUTET 4046 # CREATE AN EMPTY DIRECTORY IN THE USERS PERMANENT DIRECTORY, 4047 # IN ORDER TO NOTE THE RESPECTIVE CYCLE NUMBER ON THE ARCHIVE SYSTEM 4048 # RESTART-JOBS ARE USING THESE EMPTY-DIRECTORIES TO GET THE CURRENT HIGHEST 4049 # CYCLE NUMBER ON THE ARCHIVE SYSTEM (IN CASE THAT INFORMATIONS ARE DIFFICULT TO 4050 # TO ACCESS FROM THE ARCHIVE-SYSTEM DIRECTLY)) 4456 4051 if [[ $files_for_pes = false ]] 4457 4052 then … … 4464 4059 4465 4060 4466 # KOPIEREN AUF LOKALER MASCHINE ZUM ARCHIV-SYSTEM 4467 # AUSSERDEM MUSS LEERDATEI ANGELEGT WERDEN, DAMIT BEKANNT IST, 4468 # WIE DIE HOECHSTE ZYKLUSNUMMER AUF DEM ARCHIV-SYSTEM LAUTET 4469 # FALLS IRGENDEINE (VON MEHREREN) ARCHIVIERUNGEN SCHIEF GEHT, 4470 # WIRD FLAG GESETZT UND BLEIBT AUCH BEI WEITEREN ORDNUNGS- 4471 # GEMAESSEN ARCHIVIERUNGEN GESETZT 4061 # COPY FROM THIS HOST TO THE ARCHIVE-SYSTEM 4062 # IF ANY ARCHIVING FAILS, AN ERROR-FLAG-FILE IS SET 4063 # THIS FILE REMAINS TO BE SET, EVEN IF ARCHIVING OF FURTHER FILES IS SUCCESSFULL 4472 4064 if [[ "${actionout[$i]}" = ar ]] 4473 4065 then … … 4536 4128 elif [[ $archive_system = tivoli ]] 4537 4129 then 4538 # ARCHIVIERUNG NUR PER BATCH-JOB MOEGLICH 4539 # DATEI MUSS ZWISCHENZEITLICH INS TEMPORAERE DATENVERZEICHNIS 4540 # GELEGT WERDEN 4130 # ARCHIVING ONLY POSSIBLE VIA BATCH-JOB 4131 # IN THE MEANTIME, FILE IS STORED IN THE TEMPORARY DATA DIRECTORY, 4132 # BECAUSE MRUN'S CURRENT TEMPORARY WORKING DIRECTORY MAY ALREADY BE DELETED 4133 # WHEN THE ARCHIVE-JOB IS EXECUTED 4541 4134 [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog 4542 4135 chmod g+rx $tmp_data_catalog … … 4549 4142 fi 4550 4143 4551 # BATCH JOB GENERIEREN UND ABSCHICKEN; DATEI MUSS WIEDER 4552 # AUS TEMPORAEREM DATENVERZEICHNIS ENTFERNT WERDEN 4144 # GENERATE AND SUBMIT BATCH-JOB 4145 # FILE HAS TO BE DELETED FROM THE TEMPORARY DATA DIRECTORY 4146 # DELETE OLD EXISTING FILES FROM THE ARCHIVE 4553 4147 echo "cd $tmp_data_catalog" > archive_${frelout[$i]} 4554 4148 if [[ $files_for_pes = false ]] 4555 4149 then 4556 # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN4557 4150 echo "rm -rf \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} 4558 4151 echo "cp ${frelout[$i]} \$PERM/${frelout[$i]}" >> archive_${frelout[$i]} … … 4570 4163 elif [[ $archive_system = ut ]] 4571 4164 then 4572 # ARCHIVIERUNG NUR PER BATCH-JOB MOEGLICH 4573 # DATEI MUSS ZWISCHENZEITLICH INS TEMPORAERE DATENVERZEICHNIS 4574 # GELEGT WERDEN 4165 # ARCHIVING ONLY POSSIBLE VIA BATCH-JOB 4166 # IN THE MEANTIME, FILE IS STORED IN THE TEMPORARY DATA DIRECTORY, 4167 # BECAUSE MRUN'S CURRENT TEMPORARY WORKING DIRECTORY MAY ALREADY BE DELETED 4168 # WHEN THE ARCHIVE-JOB IS EXECUTED 4575 4169 [[ ! -d $tmp_data_catalog ]] && mkdir -p $tmp_data_catalog 4576 4170 chmod g+rx $tmp_data_catalog … … 4583 4177 fi 4584 4178 4585 # BATCH JOB GENERIEREN UND ABSCHICKEN; DATEI MUSS WIEDER 4586 # AUS TEMPORAEREM DATENVERZEICHNIS ENTFERNT WERDEN 4179 # GENERATE AND SUBMIT BATCH-JOB 4180 # FILE HAS TO BE DELETED FROM THE TEMPORARY DATA DIRECTORY 4181 # DELETE OLD EXISTING FILES FROM THE ARCHIVE 4587 4182 echo "cd $tmp_data_catalog" > archive_${frelout[$i]} 4588 4183 if [[ $files_for_pes = false ]] 4589 4184 then 4590 # EVENTUELL NOCH VORHANDENE DATEI IM ARCHIV LOSCHEN4591 4185 echo "rm -rf \$UT/${frelout[$i]}" >> archive_${frelout[$i]} 4592 4186 echo "cp ${frelout[$i]} \$UT/${frelout[$i]}" >> archive_${frelout[$i]} … … 4606 4200 archive_save=false 4607 4201 fi 4202 4203 # CREATE EMPTY FLAG-FILE OR -DIRECTORY 4204 # IN ORDER TO NOTE THE RESPECTIVE CYCLE NUMBER ON THE ARCHIVE SYSTEM 4205 # RESTART-JOBS ARE USING THESE EMPTY-DIRECTORIES TO GET THE CURRENT HIGHEST 4206 # CYCLE NUMBER ON THE ARCHIVE SYSTEM (IN CASE THAT INFORMATIONS ARE DIFFICULT TO 4207 # TO ACCESS FROM THE ARCHIVE-SYSTEM DIRECTLY)) 4608 4208 if [[ $file_saved = true ]] 4609 4209 then … … 4615 4215 fi 4616 4216 fi 4617 fi 4618 4619 # APPEND AUF LOKALER MASCHINE 4217 4218 fi 4219 4220 # APPEND ON THIS MACHINE 4620 4221 if [[ "${actionout[$i]}" = "a" ]] 4621 4222 then … … 4630 4231 fi 4631 4232 4632 # KOPIEREN AUF LOKALER MASCHINE 4633 # ES MUSS KOPIERT WERDEN, DA MOVE NICHT UEBER FILESYSTEM HINAUS MOEGLICH 4233 # COPY ON THIS MACHINE 4234 # COPY HAS TO BE USED, BECAUSE MOVE DOES NOT WORK IF FILE-ORIGIN AND TARGET ARE 4235 # ON DIFFERENT FILE-SYSTEMS 4634 4236 if [[ "${actionout[$i]}" = "" && $files_for_pes = false ]] 4635 4237 then 4636 4238 4637 # KOPIEREN AUF EINPROZESSORMASCHINE4239 # COPY IN CASE OF RUNS ON SINGLE CORES 4638 4240 if [[ "${extout[$i]}" != " " && "${extout[$i]}" != "" ]] 4639 4241 then … … 4674 4276 then 4675 4277 4676 # DIE DEN PROZESSOREN EINES PARALLELRECHNERS ZUGEHOERIGEN 4677 # DATEIEN WERDEN ERST IN EINEM KATALOG GESAMMELT UND DIESER 4678 # WIRD DANN KOPIERT 4679 # PER MOVE UMBENANNT WERDEN 4278 # FILES FROM THE DIFFERENT CORES ARE MOVED WITH ln-COMMAND TO THE PERMANENT DIRECTORY 4279 # AS A FIRST STEP, THE PERMANENT DIRECTORY IS CREATED 4680 4280 printf "\n >>> OUTPUT: ${localout[$i]}/_.... to ${pathout[$i]}\n" 4681 4281 if [[ $link_local_output = true ]] … … 4690 4290 cd $TEMPDIR 4691 4291 fi 4692 # If "ln -f" fails of if "$link_local_output = false" do a normal "cp -r" 4292 4293 # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r" 4693 4294 if [[ ! -f "${pathout[$i]}/_0000" ]] 4694 4295 then … … 4707 4308 if [[ $transfer_problems = true ]] 4708 4309 then 4709 printf "\n$ striche\n *** OUTPUT-files saved"4310 printf "\n$dashes\n *** OUTPUT-files saved" 4710 4311 printf "\n +++ WARNING: some data transfers failed! \n" 4711 4312 else 4712 printf "\n$ striche\n *** all OUTPUT-files saved \n"4713 fi 4714 fi 4715 4716 4717 # EVENTUELL FOLGEJOB STARTEN4718 # DATEI CONTINUE_RUN MUSS VOM BENUTZERPROGRAMM AUS ERZEUGT WERDEN4313 printf "\n$dashes\n *** all OUTPUT-files saved \n" 4314 fi 4315 fi 4316 4317 4318 # IF REQUIRED, START A RESTART-JOB 4319 # FILE CONTINUE_RUN MUST HAVE BEEN CREATED BY THE EXECUTABLE (PALM) 4719 4320 if [[ -f CONTINUE_RUN ]] 4720 4321 then … … 4723 4324 then 4724 4325 4725 # ZUERST IN MRUN-AUFRUF OPTIONEN FUER FORTSETZUNGSLAUF, FUER 4726 # STILLES ABARBEITEN (OHNE INTERAKTIVE RUECKFAGEN) UND FUER 4727 # BATCH-BETRIEB (NUR WICHTIG, FALLS BATCH AUF LOKALER MASCHINE 4728 # DURCHGEFUEHRT WERDEN SOLL) EINFUEGEN, FALLS NICHT BEREITS VOR- 4729 # HANDEN 4326 # ADD RESTART-OPTIONS TO THE MRUN-CALL (IF THEY ARE NOT USED ALREADY): 4327 # -C TELLS MRUN THAT IT IS A RESTART-RUN 4328 # -v SILENT MODE WITHOUT INTERACTIVE QUERIES 4329 # -n BATCH-MODE (IMPORTANT ONLY IN CASE OF BATCH JOBS ON THE LOCAL MACHINE) 4730 4330 [[ $(echo $mc | grep -c "\-C") = 0 ]] && mc="$mc -C" 4731 4331 [[ $(echo $mc | grep -c "\-v") = 0 ]] && mc="$mc -v" … … 4737 4337 4738 4338 4739 # JOB STARTEN4339 # START THE RESTART-JOB 4740 4340 printf "\n\n *** initiating restart-run on \"$return_addres\" using command:\n" 4741 4341 echo " $mc" 4742 printf "\n$ striche\n"4342 printf "\n$dashes\n" 4743 4343 if [[ $localhost != $fromhost ]] 4744 4344 then 4745 4345 4746 if [[ $localhost = lc sgih || $localhost = lccrayb || $localhost = lccrayh || $localhost = nech || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lcflow || $localhost = lckyu* ]]4346 if [[ $localhost = lccrayh || $localhost = nech || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lcflow || $localhost = lckyu* ]] 4747 4347 then 4748 4348 echo "*** ssh will be used to initiate restart-runs!" … … 4786 4386 fi 4787 4387 4788 # WARTEN, DAMIT SICH RESTART JOB IN QUEUE EINREIHEN KANN, BEVOR 4789 # DER AKTUELLE JOB ENDET 4388 # WAIT TO ALLOW THE RESTART-JOB TO BE QUEUED, BEFORE THE CURRENT JOB IS FINISHED 4790 4389 if [[ $queue = special1q ]] 4791 4390 then … … 4797 4396 else 4798 4397 4799 # BEI RECHNUNGEN AUF LOKALER MASCHINE KANN MRUN DIREKT AUFGE-4800 # RUFEN WERDEN, AUSSER AUF lcfimm4398 # JOBS RUNNING (AND STARTED) ON THE LOCAL MACHINE CAN DIRECTLY CALL MRUN (WITHOUT 4399 # USING SSH) 4801 4400 cd $LOCAL_PWD 4802 if [[ $localhost = lcfimm ]] 4803 then 4804 ssh $SSH_PORTOPT $return_addres -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " 4805 elif [[ $localhost = lckyuh ]] 4401 if [[ $localhost = lckyuh ]] 4806 4402 then 4807 4403 printf "\n +++ WARNING: no restart mechanism available for host \"$localhost\" " … … 4809 4405 printf "\n \"$mc\" " 4810 4406 else 4811 eval $mc # ' MUESSEN AUSGEWERTET WERDEN4407 eval $mc # THE ' MUST BE EVALUATED 4812 4408 fi 4813 4409 cd - > /dev/null … … 4815 4411 if [[ $localhost = lckyuh ]] 4816 4412 then 4817 printf "\n$ striche\n *** restart-run to be initiated manually\n"4413 printf "\n$dashes\n *** restart-run to be initiated manually\n" 4818 4414 else 4819 printf "\n$striche\n *** restart-run initiated \n" 4820 fi 4821 4822 4823 # EVENTUELL INPUT-DATEIEN, DIE VON TEMPORAEREM DATENVERZEICHNIS 4824 # GEHOLT WORDEN SIND, LOESCHEN 4415 printf "\n$dashes\n *** restart-run initiated \n" 4416 fi 4417 4418 4419 # DELETE INPUT-(RESTART)FILES, WHICH HAVE BEEN FETCHED FROM THE TEMPORARY DATA 4420 # DIRECTORY, BACAUSE THEY ARE NOT REQUIRED BY THE RESTART-JOB. 4421 # THIS IS DONE IN ORDER TO AVOID EXCEEDING DISC QUOTAS OR DISC SPACE (RESTART-FILES 4422 # MAY BE VERY HUGE) 4825 4423 (( i = 0 )) 4826 4424 while (( i < iin )) … … 4843 4441 4844 4442 4845 # EVTL. EMAIL-BENACHRICHTIGUNG UEBER ABGESCHLOSSENEN LAUF4443 # SEND EMAIL NOTIFICATION ABOUT THE FINISHED RUN 4846 4444 if [[ "$email_notification" != "none" ]] 4847 4445 then … … 4866 4464 4867 4465 4868 # ALL E ARBEITEN BEENDET. TEMPORAERER KATALOG KANN GELOESCHT WERDEN4466 # ALL ACTIONS FINISHED, TEMPORARY WORKING-DIRECTORY CAN BE DELETED 4869 4467 cd $HOME 4870 4468 [[ $delete_temporary_catalog = true ]] && rm -rf $TEMPDIR … … 4873 4471 4874 4472 4875 # FALLS AUF REMOTE-MASCHINE GERECHNET WERDEN SOLL, WERDEN JETZT ENTSPRE-4876 # CHENDE AKTIONEN DURCHGEFUEHRT4877 4878 # MRUN-BEFEHL FUER REMOTE-MASCHINE ZUSAMMENSTELLEN4473 # PREPARING ACTIONS, 4474 # IF A BATCH-JOB IS TO BE GENERATED AND STARTED ON A REMOTE-MACHINE GERECHNET 4475 4476 # BUILD THE MRUN-COMMAND TO BE CALLED IN THE BATCH-JOB ON THE REMOTE-MACHINE 4879 4477 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" 4880 4478 [[ "$cpp_opts" != "" ]] && mrun_com=${mrun_com}" -D \"$cpp_opts\"" … … 4886 4484 [[ $keep_data_from_previous_run = true ]] && mrun_com=${mrun_com}" -k" 4887 4485 [[ "$additional_conditions" != "" ]] && mrun_com=${mrun_com}" -K \"$additional_conditions\"" 4888 # [[ "$makefile" != "$source_path/Makefile" ]] && mrun_com=${mrun_com}" -M \"$makefile\""4889 4486 [[ "$output_list" != "" ]] && mrun_com=${mrun_com}" -o \"$output_list\"" 4890 4487 [[ "$read_from_config" = false ]] && mrun_com=${mrun_com}" -S" … … 4912 4509 4913 4510 4914 # create executable for batch job4511 # CREATE EXECUTABLE FOR BATCH JOB 4915 4512 if [[ $create_executable_for_batch = true && $restart_run != true ]] 4916 4513 then … … 4918 4515 printf "\n *** creating the executable for batch job\n" 4919 4516 4920 # method only works for batch jobs on local hosts4517 # METHOD ONLY WORKS FOR BATCH JOBS ON LOCAL HOSTS 4921 4518 if [[ $host != $localhost ]] 4922 4519 then … … 4951 4548 4952 4549 4953 # ZUSAMMENSTELLUNG DES JOBSCRIPTS AUF DATEIjobfile4550 # BUILD THE JOB-SCRIPTS ON FILE jobfile 4954 4551 jobfile=jobfile.$RANDOM 4955 4552 4956 4553 4957 # TEMPORAERES VERZEICHNIS GENERIEREN UND NACH DORT WECHSELN4554 # CREATE TEMPORARY DIRECTORY AND SWITCH TO IT 4958 4555 echo "mkdir $TEMPDIR" >> $jobfile 4959 4556 echo "cd $TEMPDIR" >> $jobfile 4960 4557 4961 4558 4962 # EVENTUELL FEHLERVERFOLGUNG AKTIVIEREN4559 # ACTIVATE ERROR-TRACEBACK 4963 4560 if [[ $do_trace = true ]] 4964 4561 then … … 4969 4566 4970 4567 4971 # initialize the environment and load modules4568 # INITIALIZE THE ENVIRONMENT AND LOAD MODULES 4972 4569 if [[ "$init_cmds" != "" ]] 4973 4570 then … … 4980 4577 4981 4578 4982 # BEREITSTELLUNG VON QUELLTEXTEN, MRUN-SCRIPTS UND KONFIGURATIONS- 4983 # DATEI FUER DEN JOB 4984 if [[ $( echo $host | cut -c1-5 ) = lcsgi || $host = ibmkisti || $host = lccrayb || $host = lccrayf || $host = lccrayh ]] 4985 then 4986 4987 # KONFIGURATIONSDATEI UND MRUN_SCRIPT IN DAS SOURCE-VERZEICHNIS 4988 # KOPIEREN 4579 # PROVIDE SOURCE-CODE FILES, MRUN-SCRIPT AND CONFIGURATION-FILE FOR THE JOB 4580 # then-CLAUSE: FILES ARE COLLECTED IN THE SOURCES_FOR_RUN_... DIRECTORY ON THE LOCAL HOST, 4581 # WHICH IS THEN FETCHED FROM THE BATCH-JOB BY USING cp/scp 4582 # THE SOURCE-CODE FILES ALREADY EXIST IN THIS DIRECTORY 4583 # else-CLAUSE: FILE-CONTENTS ARE PUT INTO THE JOB-FILE AS HERE-DOCUMENTS 4584 # THIS MAY CREATE A QUITE LARGE JOB-FILE, WHICH CAN CAUSE PROBLEMS WITH SOME 4585 # QUEUEING-SYSTEMS 4586 if [[ $host = ibmkisti || $host = lccrayb || $host = lccrayf || $host = lccrayh ]] 4587 then 4588 4589 # COPY CONFIGURATION-FILE AND MRUN-SCRIPT INTO THE SOURCES_FOR_RUN... DIRECTORY 4989 4590 if [[ $restart_run != true ]] 4990 4591 then … … 4993 4594 fi 4994 4595 4995 # SOURCE-VERZEICHNIS VOM LOKALEN RECHNER PER SCP TRANSFERIEREN4996 # ( BEI JOBS AUF LOKALEM RECHNER REICHT CP)4596 # COPY THE SOURCES_FOR_RUN... DIRECTORY FROM THE LOCAL HOST TO THE JOB VIA scp 4597 # (then-CLAUSE: JOBS ON THE LOCAL HOST CAN JUST USE cp) 4997 4598 echo "set -x" >> $jobfile 4998 4599 if [[ $host = $localhost ]] … … 5011 4612 if [[ $host = ibmkisti ]] 5012 4613 then 5013 # on KISTI's IBM firewall is only opened on interactive node4614 # ON KISTI'S IBM FIREWALL IS ONLY OPENED ON INTERACTIVE NODE 5014 4615 echo "localdir=\`pwd\`" >> $jobfile 5015 4616 echo "ssh $SSH_PORTOPT $remote_username@gaiad \"cd \$localdir; scp $PORTOPT -r $return_username@$return_addres:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile … … 5029 4630 echo "export SOURCES_COMPLETE=true" >> $jobfile 5030 4631 5031 # QUELLTEXTE, MRUN-SCRIPT UND KONFIGURATIONSDATEI IN DAS AKTUELLE5032 # ARBEITSVERZEICHNIS VERSCHIEBEN4632 # MOVE MRUN-SCRIPT AND CONFIGURATION-FILE FROM THE SOURCES_FOR_RUN... DIRECTORY TO THE 4633 # WORKING DIRECTORY OF THE JOB 5033 4634 echo "mv SOURCES_FOR_RUN_$fname/$config_file . " >> $jobfile 5034 4635 echo "mv SOURCES_FOR_RUN_$fname/$mrun_script_name . " >> $jobfile … … 5039 4640 else 5040 4641 5041 # ABSPEICHERN DER QUELLTEXTE (NUR FALLS UEBERSETZT WERDEN SOLL) 5042 # SOWIE GEGEBENENFALLS DES MAKEFILES 4642 # PROVIDE SOURCE-CODE FILES AND MAKEFILE AS HERE DOCUMENT 5043 4643 if [[ $do_compile = true ]] 5044 4644 then … … 5046 4646 source_catalog=SOURCES_FOR_RUN_$fname 5047 4647 5048 # UNTERVERZEICHNIS FUER QUELLTEXTE UND MAKEFILE ANLEGEN 5049 # MRUN WIRD DIESES VRZEICHNIS UEBER ENVIRONMENT VARIABLE 5050 # MITGETEILT (UEBERSTEUERT ANGABE IN KONFIGURATIONSDATEI) 4648 # CREATE SOURCES_FOR_RUN... DIRECTORY TO STORE THE SOURCE CODE FILES AND THE MAKEFILE 5051 4649 echo "mkdir SOURCES_FOR_RUN_$fname" >> $jobfile 5052 4650 echo "export SOURCES_COMPLETE=true" >> $jobfile … … 5055 4653 for filename in $source_list 5056 4654 do 5057 # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN4655 # BACKSLASH IS USED FOR MASKING 5058 4656 echo "cat > $filename << \"%END%\"" >> $jobfile 5059 4657 cat $source_catalog/$filename >> $jobfile … … 5063 4661 done 5064 4662 5065 # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN4663 # BACKSLASH IS USED FOR MASKING 5066 4664 echo "cat > Makefile << \"%END%\"" >> $jobfile 5067 4665 cat $source_catalog/Makefile >> $jobfile … … 5075 4673 5076 4674 5077 # ABSPEICHERN DER KONFIGURATIONSDATEI 5078 # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN 5079 # Lines with #$ coming from the svn keyword substitution are 5080 # removed from the config file in order to avoid problems 5081 # with the SGE batch system 4675 # PROVIDE THE CONFIGURATION-FILE AS HERE-DOCUMENT 4676 # BACKSLASH IS USED FOR MASKING 4677 # LINES WITH #$ IN THE CONFIGURATION-FILE, COMING FROM THE SVN KEYWORD SUBSTITUTION, 4678 # ARE REMOVED FROM THE FILE IN ORDER TO AVOID PROBLEMS WITH THE SGE BATCH SYSTEM 5082 4679 echo "cat > $config_file << \"%END%\"" >> $jobfile 5083 4680 if [[ $host = lckyuh ]] 5084 4681 then 5085 # no cross compiler on compute node4682 # NO CROSS-COMPILER ON COMPUTE NODE 5086 4683 sed 's/frtpx/frt/g' $config_file >> $jobfile 5087 4684 else … … 5092 4689 5093 4690 5094 # ABSPEICHERN DER AKTUELLEN MRUN-VERSION5095 # ABDECKZEICHEN VERHINDERN, DASS ERSETZUNGEN ERFOLGEN4691 # PROVIDE THE MRUN-SCRIPTS AS HERE-DOCUMENT 4692 # BACKSLASH IS USED FOR MASKING 5096 4693 echo "cat > $mrun_script_name <<\"%END%\"" >> $jobfile 5097 4694 if [[ $host = lckyuh ]] … … 5109 4706 5110 4707 5111 # EVTL. BENOETIGTE INPUT-DATEIEN PER FTP HOLEN ODER DEM JOB DIREKT 5112 # MITGEBEN UND AUF DEM REMOTE-RECHNER IM BENUTZERVERZEICHNIS ABLEGEN 5113 # FALLS DIESES NICHT EXISTIERT, WIRD VERSUCHT, DAS JEWEILS LETZTE 5114 # UNTERVERZEICHNIS DES PFADNAMENS ANZULEGEN 4708 # GET REQUIRED INPUT-FILES BY SCP OR BY SENDING THEM WITH THE JOB AS HERE-DOCUMENT 4709 # PUT THESE FILES INTO THE USER'S RESPECTIVE PERMANENT DIRECTORIES ON THE REMOTE-HOST 4710 # IF THE DIRECTORIES DO NOT EXIST, TRY TO CREATE THEM 5115 4711 if [[ $do_remote = true ]] 5116 4712 then … … 5130 4726 fi 5131 4727 5132 # UEBERPRUEFEN, OB DATEI ANGELEGT WERDEN KONNTE4728 # CHECK, IF FILE COULD BE CREATED 5133 4729 echo "if [[ \$? = 1 ]]" >> $jobfile 5134 4730 echo "then" >> $jobfile … … 5142 4738 fi 5143 4739 5144 # ARBEITSKATALOG AUF DER LOKALEN MASCHINE FUER EVENTUELLE 5145 # FORTSETZUNGSLAUEFE PER ENV-VARIABLE UEBERGEBEN 4740 # PROVIDE NAME OF THE CURRENT WORKING-DIRECTORY ON THE LOCAL MACHINE (FROM WHERE THE JOB IS 4741 # STARTED) BY SETTING AN ENVIRONMENT-VARIABLE. THIS INFORMATION IS USED IN THE JOB BY MRUN 4742 # IN CASE THAT RESTART-RUNS HAVE TO BE GENERATED 5146 4743 echo "LOCAL_PWD=$working_directory" >> $jobfile 5147 4744 echo "export LOCAL_PWD" >> $jobfile 5148 4745 5149 # EBENSO LOKALEN MRUN-KATALOG UEBERGEBEN4746 # PROVIDE THE PATH OF THE LOCAL MRUN-SCRIPT FOR THE SAME REASON 5150 4747 echo "LOCAL_MRUN_PATH=$PALM_BIN" >> $jobfile 5151 4748 echo "export LOCAL_MRUN_PATH" >> $jobfile 5152 4749 5153 # WORKAROUND FUER RIAM-NEC-JOBS WEGEN PROFILE-SCHWIERIGKEITEN 5154 if [[ $localhost_realname = "gate" || $localhost = lctit ]] 5155 then 5156 echo "export PALM_BIN=$PALM_BIN" >> $jobfile 5157 elif [[ $host = lcflow || $localhost = lcflow ]] 4750 # lcflow ALSO REQUIRES TO PROVIDE PATH FOR THE PALM-SCRIPTS 4751 if [[ $host = lcflow || $localhost = lcflow ]] 5158 4752 then 5159 4753 echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:' >> $jobfile … … 5161 4755 fi 5162 4756 5163 # MRUN AUF ZIELRECHNER AUFRUFEN (queue is workaround for ibmkisti) 4757 # CALL MRUN WITHIN THE JOB (SETTING QUEUE IS A WORKAROUND FOR ibmkisti) 4758 # AS FINAL ACTION, REMOVE THE TEMPORARY DIRECTORY CREATED AT THE BEGINNING OF THE JOB 5164 4759 echo "set -x" >> $jobfile 5165 4760 echo "queue=$queue" >> $jobfile … … 5172 4767 5173 4768 5174 # JOB PER SUBJOB STARTEN4769 # START THE JOB USING SUBJOB-COMMAND 5175 4770 if [[ $silent = false ]] 5176 4771 then … … 5184 4779 5185 4780 5186 fi # ENDE REMOTE-TEIL 5187 5188 5189 5190 # ENDE DER PROZEDUR 4781 fi # END OF REMOTE-PART -
palm/trunk/SCRIPTS/subjob
r1280 r1289 23 23 # Current revisions: 24 24 # ------------------ 25 # 25 # German comments translated to English 26 # fimm-, necriam-, scirocco-, ibmy-, and sgi-specific code removed 26 27 # 27 28 # Former revisions: … … 91 92 92 93 93 # VARIABLE NVEREINBARUNGEN + DEFAULTWERTE94 # VARIABLE-DECLARATIONS AND DEFAULT VALUES 94 95 delete_dayfile=false 95 96 email_notification=none … … 115 116 116 117 117 # FEHLERBEHANDLUNG118 # BEIEXIT:118 # ERROR HANDLING 119 # IN CASE OF EXIT: 119 120 trap 'if [[ $locat != normal ]] 120 121 then … … 132 133 133 134 134 # BEITERMINAL-BREAK:135 # IN CASE OF TERMINAL-BREAK: 135 136 trap '[[ -f $job_to_send ]] && rm $job_to_send 136 137 printf "\n\n+++ SUBJOB killed \n\n" … … 141 142 142 143 143 # LOKALEN HOSTNAMEN FESTSTELLEN144 # DETERMINE NAME OF LOCAL HOST 144 145 local_host=$(hostname) 145 146 146 147 147 148 148 # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALERHOST149 # UEBERHAUPT ZULAESSIG IST150 # N ote: One of the entries for "lck" or "lckordi" always has to be151 # comment out, because the hostname (node*) is same for both machines149 # SET HOST-SPECIFIC VARIABLES VEREINBAREN (CHECK, IF LOCAL HOST 150 # IS ADMITTED AT ALL) 151 # NOTE: ONE OF THE ENTRIES FOR "lck" OR "lckordi" ALWAYS HAS TO BE 152 # COMMENT OUT, BECAUSE THE HOSTNAME (node*) IS SAME FOR BOTH MACHINES 152 153 case $local_host in 153 154 (ambiel-lx) local_addres=134.106.74.48; local_host=lcfor;; … … 156 157 (autan) local_addres=130.75.105.57; local_host=lcmuk;; 157 158 (bora) local_addres=130.75.105.103; local_host=lcmuk;; 158 (bd1) local_addres=130.73.232.64; local_host=lcsgib;;159 (bd2) local_addres=130.73.232.65; local_host=lcsgib;;160 (bd3) local_addres=130.73.232.66; local_host=lcsgib;;161 (bd4) local_addres=130.73.232.67; local_host=lcsgib;;162 (b01*|bicegate1) local_addres=130.73.232.102; local_host=lcsgib;;163 159 (b04*) local_addres=133.5.4.33; local_host=lckyuh;; 164 (bicegate2) local_addres=130.73.232.103; local_host=lcsgib;;165 160 (blizzard1) local_addres=136.172.40.15; local_host=ibmh;; 166 161 (blogin*|bxc*) local_addres=130.73.233.1; local_host=lccrayb;; … … 171 166 (climate*) local_addres=165.132.26.68; local_host=lcyon;; 172 167 (clogin*) local_addres=86.50.166.21; local_host=lccrayf;; 173 (compute-*.local) local_addres=172.20.4.2; local_host=lcfimm;;174 168 (cs*) local_addres=136.172.44.131; local_host=nech;; 175 169 (elephanta) local_addres=130.75.105.6; local_host=lcmuk;; 176 (fimm.bccs.uib.no) local_addres=172.20.4.2; local_host=lcfimm;;177 170 (flow01) local_addres=10.141.255.71; local_host=lcflow;; 178 171 (flow02) local_addres=10.141.255.72; local_host=lcflow;; … … 181 174 (gaia*) local_addres=150.183.146.24; local_host=ibmkisti;; 182 175 (gallego) local_addres=130.75.105.10; local_host=lcmuk;; 183 (gfdl5) local_addres=165.132.26.58; local_host=ibmy;;184 176 (gregale) local_addres=130.75.105.109; local_host=lcmuk;; 185 177 (hababai) local_addres=130.75.105.108; local_host=lcmuk;; 186 178 (hayaka*) local_addres=133.5.4.33; local_host=lckyuh;; 187 179 (hexagon.bccs.uib.no) local_addres=129.177.20.113; local_host=lcxe6;; 188 (hd1) local_addres=130.75.4.104; local_host=lcsgih;;189 (hd2) local_addres=130.75.4.105; local_host=lcsgih;;190 (hd3) local_addres=130.75.4.106; local_host=lcsgih;;191 (hd4) local_addres=130.75.4.107; local_host=lcsgih;;192 (hicegate0) local_addres=130.75.4.101; local_host=lcsgih;;193 (h01*|hicegate1) local_addres=130.75.4.102; local_host=lcsgih;;194 (hicegate2) local_addres=130.75.4.103; local_host=lcsgih;;195 180 (hx*) local_addres=133.3.51.11; local_host=lckyoto;; 196 181 (inferno) local_addres=130.75.105.5; local_host=lcmuk;; … … 212 197 (quanero) local_addres=130.75.105.107; local_host=lcmuk;; 213 198 (rte*) local_addres=133.5.185.60; local_host=lcrte;; 214 (r1*) local_addres=130.75.4.102; local_host=lcsgih;;215 (r2*) local_addres=130.73.232.102; local_host=lcsgib;;216 (scirocco) local_addres=172.20.25.41; local_host=lcmuk;;217 199 (shiokaze-lx) local_addres=134.106.74.123; local_host=lcfor;; 218 200 (sisu-login*) local_addres=86.50.166.21; local_host=lccrayf;; 219 201 (solano) local_addres=130.75.105.110; local_host=lcmuk;; 220 202 (sugoka*) local_addres=172.31.120.1; local_host=lckyut;; 221 (sun1|sun2) local_addres=130.75.6.1; local_host=unics;;222 (sx-*) local_addres=172.16.1.131; local_host=necriam;;223 203 (t2a*) local_addres=10.1.6.165; local_host=lctit;; 224 204 (urban*) local_addres=147.46.30.151 local_host=lcsb;; … … 233 213 234 214 235 # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN215 # BY DEFAULT, THE REMOTE HOST IS THE LOCAL HOST 236 216 remote_host=$local_host 237 217 … … 239 219 240 220 241 # PROZEDUROPTIONEN EINLESEN221 # READ THE SHELLSCRIPT-OPTIONS 242 222 while getopts :c:dDe:g:h:m:n:N:O:P:q:t:T:u:vX: option 243 223 do … … 266 246 267 247 268 # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN248 # GET THE NAME OF THE JOBFILE AS NEXT ARGUMENT 269 249 (( to_shift = $OPTIND - 1 )) 270 250 shift $to_shift; file_to_send=$1 271 251 272 252 273 # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN253 # OUTPUT OF SHORT DESCRIPTION OF SCRIPT-OPTIONS 274 254 if [ "$1" = "?" ] 275 255 then … … 282 262 printf "\n -D only the job-file will be created ---" 283 263 printf "\n -h execution host, available hosts: $remote_host" 284 printf "\n ibm, ibmh, ibmkisti, ibmku, ibms, ibmy,lc...,"285 printf "\n lckiaps, lctit, nech , necriam, unics"264 printf "\n ibm, ibmh, ibmkisti, ibmku, ibms, lc...," 265 printf "\n lckiaps, lctit, nech" 286 266 printf "\n -m memory demand per process in MByte ---" 287 267 printf "\n -n jobname <jobdatei>" … … 303 283 304 284 305 # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT285 # CHECK, IF JOB-FILE HAS BEEN GIVEN AS ARGUMENT AND IF THE FILE ITSELF EXISTS 306 286 if [[ "$file_to_send" = "" ]] 307 287 then … … 322 302 323 303 324 # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME325 # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE304 # IF NO JOBNAME HAS BEEN GIVEN, JOBNAME IS SET TO THE NAME OF THE JOB-FILE, 305 # PROVIDED THAT THE JOB-FILE NAME DOES NOT CONTAIN ANY PATH 326 306 if [[ $job_name = none ]] 327 307 then … … 339 319 340 320 341 # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST342 # O DER WENN HOST NICHT ANGEGEBEN WURDE321 # SET HOST-SPECIFIC QUANTITIES, OR TERMINATE IN CASE OF UNKNOWN HOST, 322 # OR IF NO HOST HAS BEEN GIVEN 343 323 if [[ $remote_host = none ]] 344 324 then … … 352 332 (ibmku) queue=s4; remote_addres=133.5.4.129; submcom=/usr/local/bin/llsubmit;; 353 333 (ibms) queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; 354 (ibmy) queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;355 334 (lccrayb) queue=testq; remote_addres=130.73.233.1; submcom=/opt/moab/7.2.6/bin/msub;; 356 335 (lccrayh) queue=mpp1testq; remote_addres=130.75.4.1; submcom=/opt/moab/7.2.6/bin/msub;; 357 336 (lccrayf) queue=small; remote_addres=86.50.166.21; submcom=/opt/slurm/default/bin/sbatch;; 358 (lcfimm) remote_addres=172.20.4.2; submcom=/opt/torque/bin/qsub;;359 337 (lcflow) remote_addres=10.140.1.71; submcom=/cm/shared/apps/sge/6.2u5p2/bin/lx26-amd64/qsub;; 360 338 (lckyoto) remote_addres=133.3.51.11; submcom=/thin/local/bin/qsub;; 361 (lcsgib) queue=smallq; remote_addres=130.73.232.104; submcom=/opt/moab/bin/msub;;362 (lcsgih) queue=smallq; remote_addres=130.75.4.101; submcom=/opt/moab/bin/msub;;363 339 (lck) remote_addres=165.132.26.61; submcom=/usr/torque/bin/qsub;; 364 340 (lckiaps) remote_addres=118.128.66.223; submcom=/cm/shared/apps/pbspro/11.0.2.110766/bin/qsub;; … … 372 348 (lcyon) remote_addres=165.132.26.68; submcom=/usr/torque/bin/qsub;; 373 349 (nech) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";; 374 (necriam) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=172.16.1.131; submcom="/usr/bin/nqsII/qsub";;375 (vpp) qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;;376 (unics) qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;;377 350 (*) printf "\n +++ hostname \"$remote_host\" not allowed"; 378 351 locat=parameter; exit;; … … 381 354 382 355 383 # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST356 # CHECK, IF A VALID QUEUE HAS BEEN GIVEN 384 357 if [[ $no_default_queue != none ]] 385 358 then … … 407 380 (*) error=true;; 408 381 esac;; 409 (ibmy) case $ndq in410 (parallel) error=false;;411 (*) error=true;;412 esac;;413 382 (lccrayb) case $ndq in 414 383 (mpp1q|testq|specialm1q) error=false;; … … 443 412 (*) error=true;; 444 413 esac;; 445 (lcsgib|lcsgih) case $ndq in446 (testq|serialq|smallq|mediumq|bigq|workq|dataq|permq|special1q) error=false;;447 (*) error=true;;448 esac;;449 414 (lctit) case $ndq in 450 415 (G|L128|L256|L512H|S|S96|V) error=false;; … … 455 420 (*) error=true;; 456 421 esac;; 457 (necriam) case $ndq in458 (SP|SS|P6) error=false;;459 (*) error=true;;460 esac;;461 422 (t3eh) case $ndq in 462 423 (para_t3e|em|k|l|lm|comp_t3e|c|p|ht) error=false;; … … 471 432 (*) error=true;; 472 433 esac;; 473 (unics) case $ndq in474 (unics|ht) error=false;;475 (*) error=true;;476 esac;;477 434 esac 478 435 if [[ $error = true ]] … … 487 444 488 445 489 # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN490 # AUFTEILEN446 # CHECK THE CPU-TIME 447 # SPLIT TIME INTO HOURS, MINUTES, AND SECONDS 491 448 done=false 492 449 while [[ $done = false ]] … … 520 477 521 478 522 # PRUEFEN DER KERNSPEICHERANFORDERUNG479 # CHECK THE MEMORY DEMAND 523 480 done=false 524 481 while [[ $done = false ]] … … 535 492 done 536 493 537 if [[ $remote_host = nech || $remote_host = necriam]]494 if [[ $remote_host = nech ]] 538 495 then 539 496 if (( tasks_per_node != 0 )) … … 552 509 553 510 554 # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG511 # MEMORY DEMAND IN CASE OF OPENMP-USAGE ON IBM-SYSTEMS 555 512 if [[ $(echo $remote_host | cut -c1-3) = ibm ]] 556 513 then … … 559 516 560 517 561 # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN518 # CALCULATE NUMBER OF REQUIRED NODES 562 519 if (( tasks_per_node != 0 )) 563 520 then … … 566 523 567 524 568 # C alculate number of processes per node525 # CALCULATE NUMBER OF PROCESSES PER NODE 569 526 (( processes_per_node = tasks_per_node * threads_per_task )) 570 527 571 528 572 # C alculate number of MPI tasks529 # CALCULATE NUMBER OF MPI TASKS 573 530 (( mpi_tasks = numprocs / threads_per_task )) 574 531 575 532 576 # S et port number option for calls of ssh/scp, subjob and batch_scp scripts533 # SET PORT NUMBER OPTION FOR CALLS OF ssh/scp, subjob AND batch_scp SCRIPTS 577 534 if [[ "$scp_port" != "" ]] 578 535 then … … 582 539 583 540 584 # HEADER- AUSGABE541 # HEADER-OUTPUT 585 542 if [[ $verify = true ]] 586 543 then … … 612 569 613 570 614 # KONTROLLABFRAGE, OB ALLES O.K.571 # QUERY CHECK 615 572 antwort="dummy" 616 573 while [[ $antwort != y && $antwort != Y && $antwort != n && $antwort != N ]] … … 627 584 628 585 629 # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN630 kennung=$RANDOM631 job_on_remhost=${job_name}_${ kennung}_$local_host632 job_to_send=job_to_send_$ kennung586 # GENERATE RANDOM IDENTIFIER, AND DETERMINE THE JOBNAME ON THE TARGET HOST 587 identifier=$RANDOM 588 job_on_remhost=${job_name}_${identifier}_$local_host 589 job_to_send=job_to_send_$identifier 633 590 if [[ $delete_dayfile = false ]] 634 591 then 635 remote_dayfile=${local_host}_${job_name}_result_$ kennung592 remote_dayfile=${local_host}_${job_name}_result_$identifier 636 593 local_dayfile=${remote_host}_${job_name} 637 594 else … … 641 598 642 599 643 # G enerate the batch job scripts (qsub/msub/LoadLeveler)600 # GENERATE THE BATCH-JOB SCRIPTS (FOR QUEUEING-SYSTEMS qsub/msub/LoadLeveler) 644 601 if [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs != 0 ]] 645 602 then 646 603 647 # G eneral LoadLeveler settings604 # GENERAL LOADLEVELER SETTINGS 648 605 execute_in_shell="#!/bin/ksh" 649 606 use_shell="# @ shell = /bin/ksh" … … 700 657 then 701 658 network_to_use="# @ network.mpi = csss,shared,us" 702 elif [[ $remote_host = ibmy ]]703 then704 consumable_memory=""705 network_to_use=""706 659 fi 707 660 … … 756 709 else 757 710 758 if [[ $remote_host != ibmy ]] 759 then 760 761 cat >> $job_to_send << %%END%% 711 cat >> $job_to_send << %%END%% 762 712 # @ blocking = unlimited 763 713 # @ total_tasks = $numprocs … … 767 717 %%END%% 768 718 769 else 770 771 cat >> $job_to_send << %%END%% 772 # @ node = 1 773 # @ total_tasks = $numprocs 774 # @ queue 775 776 %%END%% 777 778 fi 779 780 fi 781 782 # workaround because of silly job filter on ibmkisti 719 fi 720 721 # WORKAROUND BECAUSE OF SILLY JOB FILTER ON ibmkisti 783 722 if [[ $remote_host = ibmkisti && $threads_per_task != 1 ]] 784 723 then … … 863 802 $init_cmds 864 803 $module_calls 865 866 %%END%%867 868 fi869 870 elif [[ $remote_host = lcfimm ]]871 then872 873 if [[ $numprocs != 0 ]]874 then875 cat > $job_to_send << %%END%%876 #!/bin/ksh877 #PBS -N $job_name878 #PBS -A $project_account879 #PBS -l walltime=$timestring880 #PBS -l nodes=${nodes}:ppn=$processes_per_node881 #PBS -l pmem=${memory}mb882 #PBS -m abe883 #PBS -o $remote_dayfile884 #PBS -j oe885 mpd &886 887 %%END%%888 889 else890 cat > $job_to_send << %%END%%891 #!/bin/ksh892 #PBS -N $job_name893 #PBS -A $project_account894 #PBS -l walltime=$timestring895 #PBS -l ncpus=1896 #PBS -l pmem=${memory}mb897 #PBS -m abe898 #PBS -o $remote_dayfile899 #PBS -j oe900 804 901 805 %%END%% … … 1036 940 fi 1037 941 1038 elif [[ $remote_host = lcsgih || $remote_host = lcsgib ]]1039 then1040 1041 if [[ "$sgi_feature" != "" ]]1042 then1043 feature_directive="#PBS -l feature=$sgi_feature"1044 else1045 feature_directive=""1046 fi1047 1048 if [[ $queue = dataq || $queue = permq ]]1049 then1050 feature_directive="#PBS -l feature=data"1051 fi1052 1053 if [[ $queue = testq || $queue = mediumq || $queue = bigq || $queue = workq || $queue = dataq || $queue = permq || $queue = serialq || $queue = special1q ]]1054 then1055 queue_directive="#PBS -q $queue"1056 else1057 queue_directive=""1058 fi1059 1060 if [[ $email_notification = none ]]1061 then1062 email_directive=""1063 else1064 email_directive="#PBS -M $email_notification"1065 fi1066 1067 if [[ $numprocs != 0 ]]1068 then1069 cat > $job_to_send << %%END%%1070 #!/bin/bash1071 #PBS -N $job_name1072 #PBS -l walltime=$timestring1073 #PBS -l nodes=$nodes:ppn=${processes_per_node}1074 #PBS -l naccesspolicy=$node_usage1075 #PBS -o $remote_dayfile1076 #PBS -j oe1077 $feature_directive1078 $queue_directive1079 $email_directive1080 1081 eval \`/sw/swdist/bin/modulesinit\`1082 #. /usr/share/modules/init/bash1083 $init_cmds1084 $module_calls1085 1086 echo ld_library_path=\$LD_LIBRARY_PATH1087 1088 %%END%%1089 1090 else1091 cat > $job_to_send << %%END%%1092 #PBS -S /bin/bash1093 #PBS -N $job_name1094 #PBS -l walltime=$timestring1095 #PBS -l ncpus=11096 #PBS -o $remote_dayfile1097 #PBS -j oe1098 $queue_directive1099 $email_directive1100 1101 eval \`/sw/swdist/bin/modulesinit\`1102 #. /usr/share/modules/init/bash1103 $init_cmds1104 $module_calls1105 1106 %%END%%1107 1108 fi1109 1110 942 elif [[ $remote_host = lcxe6 ]] 1111 943 then … … 1290 1122 fi 1291 1123 1292 elif [[ $remote_host = necriam ]]1293 then1294 1295 if (( nodes > 1 ))1296 then1297 cat > $job_to_send << %%END%%1298 #!/bin/ksh1299 #PBS -b $nodes1300 #PBS -o $remote_dayfile1301 #PBS -N $job_name1302 #PBS -j o1303 #PBS -v MPIPROGINV=YES1304 1305 %%END%%1306 1307 elif [[ $numprocs != 0 ]]1308 then1309 cat > $job_to_send << %%END%%1310 #!/bin/ksh1311 #PBS -q ${queue}1312 #PBS -o $remote_dayfile1313 #PBS -N $job_name1314 #PBS -j o1315 #PBS -v MPIPROGINV=YES1316 1317 %%END%%1318 1319 else1320 cat > $job_to_send << %%END%%1321 #!/bin/ksh1322 #PBS -o $remote_dayfile1323 #PBS -j o1324 1325 %%END%%1326 1327 fi1328 1329 1124 elif [[ $remote_host = lctit ]] 1330 1125 then … … 1336 1131 %%END%% 1337 1132 1338 # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN1133 # SET OPTIONS FOR SUBMIT-COMMAND 1339 1134 if [[ $tasks_per_node != $processes_per_node ]] 1340 1135 then … … 1358 1153 1359 1154 1360 # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP 1361 # BEI EXIT VERANLASSEN 1362 # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT 1363 # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH 1155 # IN CASE OF JOBS EXECUTING ON REMOTE-HOSTS, THE TRANSFER OF THE DAYFILES 1156 # TO THE LOCAL HOSTS WILL BE INITIATED BY TRAP ON EXIT 1157 # NO TRANSFER POSSIBLE ON IBM IN SEOUL 1364 1158 if [[ $delete_dayfile = false && $remote_host != $local_host ]] 1365 1159 then … … 1367 1161 echo "trap '" >> $job_to_send 1368 1162 echo "set +vx" >> $job_to_send 1369 if [[ $(echo $remote_host | cut -c1-3) = ibm || $remote_host = lccrayb || $remote_host = lccrayh || $(echo $remote_host | cut -c1- 5) = lcsgi || $(echo $remote_host | cut -c1-3) = nec || $remote_host = lcflow || $remote_host = lckiaps || $remote_host = lckyu* ]]1163 if [[ $(echo $remote_host | cut -c1-3) = ibm || $remote_host = lccrayb || $remote_host = lccrayh || $(echo $remote_host | cut -c1-3) = nec || $remote_host = lcflow || $remote_host = lckiaps || $remote_host = lckyu* ]] 1370 1164 then 1371 1165 if [[ $remote_host = ibmh ]] … … 1381 1175 then 1382 1176 return_queue=p_normal 1383 elif [[ $remote_host = ibmy ]]1384 then1385 return_queue=serial1386 elif [[ $remote_host = lcsgih || $remote_host = lcsgib ]]1387 then1388 return_queue=serialq1389 elif [[ $remote_host = necriam ]]1390 then1391 return_queue=SP1392 1177 elif [[ $remote_host = lccrayb || $remote_host = lccrayh ]] 1393 1178 then … … 1411 1196 if [[ $remote_host = ibmku ]] 1412 1197 then 1413 echo "echo \"#!/usr/bin/ksh\" >> scpjob.$ kennung" >> $job_to_send1414 echo "echo \"# @ shell = /usr/bin/ksh\" >> scpjob.$ kennung" >> $job_to_send1198 echo "echo \"#!/usr/bin/ksh\" >> scpjob.$identifier" >> $job_to_send 1199 echo "echo \"# @ shell = /usr/bin/ksh\" >> scpjob.$identifier" >> $job_to_send 1415 1200 else 1416 echo "echo \"#!/bin/ksh\" >> scpjob.$ kennung" >> $job_to_send1201 echo "echo \"#!/bin/ksh\" >> scpjob.$identifier" >> $job_to_send 1417 1202 fi 1418 echo "echo \"# @ job_type = serial\" >> scpjob.$ kennung" >> $job_to_send1419 echo "echo \"# @ job_name = transfer\" >> scpjob.$ kennung" >> $job_to_send1420 echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$ kennung" >> $job_to_send1421 echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$ kennung" >> $job_to_send1422 echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$ kennung" >> $job_to_send1423 echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$ kennung" >> $job_to_send1203 echo "echo \"# @ job_type = serial\" >> scpjob.$identifier" >> $job_to_send 1204 echo "echo \"# @ job_name = transfer\" >> scpjob.$identifier" >> $job_to_send 1205 echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$identifier" >> $job_to_send 1206 echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$identifier " >> $job_to_send 1207 echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$identifier" >> $job_to_send 1208 echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$identifier" >> $job_to_send 1424 1209 if [[ $host != "ibmh" ]] 1425 1210 then 1426 echo "echo \"# @ class = $return_queue\" >> scpjob.$ kennung" >> $job_to_send1211 echo "echo \"# @ class = $return_queue\" >> scpjob.$identifier" >> $job_to_send 1427 1212 fi 1428 echo "echo \"# @ image_size = 10\" >> scpjob.$ kennung" >> $job_to_send1429 echo "echo \"# @ notification = never\" >> scpjob.$ kennung" >> $job_to_send1430 1431 echo "echo \"# @ queue\" >> scpjob.$ kennung" >> $job_to_send1432 echo "echo \" \" >> scpjob.$ kennung" >> $job_to_send1433 1434 echo "echo \"set -x\" >> scpjob.$ kennung" >> $job_to_send1435 echo "echo \"batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \\\"$job_catalog\\\" $local_dayfile\" >> scpjob.$ kennung" >> $job_to_send1213 echo "echo \"# @ image_size = 10\" >> scpjob.$identifier" >> $job_to_send 1214 echo "echo \"# @ notification = never\" >> scpjob.$identifier" >> $job_to_send 1215 1216 echo "echo \"# @ queue\" >> scpjob.$identifier" >> $job_to_send 1217 echo "echo \" \" >> scpjob.$identifier" >> $job_to_send 1218 1219 echo "echo \"set -x\" >> scpjob.$identifier" >> $job_to_send 1220 echo "echo \"batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \\\"$job_catalog\\\" $local_dayfile\" >> scpjob.$identifier" >> $job_to_send 1436 1221 if [[ $remote_host = ibmku ]] 1437 1222 then 1438 echo "echo \"rm scpjob.$ kennung\" >> scpjob.$kennung" >> $job_to_send1223 echo "echo \"rm scpjob.$identifier\" >> scpjob.$identifier" >> $job_to_send 1439 1224 fi 1440 echo "echo \"exit\" >> scpjob.$ kennung" >> $job_to_send1225 echo "echo \"exit\" >> scpjob.$identifier" >> $job_to_send 1441 1226 1442 1227 elif [[ $remote_host = nech ]] 1443 1228 then 1444 1229 echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send 1445 echo "cat > scpjob.$ kennung<< %%END%%" >> $job_to_send1230 echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send 1446 1231 echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send 1447 1232 echo "#PBS -o last_job_transfer_protocol" >> $job_to_send … … 1454 1239 echo "%%END%%" >> $job_to_send 1455 1240 1456 elif [[ $remote_host = necriam ]]1457 then1458 echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send1459 echo "#PBS -q $return_queue" >> $job_to_send1460 echo "#PBS -o last_job_transfer_protocol" >> $job_to_send1461 echo "#PBS -j o" >> $job_to_send1462 echo " " >> $job_to_send1463 echo "set -x" >> $job_to_send1464 echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send1465 echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send1466 echo "%%END%%" >> $job_to_send1467 1468 1241 elif [[ $remote_host = lckyuh ]] 1469 1242 then 1470 echo "cat > scpjob.$ kennung<< %%END%%" >> $job_to_send1243 echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send 1471 1244 echo "#!/bin/bash" >> $job_to_send 1472 1245 echo "#PJM -L \"node=1\"" >> $job_to_send … … 1485 1258 elif [[ $remote_host = lckyut ]] 1486 1259 then 1487 echo "cat > scpjob.$ kennung<< %%END%%" >> $job_to_send1260 echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send 1488 1261 echo "#!/bin/bash" >> $job_to_send 1489 1262 echo "#PJM -L \"vnode=1\"" >> $job_to_send … … 1500 1273 echo "%%END%%" >> $job_to_send 1501 1274 1502 elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]]1503 then1504 echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send1505 echo "#!/bin/bash" >> $job_to_send1506 echo "#PBS -N job_protocol_transfer" >> $job_to_send1507 echo "#PBS -l walltime=00:30:00" >> $job_to_send1508 echo "#PBS -l nodes=1:ppn=1" >> $job_to_send1509 echo "#PBS -l feature=data" >> $job_to_send1510 echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send1511 echo "#PBS -j oe" >> $job_to_send1512 echo " " >> $job_to_send1513 echo ". /usr/share/modules/init/bash" >> $job_to_send1514 echo "set -x" >> $job_to_send1515 echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send1516 echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send1517 echo "%%END%%" >> $job_to_send1518 1519 1275 elif [[ $remote_host = lccrayb || $remote_host = lccrayh ]] 1520 1276 then 1521 echo "cat > scpjob.$ kennung<< %%END%%" >> $job_to_send1277 echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send 1522 1278 echo "#!/bin/bash" >> $job_to_send 1523 1279 echo "#PBS -N job_protocol_transfer" >> $job_to_send … … 1534 1290 elif [[ $remote_host = lcflow ]] 1535 1291 then 1536 echo "cat > scpjob.${ kennung}.tmp << %%END%%" >> $job_to_send1292 echo "cat > scpjob.${identifier}.tmp << %%END%%" >> $job_to_send 1537 1293 echo "#!/bin/bash" >> $job_to_send 1538 1294 echo "SGEPREFIX -S /bin/bash" >> $job_to_send … … 1543 1299 echo "SGEPREFIX -l excl_flow=false" >> $job_to_send 1544 1300 echo "SGEPREFIX -j y" >> $job_to_send 1545 echo "SGEPREFIX -o ${local_host}_${job_name}_scpjob_$ kennung" >> $job_to_send1301 echo "SGEPREFIX -o ${local_host}_${job_name}_scpjob_$identifier" >> $job_to_send 1546 1302 echo " " >> $job_to_send 1547 1303 echo "set -x" >> $job_to_send … … 1551 1307 echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send 1552 1308 echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send 1553 echo "rm -f scpjob.${ kennung}" >> $job_to_send1309 echo "rm -f scpjob.${identifier}" >> $job_to_send 1554 1310 echo "%%END%%" >> $job_to_send 1555 echo "sed -e 's/SGEPREFIX/#$/g' scpjob.${ kennung}.tmp > scpjob.${kennung}" >> $job_to_send1556 echo "rm -f scpjob.${ kennung}.tmp" >> $job_to_send1311 echo "sed -e 's/SGEPREFIX/#$/g' scpjob.${identifier}.tmp > scpjob.${identifier}" >> $job_to_send 1312 echo "rm -f scpjob.${identifier}.tmp" >> $job_to_send 1557 1313 1558 1314 else 1559 1315 1560 echo "cat > scpjob.$ kennung<< %%END%%" >> $job_to_send1316 echo "cat > scpjob.$identifier << %%END%%" >> $job_to_send 1561 1317 echo "# @\\\$-q $return_queue" >> $job_to_send 1562 1318 echo "# @\\\$-l${qsubtime} 10" >> $job_to_send … … 1567 1323 fi 1568 1324 echo '# @\$-lF 10mb' >> $job_to_send 1569 # echo '# @\$-o /dev/null' >> $job_to_send1570 1325 echo '# @\$-o job_queue/last_job_transfer_protocol' >> $job_to_send 1571 1326 echo '# @\\\$-eo' >> $job_to_send … … 1584 1339 if [[ $(echo $remote_host | cut -c1-3) = ibm ]] 1585 1340 then 1586 echo "llsubmit scpjob.$ kennung" >> $job_to_send1341 echo "llsubmit scpjob.$identifier" >> $job_to_send 1587 1342 elif [[ $remote_host = lccrayb || $remote_host = lccrayh ]] 1588 1343 then 1589 echo "msub -q $return_queue scpjob.$kennung" >> $job_to_send 1590 elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]] 1591 then 1592 echo "rm -rf \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send 1593 echo "chmod u+x scpjob.$kennung" >> $job_to_send 1594 echo "msub scpjob.$kennung" >> $job_to_send 1344 echo "msub -q $return_queue scpjob.$identifier" >> $job_to_send 1595 1345 elif [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 ]] 1596 1346 then 1597 echo "qsub -J n scpjob.$ kennung" >> $job_to_send1347 echo "qsub -J n scpjob.$identifier" >> $job_to_send 1598 1348 elif [[ $remote_host = t3es ]] 1599 1349 then 1600 echo "qsub -J n -s /bin/ksh scpjob.$ kennung" >> $job_to_send1350 echo "qsub -J n -s /bin/ksh scpjob.$identifier" >> $job_to_send 1601 1351 elif [[ $remote_host = lckiaps ]] 1602 1352 then 1603 echo "mv scpjob.$ kennung$job_catalog" >> $job_to_send1604 echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"$submcom ${job_catalog}/scpjob.$ kennung\" " >> $job_to_send1605 echo "rm ${job_catalog}/scpjob.$ kennung" >> $job_to_send1353 echo "mv scpjob.$identifier $job_catalog" >> $job_to_send 1354 echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"$submcom ${job_catalog}/scpjob.$identifier\" " >> $job_to_send 1355 echo "rm ${job_catalog}/scpjob.$identifier" >> $job_to_send 1606 1356 elif [[ $remote_host = lckyu* ]] 1607 1357 then 1608 echo "scp $PORTOPT scpjob.$ kennung${remote_username}@${remote_addres}:job_queue" >> $job_to_send1609 echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"cd job_queue; $submcom scpjob.$ kennung; rm scpjob.$kennung\" " >> $job_to_send1358 echo "scp $PORTOPT scpjob.$identifier ${remote_username}@${remote_addres}:job_queue" >> $job_to_send 1359 echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"cd job_queue; $submcom scpjob.$identifier; rm scpjob.$identifier\" " >> $job_to_send 1610 1360 elif [[ $remote_host = lcflow ]] 1611 1361 then 1612 echo "mv scpjob.$ kennung$job_catalog" >> $job_to_send1613 echo "/usr/bin/ssh ${remote_username}@${remote_addres} \"$init_cmds $module_calls cd $job_catalog; $submcom scpjob.$ kennung\" " >> $job_to_send1362 echo "mv scpjob.$identifier $job_catalog" >> $job_to_send 1363 echo "/usr/bin/ssh ${remote_username}@${remote_addres} \"$init_cmds $module_calls cd $job_catalog; $submcom scpjob.$identifier\" " >> $job_to_send 1614 1364 else 1615 echo "$submcom scpjob.$ kennung" >> $job_to_send1365 echo "$submcom scpjob.$identifier" >> $job_to_send 1616 1366 fi 1617 1367 if [[ $remote_host != ibmku && $remote_host != lckiaps ]] 1618 1368 then 1619 echo "rm scpjob.$ kennung" >> $job_to_send1369 echo "rm scpjob.$identifier" >> $job_to_send 1620 1370 fi 1621 1371 if [[ $remote_host = nech ]] … … 1625 1375 else 1626 1376 # echo "ftpcopy -d $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send 1377 # ??? funktioniert das ÃŒberhaupt noch ??? 1627 1378 echo "nohup ftpcopy -d -w 15 $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null &" >> $job_to_send 1628 1379 fi … … 1634 1385 1635 1386 1636 # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN1387 # APPEND THE JOB-FILE (CREATE BY mrun) TO THE JOB-DIRECTIVES GENERATED ABOVE 1637 1388 cat $file_to_send >> $job_to_send 1638 1389 … … 1643 1394 fi 1644 1395 1645 # remove job file1396 # REMOVE JOB-FILE 1646 1397 if [[ $remote_host = lctit || $remote_host = ibmku || $remote_host = lcflow ]] 1647 1398 then … … 1651 1402 1652 1403 1653 1654 # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN 1655 if [[ -z $remote_user ]] 1656 then 1657 if [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es || $remote_host = vpp ]] 1658 then 1659 grep $remote_addres ~/.netrc | read dum dum dum remote_user dum dum 1660 fi 1661 fi 1662 1663 1664 1665 # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN 1404 # TRANSFER JOB TO THE TARGET HOST (JOB-DIRECTORY) 1666 1405 if [[ $no_submit = false ]] 1667 1406 then … … 1669 1408 then 1670 1409 [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." 1671 if [[ $remote_host = ibms || $remote_host = ibmy]] # ssh on ibms cannot handle "~/"1410 if [[ $remote_host = ibms ]] # ssh on ibms cannot handle "~/" 1672 1411 then 1673 1412 job_catalog_save=$job_catalog … … 1680 1419 if [[ $remote_host = nech ]] 1681 1420 then 1682 # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ 1683 # TRANSFERIERT WERDEN 1421 # FILES CAN ONLY BE TRANSFERED VIA DKRZ'S ARCHIVE-SERVER 1684 1422 scp $PORTOPT $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost 1685 1423 else … … 1702 1440 1703 1441 1704 # NQS- BZW. LOADLEVELER-JOB STARTEN1442 # START NQS- / LOADLEVELER-JOB 1705 1443 if [[ $remote_host != $local_host ]] 1706 1444 then 1707 1445 [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" 1708 1446 1709 if [[ $(echo $remote_host | cut -c1-5) = lcsgi && $prio = true ]] 1710 then 1711 printf "\n >>> submit with HLRN qos-feature hiprio...\n" 1712 ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom -l qos=hiprio $job_on_remhost; rm $job_on_remhost" 1713 elif [[ $remote_host = ibmku ]] 1447 if [[ $remote_host = ibmku ]] 1714 1448 then 1715 1449 ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost" … … 1724 1458 else 1725 1459 cd $job_catalog 1726 if [[ $(echo $local_host | cut -c1- 5) = lcsgi || $(echo $local_host | cut -c1-3) = ibm || $(echo $local_host | cut -c1-6) = lccray ]]1460 if [[ $(echo $local_host | cut -c1-3) = ibm || $(echo $local_host | cut -c1-6) = lccray ]] 1727 1461 then 1728 1462 eval $submcom $job_on_remhost 1729 elif [[ $local_host = lc fimm || $local_host = lctit || $localhost = lcxe6 || $localhost = lck || $localhost = lckordi || $localhost = lcyon || $localhost = lcsb || $localhost = lckyu* ]]1463 elif [[ $local_host = lctit || $localhost = lcxe6 || $localhost = lck || $localhost = lckordi || $localhost = lcyon || $localhost = lcsb || $localhost = lckyu* ]] 1730 1464 then 1731 1465 chmod u+x $job_on_remhost … … 1743 1477 fi 1744 1478 1745 # J obfile must not be deleted on lctit/ibmku!! This will be done1746 # only at the end of the job.1479 # JOBFILE MUST NOT BE DELETED ON lctit/ibmku/lcflow. THIS WILL BE DONE 1480 # AT THE END OF THE JOB 1747 1481 if [[ $local_host != lctit && $local_host != ibmku && $local_host != lcflow ]] 1748 1482 then … … 1755 1489 1756 1490 1757 # ABSCHLUSSARBEITEN 1758 1491 # FINAL ACTIONS 1759 1492 if [[ $no_submit = false ]] 1760 1493 then -
palm/trunk/SOURCE/palm.f90
r1242 r1289 135 135 #endif 136 136 137 version = 'PALM 3. 9'137 version = 'PALM 3.10' 138 138 139 139 #if defined( __parallel ) -
palm/trunk/UTIL/interpret_config.f90
r1096 r1289 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! routine local_getenv removed 23 23 ! 24 24 ! Former revisions: … … 551 551 552 552 END PROGRAM interpret_config 553 554 555 556 SUBROUTINE local_getenv( var, ivar, value, ivalue )557 558 CHARACTER (LEN=*) :: var, value559 INTEGER :: ivalue, ivar560 561 CALL GETENV( var(1:ivar), value )562 ivalue = LEN_TRIM( value )563 564 END SUBROUTINE local_getenv
Note: See TracChangeset
for help on using the changeset viewer.