source: palm/trunk/SCRIPTS/subjob @ 799

Last change on this file since 799 was 799, checked in by franke, 12 years ago

Implementation of Wang collision kernel and bugfix for calculation of vpt, pt_p, and ec in case of cloud droplets

  • Property svn:keywords set to Id Rev
File size: 50.0 KB
Line 
1#!/bin/ksh
2# subjob - Plot-Shellskript         Version:  @(#)SUBJOB 1.0
3# $Id: subjob 799 2011-12-21 17:48:03Z franke $
4
5     # Prozedur zum automatischen Generieren von Batch-Jobs, die unter NQS
6     # laufen sollen und deren Ergebnis (Dayfile) zum Job-generierenden
7     # Host zurueckgeschickt werden sollen
8
9
10     # letzte Aenderung:
11     # 29/06/94 - Siggi - Beginn mit Erstellung der Originalversion
12     # 08/07/94 - Siggi - Originalversion abgeschlossen (Version 1.0)
13     # 06/02/98 - Siggi - berte validiert
14     # 27/01/01 - Siggi - ground.yonsei.ac.kr validiert, Jobs zur T3E in Korea
15     #                    moeglich
16     # 08/02/01 - Siggi - alle subjob-Meldungen ins englische uebersetzt
17     # 25/05/02 - Siggi - Unterstuetzung des LoadLeveler
18     # 30/05/02 - Siggi - Validierung fuer ibm-Rechner in Seoul (nobel) sowie
19     #                    allgemeine Anpassungen fuer ibm-Rechner
20     # 15/10/02 - Siggi - Neue Default-Jobklasse (p_normal) fuer IBM in Seoul
21     #                    Ruecktransfer des Jobprotokolls fuer diese
22     #                    Maschine abgeschaltet
23     # 31/10/02 - Siggi - berni validiert
24     # 06/11/02 - Siggi - Neue Jobklassen auf ibmb und ibmh
25     # 08/11/02 - Siggi - quanero validiert
26     # 11/12/02 - Siggi - Notification fuer Transfer-Jobs abgeschaltet
27     # 23/01/03 - Siggi - hostname nobel changed to nobela
28     # 06/02/03 - Siggi - gregale validated
29     # 12/02/03 - Siggi - orkan and maestro validated
30     # 21/02/03 - Siggi - all nobel nodes in Seoul validated
31     # 12/03/03 - Siggi - nec at DKRZ validated
32     # 13/03/03 - Siggi - new nqs resource variable Memory
33     # 07/04/03 - Siggi - processor request option -c on nech needs tasks per
34     #                    node
35     # 11/04/03 - Siggi - network on ibms has attribute "shared"
36     # 31/07/03 - Siggi - nqs2 on nech implemented (provisional: -h nech2)
37     #                    cxxl added to ibmh
38     # 29/08/03 - Siggi - changes in job queues and communication system on
39     #                    ibms
40     # 24/10/03 - Siggi - using alternate hanni address 130.75.4.2
41     # 30/10/03 - Siggi - nech is not supported any more
42     # 10/11/03 - Siggi - nech2 renamed to nech
43     # 20/11/03 - Siggi - submit command on nech changed from qsub.test to qsub
44     # 29/03/04 - Siggi - ground not supported any more, gfdl3 validated
45     # 31/03/04 - Siggi - new option -N for node usage
46     # 12/04/04 - Siggi - scp2 instead of scp used for transfer from decalpha
47     #                    due to error in ssh installation (otherwise a prompt
48     #                    for the password appears)
49     # 23/07/04 - Siggi - changes due to the new berni configuration
50     #                    (federation switch)
51     # 01/09/04 - Gerald  new job-classes on hanni
52     # 08/09/04 - Siggi - hanni IP address changed to 130.75.4.10
53     # 23/11/04 - Siggi - new job class cdata on hanni and berni
54     # 03/12/04 - Siggi - notification on ibm switched of in case of
55     #                    delete_dayfile = true, node usage in cdev set to
56     #                    shared
57     # 16/02/05 - Gerald  hababai validated
58     # 29/03/05 - Micha - new job class channi on hanni
59     # 11/05/05 - Siggi - ConsumableMemory is now required as resource keyword
60     #                    on ibms
61     # 24/05/05 - Siggi - Default queue on ibms changed from p_normal_1.3 to
62     #                    p_normal
63     # 30/06/05 - Siggi - network changed for queue cdev from "us" to "ip"
64     # 12/07/05 - Siggi - in network.mpi on ibmh/ibmb "csss" changed to
65     #                    "sn_all", new job class cexp
66     # 08/09/05 - Siggi - IP-address of gfdl3 changed
67     # 31/10/05 - Siggi - new job class pp on hurricane, serial jobs on
68     #                    hurricane (with -X0)
69     # 01/11/05 - Siggi - missing queue for jobs submitted on nech (for nech)
70     #                    added
71     # 30/12/05 - Siggi - change of IP adresses in subnet 130.75.105
72     # 09/02/06 - Siggi - ibmy admitted
73     # 10/02/06 - Siggi - scp2 changed to /bin/scp on decalpha
74     # 13/04/06 - Siggi - ostria admitted
75     # 18/04/06 - Siggi - new option -O for OpenMP usage
76     # 24/05/06 - Siggi - lctit admitted, ftpjob renamed scpjob
77     # 25/07/06 - Siggi - gfdl5 (ibmy) admitted for submitting jobs
78     # 27/09/06 - Siggi - breg/hreg extended with berni/hanni
79     # 25/10/06 - Siggi - data_limit set to 1.76 GByte on hanni and berni
80     # 28/11/06 - Siggi - levanto admitted
81     # 13/02/07 - Siggi - hpmuk releated code removed
82     # 01/03/07 - Siggi - adjustments for RIAM machines gate and NEC-SX8 (n-sx)
83     # 12/04/07 - Siggi - option -f (filetransfer protocol) removed, scp only
84     # 27/07/07 - Siggi - autan admitted
85     # 03/08/07 - Marcus- lcfimm admitted
86     # 08/10/07 - Siggi - further job classes added for hanni (csoloh...)
87     # 15/10/07 - Siggi - preliminary adjustments for lctit based on Jin's
88     #                    suggestions
89     # 19/10/07 - Marcus- add new optional argument -g group_number
90     # 19/10/07 - Siggi - a ";" was missing in the last change done by Marcus
91     # 30/10/07 - Marcus- further adjustments for queues on lctit
92     # 15/05/08 - Siggi - adjustments for lcxt4 (Bergen Center for Computational
93     #                    Science)
94     # 14/07/08 - Siggi - adjustments for lcsgih
95     # 23/09/08 - Gerald- paesano admitted
96     # 02/10/08 - Siggi - PBS adjustments for lcxt4
97     # 02/03/09 - Siggi - Adjustments for new NEC-SX9 at RIAM
98     # 16/04/09 - Marcus- Adjustments for lcsgib and lcsgih
99     # 21/04/09 - Siggi - adjustments for new IBM at DKRZ, which is now ibmh
100     # 18/05/09 - Siggi - Settings for serial jobs on lcsgi changed
101     # 24/06/09 - BjornM- adjustments for lcxt4 (loading modules manually)
102     # 08/07/09 - Siggi - option -e added (email notification on lcsgih/b)
103     # 20/07/09 - Siggi - On lcsgi, jobs for returning the job protocol are
104     #                    now run on the data nodes (feature=data)
105     # 25/08/09 - BjornM- adapted for lck
106     # 26/08/09 - Marcus- caurus admitted; optional qos feature hiprio on lcsgi
107     # 03/09/09 - Siggi - PBS sgi feature directive only used if explicitly
108     #                    set in the config file by the user
109     # 16/10/09 - Carolin-adjustments for archiving on SGI-ICE of binary files;
110     #                    adding special1q
111     # 01/12/09 - BjornM- re-adjustments for lcxt4, added sno (130.75.105.113)
112     # 16/10/09 - Carolin-adding permq
113     # 01/02/10 - Siggi - adapted for lcxt5m and lckyoto (Fujitsu HX600)
114     # 03/02/10 - Siggi - bug in serial jobs removed
115     # 26/02/10 - BjornM- re-adjustments for lcxt4 (new modules, email
116     #                    notification)
117     # 01/03/10 - Siggi - loading of modules controlled by environment variable
118     #                    module_calls
119     # 17/08/10 - BjornM- re-adjustments for lcxt4 (location of qsub)
120     # 25/08/10 - BjornM- account geofysisk replaced by guest for lcxt4
121     # 25/08/10 - Siggi - new variable project_account in pbs-statements for
122     #                    lcxt4
123     # 08/12/10 - Siggi - initialization of the module command changed for
124     #                    SGI-ICE/lcsgi
125     #                    adjustments for Kyushu Univ. (lcrte, ibmku)
126     # 14/12/10 - Siggi - adjustments for new Tsubame system at Tokyo
127     #                    institute of technology (lctit)
128     # 02/02/11 - Siggi - further asjustments for Tsubame concerning openMP
129     # 06/03/11 - Siggi - adjustments for ibmkisti
130     # 17/03/11 - Siggi - adjustments for openmp usage on ibmkisti
131     # 03/04/11 - Micha - added lckordi
132     # 17/08/11 - Siggi - hicegate0 added
133     # 18/08/11 - Siggi - workaround on lcsgi in order to avoid appends to file
134     #                    last_job_transfer_protocol
135     # 21/08/11 - Siggi - inferno admitted
136     # 29/11/11 - Siggi - adjustments for lcsgih/lcsgib queues, pingui admitted
137
138
139
140    # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
141 delete_dayfile=false
142 email_notification=none
143 group_number=none
144 locat=normal
145 no_default_queue=none
146 no_submit=false
147 job_catalog="~/job_queue"
148 job_name=none
149 local_user=$LOGNAME
150 node_usage=shared
151 numprocs=0
152 punkte="..........................................................."
153 submcom=qsub
154 queue=default
155 remote_host=none
156 remote_user=""
157 verify=true
158
159 typeset  -i   cputime=memory=Memory=0  minuten  resttime  sekunden  stunden
160 typeset  -i   inumprocs  mpi_tasks=nodes=processes_per_node=0 tasks_per_node=threads_per_task=1
161 typeset  -L20 spalte1
162 typeset  -R40 spalte2
163 typeset  -L60 spalte3
164
165
166
167    # FEHLERBEHANDLUNG
168    # BEI EXIT:
169 trap 'if [[ $locat != normal ]]
170       then
171          case  $locat  in
172             (option)  printf "\n  --> available optios can be displayed"
173                       printf " by typing:"
174                       printf "\n      \"subjob ?\" \n";;
175             (ftpcopy|parameter|scp|verify)  printf "\n";;
176             (*)       printf "\n  +++ unknown error"
177                       printf "\n      please inform S. Raasch!\n"
178          esac
179          [[ -f $job_to_send ]]  &&  rm  $job_to_send
180          printf "\n\n+++ SUBJOB killed \n\n"
181       fi' exit
182
183
184    # BEI TERMINAL-BREAK:
185 trap '[[ -f $job_to_send ]]  &&  rm  $job_to_send
186       printf "\n\n+++ SUBJOB killed \n\n"
187       exit
188      ' 2
189
190
191
192
193    # LOKALEN HOSTNAMEN FESTSTELLEN
194 local_host=$(hostname)
195
196
197
198    # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALER HOST
199    # UEBERHAUPT ZULAESSIG IST
200    # Note: One of the entries for "lck" or "lckordi" always has to be
201    # comment out, because the hostname (node*) is same for both machines
202 case  $local_host  in
203     (atmos)                 local_addres=172.20.25.35;   local_host=lcide;;
204     (autan)                 local_addres=130.75.105.57;  local_host=lcmuk;;
205     (bora)                  local_addres=130.75.105.103; local_host=lcmuk;;
206     (bd1)                   local_addres=130.73.232.64;  local_host=lcsgib;;
207     (bd2)                   local_addres=130.73.232.65;  local_host=lcsgib;;
208     (bd3)                   local_addres=130.73.232.66;  local_host=lcsgib;;
209     (bd4)                   local_addres=130.73.232.67;  local_host=lcsgib;;
210     (b01*|bicegate1)        local_addres=130.73.232.102; local_host=lcsgib;;
211     (bicegate2)             local_addres=130.73.232.103; local_host=lcsgib;;
212     (blizzard1)             local_addres=136.172.40.15;  local_host=ibmh;;
213     (breva)                 local_addres=130.75.105.98;  local_host=lcmuk;;
214     (caurus)                local_addres=130.75.105.19;  local_host=lcmuk;;
215     (climate*)              local_addres=165.132.26.68;  local_host=lcyon;;
216     (compute-*.local)       local_addres=172.20.4.2;     local_host=lcfimm;;
217     (cs*)                   local_addres=136.172.44.131; local_host=nech;;
218     (elephanta)             local_addres=130.75.105.6;   local_host=lcmuk;;
219     (fimm.bccs.uib.no)      local_addres=172.20.4.2;     local_host=lcfimm;;
220     (node*)                 local_addres=165.132.26.61   local_host=lck;;
221   #  (node*)                 local_addres=210.219.61.8    local_host=lckordi;;
222     (gaia*)                 local_addres=150.183.146.24; local_host=ibmkisti;;
223     (gallego)               local_addres=130.75.105.10;  local_host=lcmuk;;
224     (gfdl5)                 local_addres=165.132.26.58;  local_host=ibmy;;
225     (gfdl3.yonsei.ac.kr)    local_addres=165.132.26.56;  local_host=decalpha;;
226     (gregale)               local_addres=130.75.105.109; local_host=lcmuk;;
227     (hababai)               local_addres=130.75.105.108; local_host=lcmuk;;
228     (hexagon.bccs.uib.no)   local_addres=129.177.20.113; local_host=lcxt4;;
229     (hd1)                   local_addres=130.75.4.104;   local_host=lcsgih;;
230     (hd2)                   local_addres=130.75.4.105;   local_host=lcsgih;;
231     (hd3)                   local_addres=130.75.4.106;   local_host=lcsgih;;
232     (hd4)                   local_addres=130.75.4.107;   local_host=lcsgih;;
233     (hicegate0)             local_addres=130.75.4.101;   local_host=lcsgih;;
234     (h01*|hicegate1)        local_addres=130.75.4.102;   local_host=lcsgih;;
235     (hicegate2)             local_addres=130.75.4.103;   local_host=lcsgih;;
236     (hx*)                   local_addres=133.3.51.11;    local_host=lckyoto;;
237     (inferno)               local_addres=130.75.105.5;   local_host=lcmuk;;
238     (irifi)                 local_addres=130.75.105.104; local_host=lcmuk;;
239     (sno)                   local_addres=130.75.105.113; local_host=lcmuk;;
240     (levanto)               local_addres=130.75.105.45;  local_host=lcmuk;;
241     (maestro)               local_addres=130.75.105.2;   local_host=lcmuk;;
242     (meteo-login*)          local_addres=193.166.211.144;local_host=lcxt5m;;
243     (nid*)                  local_addres=129.177.20.113; local_host=lcxt4;;
244     (nobel*)                local_addres=150.183.5.101;  local_host=ibms;;
245     (orkan)                 local_addres=130.75.105.3;   local_host=lcmuk;;
246     (ostria)                local_addres=130.75.105.106; local_host=lcmuk;;
247     (paesano)               local_addres=130.75.105.46;  local_host=lcmuk;;
248     (pingui)                local_addres=134.106.74.118; local_host=lcfor;;
249     (quanero)               local_addres=130.75.105.107; local_host=lcmuk;;
250     (rte*)                  local_addres=133.5.185.60;   local_host=lcrte;;
251     (scirocco)              local_addres=172.20.25.41;   local_host=lcmuk;;
252     (solano)                local_addres=130.75.105.110; local_host=lcmuk;;
253     (sun1|sun2)             local_addres=130.75.6.1;     local_host=unics;;
254     (sx-*)                  local_addres=172.16.1.131;   local_host=necriam;;
255     (r1*)                   local_addres=130.75.4.102;   local_host=lcsgih;;
256     (r2*)                   local_addres=130.73.232.102; local_host=lcsgib;;
257     (t2a*)                  local_addres=10.1.6.165;     local_host=lctit;;
258     (vorias)                local_addres=172.20.25.43;   local_host=lcmuk;;
259     (*.cc.kyushu-u.ac.jp)   local_addres=133.5.4.129;    local_host=ibmku;;
260     (*)                     printf "\n  +++ \"$local_host\" unknown";
261                             printf "\n      please inform S. Raasch!";
262                             locat=parameter; exit;;
263 esac
264
265
266
267    # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN
268 remote_host=$local_host
269
270
271
272
273    # PROZEDUROPTIONEN EINLESEN
274 while  getopts  :c:dDe:g:h:m:n:N:O:q:t:T:u:vX:  option
275 do
276   case  $option  in
277       (c)   job_catalog=$OPTARG;;
278       (d)   delete_dayfile=true;;
279       (D)   no_submit=true;;
280       (e)   email_notification=$OPTARG;;
281       (g)   group_number=$OPTARG;;
282       (h)   remote_host=$OPTARG;;
283       (m)   memory=$OPTARG;;
284       (n)   job_name=$OPTARG;;
285       (N)   node_usage=$OPTARG;;
286       (O)   threads_per_task=$OPTARG;;
287       (q)   no_default_queue=$OPTARG;;
288       (t)   cputime=$OPTARG;;
289       (T)   tasks_per_node=$OPTARG;;
290       (u)   remote_user=$OPTARG;;
291       (v)   verify=false;;
292       (X)   numprocs=$OPTARG;;
293       (\?)  printf "\n  +++ Option $OPTARG unknown \n";
294             locat=option; exit;;
295   esac
296 done
297
298
299    # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN
300 shift OPTIND-1; file_to_send=$1
301
302
303    # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN
304 if [ "$1" = "?" ]
305 then
306   (printf "\n  *** subjob can be called as follows:\n"
307    printf "\n      subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v  <jobfile>\n"
308    printf "\n      Description of available options:\n"
309    printf "\n      Option  Description                         Default-Value"
310    printf "\n        -c    job-input- and output-catalog       ~/job_queue"
311    printf "\n        -d    no job-protocol will be created     ---"
312    printf "\n        -D    only the job-file will be created   ---"
313    printf "\n        -h    execution host, available hosts:    $remote_host"
314    printf "\n              ibm, ibmh, ibmkisti, ibmku, ibms, ibmy, lc...,"
315    printf "\n              lctit, nech, necriam, unics"
316    printf "\n        -m    memory demand per process in MByte  ---"
317    printf "\n        -n    jobname                             <jobdatei>"
318    printf "\n        -O    threads per task (for OpenMP usage) 1"
319    printf "\n        -q    job-queue to be used                default"
320    printf "\n        -t    allowed cpu-time in seconds         ---"
321    printf "\n        -T    tasks per node (on parallel hosts)  ---"
322    printf "\n        -u    username on execution host          from .netrc"
323    printf "\n        -v    no prompt for confirmation          ---"
324    printf "\n        -X    # of processors (on parallel hosts) 1"
325    printf "\n "
326    printf "\n      The only possible positional parameter is <jobfile>:"
327    printf "\n      The complete NQS-job must be provided here."
328    printf "\n      <jobfile>=? creates this outline\n\n") | more
329    exit
330 fi
331
332
333
334    # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT
335 if [[ "$file_to_send" = "" ]]
336 then
337    printf "\n  +++ job-file missing"
338    locat=parameter; exit
339 else
340    if [[ -f $file_to_send ]]
341    then
342       true
343    else
344       printf "\n  +++ job-file: "
345       printf "\n           $file_to_send"
346       printf "\n      does not exist"
347       locat=parameter; exit
348    fi
349 fi
350
351
352
353    # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME
354    # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE
355 if [[ $job_name = none ]]
356 then
357    job_name=$file_to_send
358 fi
359 if [[ $(echo $job_name | grep -c "/") != 0 ]]
360 then
361    printf "\n  +++ job-file name: "
362    printf "\n           $job_name"
363    printf "\n      must not contain \"/\"-characters"
364    locat=parameter; exit
365 fi
366
367
368
369
370    # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST
371    # ODER WENN HOST NICHT ANGEGEBEN WURDE
372 if [[ $remote_host = none ]]
373 then
374    printf "\n  +++ host missing"
375    locat=option; exit
376 else
377    case  $remote_host  in
378        (ibm)     queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
379        (ibmh)    queue=no_class; remote_addres=136.172.40.15; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
380        (ibmkisti) queue=class.32plus; remote_addres=150.183.146.24; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
381        (ibmku)   queue=s4; remote_addres=133.5.4.129; submcom=/usr/local/bin/llsubmit;;
382        (ibms)    queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
383        (ibmy)    queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;;
384        (lcfimm)  remote_addres=172.20.4.2; submcom=/opt/torque/bin/qsub;;
385        (lckyoto) remote_addres=133.3.51.11; submcom=/thin/local/bin/qsub;;
386        (lcsgib)  queue=smallq; remote_addres=130.73.232.104; submcom=/opt/moab/bin/msub;;
387        (lcsgih)  queue=smallq; remote_addres=130.75.4.101; submcom=/opt/moab/bin/msub;;
388        (lck)     remote_addres=165.132.26.61; submcom=/usr/torque/bin/qsub;;
389        (lckordi) remote_addres=210.219.61.8; submcom=/usr/torque/bin/qsub;;
390        (lctit)   queue=S; remote_addres=10.1.6.165; submcom=/opt/pbs/tools/bin/t2sub;;
391        (lcxt4)   remote_addres=129.177.20.113; submcom=/opt/torque/2.4.9-snap.201005191035/bin/qsub;;
392        (lcxt5m)  remote_addres=193.166.211.144; submcom=/opt/pbs/10.1.0.91350/bin/qsub;;
393        (lcyon)   remote_addres=165.132.26.68; submcom=/usr/torque/bin/qsub;;
394        (nech)    qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";;
395        (necriam) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=172.16.1.131; submcom="/usr/bin/nqsII/qsub";;
396        (vpp)     qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;;
397        (unics)   qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;;
398        (*)       printf "\n  +++ hostname \"$remote_host\" not allowed";
399                  locat=parameter; exit;;
400    esac
401 fi
402
403
404    # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST
405 if [[ $no_default_queue != none ]]
406 then
407    error=false
408    ndq=$no_default_queue
409    case  $remote_host  in
410        (ibm)    case  $ndq  in
411                     (p690_express|p690_standard|p690_long)  error=false;;
412                     (*)                                     error=true;;
413                 esac;;
414        (ibmh)   case  $ndq  in
415                     (no_class)  error=false;;
416                     (*)                                     error=true;;
417                 esac;;
418        (ibmkisti)   case  $ndq  in
419                     (class.32plus|class.1-2|class.2-32)  error=false;;
420                     (*)                                     error=true;;
421                 esac;;
422        (ibmku)  case  $ndq  in
423                     (sdbg1|sdbg2|sdbg4|s4|s16|s32|s32-s)    error=false;;
424                     (*)                                     error=true;;
425                 esac;;
426        (ibms)   case  $ndq  in
427                     (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand)     error=false;;
428                     (*)                                     error=true;;
429                 esac;;
430        (ibmy)   case  $ndq  in
431                     (parallel)                              error=false;;
432                     (*)                                     error=true;;
433                 esac;;
434        (lckyoto) case  $ndq  in
435                     (eh|ph)                                 error=false;;
436                     (*)                                     error=true;;
437                 esac;;
438        (lcsgib|lcsgih)   case  $ndq  in
439                     (testq|serialq|smallq|mediumq|bigq|workq|dataq|permq|special1q)       error=false;;
440                     (*)                                     error=true;;
441                 esac;;
442        (lctit)  case  $ndq  in
443                     (G|L128|L256|L512H|S|S96|V)             error=false;;
444                     (*)                                     error=true;;
445                 esac;;
446        (t3eb)   case  $ndq  in
447                     (berte|p50|p100|p392|forfree|p25himem)  error=false;;
448                     (*)    error=true;;
449                 esac;;
450        (necriam) case  $ndq  in
451                     (SP|SS|P6)  error=false;;
452                     (*)    error=true;;
453                 esac;;
454        (t3eh)   case  $ndq  in
455                     (para_t3e|em|k|l|lm|comp_t3e|c|p|ht)  error=false;;
456                     (*)    error=true;;
457                 esac;;
458        (t3ej2|t3ej5)  case  $ndq  in
459                     (low|normal|high)  error=false;;
460                     (*)    error=true;;
461                 esac;;
462        (t3es)  case  $ndq  in
463                     (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128)  error=false;;
464                     (*)    error=true;;
465                 esac;;
466        (unics)  case  $ndq  in
467                     (unics|ht)  error=false;;
468                     (*)         error=true;;
469                 esac;;
470    esac
471    if [[ $error = true ]]
472    then
473       printf "\n  +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed"
474       locat=parameter; exit
475    else
476       queue=$no_default_queue
477    fi
478 fi
479
480
481
482    # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN
483    # AUFTEILEN
484 done=false
485 while [[ $done = false ]]
486 do
487    if (( $cputime <= 0 ))
488    then
489       printf "\n  +++ wrong cpu-time or cpu-time missing"
490       printf "\n  >>> Please type cpu-time in seconds as INTEGER:"
491       printf "\n  >>> "
492       read  cputime  1>/dev/null  2>&1
493    else
494       done=true
495    fi
496 done
497 if [[ $remote_host = nech ]]
498 then
499    if (( tasks_per_node != 0 ))
500    then
501       (( cputime = cputime * tasks_per_node ))
502    elif [[ $numprocs != 0 ]]
503    then
504       (( cputime = cputime * numprocs ))
505    fi
506 fi
507 (( stunden  = cputime / 3600 ))
508 (( resttime = cputime - stunden * 3600 ))
509 (( minuten  = resttime / 60 ))
510 (( sekunden = resttime - minuten * 60 ))
511 timestring=${stunden}:${minuten}:${sekunden}
512
513
514
515    # PRUEFEN DER KERNSPEICHERANFORDERUNG
516 done=false
517 while [[ $done = false ]]
518 do
519    if (( memory <= 0 ))
520    then
521       printf "\n  +++ wrong memory demand or memory demand missing"
522       printf "\n  >>> Please type memory in  MByte per process  as INTEGER:"
523       printf "\n  >>> "
524       read  memory  1>/dev/null  2>&1
525    else
526       done=true
527    fi
528 done
529
530 if [[ $remote_host = nech  ||  $remote_host = necriam ]]
531 then
532    if (( tasks_per_node != 0 ))
533    then
534       (( Memory = memory * tasks_per_node / 1000 ))
535    elif [[ $numprocs != 0 ]]
536    then
537       (( Memory = memory * numprocs / 1000 ))
538    else
539       (( Memory = memory / 1000 ))
540    fi
541 elif [[ $remote_host = lctit ]]
542 then
543    (( Memory = memory * tasks_per_node / 1000 ))
544 fi
545
546
547    # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG
548 if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
549 then
550    (( memory = memory * threads_per_task ))
551 fi
552
553
554    # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN
555 if (( tasks_per_node != 0 ))
556 then
557    (( nodes = numprocs / ( tasks_per_node * threads_per_task ) ))
558 fi
559
560    # Calculate number of processes per node
561 (( processes_per_node = tasks_per_node * threads_per_task ))
562
563    # Calculate number of MPI tasks
564 (( mpi_tasks = numprocs / threads_per_task ))
565
566
567    # HEADER-AUSGABE
568 if [[ $verify = true ]]
569 then
570    printf "\n\n"
571    printf "#--------------------------------------------------------------# \n"
572    spalte1=SUBJOB;spalte2=$(date)
573    printf "| $spalte1$spalte2 | \n"
574    printf "|                                                              | \n"
575    printf "| values of parameters/options:                                | \n"
576    spalte1=local_host$punkte; spalte2=$punkte$local_host
577    printf "| $spalte1$spalte2 | \n"
578    spalte1=remote_host$punkte; spalte2=$punkte$remote_host
579    printf "| $spalte1$spalte2 | \n"
580    spalte1=queue$punkte; spalte2=$punkte$queue
581    printf "| $spalte1$spalte2 | \n"
582    spalte1=memory$punkte; spalte2="$punkte$memory mb"
583    printf "| $spalte1$spalte2 | \n"
584    spalte1=cputime$punkte; spalte2="$punkte$cputime sec"
585    printf "| $spalte1$spalte2 | \n"
586    spalte1=job_name$punkte; spalte2="$punkte$job_name"
587    printf "| $spalte1$spalte2 | \n"
588    printf "#--------------------------------------------------------------# \n\n"
589
590
591       # KONTROLLABFRAGE, OB ALLES O.K.
592    antwort="dummy"
593    while [[ $antwort != y  &&  $antwort != Y  &&  $antwort != n  &&  $antwort != N ]]
594    do
595       read antwort?" >>> continue (y/n) ? "
596    done
597    if [[ $antwort = n  ||  $antwort = N ]]
598    then
599       locat=verify; exit
600    fi
601    printf "\n"
602 fi
603
604
605
606    # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN
607 kennung=$RANDOM
608 job_on_remhost=${job_name}_${kennung}_$local_host
609 job_to_send=job_to_send_$kennung
610 if [[ $delete_dayfile = false ]]
611 then
612    remote_dayfile=${local_host}_${job_name}_result_$kennung
613    local_dayfile=${remote_host}_${job_name}
614 else
615    remote_dayfile=/dev/null
616 fi
617
618
619
620    # Generate the batch job scripts (qsub/msub/LoadLeveler)
621 if [[ $(echo $remote_host | cut -c1-3) = ibm  &&  $numprocs != 0 ]]
622 then
623
624       # General LoadLeveler settings
625    execute_in_shell="#!/bin/ksh"
626    use_shell="# @ shell = /bin/ksh"
627    consumable_memory="ConsumableMemory($memory mb)"
628    class="# @ class = $queue"
629    environment="# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes"
630    network_to_use="# @ network.mpi = sn_all,shared,us"
631    data_limit="# @ data_limit = 1.76gb"
632    image_size="# @ image_size = 50"
633    wall_clock_limit="# @ wall_clock_limit = ${timestring},$timestring"
634
635    if [[ $email_notification = none ]]
636    then
637       notify_user=""
638    else
639       notify_user="# @ notify_user = $email_notification"
640       if [[ $delete_dayfile = true ]]
641       then
642          notification='# @ notification = never'
643       fi
644    fi
645
646    if [[ $remote_host = ibmh ]]
647    then
648       data_limit=""
649       network_to_use=""
650       class=""
651       environment=""
652    elif [[ $remote_host = ibmkisti ]]
653    then
654       network_to_use="# @ network.MPI = sn_all,shared,US"
655       wall_clock_limit="# @ wall_clock_limit = $timestring"
656       if [[ $threads_per_task = 1 ]]
657       then
658          rset="# @ rset = RSET_MCM_AFFINITY"
659          mcm_affinity_options="# @ mcm_affinity_options = mcm_mem_pref mcm_sni_none mcm_distribute"
660       fi
661       environment=""
662       use_shell=""
663       data_limit=""
664       image_size=""
665    elif [[ $remote_host = ibmku ]]
666    then
667       execute_in_shell="#!/usr/bin/ksh"
668       use_shell="# @ shell = /usr/bin/ksh"
669       consumable_memory=""
670       environment=""
671       network_to_use="# @ network.mpi = sn_all,shared,us"
672       data_limit=""
673       image_size=""
674    elif [[ $remote_host = ibms ]]
675    then
676       network_to_use="# @ network.mpi = csss,shared,us"
677    elif [[ $remote_host = ibmy ]]
678    then
679       consumable_memory=""
680       network_to_use=""
681    fi
682
683    cat > $job_to_send << %%END%%
684$execute_in_shell
685$use_shell
686
687# @ job_type = parallel
688# @ job_name = $job_name
689# @ resources = ConsumableCpus($threads_per_task) $consumable_memory
690# @ output = $remote_dayfile
691# @ error = $remote_dayfile
692$wall_clock_limit
693$image_size
694$class
695$environment
696$network_to_use
697$data_limit
698$rset
699$mcm_affinity_options
700$notification
701$notify_user
702
703%%END%%
704
705    if (( nodes > 0 ))
706    then
707
708       if [[ $remote_host != ibmkisti ]]
709       then
710
711          cat >> $job_to_send << %%END%%
712# @ node = $nodes
713# @ tasks_per_node = $processes_per_node
714# @ node_usage = $node_usage
715# @ queue
716
717%%END%%
718
719       else
720
721          cat >> $job_to_send << %%END%%
722# @ total_tasks = $mpi_tasks
723# @ blocking = unlimited
724# @ queue
725
726%%END%%
727
728       fi
729
730    else
731
732       if [[ $remote_host != ibmy ]]
733       then
734
735          cat >> $job_to_send << %%END%%
736# @ blocking = unlimited
737# @ total_tasks = $numprocs
738# @ node_usage = $node_usage
739# @ queue
740
741%%END%%
742
743       else
744
745          cat >> $job_to_send << %%END%%
746# @ node = 1
747# @ total_tasks = $numprocs
748# @ queue
749
750%%END%%
751
752       fi
753
754    fi
755
756       # workaround because of silly job filter on ibmkisti
757    if [[ $remote_host = ibmkisti  &&  $threads_per_task != 1 ]]
758    then
759       echo  "export OMP_NUM_THREADS=$threads_per_task"  >>  $job_to_send
760    fi
761
762 elif [[ $(echo $remote_host | cut -c1-3) = ibm  &&  $numprocs = 0 ]]
763 then
764
765    cat > $job_to_send << %%END%%
766#!/bin/ksh
767
768# @ job_type = serial
769# @ node_usage = $node_usage
770# @ job_name = palm
771# @ wall_clock_limit = ${timestring},$timestring
772# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)
773# @ output = $remote_dayfile
774# @ error = $remote_dayfile
775$class
776$notification
777
778# @ queue
779
780%%END%%
781
782 elif [[ $remote_host = lcfimm ]]
783 then
784
785    if [[ $numprocs != 0 ]]
786    then
787       cat > $job_to_send << %%END%%
788#!/bin/ksh
789#PBS -N $job_name
790#PBS -A $project_account
791#PBS -l walltime=$timestring
792#PBS -l nodes=${nodes}:ppn=$processes_per_node
793#PBS -l pmem=${memory}mb
794#PBS -m abe
795#PBS -o $remote_dayfile
796#PBS -j oe
797mpd &
798
799%%END%%
800
801    else
802       cat > $job_to_send << %%END%%
803#!/bin/ksh
804#PBS -N $job_name
805#PBS -A $project_account
806#PBS -l walltime=$timestring
807#PBS -l ncpus=1
808#PBS -l pmem=${memory}mb
809#PBS -m abe
810#PBS -o $remote_dayfile
811#PBS -j oe
812
813%%END%%
814
815    fi
816
817 elif [[ $remote_host = lck || $remote_host = lckordi ]]
818 then
819
820    if [[ $numprocs != 0 ]]
821    then
822       cat > $job_to_send << %%END%%
823#!/bin/ksh
824#PBS -N $job_name
825#PBS -l walltime=$timestring
826#PBS -l ncpus=$numprocs
827#PBS -l pmem=${memory}mb
828#PBS -o $remote_dayfile
829#PBS -j oe
830
831mpd &
832
833%%END%%
834
835    else
836       cat > $job_to_send << %%END%%
837#!/bin/ksh
838#PBS -N $job_name
839#PBS -l walltime=$timestring
840#PBS -l ncpus=1
841#PBS -l pmem=${memory}mb
842#PBS -o $remote_dayfile
843#PBS -j oe
844
845%%END%%
846
847    fi
848
849 elif [[ $remote_host = lcyon ]]
850 then
851
852    if [[ $numprocs != 0 ]]
853    then
854       cat > $job_to_send << %%END%%
855#!/bin/ksh
856#PBS -N $job_name
857#PBS -l walltime=$timestring
858#PBS -l ncpus=$numprocs
859#PBS -l pmem=${memory}mb
860#PBS -o $remote_dayfile
861#PBS -j oe
862
863%%END%%
864
865    else
866       cat > $job_to_send << %%END%%
867#!/bin/ksh
868#PBS -N $job_name
869#PBS -l walltime=$timestring
870#PBS -l ncpus=1
871#PBS -l pmem=${memory}mb
872#PBS -o $remote_dayfile
873#PBS -j oe
874
875%%END%%
876
877    fi
878
879 elif [[ $remote_host = lcsgih  ||  $remote_host = lcsgib ]]
880 then
881
882    if [[ "$sgi_feature" != "" ]]
883    then
884       feature_directive="#PBS -l feature=$sgi_feature"
885    else
886       feature_directive=""
887    fi
888
889    if [[ $queue = dataq || $queue = permq ]]
890    then
891       feature_directive="#PBS -l feature=data"
892    fi
893
894    if [[ $queue = testq  || $queue = mediumq  ||  $queue = bigq  ||  $queue = workq  ||  $queue = dataq  ||  $queue = permq ||  $queue = serialq  ||  $queue = special1q ]]
895    then
896       queue_directive="#PBS -q $queue"
897    else
898       queue_directive=""
899    fi
900
901    if [[ $email_notification = none ]]
902    then
903       email_directive=""
904    else
905       email_directive="#PBS -M $email_notification"
906    fi
907
908    if [[ $numprocs != 0 ]]
909    then
910       cat > $job_to_send << %%END%%
911#!/bin/bash
912#PBS -N $job_name
913#PBS -l walltime=$timestring
914#PBS -l nodes=$nodes:ppn=${processes_per_node}
915#PBS -l naccesspolicy=$node_usage
916#PBS -o $remote_dayfile
917#PBS -j oe
918$feature_directive
919$queue_directive
920$email_directive
921
922eval \`/sw/swdist/bin/modulesinit\`
923#. /usr/share/modules/init/bash
924$module_calls
925
926echo ld_library_path=\$LD_LIBRARY_PATH
927
928%%END%%
929
930    else
931       cat > $job_to_send << %%END%%
932#PBS -S /bin/bash
933#PBS -N $job_name
934#PBS -l walltime=$timestring
935#PBS -l ncpus=1
936#PBS -o $remote_dayfile
937#PBS -j oe
938$queue_directive
939$email_directive
940
941eval \`/sw/swdist/bin/modulesinit\`
942#. /usr/share/modules/init/bash
943$module_calls
944
945%%END%%
946
947    fi
948
949 elif [[ $remote_host = lcxt4 ]]
950 then
951
952    if [[ $numprocs != 0 ]]
953    then
954       cat > $job_to_send << %%END%%
955#!/bin/ksh
956#PBS -S /bin/ksh
957#PBS -N $job_name
958#PBS -A $project_account
959#PBS -j oe
960#PBS -l walltime=$timestring
961#PBS -l mppwidth=${numprocs}
962#PBS -l mppnppn=${processes_per_node}
963#PBS -m abe
964#PBS -o $remote_dayfile
965$email_directive
966
967. /opt/modules/default/init/ksh
968$module_calls
969
970%%END%%
971
972    else
973       cat > $job_to_send << %%END%%
974#!/bin/ksh
975#PBS -S /bin/ksh
976#PBS -N $job_name
977#PBS -A $project_account
978#PBS -j oe
979#PBS -l walltime=$timestring
980#PBS -l ncpus=1
981#PBS -l pmem=${memory}mb
982#PBS -m abe
983$email_directive
984#PBS -o $remote_dayfile
985
986. /opt/modules/default/init/ksh
987$module_calls
988
989%%END%%
990
991    fi
992
993 elif [[ $remote_host = lckyoto ]]
994 then
995
996       cat > $job_to_send << %%END%%
997#!/bin/ksh
998# @\$-o $remote_dayfile
999# @\$-eo -oi
1000# @\$-lP 16
1001# @\$-lp 1
1002# @\$-lm 28gb  -llm unlimited -ls unlimited
1003# @\$-q $queue
1004# @\$-Pvn abs_pack
1005##for intel? @\$-Pvn abs_unpack -Pvs unpack -Pvc unpack
1006#. /thin/local/etc/setprofile/intel-11.0.sh
1007#. /thin/local/etc/setprofile/mvapich2-1.4+intel-11.0.sh
1008. ~/.myprofile
1009#. /home2/t/t51254/palm/current_version/myprofile
1010#. /thin/apps/pgi/mpi.sh
1011#
1012env
1013#
1014set -x
1015
1016%%END%%
1017
1018 elif [[ $remote_host = lcxt5m ]]
1019 then
1020
1021    if [[ $numprocs != 0 ]]
1022    then
1023       cat > $job_to_send << %%END%%
1024#!/bin/ksh
1025#PBS -S /bin/ksh
1026#PBS -N $job_name
1027#PBS -j oe
1028#PBS -l walltime=$timestring
1029#PBS -l mppwidth=${numprocs}
1030#PBS -l mppnppn=${processes_per_node}
1031#PBS -m abe
1032#PBS -o $remote_dayfile
1033
1034. /opt/modules/default/init/ksh
1035$module_calls
1036
1037%%END%%
1038
1039    else
1040       cat > $job_to_send << %%END%%
1041#!/bin/ksh
1042#PBS -S /bin/ksh
1043#PBS -N $job_name
1044#PBS -j oe
1045#PBS -l walltime=$timestring
1046#PBS -l ncpus=1
1047#PBS -l pmem=${memory}mb
1048#PBS -m abe
1049#PBS -o $remote_dayfile
1050
1051. /opt/modules/default/init/ksh
1052$module_calls
1053
1054%%END%%
1055
1056    fi
1057
1058 elif [[ $remote_host = nech ]]
1059 then
1060
1061    if (( nodes > 1 ))
1062    then
1063       cat > $job_to_send << %%END%%
1064#!/bin/ksh
1065#PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime
1066#PBS -l ${qsubmem}=${Memory}gb
1067#PBS -b $nodes
1068#PBS -o $remote_dayfile
1069#PBS -N palm
1070#PBS -j o
1071#PBS -T mpisx
1072
1073%%END%%
1074
1075    elif [[ $numprocs != 0 ]]
1076    then
1077       cat > $job_to_send << %%END%%
1078#!/bin/ksh
1079#PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime
1080#PBS -l ${qsubmem}=${Memory}gb
1081#PBS -o $remote_dayfile
1082#PBS -N palm
1083#PBS -j o
1084
1085%%END%%
1086
1087    else
1088       cat > $job_to_send << %%END%%
1089#!/bin/ksh
1090#PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime
1091#PBS -o $remote_dayfile
1092#PBS -j o
1093
1094%%END%%
1095
1096    fi
1097
1098 elif [[ $remote_host = necriam ]]
1099 then
1100
1101    if (( nodes > 1 ))
1102    then
1103       cat > $job_to_send << %%END%%
1104#!/bin/ksh
1105#PBS -b $nodes
1106#PBS -o $remote_dayfile
1107#PBS -N $job_name
1108#PBS -j o
1109#PBS -v MPIPROGINV=YES
1110
1111%%END%%
1112
1113    elif [[ $numprocs != 0 ]]
1114    then
1115       cat > $job_to_send << %%END%%
1116#!/bin/ksh
1117#PBS -q ${queue}
1118#PBS -o $remote_dayfile
1119#PBS -N $job_name
1120#PBS -j o
1121#PBS -v MPIPROGINV=YES
1122
1123%%END%%
1124
1125    else
1126       cat > $job_to_send << %%END%%
1127#!/bin/ksh
1128#PBS -o $remote_dayfile
1129#PBS -j o
1130
1131%%END%%
1132
1133    fi
1134
1135 elif [[ $remote_host = lctit ]]
1136 then
1137    cat > $job_to_send << %%END%%
1138#!/bin/ksh
1139
1140$module_calls
1141
1142%%END%%
1143
1144       # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN
1145    if [[ $tasks_per_node != $processes_per_node ]]
1146    then
1147       submcom="$submcom -W group_list=$group_number -N $job_name -l walltime=$timestring -l select=$nodes:ncpus=$processes_per_node:mpiprocs=$tasks_per_node:mem=${Memory}gb -o $remote_dayfile -j oe -q $queue "
1148    else
1149       submcom="$submcom -W group_list=$group_number -N $job_name -l walltime=$timestring -l select=$nodes:ncpus=$processes_per_node:mpiprocs=$tasks_per_node:mem=${Memory}gb -l place=scatter -o $remote_dayfile -j oe -q $queue "
1150    fi
1151
1152 else
1153
1154    cat > $job_to_send << %%END%%
1155# @\$-q ${queue}
1156# @\$-l${qsubtime} $timestring
1157# @\$-l${qsubmem} ${memory}mb
1158# @\$-o $remote_dayfile
1159# @\$-eo
1160
1161%%END%%
1162
1163 fi
1164
1165
1166    # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP
1167    # BEI EXIT VERANLASSEN
1168    # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT
1169    # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH
1170 if [[ $delete_dayfile = false  &&  $remote_host != $local_host ]]
1171 then
1172    echo "set +vx"                              >>  $job_to_send
1173    echo "trap '"                               >>  $job_to_send
1174    echo "set +vx"                              >>  $job_to_send
1175    if [[ $(echo $remote_host | cut -c1-3) = ibm  ||  $(echo $remote_host | cut -c1-5) = lcsgi  ||  $(echo $remote_host | cut -c1-3) = nec ]]
1176    then
1177       if [[ $remote_host = ibmh ]]
1178       then
1179          return_queue=c1
1180       elif [[ $remote_host = ibmkisti ]]
1181       then
1182          return_queue=class.1-2
1183       elif [[ $remote_host = ibmku ]]
1184       then
1185          return_queue=sdbg2
1186       elif [[ $remote_host = ibms ]]
1187       then
1188          return_queue=p_normal
1189       elif [[ $remote_host = ibmy ]]
1190       then
1191          return_queue=serial
1192       elif [[ $remote_host = lcsgih  ||  $remote_host = lcsgib ]]
1193       then
1194          return_queue=serialq
1195       elif [[ $remote_host = necriam ]]
1196       then
1197          return_queue=SP
1198       else
1199          return_queue=unknown
1200       fi
1201
1202       if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
1203       then
1204
1205          if [[ $remote_host = ibmku ]]
1206          then
1207             echo "echo \"#!/usr/bin/ksh\" >> scpjob.$kennung"            >>  $job_to_send
1208             echo "echo \"# @ shell = /usr/bin/ksh\" >> scpjob.$kennung"  >>  $job_to_send
1209          else
1210             echo "echo \"#!/bin/ksh\" >> scpjob.$kennung"                >>  $job_to_send
1211          fi
1212          echo "echo \"# @ job_type = serial\" >> scpjob.$kennung"    >>  $job_to_send
1213          echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung"  >>  $job_to_send
1214          echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$kennung"  >>  $job_to_send
1215          echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$kennung "  >>  $job_to_send
1216          echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung"  >>  $job_to_send
1217          echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung"  >>  $job_to_send
1218          if [[ $host != "ibmh" ]]
1219          then
1220             echo "echo \"# @ class = $return_queue\" >> scpjob.$kennung"  >>  $job_to_send
1221          fi
1222          echo "echo \"# @ image_size = 10\" >> scpjob.$kennung"      >>  $job_to_send
1223          echo "echo \"# @ notification = never\" >> scpjob.$kennung" >>  $job_to_send
1224
1225          echo "echo \"# @ queue\" >> scpjob.$kennung"                >>  $job_to_send
1226          echo "echo \" \" >> scpjob.$kennung"                        >>  $job_to_send
1227
1228          echo "echo \"set -x\" >> scpjob.$kennung"                   >>  $job_to_send
1229          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
1230          if [[ $remote_host = ibmku ]]
1231          then
1232             echo "echo \"rm  scpjob.$kennung\" >> scpjob.$kennung"   >>  $job_to_send
1233          fi
1234          echo "echo \"exit\" >> scpjob.$kennung"                     >>  $job_to_send
1235
1236       elif [[ $remote_host = nech ]]
1237       then
1238          echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
1239          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
1240          echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100"  >>  $job_to_send
1241          echo "#PBS -o last_job_transfer_protocol"      >>  $job_to_send
1242          echo "#PBS -j o"                         >>  $job_to_send
1243          echo " "                                 >>  $job_to_send
1244          echo "set -x"                            >>  $job_to_send
1245          echo "cd /pf/b/${remote_user}/job_queue" >>  $job_to_send
1246          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
1247          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
1248          echo "%%END%%"                           >>  $job_to_send
1249
1250       elif [[ $remote_host = necriam ]]
1251       then
1252          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
1253          echo "#PBS -q $return_queue"             >>  $job_to_send
1254          echo "#PBS -o last_job_transfer_protocol"      >>  $job_to_send
1255          echo "#PBS -j o"                         >>  $job_to_send
1256          echo " "                                 >>  $job_to_send
1257          echo "set -x"                            >>  $job_to_send
1258          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  $remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
1259          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
1260          echo "%%END%%"                           >>  $job_to_send
1261
1262       elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]]
1263       then
1264          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
1265          echo "#!/bin/bash"                             >>  $job_to_send
1266          echo "#PBS -N job_protocol_transfer"           >>  $job_to_send
1267          echo "#PBS -l walltime=00:30:00"               >>  $job_to_send
1268          echo "#PBS -l nodes=1:ppn=1"                   >>  $job_to_send
1269          echo "#PBS -l feature=data"                    >>  $job_to_send
1270          echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol"      >>  $job_to_send
1271          echo "#PBS -j oe"                        >>  $job_to_send
1272          echo " "                                 >>  $job_to_send
1273          echo ". /usr/share/modules/init/bash"    >>  $job_to_send
1274          echo "set -x"                            >>  $job_to_send
1275          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
1276          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
1277          echo "%%END%%"                           >>  $job_to_send
1278
1279       else
1280
1281          echo "cat > scpjob.$kennung << %%END%%"  >>  $job_to_send
1282          echo "# @\\\$-q $return_queue"           >>  $job_to_send
1283          echo "# @\\\$-l${qsubtime} 10"           >>  $job_to_send
1284          echo "# @\\\$-l${qsubmem} 10mb"          >>  $job_to_send
1285          if [[ $remote_host = t3ej2  ||  $remote_host = t3ej5  ||  $remote_host = t3es ]]
1286          then
1287             echo "# @\$-l mpp_p=0"                >>  $job_to_send
1288          fi
1289          echo '# @\$-lF 10mb'                     >>  $job_to_send
1290#          echo '# @\$-o /dev/null'                 >>  $job_to_send
1291          echo '# @\$-o job_queue/last_job_transfer_protocol'    >>  $job_to_send
1292          echo '# @\\\$-eo'                          >>  $job_to_send
1293          echo " "                                 >>  $job_to_send
1294          if [[ $remote_host = t3ej2  ||  $remote_host = t3ej5 ]]
1295          then
1296             echo "set +vx"                        >>  $job_to_send
1297             echo ". .profile"                     >>  $job_to_send
1298          fi
1299          echo "set -x"                            >>  $job_to_send
1300          echo "batch_scp  -d  -w 10  -u $local_user $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null"  >>  $job_to_send
1301          echo "[[ \"\$for_subjob_to_do\" != \"\" ]]  &&  eval \$for_subjob_to_do"  >>  $job_to_send
1302          echo "%%END%%"                           >>  $job_to_send
1303       fi
1304
1305       if [[ $(echo $remote_host | cut -c1-3) = ibm ]]
1306       then
1307          echo "llsubmit  scpjob.$kennung"      >>  $job_to_send
1308       elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]]
1309       then
1310          echo "rm -rf \$HOME/job_queue/last_job_transfer_protocol"  >>  $job_to_send
1311          echo "chmod  u+x  scpjob.$kennung"                         >>  $job_to_send
1312          echo "msub  scpjob.$kennung"                               >>  $job_to_send
1313       elif [[ $remote_host = t3eb  ||  $remote_host = t3eh  ||  $remote_host = t3ej2  ||  $remote_host = t3ej5 ]]
1314       then
1315          echo "qsub -J n  scpjob.$kennung"     >>  $job_to_send
1316       elif [[ $remote_host = t3es ]]
1317       then
1318          echo "qsub -J n  -s /bin/ksh  scpjob.$kennung"     >>  $job_to_send
1319       else
1320          echo "qsub  scpjob.$kennung"          >>  $job_to_send
1321       fi
1322       if [[ $remote_host != ibmku ]]
1323       then
1324          echo "rm  scpjob.$kennung"            >>  $job_to_send
1325       fi
1326       if [[ $remote_host = nech ]]
1327       then
1328          echo "cd -"                           >>  $job_to_send
1329       fi
1330    else
1331#       echo "ftpcopy  -d  $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile"  >>  $job_to_send
1332       echo "nohup  ftpcopy  -d  -w 15  $local_addres  ${job_catalog}/$remote_dayfile  \"$job_catalog\"  $local_dayfile  >  /dev/null  &"  >>  $job_to_send
1333    fi
1334    echo "set -x"                               >>  $job_to_send
1335    echo "     ' exit"                          >>  $job_to_send
1336    echo "set -x"                               >>  $job_to_send
1337 fi
1338
1339
1340
1341    # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN
1342 cat  $file_to_send  >>  $job_to_send
1343
1344 if [[ $remote_host = ibm ]]
1345 then
1346    echo " "         >>  $job_to_send
1347    echo "exit"      >>  $job_to_send
1348 fi
1349
1350    # remove job file
1351 if [[ $remote_host = lctit  ||  $remote_host = ibmku ]]
1352 then
1353    echo " "                               >>  $job_to_send
1354    echo "rm ~/job_queue/$job_on_remhost"  >>  $job_to_send
1355 fi
1356
1357
1358
1359    # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN
1360 if [[ -z $remote_user ]]
1361 then
1362    if [[ $remote_host = t3eb  ||  $remote_host = t3eh  ||  $remote_host = t3ej2  ||  $remote_host = t3ej5  ||  $remote_host = t3es  ||  $remote_host = vpp ]]
1363    then
1364       grep  $remote_addres  ~/.netrc | read dum dum dum remote_user dum dum
1365    fi
1366 fi
1367
1368
1369
1370    # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN
1371 if [[ $no_submit = false ]]
1372 then
1373    if [[ $remote_host != $local_host ]]
1374    then
1375       [[ $verify = true ]]  &&  printf "\n >>> transfering job to \"$remote_host\"..."
1376       if [[ $remote_host = ibms  ||  $remote_host = ibmy ]]    # ssh on ibms cannot handle "~/"
1377       then
1378          job_catalog_save=$job_catalog
1379          job_catalog=job_queue
1380       elif [[ $remote_host = nech ]]
1381       then
1382          job_catalog_save=$job_catalog
1383          job_catalog=/hpf/b/${remote_user}/job_queue
1384       fi
1385       if [[ $local_host = decalpha ]]
1386       then
1387             # VERWENDUNG VON SCP AUF DECALPHA FRAGT FEHLERHAFTERWEISE
1388             # PASSWORT AB
1389          /bin/scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
1390       elif [[ $remote_host = nech ]]
1391       then
1392             # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ
1393             # TRANSFERIERT WERDEN
1394          scp  $job_to_send  ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost
1395       else
1396          scp  $job_to_send  ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost
1397       fi
1398       if [[ $? = 1 ]]
1399       then
1400          locat=scp; exit
1401       fi
1402       if [[ $remote_host = ibms ]]
1403       then
1404          job_catalog=$job_catalog_save
1405       fi
1406       [[ $verify = true ]]  &&  printf "\n >>> finished\n"
1407    else
1408       eval  job_catalog=$job_catalog
1409       cp  $job_to_send  ${job_catalog}/$job_on_remhost
1410    fi
1411
1412
1413
1414       # NQS- BZW. LOADLEVELER-JOB STARTEN
1415    if [[ $remote_host != $local_host ]]
1416    then
1417       [[ $verify = true ]]  &&  printf "\n >>> submitting job using \"qsub\"...\n"
1418
1419       if [[ $(echo $remote_host | cut -c1-5) = lcsgi  &&  $prio = true ]]
1420       then
1421          printf "\n >>> submit with HLRN qos-feature hiprio...\n"
1422          ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom -l qos=hiprio $job_on_remhost; rm $job_on_remhost"
1423       elif [[ $remote_host = ibmku ]]
1424       then
1425          ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost"
1426       else
1427          ssh  $remote_addres  -l $remote_user  "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost"
1428       fi
1429
1430       [[ $verify = true ]]  &&  printf " >>> o.k.\n"
1431    else
1432       cd  $job_catalog
1433       if [[ $(echo $local_host | cut -c1-5) = lcsgi  ||  $(echo $local_host | cut -c1-3) = ibm ]]
1434       then
1435          eval  $submcom  $job_on_remhost
1436       elif [[  $local_host = lcfimm  ||  $local_host = lctit  ||  $localhost = lcxt4  ||  $localhost = lck  || $localhost = lckordi||  $localhost = lcyon ]]
1437       then
1438          chmod  u+x  $job_on_remhost
1439          echo "$submcom  $job_on_remhost"
1440          eval  $submcom  $job_on_remhost
1441       elif [[ $local_host = nech ]]
1442       then
1443          if [[ $queue = default ]]
1444          then
1445             eval  $submcom  $job_on_remhost
1446          else
1447             eval  $submcom  -q $queue  $job_on_remhost
1448          fi
1449       else
1450          qsub  $job_on_remhost
1451       fi
1452
1453          # Jobfile must not be deleted on lctit/ibmku!! This will be done
1454          # only at the end of the job.
1455       if [[ $local_host != lctit  &&  $local_host != ibmku ]]
1456       then
1457          rm  $job_on_remhost
1458       fi
1459       cd  -  > /dev/null
1460    fi
1461 fi
1462
1463
1464
1465    # ABSCHLUSSARBEITEN
1466
1467 if [[ $no_submit = false ]]
1468 then
1469    rm  $job_to_send
1470 fi
1471 [[ $verify = true ]]  &&  printf "\n\n *** SUBJOB finished \n\n"
Note: See TracBrowser for help on using the repository browser.