1 | #!/bin/ksh |
---|
2 | # subjob - Plot-Shellskript Version: @(#)SUBJOB 1.0 13/02/07 |
---|
3 | # $Id: subjob 54 2007-03-08 00:00:02Z raasch $ |
---|
4 | |
---|
5 | # Prozedur zum automatischen Generieren von Batch-Jobs, die unter NQS |
---|
6 | # laufen sollen und deren Ergebnis (Dayfile) zum Job-generierenden |
---|
7 | # Host zurueckgeschickt werden sollen |
---|
8 | |
---|
9 | |
---|
10 | # letzte Aenderung: |
---|
11 | # 29/06/94 - Siggi - Beginn mit Erstellung der Originalversion |
---|
12 | # 08/07/94 - Siggi - Originalversion abgeschlossen (Version 1.0) |
---|
13 | # 06/02/98 - Siggi - berte validiert |
---|
14 | # 27/01/01 - Siggi - ground.yonsei.ac.kr validiert, Jobs zur T3E in Korea |
---|
15 | # moeglich |
---|
16 | # 08/02/01 - Siggi - alle subjob-Meldungen ins englische uebersetzt |
---|
17 | # 25/05/02 - Siggi - Unterstuetzung des LoadLeveler |
---|
18 | # 30/05/02 - Siggi - Validierung fuer ibm-Rechner in Seoul (nobel) sowie |
---|
19 | # allgemeine Anpassungen fuer ibm-Rechner |
---|
20 | # 15/10/02 - Siggi - Neue Default-Jobklasse (p_normal) fuer IBM in Seoul |
---|
21 | # Ruecktransfer des Jobprotokolls fuer diese |
---|
22 | # Maschine abgeschaltet |
---|
23 | # 31/10/02 - Siggi - berni validiert |
---|
24 | # 06/11/02 - Siggi - Neue Jobklassen auf ibmb und ibmh |
---|
25 | # 08/11/02 - Siggi - quanero validiert |
---|
26 | # 11/12/02 - Siggi - Notification fuer Transfer-Jobs abgeschaltet |
---|
27 | # 23/01/03 - Siggi - hostname nobel changed to nobela |
---|
28 | # 06/02/03 - Siggi - gregale validated |
---|
29 | # 12/02/03 - Siggi - orkan and maestro validated |
---|
30 | # 21/02/03 - Siggi - all nobel nodes in Seoul validated |
---|
31 | # 12/03/03 - Siggi - nec at DKRZ validated |
---|
32 | # 13/03/03 - Siggi - new nqs resource variable Memory |
---|
33 | # 07/04/03 - Siggi - processor request option -c on nech needs tasks per |
---|
34 | # node |
---|
35 | # 11/04/03 - Siggi - network on ibms has attribute "shared" |
---|
36 | # 31/07/03 - Siggi - nqs2 on nech implemented (provisional: -h nech2) |
---|
37 | # cxxl added to ibmh |
---|
38 | # 29/08/03 - Siggi - changes in job queues and communication system on |
---|
39 | # ibms |
---|
40 | # 24/10/03 - Siggi - using alternate hanni address 130.75.4.2 |
---|
41 | # 30/10/03 - Siggi - nech is not supported any more |
---|
42 | # 10/11/03 - Siggi - nech2 renamed to nech |
---|
43 | # 20/11/03 - Siggi - submit command on nech changed from qsub.test to qsub |
---|
44 | # 29/03/04 - Siggi - ground not supported any more, gfdl3 validated |
---|
45 | # 31/03/04 - Siggi - new option -N for node usage |
---|
46 | # 12/04/04 - Siggi - scp2 instead of scp used for transfer from decalpha |
---|
47 | # due to error in ssh installation (otherwise a prompt |
---|
48 | # for the password appears) |
---|
49 | # 23/07/04 - Siggi - changes due to the new berni configuration |
---|
50 | # (federation switch) |
---|
51 | # 01/09/04 - Gerald new job-classes on hanni |
---|
52 | # 08/09/04 - Siggi - hanni IP address changed to 130.75.4.10 |
---|
53 | # 23/11/04 - Siggi - new job class cdata on hanni and berni |
---|
54 | # 03/12/04 - Siggi - notification on ibm switched of in case of |
---|
55 | # delete_dayfile = true, node usage in cdev set to |
---|
56 | # shared |
---|
57 | # 16/02/05 - Gerald hababai validated |
---|
58 | # 29/03/05 - Micha - new job class channi on hanni |
---|
59 | # 11/05/05 - Siggi - ConsumableMemory is now required as resource keyword |
---|
60 | # on ibms |
---|
61 | # 24/05/05 - Siggi - Default queue on ibms changed from p_normal_1.3 to |
---|
62 | # p_normal |
---|
63 | # 30/06/05 - Siggi - network changed for queue cdev from "us" to "ip" |
---|
64 | # 12/07/05 - Siggi - in network.mpi on ibmh/ibmb "csss" changed to |
---|
65 | # "sn_all", new job class cexp |
---|
66 | # 08/09/05 - Siggi - IP-address of gfdl3 changed |
---|
67 | # 31/10/05 - Siggi - new job class pp on hurricane, serial jobs on |
---|
68 | # hurricane (with -X0) |
---|
69 | # 01/11/05 - Siggi - missing queue for jobs submitted on nech (for nech) |
---|
70 | # added |
---|
71 | # 30/12/05 - Siggi - change of IP adresses in subnet 130.75.105 |
---|
72 | # 09/02/06 - Siggi - ibmy admitted |
---|
73 | # 10/02/06 - Siggi - scp2 changed to /bin/scp on decalpha |
---|
74 | # 13/04/06 - Siggi - ostria admitted |
---|
75 | # 18/04/06 - Siggi - new option -O for OpenMP usage |
---|
76 | # 24/05/06 - Siggi - lctit admitted, ftpjob renamed scpjob |
---|
77 | # 25/07/06 - Siggi - gfdl5 (ibmy) admitted for submitting jobs |
---|
78 | # 27/09/06 - Siggi - breg/hreg extended with berni/hanni |
---|
79 | # 25/10/06 - Siggi - data_limit set to 1.76 GByte on hanni and berni |
---|
80 | # 28/11/06 - Siggi - levanto admitted |
---|
81 | # 13/02/07 - Siggi - hpmuk releated code removed |
---|
82 | # 01/03/07 - Siggi - adjustments for RIAM machines gate and NEC-SX8 (n-sx) |
---|
83 | |
---|
84 | |
---|
85 | # VARIABLENVEREINBARUNGEN + DEFAULTWERTE |
---|
86 | delete_dayfile=false |
---|
87 | filetransfer_protocol=scp |
---|
88 | locat=normal |
---|
89 | no_default_queue=none |
---|
90 | no_submit=false |
---|
91 | job_catalog="~/job_queue" |
---|
92 | job_name=none |
---|
93 | local_user=$LOGNAME |
---|
94 | node_usage=shared |
---|
95 | numprocs=1 |
---|
96 | punkte="..........................................................." |
---|
97 | submcom=qsub |
---|
98 | queue=default |
---|
99 | remote_host=none |
---|
100 | remote_user="" |
---|
101 | verify=true |
---|
102 | |
---|
103 | typeset -i cputime=0 memory=0 Memory=0 minuten resttime sekunden stunden |
---|
104 | typeset -i inumprocs nodes=0 tasks_per_node=0 threads_per_task=1 |
---|
105 | typeset -L20 spalte1 |
---|
106 | typeset -R40 spalte2 |
---|
107 | typeset -L60 spalte3 |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | # FEHLERBEHANDLUNG |
---|
112 | # BEI EXIT: |
---|
113 | trap 'if [[ $locat != normal ]] |
---|
114 | then |
---|
115 | case $locat in |
---|
116 | (option) printf "\n --> available optios can be displayed" |
---|
117 | printf " by typing:" |
---|
118 | printf "\n \"subjob ?\" \n";; |
---|
119 | (ftpcopy|parameter|scp|verify) printf "\n";; |
---|
120 | (*) printf "\n +++ unknown error" |
---|
121 | printf "\n please inform S. Raasch!\n" |
---|
122 | esac |
---|
123 | [[ -f $job_to_send ]] && rm $job_to_send |
---|
124 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
125 | fi' exit |
---|
126 | |
---|
127 | |
---|
128 | # BEI TERMINAL-BREAK: |
---|
129 | trap '[[ -f $job_to_send ]] && rm $job_to_send |
---|
130 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
131 | exit |
---|
132 | ' 2 |
---|
133 | |
---|
134 | |
---|
135 | |
---|
136 | |
---|
137 | # LOKALEN HOSTNAMEN FESTSTELLEN |
---|
138 | local_host=$(hostname) |
---|
139 | |
---|
140 | |
---|
141 | |
---|
142 | # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALER HOST |
---|
143 | # UEBERHAUPT ZULAESSIG IST |
---|
144 | case $local_host in |
---|
145 | (atmos) local_addres=172.20.25.35; local_host=lcide;; |
---|
146 | (bora) local_addres=130.75.105.103; local_host=lcmuk;; |
---|
147 | (breg*-en0|berni*-en0) local_addres=130.73.230.10; local_host=ibmb;; |
---|
148 | (breva) local_addres=130.75.105.98; local_host=lcmuk;; |
---|
149 | (cs*) local_addres=136.172.44.131; local_host=nech;; |
---|
150 | (elephanta) local_addres=130.75.105.6; local_host=lcmuk;; |
---|
151 | (gate|n-sx) local_addres=133.5.178.11; local_host=neck;; |
---|
152 | (gfdl5) local_addres=165.132.26.58; local_host=ibmy;; |
---|
153 | (gfdl3.yonsei.ac.kr) local_addres=165.132.26.56; local_host=decalpha;; |
---|
154 | (gregale) local_addres=130.75.105.109; local_host=lcmuk;; |
---|
155 | (hababai) local_addres=130.75.105.108; local_host=lcmuk;; |
---|
156 | (hreg*-en0|hanni*-en0) local_addres=130.75.4.10; local_host=ibmh;; |
---|
157 | (irifi) local_addres=130.75.105.104; local_host=lcmuk;; |
---|
158 | (levanto) local_addres=130.75.105.45; local_host=lcmuk;; |
---|
159 | (maestro) local_addres=130.75.105.2; local_host=lcmuk;; |
---|
160 | (nobel*) local_addres=150.183.5.101; local_host=ibms;; |
---|
161 | (orkan) local_addres=130.75.105.3; local_host=lcmuk;; |
---|
162 | (ostria) local_addres=130.75.105.106; local_host=lcmuk;; |
---|
163 | (quanero) local_addres=130.75.105.107; local_host=lcmuk;; |
---|
164 | (scirocco) local_addres=172.20.25.41; local_host=lcmuk;; |
---|
165 | (sun1|sun2) local_addres=130.75.6.1; local_host=unics;; |
---|
166 | (tgg*) local_addres=172.17.75.161; local_host=lctit;; |
---|
167 | (vorias) local_addres=172.20.25.43; local_host=lcmuk;; |
---|
168 | (*) printf "\n +++ \"$local_host\" unknown"; |
---|
169 | printf "\n please inform S. Raasch!"; |
---|
170 | locat=parameter; exit;; |
---|
171 | esac |
---|
172 | |
---|
173 | |
---|
174 | |
---|
175 | # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN |
---|
176 | remote_host=$local_host |
---|
177 | |
---|
178 | |
---|
179 | |
---|
180 | |
---|
181 | # PROZEDUROPTIONEN EINLESEN |
---|
182 | while getopts :c:dDf:h:m:n:N:O:q:t:T:u:vX: option |
---|
183 | do |
---|
184 | case $option in |
---|
185 | (c) job_catalog=$OPTARG;; |
---|
186 | (d) delete_dayfile=true;; |
---|
187 | (D) no_submit=true;; |
---|
188 | (f) filetransfer_protocol=$OPTARG;; |
---|
189 | (h) remote_host=$OPTARG;; |
---|
190 | (m) memory=$OPTARG;; |
---|
191 | (n) job_name=$OPTARG;; |
---|
192 | (N) node_usage=$OPTARG;; |
---|
193 | (O) threads_per_task=$OPTARG;; |
---|
194 | (q) no_default_queue=$OPTARG;; |
---|
195 | (t) cputime=$OPTARG;; |
---|
196 | (T) tasks_per_node=$OPTARG;; |
---|
197 | (u) remote_user=$OPTARG;; |
---|
198 | (v) verify=false;; |
---|
199 | (X) numprocs=$OPTARG;; |
---|
200 | (\?) printf "\n +++ Option $OPTARG unknown \n"; |
---|
201 | locat=option; exit;; |
---|
202 | esac |
---|
203 | done |
---|
204 | |
---|
205 | |
---|
206 | # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN |
---|
207 | shift OPTIND-1; file_to_send=$1 |
---|
208 | |
---|
209 | |
---|
210 | # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN |
---|
211 | if [ "$1" = "?" ] |
---|
212 | then |
---|
213 | (printf "\n *** subjob can be called as follows:\n" |
---|
214 | printf "\n subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v <jobfile>\n" |
---|
215 | printf "\n Description of available options:\n" |
---|
216 | printf "\n Option Description Default-Value" |
---|
217 | printf "\n -c job-input- and output-catalog ~/job_queue" |
---|
218 | printf "\n -d no job-protocol will be created ---" |
---|
219 | printf "\n -D only the job-file will be created ---" |
---|
220 | printf "\n -f filetransfer protocol scp" |
---|
221 | printf "\n -h execution host, available hosts: $remote_host" |
---|
222 | printf "\n ibm, ibmb, ibmh, ibms, ibmy, lcmuk," |
---|
223 | printf "\n lctit, nech, neck, unics" |
---|
224 | printf "\n -m memory demand per process in MByte ---" |
---|
225 | printf "\n -n jobname <jobdatei>" |
---|
226 | printf "\n -O threads per task (for OpenMP usage) 1" |
---|
227 | printf "\n -q job-queue to be used default" |
---|
228 | printf "\n -t allowed cpu-time in seconds ---" |
---|
229 | printf "\n -T tasks per node (on parallel hosts) ---" |
---|
230 | printf "\n -u username on execution host from .netrc" |
---|
231 | printf "\n -v no prompt for confirmation ---" |
---|
232 | printf "\n -X # of processors (on parallel hosts) 1" |
---|
233 | printf "\n " |
---|
234 | printf "\n The only possible positional parameter is <jobfile>:" |
---|
235 | printf "\n The complete NQS-job must be provided here." |
---|
236 | printf "\n <jobfile>=? creates this outline\n\n") | more |
---|
237 | exit |
---|
238 | fi |
---|
239 | |
---|
240 | |
---|
241 | |
---|
242 | # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT |
---|
243 | if [[ "$file_to_send" = "" ]] |
---|
244 | then |
---|
245 | printf "\n +++ job-file missing" |
---|
246 | locat=parameter; exit |
---|
247 | else |
---|
248 | if [[ -f $file_to_send ]] |
---|
249 | then |
---|
250 | true |
---|
251 | else |
---|
252 | printf "\n +++ job-file: " |
---|
253 | printf "\n $file_to_send" |
---|
254 | printf "\n does not exist" |
---|
255 | locat=parameter; exit |
---|
256 | fi |
---|
257 | fi |
---|
258 | |
---|
259 | |
---|
260 | |
---|
261 | # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME |
---|
262 | # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE |
---|
263 | if [[ $job_name = none ]] |
---|
264 | then |
---|
265 | job_name=$file_to_send |
---|
266 | fi |
---|
267 | if [[ $(echo $job_name | grep -c "/") != 0 ]] |
---|
268 | then |
---|
269 | printf "\n +++ job-file name: " |
---|
270 | printf "\n $job_name" |
---|
271 | printf "\n must not contain \"/\"-characters" |
---|
272 | locat=parameter; exit |
---|
273 | fi |
---|
274 | |
---|
275 | |
---|
276 | |
---|
277 | |
---|
278 | # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST |
---|
279 | # ODER WENN HOST NICHT ANGEGEBEN WURDE |
---|
280 | if [[ $remote_host = none ]] |
---|
281 | then |
---|
282 | printf "\n +++ host missing" |
---|
283 | locat=option; exit |
---|
284 | else |
---|
285 | case $remote_host in |
---|
286 | (ibm) queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
287 | (ibmb) queue=cpar; remote_addres=130.73.230.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
288 | (ibmh) queue=cpar; remote_addres=130.75.4.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
289 | (ibms) queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
290 | (ibmy) queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
291 | (lctit) queue=test; remote_addres=172.17.75.161; submcom=/n1ge/TITECH_GRID/tools/bin/n1ge;; |
---|
292 | (nech) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";; |
---|
293 | (neck) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=133.5.178.11; submcom="/usr/bin/nqsII/qsub";; |
---|
294 | (vpp) qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;; |
---|
295 | (unics) qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;; |
---|
296 | (*) printf "\n +++ hostname \"$remote_host\" not allowed"; |
---|
297 | locat=parameter; exit;; |
---|
298 | esac |
---|
299 | fi |
---|
300 | |
---|
301 | |
---|
302 | # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST |
---|
303 | if [[ $no_default_queue != none ]] |
---|
304 | then |
---|
305 | error=false |
---|
306 | ndq=$no_default_queue |
---|
307 | case $remote_host in |
---|
308 | (ibm) case $ndq in |
---|
309 | (p690_express|p690_standard|p690_long) error=false;; |
---|
310 | (*) error=true;; |
---|
311 | esac;; |
---|
312 | (ibmb) case $ndq in |
---|
313 | (cdata|cdev|cexp|c1|cshare|csolo|cspec) error=false;; |
---|
314 | (*) error=true;; |
---|
315 | esac;; |
---|
316 | (ibmh) case $ndq in |
---|
317 | (cdata|cdev|cexp|channi|cxxl|c1|cshare|csolo|cspec) error=false;; |
---|
318 | (*) error=true;; |
---|
319 | esac;; |
---|
320 | (ibms) case $ndq in |
---|
321 | (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand) error=false;; |
---|
322 | (*) error=true;; |
---|
323 | esac;; |
---|
324 | (ibmy) case $ndq in |
---|
325 | (parallel) error=false;; |
---|
326 | (*) error=true;; |
---|
327 | esac;; |
---|
328 | (lctit) case $ndq in |
---|
329 | (cs|default|high|test) error=false;; |
---|
330 | (*) error=true;; |
---|
331 | esac;; |
---|
332 | (t3eb) case $ndq in |
---|
333 | (berte|p50|p100|p392|forfree|p25himem) error=false;; |
---|
334 | (*) error=true;; |
---|
335 | esac;; |
---|
336 | (t3eh) case $ndq in |
---|
337 | (para_t3e|em|k|l|lm|comp_t3e|c|p|ht) error=false;; |
---|
338 | (*) error=true;; |
---|
339 | esac;; |
---|
340 | (t3ej2|t3ej5) case $ndq in |
---|
341 | (low|normal|high) error=false;; |
---|
342 | (*) error=true;; |
---|
343 | esac;; |
---|
344 | (t3es) case $ndq in |
---|
345 | (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128) error=false;; |
---|
346 | (*) error=true;; |
---|
347 | esac;; |
---|
348 | (unics) case $ndq in |
---|
349 | (unics|ht) error=false;; |
---|
350 | (*) error=true;; |
---|
351 | esac;; |
---|
352 | esac |
---|
353 | if [[ $error = true ]] |
---|
354 | then |
---|
355 | printf "\n +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed" |
---|
356 | locat=parameter; exit |
---|
357 | else |
---|
358 | queue=$no_default_queue |
---|
359 | fi |
---|
360 | fi |
---|
361 | |
---|
362 | |
---|
363 | |
---|
364 | # KNOTENNUTZUNG IN ENTWICKLERQUEUE MUSS SHARED SEIN |
---|
365 | if [[ $node_usage != shared && $queue = cdev ]] |
---|
366 | then |
---|
367 | node_usage=shared |
---|
368 | fi |
---|
369 | |
---|
370 | |
---|
371 | |
---|
372 | # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN |
---|
373 | # AUFTEILEN |
---|
374 | done=false |
---|
375 | while [[ $done = false ]] |
---|
376 | do |
---|
377 | if (( $cputime <= 0 )) |
---|
378 | then |
---|
379 | printf "\n +++ wrong cpu-time or cpu-time missing" |
---|
380 | printf "\n >>> Please type cpu-time in seconds as INTEGER:" |
---|
381 | printf "\n >>> " |
---|
382 | read cputime 1>/dev/null 2>&1 |
---|
383 | else |
---|
384 | done=true |
---|
385 | fi |
---|
386 | done |
---|
387 | if [[ $remote_host = nech ]] |
---|
388 | then |
---|
389 | if (( tasks_per_node != 0 )) |
---|
390 | then |
---|
391 | (( cputime = cputime * tasks_per_node )) |
---|
392 | elif [[ $numprocs != 0 ]] |
---|
393 | then |
---|
394 | (( cputime = cputime * numprocs )) |
---|
395 | fi |
---|
396 | fi |
---|
397 | (( stunden = cputime / 3600 )) |
---|
398 | (( resttime = cputime - stunden * 3600 )) |
---|
399 | (( minuten = resttime / 60 )) |
---|
400 | (( sekunden = resttime - minuten * 60 )) |
---|
401 | timestring=${stunden}:${minuten}:${sekunden} |
---|
402 | |
---|
403 | |
---|
404 | |
---|
405 | # PRUEFEN DER KERNSPEICHERANFORDERUNG |
---|
406 | done=false |
---|
407 | while [[ $done = false ]] |
---|
408 | do |
---|
409 | if (( memory <= 0 )) |
---|
410 | then |
---|
411 | printf "\n +++ wrong memory demand or memory demand missing" |
---|
412 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
413 | printf "\n >>> " |
---|
414 | read memory 1>/dev/null 2>&1 |
---|
415 | else |
---|
416 | done=true |
---|
417 | fi |
---|
418 | done |
---|
419 | |
---|
420 | if [[ $remote_host = nech || $remote_host = neck ]] |
---|
421 | then |
---|
422 | if (( tasks_per_node != 0 )) |
---|
423 | then |
---|
424 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
425 | elif [[ $numprocs != 0 ]] |
---|
426 | then |
---|
427 | (( Memory = memory * numprocs / 1000 )) |
---|
428 | else |
---|
429 | (( Memory = memory / 1000 )) |
---|
430 | fi |
---|
431 | fi |
---|
432 | |
---|
433 | |
---|
434 | # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG |
---|
435 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
436 | then |
---|
437 | (( memory = memory * threads_per_task )) |
---|
438 | fi |
---|
439 | |
---|
440 | |
---|
441 | # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN |
---|
442 | if (( tasks_per_node != 0 )) |
---|
443 | then |
---|
444 | (( nodes = numprocs / ( tasks_per_node * threads_per_task ) )) |
---|
445 | fi |
---|
446 | |
---|
447 | |
---|
448 | |
---|
449 | # HEADER-AUSGABE |
---|
450 | if [[ $verify = true ]] |
---|
451 | then |
---|
452 | printf "\n\n" |
---|
453 | printf "#--------------------------------------------------------------# \n" |
---|
454 | spalte1=SUBJOB;spalte2=$(date) |
---|
455 | printf "| $spalte1$spalte2 | \n" |
---|
456 | printf "| | \n" |
---|
457 | printf "| values of parameters/options: | \n" |
---|
458 | spalte1=local_host$punkte; spalte2=$punkte$local_host |
---|
459 | printf "| $spalte1$spalte2 | \n" |
---|
460 | spalte1=remote_host$punkte; spalte2=$punkte$remote_host |
---|
461 | printf "| $spalte1$spalte2 | \n" |
---|
462 | spalte1=queue$punkte; spalte2=$punkte$queue |
---|
463 | printf "| $spalte1$spalte2 | \n" |
---|
464 | spalte1=memory$punkte; spalte2="$punkte$memory mb" |
---|
465 | printf "| $spalte1$spalte2 | \n" |
---|
466 | spalte1=cputime$punkte; spalte2="$punkte$cputime sec" |
---|
467 | printf "| $spalte1$spalte2 | \n" |
---|
468 | spalte1=job_name$punkte; spalte2="$punkte$job_name" |
---|
469 | printf "| $spalte1$spalte2 | \n" |
---|
470 | printf "#--------------------------------------------------------------# \n\n" |
---|
471 | |
---|
472 | |
---|
473 | # KONTROLLABFRAGE, OB ALLES O.K. |
---|
474 | antwort="dummy" |
---|
475 | while [[ $antwort != y && $antwort != Y && $antwort != n && $antwort != N ]] |
---|
476 | do |
---|
477 | read antwort?" >>> continue (y/n) ? " |
---|
478 | done |
---|
479 | if [[ $antwort = n || $antwort = N ]] |
---|
480 | then |
---|
481 | locat=verify; exit |
---|
482 | fi |
---|
483 | printf "\n" |
---|
484 | fi |
---|
485 | |
---|
486 | |
---|
487 | |
---|
488 | # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN |
---|
489 | kennung=$RANDOM |
---|
490 | job_on_remhost=${job_name}_${kennung}_$local_host |
---|
491 | job_to_send=job_to_send_$kennung |
---|
492 | if [[ $delete_dayfile = false ]] |
---|
493 | then |
---|
494 | remote_dayfile=${local_host}_${job_name}_result_$kennung |
---|
495 | local_dayfile=${remote_host}_${job_name} |
---|
496 | else |
---|
497 | remote_dayfile=/dev/null |
---|
498 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
499 | then |
---|
500 | notification='# @ notification = never' |
---|
501 | fi |
---|
502 | fi |
---|
503 | |
---|
504 | |
---|
505 | |
---|
506 | # QSUB- ODER LL-KOMMANDOS BZW. SKRIPTE GENERIEREN |
---|
507 | if [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs != 0 ]] |
---|
508 | then |
---|
509 | |
---|
510 | if [[ $remote_host = ibmy ]] |
---|
511 | then |
---|
512 | consumable_memory="" |
---|
513 | else |
---|
514 | consumable_memory="ConsumableMemory($memory mb)" |
---|
515 | fi |
---|
516 | if [[ $queue = cdev ]] |
---|
517 | then |
---|
518 | data_limit="# @ data_limit = 1.76gb" |
---|
519 | network_to_use="# @ network.mpi = sn_all,shared,ip" |
---|
520 | else |
---|
521 | if [[ $remote_host = ibms ]] |
---|
522 | then |
---|
523 | network_to_use="# @ network.mpi = csss,shared,us" |
---|
524 | elif [[ $remote_host = ibmy ]] |
---|
525 | then |
---|
526 | network_to_use="" |
---|
527 | else |
---|
528 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
529 | data_limit="# @ data_limit = 1.76gb" |
---|
530 | fi |
---|
531 | fi |
---|
532 | |
---|
533 | cat > $job_to_send << %%END%% |
---|
534 | #!/bin/ksh |
---|
535 | |
---|
536 | # @ job_type = parallel |
---|
537 | # @ job_name = palm |
---|
538 | # @ wall_clock_limit = ${timestring},$timestring |
---|
539 | # @ resources = ConsumableCpus($threads_per_task) $consumable_memory |
---|
540 | # @ output = $remote_dayfile |
---|
541 | # @ error = $remote_dayfile |
---|
542 | # @ image_size = 50 |
---|
543 | # @ class = $queue |
---|
544 | # @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes |
---|
545 | $network_to_use |
---|
546 | $data_limit |
---|
547 | $notification |
---|
548 | |
---|
549 | %%END%% |
---|
550 | |
---|
551 | if (( nodes > 0 )) |
---|
552 | then |
---|
553 | |
---|
554 | cat >> $job_to_send << %%END%% |
---|
555 | # @ node = $nodes |
---|
556 | # @ tasks_per_node = $tasks_per_node |
---|
557 | # @ node_usage = $node_usage |
---|
558 | # @ queue |
---|
559 | |
---|
560 | %%END%% |
---|
561 | |
---|
562 | else |
---|
563 | |
---|
564 | if [[ $remote_host != ibmy ]] |
---|
565 | then |
---|
566 | |
---|
567 | cat >> $job_to_send << %%END%% |
---|
568 | # @ blocking = unlimited |
---|
569 | # @ total_tasks = $numprocs |
---|
570 | # @ node_usage = $node_usage |
---|
571 | # @ queue |
---|
572 | |
---|
573 | %%END%% |
---|
574 | |
---|
575 | else |
---|
576 | |
---|
577 | cat >> $job_to_send << %%END%% |
---|
578 | # @ node = 1 |
---|
579 | # @ total_tasks = $numprocs |
---|
580 | # @ queue |
---|
581 | |
---|
582 | %%END%% |
---|
583 | |
---|
584 | fi |
---|
585 | |
---|
586 | fi |
---|
587 | |
---|
588 | elif [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs = 0 ]] |
---|
589 | then |
---|
590 | |
---|
591 | cat > $job_to_send << %%END%% |
---|
592 | #!/bin/ksh |
---|
593 | |
---|
594 | # @ job_type = serial |
---|
595 | # @ node_usage = $node_usage |
---|
596 | # @ job_name = palm |
---|
597 | # @ wall_clock_limit = ${timestring},$timestring |
---|
598 | # @ resources = ConsumableCpus(1) ConsumableMemory(1 gb) |
---|
599 | # @ output = $remote_dayfile |
---|
600 | # @ error = $remote_dayfile |
---|
601 | # @ class = $queue |
---|
602 | $notification |
---|
603 | |
---|
604 | # @ queue |
---|
605 | |
---|
606 | %%END%% |
---|
607 | |
---|
608 | elif [[ $remote_host = nech ]] |
---|
609 | then |
---|
610 | |
---|
611 | if (( nodes > 1 )) |
---|
612 | then |
---|
613 | cat > $job_to_send << %%END%% |
---|
614 | #!/bin/ksh |
---|
615 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
616 | #PBS -l ${qsubmem}=${Memory}gb |
---|
617 | #PBS -b $nodes |
---|
618 | #PBS -o $remote_dayfile |
---|
619 | #PBS -N palm |
---|
620 | #PBS -j o |
---|
621 | #PBS -T mpisx |
---|
622 | |
---|
623 | %%END%% |
---|
624 | |
---|
625 | elif [[ $numprocs != 0 ]] |
---|
626 | then |
---|
627 | cat > $job_to_send << %%END%% |
---|
628 | #!/bin/ksh |
---|
629 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
630 | #PBS -l ${qsubmem}=${Memory}gb |
---|
631 | #PBS -o $remote_dayfile |
---|
632 | #PBS -N palm |
---|
633 | #PBS -j o |
---|
634 | |
---|
635 | %%END%% |
---|
636 | |
---|
637 | else |
---|
638 | cat > $job_to_send << %%END%% |
---|
639 | #!/bin/ksh |
---|
640 | #PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime |
---|
641 | #PBS -o $remote_dayfile |
---|
642 | #PBS -j o |
---|
643 | |
---|
644 | %%END%% |
---|
645 | |
---|
646 | fi |
---|
647 | |
---|
648 | elif [[ $remote_host = neck ]] |
---|
649 | then |
---|
650 | |
---|
651 | if (( nodes > 1 )) |
---|
652 | then |
---|
653 | cat > $job_to_send << %%END%% |
---|
654 | #!/bin/ksh |
---|
655 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
656 | #PBS -l ${qsubmem}=${Memory}gb |
---|
657 | #PBS -b $nodes |
---|
658 | #PBS -o $remote_dayfile |
---|
659 | #PBS -N palm |
---|
660 | #PBS -j o |
---|
661 | #PBS -T mpisx |
---|
662 | |
---|
663 | %%END%% |
---|
664 | |
---|
665 | elif [[ $numprocs != 0 ]] |
---|
666 | then |
---|
667 | cat > $job_to_send << %%END%% |
---|
668 | #!/bin/ksh |
---|
669 | #PBS -q ${queue} |
---|
670 | #PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime |
---|
671 | #PBS -l ${qsubmem}=${Memory}gb |
---|
672 | #PBS -o $remote_dayfile |
---|
673 | #PBS -N palm |
---|
674 | #PBS -j o |
---|
675 | #PBS -T mpisx |
---|
676 | |
---|
677 | %%END%% |
---|
678 | |
---|
679 | else |
---|
680 | cat > $job_to_send << %%END%% |
---|
681 | #!/bin/ksh |
---|
682 | #PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime |
---|
683 | #PBS -o $remote_dayfile |
---|
684 | #PBS -j o |
---|
685 | |
---|
686 | %%END%% |
---|
687 | |
---|
688 | fi |
---|
689 | |
---|
690 | elif [[ $remote_host = lctit ]] |
---|
691 | then |
---|
692 | cat > $job_to_send << %%END%% |
---|
693 | #!/bin/bash |
---|
694 | #$ -S /bin/bash |
---|
695 | cd $job_catalog |
---|
696 | PATH=$job_catalog:${job_catalog}/../pub:\$PATH |
---|
697 | export PATH |
---|
698 | |
---|
699 | %%END%% |
---|
700 | |
---|
701 | # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN |
---|
702 | submcom="$submcom -N $job_name -sgeout $remote_dayfile -q default" |
---|
703 | |
---|
704 | else |
---|
705 | |
---|
706 | cat > $job_to_send << %%END%% |
---|
707 | # @\$-q ${queue} |
---|
708 | # @\$-l${qsubtime} $timestring |
---|
709 | # @\$-l${qsubmem} ${memory}mb |
---|
710 | # @\$-o $remote_dayfile |
---|
711 | # @\$-eo |
---|
712 | |
---|
713 | %%END%% |
---|
714 | |
---|
715 | fi |
---|
716 | |
---|
717 | |
---|
718 | # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP |
---|
719 | # BEI EXIT VERANLASSEN |
---|
720 | # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT |
---|
721 | # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH |
---|
722 | if [[ $delete_dayfile = false && $remote_host != $local_host ]] |
---|
723 | then |
---|
724 | echo "set +vx" >> $job_to_send |
---|
725 | echo "trap '" >> $job_to_send |
---|
726 | echo "set +vx" >> $job_to_send |
---|
727 | if [[ $(echo $remote_host | cut -c1-3) = ibm || $(echo $remote_host | cut -c1-3) = nec || $remote_host = lctit ]] |
---|
728 | then |
---|
729 | if [[ $remote_host = ibmb || $remote_host = ibmh ]] |
---|
730 | then |
---|
731 | return_queue=c1 |
---|
732 | elif [[ $remote_host = ibms ]] |
---|
733 | then |
---|
734 | return_queue=p_normal |
---|
735 | elif [[ $remote_host = ibmy ]] |
---|
736 | then |
---|
737 | return_queue=serial |
---|
738 | elif [[ $remote_host = lctit ]] |
---|
739 | then |
---|
740 | return_queue=default |
---|
741 | elif [[ $remote_host = neck ]] |
---|
742 | then |
---|
743 | return_queue=S |
---|
744 | else |
---|
745 | return_queue=unknown |
---|
746 | fi |
---|
747 | |
---|
748 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
749 | then |
---|
750 | |
---|
751 | echo "echo \"#!/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
752 | echo "echo \"# @ job_type = serial\" >> scpjob.$kennung" >> $job_to_send |
---|
753 | echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung" >> $job_to_send |
---|
754 | echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$kennung" >> $job_to_send |
---|
755 | echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$kennung " >> $job_to_send |
---|
756 | echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
757 | echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
758 | echo "echo \"# @ class = $return_queue\" >> scpjob.$kennung" >> $job_to_send |
---|
759 | echo "echo \"# @ image_size = 10\" >> scpjob.$kennung" >> $job_to_send |
---|
760 | echo "echo \"# @ notification = never\" >> scpjob.$kennung" >> $job_to_send |
---|
761 | |
---|
762 | echo "echo \"# @ queue\" >> scpjob.$kennung" >> $job_to_send |
---|
763 | echo "echo \" \" >> scpjob.$kennung" >> $job_to_send |
---|
764 | |
---|
765 | echo "echo \"set -x\" >> scpjob.$kennung" >> $job_to_send |
---|
766 | echo "echo \"batch_scp -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \\\"$job_catalog\\\" $local_dayfile\" >> scpjob.$kennung" >> $job_to_send |
---|
767 | echo "echo \"exit\" >> scpjob.$kennung" >> $job_to_send |
---|
768 | |
---|
769 | elif [[ $remote_host = nech ]] |
---|
770 | then |
---|
771 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
772 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
773 | echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send |
---|
774 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
775 | echo "#PBS -j o" >> $job_to_send |
---|
776 | echo " " >> $job_to_send |
---|
777 | echo "set -x" >> $job_to_send |
---|
778 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
779 | echo "batch_scp -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
780 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
781 | echo "%%END%%" >> $job_to_send |
---|
782 | |
---|
783 | elif [[ $remote_host = neck ]] |
---|
784 | then |
---|
785 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
786 | echo "#PBS -q $return_queue" >> $job_to_send |
---|
787 | echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send |
---|
788 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
789 | echo "#PBS -j o" >> $job_to_send |
---|
790 | echo " " >> $job_to_send |
---|
791 | echo "set -x" >> $job_to_send |
---|
792 | echo "batch_scp -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
793 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
794 | echo "%%END%%" >> $job_to_send |
---|
795 | |
---|
796 | elif [[ $remote_host = lctit ]] |
---|
797 | then |
---|
798 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
799 | echo "set -x" >> $job_to_send |
---|
800 | echo "PATH=\$PATH:$job_catalog/../pub" >> $job_to_send |
---|
801 | echo "cd $job_catalog" >> $job_to_send |
---|
802 | echo "batch_scp -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
803 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
804 | echo "%%END%%" >> $job_to_send |
---|
805 | |
---|
806 | else |
---|
807 | |
---|
808 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
809 | echo "# @\\\$-q $return_queue" >> $job_to_send |
---|
810 | echo "# @\\\$-l${qsubtime} 10" >> $job_to_send |
---|
811 | echo "# @\\\$-l${qsubmem} 10mb" >> $job_to_send |
---|
812 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es ]] |
---|
813 | then |
---|
814 | echo "# @\$-l mpp_p=0" >> $job_to_send |
---|
815 | fi |
---|
816 | echo '# @\$-lF 10mb' >> $job_to_send |
---|
817 | # echo '# @\$-o /dev/null' >> $job_to_send |
---|
818 | echo '# @\$-o job_queue/last_job_transfer_protocol' >> $job_to_send |
---|
819 | echo '# @\\\$-eo' >> $job_to_send |
---|
820 | echo " " >> $job_to_send |
---|
821 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
822 | then |
---|
823 | echo "set +vx" >> $job_to_send |
---|
824 | echo ". .profile" >> $job_to_send |
---|
825 | fi |
---|
826 | echo "set -x" >> $job_to_send |
---|
827 | echo "batch_scp -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null" >> $job_to_send |
---|
828 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
829 | echo "%%END%%" >> $job_to_send |
---|
830 | fi |
---|
831 | |
---|
832 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
833 | then |
---|
834 | echo "llsubmit scpjob.$kennung" >> $job_to_send |
---|
835 | elif [[ $remote_host = lctit ]] |
---|
836 | then |
---|
837 | echo "chmod u+x scpjob.$kennung" >> $job_to_send |
---|
838 | echo "rm -rf ${job_catalog}/last_job_transfer_protocol" >> $job_to_send |
---|
839 | echo "n1ge -N jobtransfer -q $return_queue -sgeout ${job_catalog}/last_job_transfer_protocol scpjob.$kennung" >> $job_to_send |
---|
840 | echo "sleep 10" >> $job_to_send |
---|
841 | elif [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
842 | then |
---|
843 | echo "qsub -J n scpjob.$kennung" >> $job_to_send |
---|
844 | elif [[ $remote_host = t3es ]] |
---|
845 | then |
---|
846 | echo "qsub -J n -s /bin/ksh scpjob.$kennung" >> $job_to_send |
---|
847 | else |
---|
848 | echo "qsub scpjob.$kennung" >> $job_to_send |
---|
849 | fi |
---|
850 | echo "rm scpjob.$kennung" >> $job_to_send |
---|
851 | if [[ $remote_host = nech ]] |
---|
852 | then |
---|
853 | echo "cd -" >> $job_to_send |
---|
854 | fi |
---|
855 | else |
---|
856 | # echo "ftpcopy -d $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
857 | echo "nohup ftpcopy -d -w 15 $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null &" >> $job_to_send |
---|
858 | fi |
---|
859 | echo "set -x" >> $job_to_send |
---|
860 | echo " ' exit" >> $job_to_send |
---|
861 | echo "set -x" >> $job_to_send |
---|
862 | fi |
---|
863 | |
---|
864 | |
---|
865 | |
---|
866 | # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN |
---|
867 | cat $file_to_send >> $job_to_send |
---|
868 | if [[ $remote_host = ibm ]] |
---|
869 | then |
---|
870 | echo " " >> $job_to_send |
---|
871 | echo "exit" >> $job_to_send |
---|
872 | fi |
---|
873 | |
---|
874 | |
---|
875 | |
---|
876 | # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN |
---|
877 | if [[ -z $remote_user ]] |
---|
878 | then |
---|
879 | if [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es || $remote_host = vpp ]] |
---|
880 | then |
---|
881 | grep $remote_addres ~/.netrc | read dum dum dum remote_user dum dum |
---|
882 | fi |
---|
883 | fi |
---|
884 | |
---|
885 | |
---|
886 | |
---|
887 | # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN |
---|
888 | if [[ $no_submit = false ]] |
---|
889 | then |
---|
890 | if [[ $remote_host != $local_host ]] |
---|
891 | then |
---|
892 | [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." |
---|
893 | if [[ $filetransfer_protocol = scp ]] |
---|
894 | then |
---|
895 | if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" |
---|
896 | then |
---|
897 | job_catalog_save=$job_catalog |
---|
898 | job_catalog=job_queue |
---|
899 | elif [[ $remote_host = nech ]] |
---|
900 | then |
---|
901 | job_catalog_save=$job_catalog |
---|
902 | job_catalog=/hpf/b/${remote_user}/job_queue |
---|
903 | fi |
---|
904 | if [[ $local_host = decalpha ]] |
---|
905 | then |
---|
906 | # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE |
---|
907 | # PASSWORT AB |
---|
908 | /bin/scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost |
---|
909 | elif [[ $remote_host = nech ]] |
---|
910 | then |
---|
911 | # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ |
---|
912 | # TRANSFERIERT WERDEN |
---|
913 | scp $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost |
---|
914 | else |
---|
915 | scp $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost |
---|
916 | fi |
---|
917 | if [[ $? = 1 ]] |
---|
918 | then |
---|
919 | locat=scp; exit |
---|
920 | fi |
---|
921 | if [[ $remote_host = ibms ]] |
---|
922 | then |
---|
923 | job_catalog=$job_catalog_save |
---|
924 | fi |
---|
925 | else |
---|
926 | ftpcopy -s -o $remote_addres $job_to_send "$job_catalog" $job_on_remhost |
---|
927 | if [[ $? = 1 ]] |
---|
928 | then |
---|
929 | locat=ftpcopy; exit |
---|
930 | fi |
---|
931 | fi |
---|
932 | [[ $verify = true ]] && printf "\n >>> finished\n" |
---|
933 | else |
---|
934 | eval job_catalog=$job_catalog |
---|
935 | cp $job_to_send ${job_catalog}/$job_on_remhost |
---|
936 | fi |
---|
937 | |
---|
938 | |
---|
939 | |
---|
940 | # NQS- BZW. LOADLEVELER-JOB STARTEN |
---|
941 | if [[ $remote_host != $local_host ]] |
---|
942 | then |
---|
943 | [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" |
---|
944 | if [[ $filetransfer_protocol = scp ]] |
---|
945 | then |
---|
946 | if [[ $remote_host != lctit ]] |
---|
947 | then |
---|
948 | ssh $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" |
---|
949 | else |
---|
950 | # TIT ERLAUBT NUR DIE AUSFÜHRUNG GANZ BESTIMMTER KOMMANDOS |
---|
951 | # MIT SSH, DESHALB AUFRUF PER PIPE |
---|
952 | # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR |
---|
953 | print "cd $job_catalog; chmod u+x $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 |
---|
954 | echo "first try" > send_protocol |
---|
955 | while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]] |
---|
956 | do |
---|
957 | if [[ $(cat send_protocol | grep -c "first try") = 1 ]] |
---|
958 | then |
---|
959 | printf "\n trying to submit job to TIT cluster..." |
---|
960 | else |
---|
961 | printf "\n +++ failed ... trying to submit again ..." |
---|
962 | fi |
---|
963 | print "cd $job_catalog; $submcom $job_on_remhost" | ssh $remote_addres -l $remote_user > send_protocol 2>&1 |
---|
964 | cat send_protocol |
---|
965 | done |
---|
966 | sleep 10 |
---|
967 | print "cd $job_catalog; rm $job_on_remhost" | ssh $remote_addres -l $remote_user > /dev/null 2>&1 |
---|
968 | echo "$submcom $job_on_remhost" |
---|
969 | rm send_protocol |
---|
970 | fi |
---|
971 | else |
---|
972 | if [[ $remote_host = ibms ]] |
---|
973 | then |
---|
974 | password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'` |
---|
975 | echo "echo \"$remote_user\" " > telnet_script |
---|
976 | echo "sleep 5" >> telnet_script |
---|
977 | echo "echo \"$password\" " >> telnet_script |
---|
978 | echo "sleep 10" >> telnet_script |
---|
979 | echo "echo \"\" " >> telnet_script |
---|
980 | echo "sleep 2" >> telnet_script |
---|
981 | echo "echo \"cd $job_catalog; $submcom $job_on_remhost; rm -rf $job_on_remhost\" " >> telnet_script |
---|
982 | echo "sleep 10" >> telnet_script |
---|
983 | echo "echo \"exit\" " >> telnet_script |
---|
984 | |
---|
985 | chmod u+x telnet_script |
---|
986 | telnet_script | telnet $remote_addres 2>&1 | grep "llsubmit:" |
---|
987 | rm telnet_script |
---|
988 | elif [[ $remote_host = t3es ]] |
---|
989 | then |
---|
990 | password=`cat ~/.netrc | grep $remote_addres | awk '{print $6}'` |
---|
991 | echo "printf \"$remote_user\\\n\" " > telnet_script |
---|
992 | echo "sleep 10" >> telnet_script |
---|
993 | echo "printf \"$password\\\n\" " >> telnet_script |
---|
994 | echo "sleep 10" >> telnet_script |
---|
995 | echo "printf \"\\\n\" " >> telnet_script |
---|
996 | echo "sleep 5" >> telnet_script |
---|
997 | echo "printf \"\\\n\" " >> telnet_script |
---|
998 | echo "sleep 5" >> telnet_script |
---|
999 | echo "printf \"cd $job_catalog; $submcom $job_on_remhost; rm -f $job_on_remhost\\\n\" " >> telnet_script |
---|
1000 | echo "sleep 10" >> telnet_script |
---|
1001 | echo "printf \"exit\\\n\" " >> telnet_script |
---|
1002 | |
---|
1003 | chmod u+x telnet_script |
---|
1004 | cat telnet_script |
---|
1005 | telnet_script | telnet $remote_addres | grep $remote_user |
---|
1006 | rm telnet_script |
---|
1007 | else |
---|
1008 | remcom.x $remote_addres "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" |
---|
1009 | fi |
---|
1010 | fi |
---|
1011 | [[ $verify = true ]] && printf " >>> o.k.\n" |
---|
1012 | else |
---|
1013 | cd $job_catalog |
---|
1014 | if [[ $(echo $local_host | cut -c1-3) = ibm ]] |
---|
1015 | then |
---|
1016 | eval $submcom $job_on_remhost |
---|
1017 | elif [[ $local_host = lctit ]] |
---|
1018 | then |
---|
1019 | eval $submcom $job_on_remhost |
---|
1020 | echo "$submcom $job_on_remhost" |
---|
1021 | chmod u+x $job_on_remhost |
---|
1022 | sleep 5 # WEIL N1GE IM HINTERGRUND ARBEITET UND DATEI SONST EVTL. |
---|
1023 | # SCHON WIEDER GELOESCT IST |
---|
1024 | elif [[ $local_host = nech ]] |
---|
1025 | then |
---|
1026 | if [[ $queue = default ]] |
---|
1027 | then |
---|
1028 | eval $submcom $job_on_remhost |
---|
1029 | else |
---|
1030 | eval $submcom -q $queue $job_on_remhost |
---|
1031 | fi |
---|
1032 | else |
---|
1033 | qsub $job_on_remhost |
---|
1034 | fi |
---|
1035 | rm $job_on_remhost |
---|
1036 | cd - > /dev/null |
---|
1037 | fi |
---|
1038 | fi |
---|
1039 | |
---|
1040 | |
---|
1041 | |
---|
1042 | # ABSCHLUSSARBEITEN |
---|
1043 | |
---|
1044 | if [[ $no_submit = false ]] |
---|
1045 | then |
---|
1046 | rm $job_to_send |
---|
1047 | fi |
---|
1048 | [[ $verify = true ]] && printf "\n\n *** SUBJOB finished \n\n" |
---|