Changeset 1289 for palm/trunk/SCRIPTS/subjob
- Timestamp:
- Mar 4, 2014 7:12:34 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.