source: palm/trunk/SCRIPTS/subjob @ 399

Last change on this file since 399 was 399, checked in by weinreis, 15 years ago

mrun and subjob modified for archiving and special1q

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