source: palm/trunk/SCRIPTS/subjob @ 339

Last change on this file since 339 was 326, checked in by raasch, 15 years ago

bugfix in subjob

  • Property svn:keywords set to Id Rev
File size: 42.1 KB
Line 
1#!/bin/ksh
2# subjob - Plot-Shellskript         Version:  @(#)SUBJOB 1.0
3# $Id: subjob 326 2009-05-20 12:40:29Z 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     # 12/04/07 - Siggi - option -f (filetransfer protocol) removed, scp only
84     # 27/07/07 - Siggi - autan admitted
85     # 03/08/07 - Marcus- lcfimm admitted
86     # 08/10/07 - Siggi - further job classes added for hanni (csoloh...)
87     # 15/10/07 - Siggi - preliminary adjustments for lctit based on Jin's
88     #                    suggestions
89     # 19/10/07 - Marcus- add new optional argument -g group_number
90     # 19/10/07 - Siggi - a ";" was missing in the last change done by Marcus
91     # 30/10/07 - Marcus- further adjustments for queues on lctit
92     # 15/05/08 - Siggi - adjustments for lcxt4 (Bergen Center for Computational
93     #                    Science)
94     # 14/07/08 - Siggi - adjustments for lcsgih
95     # 23/09/08 - Gerald- paesano admitted
96     # 02/10/08 - Siggi - PBS adjustments for lcxt4
97     # 02/03/09 - Siggi - Adjustments for new NEC-SX9 at RIAM
98     # 16/04/09 - Marcus- Adjustments for lcsgib and lcsgih
99     # 21/04/09 - Siggi - adjustments for new IBM at DKRZ, which is now ibmh
100     # 18/05/09 - Siggi - Settings for serial jobs on lcsgi changed
101
102
103
104    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
105 delete_dayfile=false
106 group_number=none
107 locat=normal
108 no_default_queue=none
109 no_submit=false
110 job_catalog="~/job_queue"
111 job_name=none
112 local_user=$LOGNAME
113 node_usage=shared
114 numprocs=1
115 punkte="..........................................................."
116 submcom=qsub
117 queue=default
118 remote_host=none
119 remote_user=""
120 verify=true
121
122 typeset  -i   cputime=memory=Memory=0  minuten  resttime  sekunden  stunden
123 typeset  -i   inumprocs  nodes=tasks_per_node=threads_per_task=1
124 typeset  -L20 spalte1
125 typeset  -R40 spalte2
126 typeset  -L60 spalte3
127
128
129
130    # FEHLERBEHANDLUNG
131    # BEI EXIT:
132 trap 'if [[ $locat != normal ]]
133       then
134          case  $locat  in
135             (option)  printf "\n  --> available optios can be displayed"
136                       printf " by typing:"
137                       printf "\n      \"subjob ?\" \n";;
138             (ftpcopy|parameter|scp|verify)  printf "\n";;
139             (*)       printf "\n  +++ unknown error"
140                       printf "\n      please inform S. Raasch!\n"
141          esac
142          [[ -f $job_to_send ]]  &&  rm  $job_to_send
143          printf "\n\n+++ SUBJOB killed \n\n"
144       fi' exit
145
146
147    # BEI TERMINAL-BREAK:
148 trap '[[ -f $job_to_send ]]  &&  rm  $job_to_send
149       printf "\n\n+++ SUBJOB killed \n\n"
150       exit
151      ' 2
152
153
154
155
156    # LOKALEN HOSTNAMEN FESTSTELLEN
157 local_host=$(hostname)
158
159
160
161    # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALER HOST
162    # UEBERHAUPT ZULAESSIG IST
163 case  $local_host  in
164     (atmos)                 local_addres=172.20.25.35;   local_host=lcide;;
165     (autan)                 local_addres=130.75.105.57;  local_host=lcmuk;;
166     (bora)                  local_addres=130.75.105.103; local_host=lcmuk;;
167     (bicegate1)             local_addres=130.73.232.102; local_host=lcsgib;;
168     (bicegate2)             local_addres=130.73.232.103; local_host=lcsgib;;
169     (breg*-en0|berni*-en0)  local_addres=130.73.230.10;  local_host=ibmb;;
170     (breva)                 local_addres=130.75.105.98;  local_host=lcmuk;;
171     (b01*|bicegate1)        local_addres=130.73.232.102; local_host=lcsgib;;
172     (bicegate2)             local_addres=130.73.232.103; local_host=lcsgib;;
173     (compute-*.local)       local_addres=172.20.4.2;     local_host=lcfimm;;
174     (cs*)                   local_addres=136.172.44.131; local_host=nech;;
175     (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     (gallego)               local_addres=130.75.105.10;  local_host=lcmuk;;
178     (gfdl5)                 local_addres=165.132.26.58;  local_host=ibmy;;
179     (gfdl3.yonsei.ac.kr)    local_addres=165.132.26.56;  local_host=decalpha;;
180     (gregale)               local_addres=130.75.105.109; local_host=lcmuk;;
181     (hababai)               local_addres=130.75.105.108; local_host=lcmuk;;
182     (hexagon.bccs.uib.no)   local_addres=129.177.20.113; local_host=lcxt4;;
183     (h01*|hicegate1)        local_addres=130.75.4.102;   local_host=lcsgih;;
184     (hicegate2)             local_addres=130.75.4.103;   local_host=lcsgih;;
185     (blizzard1)             local_addres=136.172.40.15;  local_host=ibmh;;
186     (irifi)                 local_addres=130.75.105.104; local_host=lcmuk;;
187     (levanto)               local_addres=130.75.105.45;  local_host=lcmuk;;
188     (maestro)               local_addres=130.75.105.2;   local_host=lcmuk;;
189     (nid*)                  local_addres=129.177.20.113; local_host=lcxt4;;
190     (nobel*)                local_addres=150.183.5.101;  local_host=ibms;;
191     (orkan)                 local_addres=130.75.105.3;   local_host=lcmuk;;
192     (ostria)                local_addres=130.75.105.106; local_host=lcmuk;;
193     (paesano)               local_addres=130.75.105.46;  local_host=lcmuk;;
194     (quanero)               local_addres=130.75.105.107; local_host=lcmuk;;
195     (scirocco)              local_addres=172.20.25.41;   local_host=lcmuk;;
196     (sun1|sun2)             local_addres=130.75.6.1;     local_host=unics;;
197     (sx-*)                  local_addres=172.16.1.131;   local_host=necriam;;
198     (r1*)                   local_addres=130.75.4.102;   local_host=lcsgih;;
199     (r2*)                   local_addres=130.73.232.102; local_host=lcsgib;;
200     (tgg*)                  local_addres=172.17.75.161;  local_host=lctit;;
201     (vorias)                local_addres=172.20.25.43;   local_host=lcmuk;;
202     (*)                     printf "\n  +++ \"$local_host\" unknown";
203                             printf "\n      please inform S. Raasch!";
204                             locat=parameter; exit;;
205 esac
206
207
208
209    # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN
210 remote_host=$local_host
211
212
213
214
215    # PROZEDUROPTIONEN EINLESEN
216 while  getopts  :c:dDg:h:m:n:N:O:q:t:T:u:vX:  option
217 do
218   case  $option  in
219       (c)   job_catalog=$OPTARG;;
220       (d)   delete_dayfile=true;;
221       (D)   no_submit=true;;
222       (g)   group_number=$OPTARG;;
223       (h)   remote_host=$OPTARG;;
224       (m)   memory=$OPTARG;;
225       (n)   job_name=$OPTARG;;
226       (N)   node_usage=$OPTARG;;
227       (O)   threads_per_task=$OPTARG;;
228       (q)   no_default_queue=$OPTARG;;
229       (t)   cputime=$OPTARG;;
230       (T)   tasks_per_node=$OPTARG;;
231       (u)   remote_user=$OPTARG;;
232       (v)   verify=false;;
233       (X)   numprocs=$OPTARG;;
234       (\?)  printf "\n  +++ Option $OPTARG unknown \n";
235             locat=option; exit;;
236   esac
237 done
238
239
240    # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN
241 shift OPTIND-1; file_to_send=$1
242
243
244    # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN
245 if [ "$1" = "?" ]
246 then
247   (printf "\n  *** subjob can be called as follows:\n"
248    printf "\n      subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v  <jobfile>\n"
249    printf "\n      Description of available options:\n"
250    printf "\n      Option  Description                         Default-Value"
251    printf "\n        -c    job-input- and output-catalog       ~/job_queue"
252    printf "\n        -d    no job-protocol will be created     ---"
253    printf "\n        -D    only the job-file will be created   ---"
254    printf "\n        -h    execution host, available hosts:    $remote_host"
255    printf "\n              ibm, ibmb, ibmh, ibms, ibmy, lcmuk,"
256    printf "\n              lctit, nech, necriam, unics"
257    printf "\n        -m    memory demand per process in MByte  ---"
258    printf "\n        -n    jobname                             <jobdatei>"
259    printf "\n        -O    threads per task (for OpenMP usage) 1"
260    printf "\n        -q    job-queue to be used                default"
261    printf "\n        -t    allowed cpu-time in seconds         ---"
262    printf "\n        -T    tasks per node (on parallel hosts)  ---"
263    printf "\n        -u    username on execution host          from .netrc"
264    printf "\n        -v    no prompt for confirmation          ---"
265    printf "\n        -X    # of processors (on parallel hosts) 1"
266    printf "\n "
267    printf "\n      The only possible positional parameter is <jobfile>:"
268    printf "\n      The complete NQS-job must be provided here."
269    printf "\n      <jobfile>=? creates this outline\n\n") | more
270    exit
271 fi
272
273
274
275    # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT
276 if [[ "$file_to_send" = "" ]]
277 then
278    printf "\n  +++ job-file missing"
279    locat=parameter; exit
280 else
281    if [[ -f $file_to_send ]]
282    then
283       true
284    else
285       printf "\n  +++ job-file: "
286       printf "\n           $file_to_send"
287       printf "\n      does not exist"
288       locat=parameter; exit
289    fi
290 fi
291
292
293
294    # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME
295    # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE
296 if [[ $job_name = none ]]
297 then
298    job_name=$file_to_send
299 fi
300 if [[ $(echo $job_name | grep -c "/") != 0 ]]
301 then
302    printf "\n  +++ job-file name: "
303    printf "\n           $job_name"
304    printf "\n      must not contain \"/\"-characters"
305    locat=parameter; exit
306 fi
307
308
309
310
311    # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST
312    # ODER WENN HOST NICHT ANGEGEBEN WURDE
313 if [[ $remote_host = none ]]
314 then
315    printf "\n  +++ host missing"
316    locat=option; exit
317 else
318    case  $remote_host  in
319        (ibm)     queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
320        (ibmb)    queue=cpar; remote_addres=130.73.230.10; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
321        (ibmh)    queue=no_class; remote_addres=136.172.40.15; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
322        (ibms)    queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
323        (ibmy)    queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
324        (lcfimm)  remote_addres=172.20.4.2; submcom=/opt/torque/bin/qsub;;
325        (lcsgib)  queue=smallq; remote_addres=130.73.232.103; submcom=/opt/moab/bin/msub;;
326        (lcsgih)  queue=smallq; remote_addres=130.75.4.103; submcom=/opt/moab/bin/msub;;
327        (lctit)   queue=lctit; remote_addres=172.17.75.161; submcom=/n1ge/TITECH_GRID/tools/bin/n1ge;;
328        (lcxt4)   remote_addres=129.177.20.113; submcom=/opt/torque/2.3.0/bin/qsub;;
329        (nech)    qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";;
330        (necriam) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=172.16.1.131; submcom="/usr/bin/nqsII/qsub";;
331        (vpp)     qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;;
332        (unics)   qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;;
333        (*)       printf "\n  +++ hostname \"$remote_host\" not allowed";
334                  locat=parameter; exit;;
335    esac
336 fi
337
338
339    # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST
340 if [[ $no_default_queue != none ]]
341 then
342    error=false
343    ndq=$no_default_queue
344    case  $remote_host  in
345        (ibm)    case  $ndq  in
346                     (p690_express|p690_standard|p690_long)  error=false;;
347                     (*)                                     error=true;;
348                 esac;;
349        (ibmb)   case  $ndq  in
350                     (cdata|cdev|cexp|c1|cshare|csolo|cspec) error=false;;
351                     (*)                                     error=true;;
352                 esac;;
353        (ibmh)   case  $ndq  in
354                     (no_class)  error=false;;
355                     (*)                                     error=true;;
356                 esac;;
357        (ibms)   case  $ndq  in
358                     (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand)     error=false;;
359                     (*)                                     error=true;;
360                 esac;;
361        (ibmy)   case  $ndq  in
362                     (parallel)                              error=false;;
363                     (*)                                     error=true;;
364                 esac;;
365        (lcsgib|lcsgih)   case  $ndq  in
366                     (testq|serialq|smallq|bigq)             error=false;;
367                     (*)                                     error=true;;
368                 esac;;
369        (lctit)  case  $ndq  in
370                     (novice|sla1|sla2|sla3|RAM64GB|RAM128GB)    error=false;;
371                     (*)                                     error=true;;
372                 esac;;
373        (t3eb)   case  $ndq  in
374                     (berte|p50|p100|p392|forfree|p25himem)  error=false;;
375                     (*)    error=true;;
376                 esac;;
377        (necriam) case  $ndq  in
378                     (SP|SS|P6)  error=false;;
379                     (*)    error=true;;
380                 esac;;
381        (t3eh)   case  $ndq  in
382                     (para_t3e|em|k|l|lm|comp_t3e|c|p|ht)  error=false;;
383                     (*)    error=true;;
384                 esac;;
385        (t3ej2|t3ej5)  case  $ndq  in
386                     (low|normal|high)  error=false;;
387                     (*)    error=true;;
388                 esac;;
389        (t3es)  case  $ndq  in
390                     (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128)  error=false;;
391                     (*)    error=true;;
392                 esac;;
393        (unics)  case  $ndq  in
394                     (unics|ht)  error=false;;
395                     (*)         error=true;;
396                 esac;;
397    esac
398    if [[ $error = true ]]
399    then
400       printf "\n  +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed"
401       locat=parameter; exit
402    else
403       queue=$no_default_queue
404    fi
405 fi
406
407
408
409    # KNOTENNUTZUNG IN ENTWICKLERQUEUE MUSS SHARED SEIN
410 if [[ $node_usage != shared  &&  $queue = cdev ]]
411 then
412    node_usage=shared
413 fi
414
415
416
417    # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN
418    # AUFTEILEN
419 done=false
420 while [[ $done = false ]]
421 do
422    if (( $cputime <= 0 ))
423    then
424       printf "\n  +++ wrong cpu-time or cpu-time missing"
425       printf "\n  >>> Please type cpu-time in seconds as INTEGER:"
426       printf "\n  >>> "
427       read  cputime  1>/dev/null  2>&1
428    else
429       done=true
430    fi
431 done
432 if [[ $remote_host = nech ]]
433 then
434    if (( tasks_per_node != 0 ))
435    then
436       (( cputime = cputime * tasks_per_node ))
437    elif [[ $numprocs != 0 ]]
438    then
439       (( cputime = cputime * numprocs ))
440    fi
441 fi
442 (( stunden  = cputime / 3600 ))
443 (( resttime = cputime - stunden * 3600 ))
444 (( minuten  = resttime / 60 ))
445 (( sekunden = resttime - minuten * 60 ))
446 timestring=${stunden}:${minuten}:${sekunden}
447
448
449
450    # PRUEFEN DER KERNSPEICHERANFORDERUNG
451 done=false
452 while [[ $done = false ]]
453 do
454    if (( memory <= 0 ))
455    then
456       printf "\n  +++ wrong memory demand or memory demand missing"
457       printf "\n  >>> Please type memory in  MByte per process  as INTEGER:"
458       printf "\n  >>> "
459       read  memory  1>/dev/null  2>&1
460    else
461       done=true
462    fi
463 done
464
465 if [[ $remote_host = nech  ||  $remote_host = necriam ]]
466 then
467    if (( tasks_per_node != 0 ))
468    then
469       (( Memory = memory * tasks_per_node / 1000 ))
470    elif [[ $numprocs != 0 ]]
471    then
472       (( Memory = memory * numprocs / 1000 ))
473    else
474       (( Memory = memory / 1000 ))
475    fi
476 fi
477
478
479    # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG
480 if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
481 then
482    (( memory = memory * threads_per_task ))
483 fi
484
485
486    # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN
487 if (( tasks_per_node != 0 ))
488 then
489    (( nodes = numprocs / ( tasks_per_node * threads_per_task ) ))
490 fi
491
492
493
494    # HEADER-AUSGABE
495 if [[ $verify = true ]]
496 then
497    printf "\n\n"
498    printf "#--------------------------------------------------------------# \n"
499    spalte1=SUBJOB;spalte2=$(date)
500    printf "| $spalte1$spalte2 | \n"
501    printf "|                                                              | \n"
502    printf "| values of parameters/options:                                | \n"
503    spalte1=local_host$punkte; spalte2=$punkte$local_host
504    printf "| $spalte1$spalte2 | \n"
505    spalte1=remote_host$punkte; spalte2=$punkte$remote_host
506    printf "| $spalte1$spalte2 | \n"
507    spalte1=queue$punkte; spalte2=$punkte$queue
508    printf "| $spalte1$spalte2 | \n"
509    spalte1=memory$punkte; spalte2="$punkte$memory mb"
510    printf "| $spalte1$spalte2 | \n"
511    spalte1=cputime$punkte; spalte2="$punkte$cputime sec"
512    printf "| $spalte1$spalte2 | \n"
513    spalte1=job_name$punkte; spalte2="$punkte$job_name"
514    printf "| $spalte1$spalte2 | \n"
515    printf "#--------------------------------------------------------------# \n\n"
516
517
518       # KONTROLLABFRAGE, OB ALLES O.K.
519    antwort="dummy"
520    while [[ $antwort != y  &&  $antwort != Y  &&  $antwort != n  &&  $antwort != N ]]
521    do
522       read antwort?" >>> continue (y/n) ? "
523    done
524    if [[ $antwort = n  ||  $antwort = N ]]
525    then
526       locat=verify; exit
527    fi
528    printf "\n"
529 fi
530
531
532
533    # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN
534 kennung=$RANDOM
535 job_on_remhost=${job_name}_${kennung}_$local_host
536 job_to_send=job_to_send_$kennung
537 if [[ $delete_dayfile = false ]]
538 then
539    remote_dayfile=${local_host}_${job_name}_result_$kennung
540    local_dayfile=${remote_host}_${job_name}
541 else
542    remote_dayfile=/dev/null
543    if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
544    then
545       notification='# @ notification = never'
546    fi
547 fi
548
549
550
551    # QSUB- ODER LL-KOMMANDOS BZW. SKRIPTE  GENERIEREN
552 if [[ $(echo $remote_host | cut -c1-3) = ibm  &&  $numprocs != 0 ]]
553 then
554
555    if [[ $remote_host = ibmy ]]
556    then
557       consumable_memory=""
558    else
559       consumable_memory="ConsumableMemory($memory mb)"
560    fi
561
562    if [[ $remote_host = ibmh ]]
563    then
564       data_limit=""
565       network_to_use=""
566       class=""
567       environment=""
568    else
569       class="# @ class = $queue"
570       environment="# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes"
571       if [[ $queue = cdev ]]
572       then
573          data_limit="# @ data_limit = 1.76gb"
574          network_to_use="# @ network.mpi = sn_all,shared,ip"
575       else
576          if [[ $remote_host = ibms ]]
577          then
578             network_to_use="# @ network.mpi = csss,shared,us"
579          elif [[ $remote_host = ibmy ]]
580          then
581             network_to_use=""
582          else
583             network_to_use="# @ network.mpi = sn_all,shared,us"
584             data_limit="# @ data_limit = 1.76gb"
585          fi
586       fi
587    fi
588
589    cat > $job_to_send << %%END%%
590#!/bin/ksh
591# @ shell = /bin/ksh
592
593# @ job_type = parallel
594# @ job_name = palm
595# @ wall_clock_limit = ${timestring},$timestring
596# @ resources = ConsumableCpus($threads_per_task) $consumable_memory
597# @ output = $remote_dayfile
598# @ error = $remote_dayfile
599# @ image_size = 50
600$class
601$environment
602$network_to_use
603$data_limit
604$notification
605
606%%END%%
607
608    if (( nodes > 0 ))
609    then
610
611       cat >> $job_to_send << %%END%%
612# @ node = $nodes
613# @ tasks_per_node = $tasks_per_node
614# @ node_usage = $node_usage
615# @ queue
616
617%%END%%
618
619    else
620
621       if [[ $remote_host != ibmy ]]
622       then
623
624          cat >> $job_to_send << %%END%%
625# @ blocking = unlimited
626# @ total_tasks = $numprocs
627# @ node_usage = $node_usage
628# @ queue
629
630%%END%%
631
632       else
633
634          cat >> $job_to_send << %%END%%
635# @ node = 1
636# @ total_tasks = $numprocs
637# @ queue
638
639%%END%%
640
641       fi
642
643    fi
644
645 elif [[ $(echo $remote_host | cut -c1-3) = ibm  &&  $numprocs = 0 ]]
646 then
647
648    cat > $job_to_send << %%END%%
649#!/bin/ksh
650
651# @ job_type = serial
652# @ node_usage = $node_usage
653# @ job_name = palm
654# @ wall_clock_limit = ${timestring},$timestring
655# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)
656# @ output = $remote_dayfile
657# @ error = $remote_dayfile
658$class
659$notification
660
661# @ queue
662
663%%END%%
664
665 elif [[ $remote_host = lcfimm ]]
666 then
667
668    if [[ $numprocs != 0 ]]
669    then
670       cat > $job_to_send << %%END%%
671#!/bin/ksh
672#PBS -N $job_name
673#PBS -A geofysisk
674#PBS -l walltime=$timestring
675#PBS -l nodes=${nodes}:ppn=$tasks_per_node
676#PBS -l pmem=${memory}mb
677#PBS -m abe
678#PBS -M bjorn.maronga@student.uib.no
679#PBS -o $remote_dayfile
680#PBS -j oe
681mpd &
682
683%%END%%
684
685    else
686       cat > $job_to_send << %%END%%
687#!/bin/ksh
688#PBS -N $job_name
689#PBS -A geofysisk
690#PBS -l walltime=$timestring
691#PBS -l ncpus=1
692#PBS -l pmem=${memory}mb
693#PBS -m abe
694#PBS -M bjorn.maronga@student.uib.no
695#PBS -o $remote_dayfile
696#PBS -j oe
697
698%%END%%
699
700    fi
701
702 elif [[ $remote_host = lcsgih  ||  $remote_host = lcsgib ]]
703 then
704
705    if [[ $queue = testq ]]
706    then
707       queue_directive="#PBS -q $queue"
708    else
709       queue_directive=""
710    fi
711
712    if [[ $numprocs != 0 ]]
713    then
714       cat > $job_to_send << %%END%%
715#!/bin/bash
716#PBS -N $job_name
717#PBS -l walltime=$timestring
718#PBS -l nodes=$nodes:ppn=${tasks_per_node}
719#PBS -l feature=$sgi_feature
720#PBS -l naccesspolicy=$node_usage
721#PBS -o $remote_dayfile
722#PBS -j oe
723$queue_directive
724
725. /usr/share/modules/init/bash
726module load $mpilib
727# module load mvapich2/1.2rc1-intel
728# module load mvapich2
729module load netcdf
730export LD_LIBRARY_PATH=/sw/intel/cce/10.1.015/lib:/sw/intel/fce/10.1.015/lib:/sw/dataformats/netcdf/3.6.2/lib:\$LD_LIBRARY_PATH
731echo ld_library_path=\$LD_LIBRARY_PATH
732
733%%END%%
734
735    else
736       cat > $job_to_send << %%END%%
737#PBS -S /bin/bash
738#PBS -N $job_name
739#PBS -l walltime=$timestring
740#PBS -l ncpus=1
741#PBS -o $remote_dayfile
742#PBS -e $remote_dayfile
743
744%%END%%
745
746    fi
747
748 elif [[ $remote_host = lcxt4 ]]
749 then
750
751    if [[ $numprocs != 0 ]]
752    then
753       cat > $job_to_send << %%END%%
754#!/bin/ksh
755#PBS -S /bin/ksh
756#PBS -N $job_name
757#PBS -A geofysisk
758#PBS -j oe
759#PBS -l walltime=$timestring
760#PBS -l mppwidth=${numprocs}
761#PBS -l mppnppn=${tasks_per_node}
762#PBS -m abe
763#PBS -M bjorn.maronga@student.uib.no
764#PBS -o $remote_dayfile
765
766%%END%%
767
768    else
769       cat > $job_to_send << %%END%%
770#!/bin/ksh
771#PBS -S /bin/ksh
772#PBS -N $job_name
773#PBS -A geofysisk
774#PBS -j oe
775#PBS -l walltime=$timestring
776#PBS -l ncpus=1
777#PBS -l pmem=${memory}mb
778#PBS -m abe
779#PBS -M bjorn.maronga@student.uib.no
780#PBS -o $remote_dayfile
781
782%%END%%
783
784    fi
785
786 elif [[ $remote_host = nech ]]
787 then
788
789    if (( nodes > 1 ))
790    then
791       cat > $job_to_send << %%END%%
792#!/bin/ksh
793#PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime
794#PBS -l ${qsubmem}=${Memory}gb
795#PBS -b $nodes
796#PBS -o $remote_dayfile
797#PBS -N palm
798#PBS -j o
799#PBS -T mpisx
800
801%%END%%
802
803    elif [[ $numprocs != 0 ]]
804    then
805       cat > $job_to_send << %%END%%
806#!/bin/ksh
807#PBS -l cpunum_prc=$tasks_per_node,cputim_job=$cputime
808#PBS -l ${qsubmem}=${Memory}gb
809#PBS -o $remote_dayfile
810#PBS -N palm
811#PBS -j o
812
813%%END%%
814
815    else
816       cat > $job_to_send << %%END%%
817#!/bin/ksh
818#PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime
819#PBS -o $remote_dayfile
820#PBS -j o
821
822%%END%%
823
824    fi
825
826 elif [[ $remote_host = necriam ]]
827 then
828
829    if (( nodes > 1 ))
830    then
831       cat > $job_to_send << %%END%%
832#!/bin/ksh
833#PBS -b $nodes
834#PBS -o $remote_dayfile
835#PBS -N $job_name
836#PBS -j o
837#PBS -v MPIPROGINV=YES
838
839%%END%%
840
841    elif [[ $numprocs != 0 ]]
842    then
843       cat > $job_to_send << %%END%%
844#!/bin/ksh
845#PBS -q ${queue}
846#PBS -o $remote_dayfile
847#PBS -N $job_name
848#PBS -j o
849#PBS -v MPIPROGINV=YES
850
851%%END%%
852
853    else
854       cat > $job_to_send << %%END%%
855#!/bin/ksh
856#PBS -o $remote_dayfile
857#PBS -j o
858
859%%END%%
860
861    fi
862
863 elif [[ $remote_host = lctit ]]
864 then
865    cat > $job_to_send << %%END%%
866#!/bin/bash
867#$ -S /bin/bash
868cd $job_catalog
869export PATH=$PALM_BIN:\$PATH
870echo \$PATH
871
872%%END%%
873
874       # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN
875  #  submcom="$submcom  -N $job_name  -sgeout $remote_dayfile  -q default"
876    submcom="$submcom -g $group_number -N $job_name -rt 4320 -sgeout $remote_dayfile  -q $node_usage "
877
878 else
879
880    cat > $job_to_send << %%END%%
881# @\$-q ${queue}
882# @\$-l${qsubtime} $timestring
883# @\$-l${qsubmem} ${memory}mb
884# @\$-o $remote_dayfile
885# @\$-eo
886
887%%END%%
888
889 fi
890
891
892    # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP
893    # BEI EXIT VERANLASSEN
894    # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT
895    # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH
896 if [[ $delete_dayfile = false  &&  $remote_host != $local_host ]]
897 then
898    echo "set +vx"                              >>  $job_to_send
899    echo "trap '"                               >>  $job_to_send
900    echo "set +vx"                              >>  $job_to_send
901    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $(echo $remote_host | cut -c1-5) = lcsgi  ||  $(echo $remote_host | cut -c1-3) = nec  ||  $remote_host = lctit ]]
902    then
903       if [[ $remote_host = ibmb  ||  $remote_host = ibmh ]]
904       then
905          return_queue=c1
906       elif [[ $remote_host = ibms ]]
907       then
908          return_queue=p_normal
909       elif [[ $remote_host = ibmy ]]
910       then
911          return_queue=serial
912       elif [[ $remote_host = lcsgih  ||  $remote_host = lcsgib ]]
913       then
914          return_queue=serialq
915       elif [[ $remote_host = lctit ]]
916       then
917          return_queue=sla3
918       elif [[ $remote_host = necriam ]]
919       then
920          return_queue=SP
921       else
922          return_queue=unknown
923       fi
924
925       if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
926       then
927
928          echo "echo \"#!/bin/ksh\" >> scpjob.$kennung"               >>  $job_to_send
929          echo "echo \"# @ job_type = serial\" >> scpjob.$kennung"    >>  $job_to_send
930          echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung"  >>  $job_to_send
931          echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$kennung"  >>  $job_to_send
932          echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$kennung "  >>  $job_to_send
933          echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung"  >>  $job_to_send
934          echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung"  >>  $job_to_send
935          if [[ $host != "ibmh" ]]
936          then
937             echo "echo \"# @ class = $return_queue\" >> scpjob.$kennung"  >>  $job_to_send
938          fi
939          echo "echo \"# @ image_size = 10\" >> scpjob.$kennung"      >>  $job_to_send
940          echo "echo \"# @ notification = never\" >> scpjob.$kennung" >>  $job_to_send
941
942          echo "echo \"# @ queue\" >> scpjob.$kennung"                >>  $job_to_send
943          echo "echo \" \" >> scpjob.$kennung"                        >>  $job_to_send
944
945          echo "echo \"set -x\" >> scpjob.$kennung"                   >>  $job_to_send
946          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
947          echo "echo \"exit\" >> scpjob.$kennung"                     >>  $job_to_send
948
949       elif [[ $remote_host = nech ]]
950       then
951          echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
952          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
953          echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100"  >>  $job_to_send
954          echo "#PBS -o last_job_transfer_protocol"      >>  $job_to_send
955          echo "#PBS -j o"                         >>  $job_to_send
956          echo " "                                 >>  $job_to_send
957          echo "set -x"                            >>  $job_to_send
958          echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
959          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
960          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
961          echo "%%END%%"                           >>  $job_to_send
962
963       elif [[ $remote_host = necriam ]]
964       then
965          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
966          echo "#PBS -q $return_queue"             >>  $job_to_send
967          echo "#PBS -o last_job_transfer_protocol"      >>  $job_to_send
968          echo "#PBS -j o"                         >>  $job_to_send
969          echo " "                                 >>  $job_to_send
970          echo "set -x"                            >>  $job_to_send
971          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
972          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
973          echo "%%END%%"                           >>  $job_to_send
974
975       elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]]
976       then
977          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
978          echo "#!/bin/bash"                             >>  $job_to_send
979          echo "#PBS -N job_protocol_transfer"           >>  $job_to_send
980          echo "#PBS -l walltime=00:30:00"               >>  $job_to_send
981          echo "#PBS -l nodes=1:ppn=1"                   >>  $job_to_send
982          echo "#PBS -l feature=xe"                      >>  $job_to_send
983          echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol"      >>  $job_to_send
984          echo "#PBS -j oe"                        >>  $job_to_send
985          echo " "                                 >>  $job_to_send
986          echo ". /usr/share/modules/init/bash"    >>  $job_to_send
987          echo "set -x"                            >>  $job_to_send
988          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
989          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
990          echo "%%END%%"                           >>  $job_to_send
991
992       elif [[ $remote_host = lctit ]]
993       then
994          echo "cat > scpjob.$kennung << %%END%%"          >>  $job_to_send
995          echo "set -x"                                    >>  $job_to_send
996          echo "PATH=\$PATH:$job_catalog/../pub"           >>  $job_to_send
997          echo "cd $job_catalog"                           >>  $job_to_send
998          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
999          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
1000          echo "%%END%%"                                   >>  $job_to_send
1001
1002       else
1003
1004          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
1005          echo "# @\\\$-q $return_queue"           >>  $job_to_send
1006          echo "# @\\\$-l${qsubtime} 10"           >>  $job_to_send
1007          echo "# @\\\$-l${qsubmem} 10mb"          >>  $job_to_send
1008          if [[ $remote_host = t3ej2  ||  $remote_host = t3ej5  ||  $remote_host = t3es ]]
1009          then
1010             echo "# @\$-l mpp_p=0"                >>  $job_to_send
1011          fi
1012          echo '# @\$-lF 10mb'                     >>  $job_to_send
1013#          echo '# @\$-o /dev/null'                 >>  $job_to_send
1014          echo '# @\$-o job_queue/last_job_transfer_protocol'    >>  $job_to_send
1015          echo '# @\\\$-eo'                          >>  $job_to_send
1016          echo " "                                 >>  $job_to_send
1017          if [[ $remote_host = t3ej2  ||  $remote_host = t3ej5 ]]
1018          then
1019             echo "set +vx"                        >>  $job_to_send
1020             echo ". .profile"                     >>  $job_to_send
1021          fi
1022          echo "set -x"                            >>  $job_to_send
1023          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null"  >>  $job_to_send
1024          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
1025          echo "%%END%%"                           >>  $job_to_send
1026       fi
1027
1028       if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
1029       then
1030          echo "llsubmit  scpjob.$kennung"      >>  $job_to_send
1031       elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]]
1032       then
1033          echo "chmod  u+x  scpjob.$kennung"    >>  $job_to_send
1034          echo "msub  scpjob.$kennung"          >>  $job_to_send
1035       elif [[ $remote_host = lctit ]]
1036       then
1037          echo "chmod  u+x  scpjob.$kennung"    >>  $job_to_send
1038          echo "rm -rf ${job_catalog}/last_job_transfer_protocol"  >>  $job_to_send
1039          echo "n1ge  -N jobtransfer  -q $return_queue  -sgeout ${job_catalog}/last_job_transfer_protocol  scpjob.$kennung"  >>  $job_to_send
1040          echo "sleep 10"                       >>  $job_to_send
1041       elif [[ $remote_host = t3eb  ||  $remote_host = t3eh  ||  $remote_host = t3ej2  ||  $remote_host = t3ej5 ]]
1042       then
1043          echo "qsub -J n  scpjob.$kennung"     >>  $job_to_send
1044       elif [[ $remote_host = t3es ]]
1045       then
1046          echo "qsub -J n  -s /bin/ksh  scpjob.$kennung"     >>  $job_to_send
1047       else
1048          echo "qsub  scpjob.$kennung"          >>  $job_to_send
1049       fi
1050       echo "rm  scpjob.$kennung"               >>  $job_to_send
1051       if [[ $remote_host = nech ]]
1052       then
1053          echo "cd -"                           >>  $job_to_send
1054       fi
1055    else
1056#       echo "ftpcopy  -d  $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
1057       echo "nohup  ftpcopy  -d  -w 15  $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null  &"  >>  $job_to_send
1058    fi
1059    echo "set -x"                               >>  $job_to_send
1060    echo "     ' exit"                          >>  $job_to_send
1061    echo "set -x"                               >>  $job_to_send
1062 fi
1063
1064
1065
1066    # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN
1067 cat  $file_to_send  >>  $job_to_send
1068
1069 if [[ $remote_host = ibm ]]
1070 then
1071    echo " "         >>  $job_to_send
1072    echo "exit"      >>  $job_to_send
1073 fi
1074 if [[ $remote_host = lctit ]]
1075 then
1076    echo " "                               >>  $job_to_send
1077    echo "rm ~/job_queue/$job_on_remhost"  >>  $job_to_send
1078 fi
1079
1080
1081
1082    # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN
1083 if [[ -z $remote_user ]]
1084 then
1085    if [[ $remote_host = t3eb  ||  $remote_host = t3eh  ||  $remote_host = t3ej2  ||  $remote_host = t3ej5  ||  $remote_host = t3es  ||  $remote_host = vpp ]]
1086    then
1087       grep  $remote_addres  ~/.netrc | read dum dum dum remote_user dum dum
1088    fi
1089 fi
1090
1091
1092
1093    # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN
1094 if [[ $no_submit = false ]]
1095 then
1096    if [[ $remote_host != $local_host ]]
1097    then
1098       [[ $verify = true ]]  &&  printf "\n >>> transfering job to \"$remote_host\"..."
1099       if [[ $remote_host = ibms  ||  $remote_host = ibmy ]]    # ssh on ibms cannot handle "~/"
1100       then
1101          job_catalog_save=$job_catalog
1102          job_catalog=job_queue
1103       elif [[ $remote_host = nech ]]
1104       then
1105          job_catalog_save=$job_catalog
1106          job_catalog=/hpf/b/${remote_user}/job_queue
1107       fi
1108       if [[ $local_host = decalpha ]]
1109       then
1110             # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE
1111             # PASSWORT AB
1112          /bin/scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
1113       elif [[ $remote_host = nech ]]
1114       then
1115             # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ
1116             # TRANSFERIERT WERDEN
1117          scp  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
1118       else
1119          scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
1120       fi
1121       if [[ $? = 1 ]]
1122       then
1123          locat=scp; exit
1124       fi
1125       if [[ $remote_host = ibms ]]
1126       then
1127          job_catalog=$job_catalog_save
1128       fi
1129       [[ $verify = true ]]  &&  printf "\n >>> finished\n"
1130    else
1131       eval  job_catalog=$job_catalog
1132       cp  $job_to_send  ${job_catalog}/$job_on_remhost
1133    fi
1134
1135
1136
1137       # NQS- BZW. LOADLEVELER-JOB STARTEN
1138    if [[ $remote_host != $local_host ]]
1139    then
1140       [[ $verify = true ]]  &&  printf "\n >>> submitting job using \"qsub\"...\n"
1141       if [[ $remote_host != lctit ]]
1142       then
1143          ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
1144       else
1145             # TIT ERLAUBT NUR DIE AUSFï¿œHRUNG GANZ BESTIMMTER KOMMANDOS
1146             # MIT SSH, DESHALB AUFRUF PER PIPE
1147             # UEBERGANGSWEISE CHECK, OB N1GE ENVIRONMENT WIRKLICH VERFUEGBAR
1148          print  "cd $job_catalog; chmod u+x $job_on_remhost"  |  ssh  $remote_addres  -l $remote_user  > /dev/null  2>&1
1149          echo "first try" > send_protocol
1150          while [[ $(cat send_protocol | grep -c "Forwarding to N1GE") = 0 ]]
1151          do
1152             if [[ $(cat send_protocol | grep -c "first try") = 1 ]]
1153             then
1154                printf "\n trying to submit job to TIT cluster..."
1155             else
1156                printf "\n +++ failed ... trying to submit again ..."
1157             fi
1158             print  "cd $job_catalog; $submcom $job_on_remhost"  |  ssh  $remote_addres  -l $remote_user  >  send_protocol  2>&1
1159             cat send_protocol
1160          done
1161          sleep 10
1162          print  "cd $job_catalog;  rm $job_on_remhost"  |  ssh  $remote_addres  -l $remote_user  > /dev/null  2>&1
1163          echo "$submcom  $job_on_remhost"
1164          rm  send_protocol
1165       fi
1166
1167       [[ $verify = true ]]  &&  printf " >>> o.k.\n"
1168    else
1169       cd  $job_catalog
1170       if [[ $(echo $local_host | cut -c1-5) = lcsgi  ||  $(echo $local_host | cut -c1-3) = ibm ]]
1171       then
1172          eval  $submcom  $job_on_remhost
1173       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxt4 ]]
1174       then
1175          eval  $submcom  $job_on_remhost
1176          echo "$submcom  $job_on_remhost"
1177          chmod  u+x  $job_on_remhost
1178       elif [[ $(echo $local_host | cut -c1-5) = lcsgi ]]
1179       then
1180          eval  $submcom  $job_on_remhost
1181       elif [[ $local_host = nech ]]
1182       then
1183          if [[ $queue = default ]]
1184          then
1185             eval  $submcom  $job_on_remhost 
1186          else
1187             eval  $submcom  -q $queue  $job_on_remhost 
1188          fi
1189       else
1190          qsub  $job_on_remhost
1191       fi
1192          # JOBFILE DARF AUF LCTIT NICHT GELOESCHT WERDEN!! GESCHIEHT ERST AM JOBENDE
1193       [[ $local_host != lctit ]]  &&  rm  $job_on_remhost
1194       cd  -  > /dev/null
1195    fi
1196 fi
1197
1198
1199
1200    # ABSCHLUSSARBEITEN
1201
1202 if [[ $no_submit = false ]]
1203 then
1204    rm  $job_to_send
1205 fi
1206 [[ $verify = true ]]  &&  printf "\n\n *** SUBJOB finished \n\n"
Note: See TracBrowser for help on using the repository browser.