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