source: palm/trunk/SCRIPTS/subjob @ 374

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

mrun adjustments for ice2 and for ssh calls of restart jobs

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