source: palm/trunk/SCRIPTS/subjob @ 376

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

bugfix concerning output of averaged 2d/3d quantities

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