1 | #!/bin/ksh |
---|
2 | |
---|
3 | # subjob - script for automatic generation and submission of batch-job files |
---|
4 | # for various batch queuing systems |
---|
5 | |
---|
6 | #--------------------------------------------------------------------------------# |
---|
7 | # This file is part of PALM. |
---|
8 | # |
---|
9 | # PALM is free software: you can redistribute it and/or modify it under the terms |
---|
10 | # of the GNU General Public License as published by the Free Software Foundation, |
---|
11 | # either version 3 of the License, or (at your option) any later version. |
---|
12 | # |
---|
13 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
14 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
15 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
16 | # |
---|
17 | # You should have received a copy of the GNU General Public License along with |
---|
18 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | # |
---|
20 | # Copyright 1997-2012 Leibniz University Hannover |
---|
21 | #--------------------------------------------------------------------------------# |
---|
22 | # |
---|
23 | # Current revisions: |
---|
24 | # ------------------ |
---|
25 | # |
---|
26 | # |
---|
27 | # Former revisions: |
---|
28 | # ----------------- |
---|
29 | # $Id: subjob 1174 2013-05-31 10:28:08Z raasch $ |
---|
30 | # |
---|
31 | # 1103 2013-02-20 02:15:53Z raasch |
---|
32 | # bash compatibility adjustments (usage of OPTIND, output formatting with printf |
---|
33 | # instead typeset -L/R), |
---|
34 | # further adjustments for lckyuh |
---|
35 | # |
---|
36 | # 2013-02-10 01:47:43Z raasch |
---|
37 | # adjustments for Kyushu-Univeristy computing center (lckyuh - hayaka) |
---|
38 | # and for Forwind cluster (lcflow) |
---|
39 | # |
---|
40 | # 1094 2013-02-03 01:52:12Z raasch |
---|
41 | # new option -P for explicit setting of ssh/scp port, |
---|
42 | # decalpha parts (yonsei) removed |
---|
43 | # |
---|
44 | # 2013-02-02 07:06:13Z raasch |
---|
45 | # adjustments for Kyushu-University computing center (lckyut - tatara) |
---|
46 | # old changelog messages removed |
---|
47 | # |
---|
48 | # 1046 2012-11-09 14:38:45Z maronga |
---|
49 | # code put under GPL (PALM 3.9) |
---|
50 | # |
---|
51 | # 08/07/94 - Siggi - first version finished |
---|
52 | # 29/06/94 - Siggi - script development started |
---|
53 | #--------------------------------------------------------------------------------# |
---|
54 | # subjob - script for automatic generation and submission of batch-job files |
---|
55 | # for various batch queuing systems |
---|
56 | #--------------------------------------------------------------------------------# |
---|
57 | |
---|
58 | |
---|
59 | # VARIABLENVEREINBARUNGEN + DEFAULTWERTE |
---|
60 | delete_dayfile=false |
---|
61 | email_notification=none |
---|
62 | group_number=none |
---|
63 | locat=normal |
---|
64 | no_default_queue=none |
---|
65 | no_submit=false |
---|
66 | job_catalog="~/job_queue" |
---|
67 | job_name=none |
---|
68 | local_user=$LOGNAME |
---|
69 | node_usage=shared |
---|
70 | numprocs=0 |
---|
71 | punkte="..........................................................." |
---|
72 | submcom=qsub |
---|
73 | queue=default |
---|
74 | remote_host=none |
---|
75 | remote_user="" |
---|
76 | verify=true |
---|
77 | |
---|
78 | typeset -i cputime=0 memory=0 Memory=0 minuten resttime sekunden stunden |
---|
79 | typeset -i inumprocs mpi_tasks=0 nodes=0 processes_per_node=0 tasks_per_node=0 threads_per_task=1 |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | # FEHLERBEHANDLUNG |
---|
84 | # BEI EXIT: |
---|
85 | trap 'if [[ $locat != normal ]] |
---|
86 | then |
---|
87 | case $locat in |
---|
88 | (option) printf "\n --> available optios can be displayed" |
---|
89 | printf " by typing:" |
---|
90 | printf "\n \"subjob ?\" \n";; |
---|
91 | (ftpcopy|parameter|scp|verify) printf "\n";; |
---|
92 | (*) printf "\n +++ unknown error" |
---|
93 | printf "\n please inform S. Raasch!\n" |
---|
94 | esac |
---|
95 | [[ -f $job_to_send ]] && rm $job_to_send |
---|
96 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
97 | fi' exit |
---|
98 | |
---|
99 | |
---|
100 | # BEI TERMINAL-BREAK: |
---|
101 | trap '[[ -f $job_to_send ]] && rm $job_to_send |
---|
102 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
103 | exit |
---|
104 | ' 2 |
---|
105 | |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | # LOKALEN HOSTNAMEN FESTSTELLEN |
---|
110 | local_host=$(hostname) |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALER HOST |
---|
115 | # UEBERHAUPT ZULAESSIG IST |
---|
116 | # Note: One of the entries for "lck" or "lckordi" always has to be |
---|
117 | # comment out, because the hostname (node*) is same for both machines |
---|
118 | case $local_host in |
---|
119 | (atmos) local_addres=172.20.25.35; local_host=lcide;; |
---|
120 | (autan) local_addres=130.75.105.57; local_host=lcmuk;; |
---|
121 | (bora) local_addres=130.75.105.103; local_host=lcmuk;; |
---|
122 | (bd1) local_addres=130.73.232.64; local_host=lcsgib;; |
---|
123 | (bd2) local_addres=130.73.232.65; local_host=lcsgib;; |
---|
124 | (bd3) local_addres=130.73.232.66; local_host=lcsgib;; |
---|
125 | (bd4) local_addres=130.73.232.67; local_host=lcsgib;; |
---|
126 | (b01*|bicegate1) local_addres=130.73.232.102; local_host=lcsgib;; |
---|
127 | (b04*) local_addres=133.5.4.33; local_host=lckyuh;; |
---|
128 | (bicegate2) local_addres=130.73.232.103; local_host=lcsgib;; |
---|
129 | (blizzard1) local_addres=136.172.40.15; local_host=ibmh;; |
---|
130 | (breva) local_addres=130.75.105.98; local_host=lcmuk;; |
---|
131 | (buran) local_addres=130.75.105.58; local_host=lcmuk;; |
---|
132 | (caurus) local_addres=130.75.105.19; local_host=lcmuk;; |
---|
133 | (climate*) local_addres=165.132.26.68; local_host=lcyon;; |
---|
134 | (compute-*.local) local_addres=172.20.4.2; local_host=lcfimm;; |
---|
135 | (cs*) local_addres=136.172.44.131; local_host=nech;; |
---|
136 | (elephanta) local_addres=130.75.105.6; local_host=lcmuk;; |
---|
137 | (fimm.bccs.uib.no) local_addres=172.20.4.2; local_host=lcfimm;; |
---|
138 | (flow01) local_addres=10.141.255.71; local_host=lcflow;; |
---|
139 | (flow02) local_addres=10.141.255.72; local_host=lcflow;; |
---|
140 | (node*) local_addres=165.132.26.61 local_host=lck;; |
---|
141 | # (node*) local_addres=210.219.61.8 local_host=lckordi;; |
---|
142 | (gaia*) local_addres=150.183.146.24; local_host=ibmkisti;; |
---|
143 | (gallego) local_addres=130.75.105.10; local_host=lcmuk;; |
---|
144 | (gfdl5) local_addres=165.132.26.58; local_host=ibmy;; |
---|
145 | (gregale) local_addres=130.75.105.109; local_host=lcmuk;; |
---|
146 | (hababai) local_addres=130.75.105.108; local_host=lcmuk;; |
---|
147 | (hayaka*) local_addres=133.5.4.33; local_host=lckyuh;; |
---|
148 | (hexagon.bccs.uib.no) local_addres=129.177.20.113; local_host=lcxe6;; |
---|
149 | (hd1) local_addres=130.75.4.104; local_host=lcsgih;; |
---|
150 | (hd2) local_addres=130.75.4.105; local_host=lcsgih;; |
---|
151 | (hd3) local_addres=130.75.4.106; local_host=lcsgih;; |
---|
152 | (hd4) local_addres=130.75.4.107; local_host=lcsgih;; |
---|
153 | (hicegate0) local_addres=130.75.4.101; local_host=lcsgih;; |
---|
154 | (h01*|hicegate1) local_addres=130.75.4.102; local_host=lcsgih;; |
---|
155 | (hicegate2) local_addres=130.75.4.103; local_host=lcsgih;; |
---|
156 | (hx*) local_addres=133.3.51.11; local_host=lckyoto;; |
---|
157 | (inferno) local_addres=130.75.105.5; local_host=lcmuk;; |
---|
158 | (irifi) local_addres=130.75.105.104; local_host=lcmuk;; |
---|
159 | (sno) local_addres=130.75.105.113; local_host=lcmuk;; |
---|
160 | (levanto) local_addres=130.75.105.45; local_host=lcmuk;; |
---|
161 | (login*) local_addres=118.128.66.223; local_host=lckiaps;; |
---|
162 | (maestro) local_addres=130.75.105.2; local_host=lcmuk;; |
---|
163 | (meller) local_addres=134.106.74.155; local_host=lcfor;; |
---|
164 | (meteo-login*) local_addres=193.166.211.144;local_host=lcxt5m;; |
---|
165 | (hexagon*) local_addres=129.177.20.113; local_host=lcxe6;; |
---|
166 | (nobel*) local_addres=150.183.5.101; local_host=ibms;; |
---|
167 | (orkan) local_addres=130.75.105.3; local_host=lcmuk;; |
---|
168 | (ostria) local_addres=130.75.105.106; local_host=lcmuk;; |
---|
169 | (paesano) local_addres=130.75.105.46; local_host=lcmuk;; |
---|
170 | (pcj*) local_addres=172.31.120.1; local_host=lckyut;; |
---|
171 | (pingui) local_addres=134.106.74.118; local_host=lcfor;; |
---|
172 | (quanero) local_addres=130.75.105.107; local_host=lcmuk;; |
---|
173 | (rte*) local_addres=133.5.185.60; local_host=lcrte;; |
---|
174 | (scirocco) local_addres=172.20.25.41; local_host=lcmuk;; |
---|
175 | (solano) local_addres=130.75.105.110; local_host=lcmuk;; |
---|
176 | (sugoka*) local_addres=172.31.120.1; local_host=lckyut;; |
---|
177 | (sun1|sun2) local_addres=130.75.6.1; local_host=unics;; |
---|
178 | (sx-*) local_addres=172.16.1.131; local_host=necriam;; |
---|
179 | (r1*) local_addres=130.75.4.102; local_host=lcsgih;; |
---|
180 | (r2*) local_addres=130.73.232.102; local_host=lcsgib;; |
---|
181 | (t2a*) local_addres=10.1.6.165; local_host=lctit;; |
---|
182 | (urban*) local_addres=147.46.30.151 local_host=lcsb;; |
---|
183 | (vorias) local_addres=172.20.25.43; local_host=lcmuk;; |
---|
184 | (*.cc.kyushu-u.ac.jp) local_addres=133.5.4.129; local_host=ibmku;; |
---|
185 | (*) printf "\n +++ \"$local_host\" unknown"; |
---|
186 | printf "\n please inform S. Raasch!"; |
---|
187 | locat=parameter; exit;; |
---|
188 | esac |
---|
189 | |
---|
190 | |
---|
191 | |
---|
192 | # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN |
---|
193 | remote_host=$local_host |
---|
194 | |
---|
195 | |
---|
196 | |
---|
197 | |
---|
198 | # PROZEDUROPTIONEN EINLESEN |
---|
199 | while getopts :c:dDe:g:h:m:n:N:O:P:q:t:T:u:vX: option |
---|
200 | do |
---|
201 | case $option in |
---|
202 | (c) job_catalog=$OPTARG;; |
---|
203 | (d) delete_dayfile=true;; |
---|
204 | (D) no_submit=true;; |
---|
205 | (e) email_notification=$OPTARG;; |
---|
206 | (g) group_number=$OPTARG;; |
---|
207 | (h) remote_host=$OPTARG;; |
---|
208 | (m) memory=$OPTARG;; |
---|
209 | (n) job_name=$OPTARG;; |
---|
210 | (N) node_usage=$OPTARG;; |
---|
211 | (O) threads_per_task=$OPTARG;; |
---|
212 | (P) scp_port=$OPTARG;; |
---|
213 | (q) no_default_queue=$OPTARG;; |
---|
214 | (t) cputime=$OPTARG;; |
---|
215 | (T) tasks_per_node=$OPTARG;; |
---|
216 | (u) remote_user=$OPTARG;; |
---|
217 | (v) verify=false;; |
---|
218 | (X) numprocs=$OPTARG;; |
---|
219 | (\?) printf "\n +++ Option $OPTARG unknown \n"; |
---|
220 | locat=option; exit;; |
---|
221 | esac |
---|
222 | done |
---|
223 | |
---|
224 | |
---|
225 | # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN |
---|
226 | (( to_shift = $OPTIND - 1 )) |
---|
227 | shift $to_shift; file_to_send=$1 |
---|
228 | |
---|
229 | |
---|
230 | # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN |
---|
231 | if [ "$1" = "?" ] |
---|
232 | then |
---|
233 | (printf "\n *** subjob can be called as follows:\n" |
---|
234 | printf "\n subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v <jobfile>\n" |
---|
235 | printf "\n Description of available options:\n" |
---|
236 | printf "\n Option Description Default-Value" |
---|
237 | printf "\n -c job-input- and output-catalog ~/job_queue" |
---|
238 | printf "\n -d no job-protocol will be created ---" |
---|
239 | printf "\n -D only the job-file will be created ---" |
---|
240 | printf "\n -h execution host, available hosts: $remote_host" |
---|
241 | printf "\n ibm, ibmh, ibmkisti, ibmku, ibms, ibmy, lc...," |
---|
242 | printf "\n lckiaps, lctit, nech, necriam, unics" |
---|
243 | printf "\n -m memory demand per process in MByte ---" |
---|
244 | printf "\n -n jobname <jobdatei>" |
---|
245 | printf "\n -O threads per task (for OpenMP usage) 1" |
---|
246 | printf "\n -P ssh/scp port default port" |
---|
247 | printf "\n -q job-queue to be used default" |
---|
248 | printf "\n -t allowed cpu-time in seconds ---" |
---|
249 | printf "\n -T tasks per node (on parallel hosts) ---" |
---|
250 | printf "\n -u username on execution host from .netrc" |
---|
251 | printf "\n -v no prompt for confirmation ---" |
---|
252 | printf "\n -X # of processors (on parallel hosts) 1" |
---|
253 | printf "\n " |
---|
254 | printf "\n The only possible positional parameter is <jobfile>:" |
---|
255 | printf "\n The complete NQS-job must be provided here." |
---|
256 | printf "\n <jobfile>=? creates this outline\n\n") | more |
---|
257 | exit |
---|
258 | fi |
---|
259 | |
---|
260 | |
---|
261 | |
---|
262 | # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT |
---|
263 | if [[ "$file_to_send" = "" ]] |
---|
264 | then |
---|
265 | printf "\n +++ job-file missing" |
---|
266 | locat=parameter; exit |
---|
267 | else |
---|
268 | if [[ -f $file_to_send ]] |
---|
269 | then |
---|
270 | true |
---|
271 | else |
---|
272 | printf "\n +++ job-file: " |
---|
273 | printf "\n $file_to_send" |
---|
274 | printf "\n does not exist" |
---|
275 | locat=parameter; exit |
---|
276 | fi |
---|
277 | fi |
---|
278 | |
---|
279 | |
---|
280 | |
---|
281 | # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME |
---|
282 | # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE |
---|
283 | if [[ $job_name = none ]] |
---|
284 | then |
---|
285 | job_name=$file_to_send |
---|
286 | fi |
---|
287 | if [[ $(echo $job_name | grep -c "/") != 0 ]] |
---|
288 | then |
---|
289 | printf "\n +++ job-file name: " |
---|
290 | printf "\n $job_name" |
---|
291 | printf "\n must not contain \"/\"-characters" |
---|
292 | locat=parameter; exit |
---|
293 | fi |
---|
294 | |
---|
295 | |
---|
296 | |
---|
297 | |
---|
298 | # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST |
---|
299 | # ODER WENN HOST NICHT ANGEGEBEN WURDE |
---|
300 | if [[ $remote_host = none ]] |
---|
301 | then |
---|
302 | printf "\n +++ host missing" |
---|
303 | locat=option; exit |
---|
304 | else |
---|
305 | case $remote_host in |
---|
306 | (ibm) queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
307 | (ibmh) queue=no_class; remote_addres=136.172.40.15; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
308 | (ibmkisti) queue=class.32plus; remote_addres=150.183.146.24; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
309 | (ibmku) queue=s4; remote_addres=133.5.4.129; submcom=/usr/local/bin/llsubmit;; |
---|
310 | (ibms) queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
311 | (ibmy) queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
312 | (lcfimm) remote_addres=172.20.4.2; submcom=/opt/torque/bin/qsub;; |
---|
313 | (lcflow) remote_addres=10.140.1.71; submcom=/cm/shared/apps/sge/6.2u5p2/bin/lx26-amd64/qsub;; |
---|
314 | (lckyoto) remote_addres=133.3.51.11; submcom=/thin/local/bin/qsub;; |
---|
315 | (lcsgib) queue=smallq; remote_addres=130.73.232.104; submcom=/opt/moab/bin/msub;; |
---|
316 | (lcsgih) queue=smallq; remote_addres=130.75.4.101; submcom=/opt/moab/bin/msub;; |
---|
317 | (lck) remote_addres=165.132.26.61; submcom=/usr/torque/bin/qsub;; |
---|
318 | (lckiaps) remote_addres=118.128.66.223; submcom=/cm/shared/apps/pbspro/11.0.2.110766/bin/qsub;; |
---|
319 | (lckordi) remote_addres=210.219.61.8; submcom=/usr/torque/bin/qsub;; |
---|
320 | (lckyuh) remote_addres=133.5.4.33; submcom=/usr/bin/pjsub;; |
---|
321 | (lckyut) remote_addres=133.5.4.37; submcom=/usr/bin/pjsub;; |
---|
322 | (lcsb) remote_addres=147.46.30.151; submcom=/usr/torque/bin/qsub;; |
---|
323 | (lctit) queue=S; remote_addres=10.1.6.165; submcom=/opt/pbs/tools/bin/t2sub;; |
---|
324 | (lcxe6) remote_addres=129.177.20.113; submcom=/opt/torque/2.5.10/bin/qsub;; |
---|
325 | (lcxt5m) remote_addres=193.166.211.144; submcom=/opt/pbs/10.1.0.91350/bin/qsub;; |
---|
326 | (lcyon) remote_addres=165.132.26.68; submcom=/usr/torque/bin/qsub;; |
---|
327 | (nech) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";; |
---|
328 | (necriam) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=172.16.1.131; submcom="/usr/bin/nqsII/qsub";; |
---|
329 | (vpp) qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;; |
---|
330 | (unics) qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;; |
---|
331 | (*) printf "\n +++ hostname \"$remote_host\" not allowed"; |
---|
332 | locat=parameter; exit;; |
---|
333 | esac |
---|
334 | fi |
---|
335 | |
---|
336 | |
---|
337 | # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST |
---|
338 | if [[ $no_default_queue != none ]] |
---|
339 | then |
---|
340 | error=false |
---|
341 | ndq=$no_default_queue |
---|
342 | case $remote_host in |
---|
343 | (ibm) case $ndq in |
---|
344 | (p690_express|p690_standard|p690_long) error=false;; |
---|
345 | (*) error=true;; |
---|
346 | esac;; |
---|
347 | (ibmh) case $ndq in |
---|
348 | (no_class) error=false;; |
---|
349 | (*) error=true;; |
---|
350 | esac;; |
---|
351 | (ibmkisti) case $ndq in |
---|
352 | (class.32plus|class.1-2|class.2-32) error=false;; |
---|
353 | (*) error=true;; |
---|
354 | esac;; |
---|
355 | (ibmku) case $ndq in |
---|
356 | (sdbg1|sdbg2|sdbg4|s4|s16|s32|s32-s) error=false;; |
---|
357 | (*) error=true;; |
---|
358 | esac;; |
---|
359 | (ibms) case $ndq in |
---|
360 | (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand) error=false;; |
---|
361 | (*) error=true;; |
---|
362 | esac;; |
---|
363 | (ibmy) case $ndq in |
---|
364 | (parallel) error=false;; |
---|
365 | (*) error=true;; |
---|
366 | esac;; |
---|
367 | (lcflow) case $ndq in |
---|
368 | (cfd_lom_long.q|cfd_him_long.q|cfd_lom_serl.q|cfd_lom_shrt.q|cfd_him_shrt.q) error=false;; |
---|
369 | (*) error=true;; |
---|
370 | esac;; |
---|
371 | (lckiaps) case $ndq in |
---|
372 | (express|normal) error=false;; |
---|
373 | (*) error=true;; |
---|
374 | esac;; |
---|
375 | (lckyoto) case $ndq in |
---|
376 | (eh|ph) error=false;; |
---|
377 | (*) error=true;; |
---|
378 | esac;; |
---|
379 | (lckyuh) case $ndq in |
---|
380 | (fx-dbg|fx-single|fx-small|fx-middle|fx-large) error=false;; |
---|
381 | (*) error=true;; |
---|
382 | esac;; |
---|
383 | (lckyut) case $ndq in |
---|
384 | (cx-dbg|cx-single|cx-small|cx-middle|cx-large) error=false;; |
---|
385 | (*) error=true;; |
---|
386 | esac;; |
---|
387 | (lcsgib|lcsgih) case $ndq in |
---|
388 | (testq|serialq|smallq|mediumq|bigq|workq|dataq|permq|special1q) error=false;; |
---|
389 | (*) error=true;; |
---|
390 | esac;; |
---|
391 | (lctit) case $ndq in |
---|
392 | (G|L128|L256|L512H|S|S96|V) error=false;; |
---|
393 | (*) error=true;; |
---|
394 | esac;; |
---|
395 | (t3eb) case $ndq in |
---|
396 | (berte|p50|p100|p392|forfree|p25himem) error=false;; |
---|
397 | (*) error=true;; |
---|
398 | esac;; |
---|
399 | (necriam) case $ndq in |
---|
400 | (SP|SS|P6) error=false;; |
---|
401 | (*) error=true;; |
---|
402 | esac;; |
---|
403 | (t3eh) case $ndq in |
---|
404 | (para_t3e|em|k|l|lm|comp_t3e|c|p|ht) error=false;; |
---|
405 | (*) error=true;; |
---|
406 | esac;; |
---|
407 | (t3ej2|t3ej5) case $ndq in |
---|
408 | (low|normal|high) error=false;; |
---|
409 | (*) error=true;; |
---|
410 | esac;; |
---|
411 | (t3es) case $ndq in |
---|
412 | (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128) error=false;; |
---|
413 | (*) error=true;; |
---|
414 | esac;; |
---|
415 | (unics) case $ndq in |
---|
416 | (unics|ht) error=false;; |
---|
417 | (*) error=true;; |
---|
418 | esac;; |
---|
419 | esac |
---|
420 | if [[ $error = true ]] |
---|
421 | then |
---|
422 | printf "\n +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed" |
---|
423 | locat=parameter; exit |
---|
424 | else |
---|
425 | queue=$no_default_queue |
---|
426 | fi |
---|
427 | fi |
---|
428 | |
---|
429 | |
---|
430 | |
---|
431 | # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN |
---|
432 | # AUFTEILEN |
---|
433 | done=false |
---|
434 | while [[ $done = false ]] |
---|
435 | do |
---|
436 | if (( $cputime <= 0 )) |
---|
437 | then |
---|
438 | printf "\n +++ wrong cpu-time or cpu-time missing" |
---|
439 | printf "\n >>> Please type cpu-time in seconds as INTEGER:" |
---|
440 | printf "\n >>> " |
---|
441 | read cputime 1>/dev/null 2>&1 |
---|
442 | else |
---|
443 | done=true |
---|
444 | fi |
---|
445 | done |
---|
446 | if [[ $remote_host = nech ]] |
---|
447 | then |
---|
448 | if (( tasks_per_node != 0 )) |
---|
449 | then |
---|
450 | (( cputime = cputime * tasks_per_node )) |
---|
451 | elif [[ $numprocs != 0 ]] |
---|
452 | then |
---|
453 | (( cputime = cputime * numprocs )) |
---|
454 | fi |
---|
455 | fi |
---|
456 | (( stunden = cputime / 3600 )) |
---|
457 | (( resttime = cputime - stunden * 3600 )) |
---|
458 | (( minuten = resttime / 60 )) |
---|
459 | (( sekunden = resttime - minuten * 60 )) |
---|
460 | timestring=${stunden}:${minuten}:${sekunden} |
---|
461 | |
---|
462 | |
---|
463 | |
---|
464 | # PRUEFEN DER KERNSPEICHERANFORDERUNG |
---|
465 | done=false |
---|
466 | while [[ $done = false ]] |
---|
467 | do |
---|
468 | if (( memory <= 0 )) |
---|
469 | then |
---|
470 | printf "\n +++ wrong memory demand or memory demand missing" |
---|
471 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
472 | printf "\n >>> " |
---|
473 | read memory 1>/dev/null 2>&1 |
---|
474 | else |
---|
475 | done=true |
---|
476 | fi |
---|
477 | done |
---|
478 | |
---|
479 | if [[ $remote_host = nech || $remote_host = necriam ]] |
---|
480 | then |
---|
481 | if (( tasks_per_node != 0 )) |
---|
482 | then |
---|
483 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
484 | elif [[ $numprocs != 0 ]] |
---|
485 | then |
---|
486 | (( Memory = memory * numprocs / 1000 )) |
---|
487 | else |
---|
488 | (( Memory = memory / 1000 )) |
---|
489 | fi |
---|
490 | elif [[ $remote_host = lctit ]] |
---|
491 | then |
---|
492 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
493 | fi |
---|
494 | |
---|
495 | |
---|
496 | # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG |
---|
497 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
498 | then |
---|
499 | (( memory = memory * threads_per_task )) |
---|
500 | fi |
---|
501 | |
---|
502 | |
---|
503 | # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN |
---|
504 | if (( tasks_per_node != 0 )) |
---|
505 | then |
---|
506 | (( nodes = numprocs / ( tasks_per_node * threads_per_task ) )) |
---|
507 | fi |
---|
508 | |
---|
509 | |
---|
510 | # Calculate number of processes per node |
---|
511 | (( processes_per_node = tasks_per_node * threads_per_task )) |
---|
512 | |
---|
513 | |
---|
514 | # Calculate number of MPI tasks |
---|
515 | (( mpi_tasks = numprocs / threads_per_task )) |
---|
516 | |
---|
517 | |
---|
518 | # Set port number option for calls of ssh/scp, subjob and batch_scp scripts |
---|
519 | if [[ "$scp_port" != "" ]] |
---|
520 | then |
---|
521 | PORTOPT="-P $scp_port" |
---|
522 | SSH_PORTOPT="-p $scp_port" |
---|
523 | fi |
---|
524 | |
---|
525 | |
---|
526 | # HEADER-AUSGABE |
---|
527 | if [[ $verify = true ]] |
---|
528 | then |
---|
529 | printf "\n\n" |
---|
530 | printf "#--------------------------------------------------------------# \n" |
---|
531 | spalte1=SUBJOB;spalte2=$(date) |
---|
532 | printf "| %-20s%40s | \n" "$spalte1" "$spalte2" |
---|
533 | printf "| | \n" |
---|
534 | printf "| values of parameters/options: | \n" |
---|
535 | spalte1=$(echo local_host$punkte | cut -c-20) |
---|
536 | spalte2=$punkte$local_host |
---|
537 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
538 | spalte1=$(echo remote_host$punkte | cut -c-20) |
---|
539 | spalte2=$punkte$remote_host |
---|
540 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
541 | spalte1=$(echo queue$punkte | cut -c-20) |
---|
542 | spalte2=$punkte$queue |
---|
543 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
544 | spalte1=$(echo memory$punkte | cut -c-20) |
---|
545 | spalte2="$punkte$memory mb" |
---|
546 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
547 | spalte1=$(echo cputime$punkte | cut -c-20) |
---|
548 | spalte2="$punkte$cputime sec" |
---|
549 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
550 | spalte1=$(echo job_name$punkte | cut -c-20) |
---|
551 | spalte2="$punkte$job_name" |
---|
552 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
553 | printf "#--------------------------------------------------------------# \n\n" |
---|
554 | |
---|
555 | |
---|
556 | # KONTROLLABFRAGE, OB ALLES O.K. |
---|
557 | antwort="dummy" |
---|
558 | while [[ $antwort != y && $antwort != Y && $antwort != n && $antwort != N ]] |
---|
559 | do |
---|
560 | read antwort?" >>> continue (y/n) ? " |
---|
561 | done |
---|
562 | if [[ $antwort = n || $antwort = N ]] |
---|
563 | then |
---|
564 | locat=verify; exit |
---|
565 | fi |
---|
566 | printf "\n" |
---|
567 | fi |
---|
568 | |
---|
569 | |
---|
570 | |
---|
571 | # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN |
---|
572 | kennung=$RANDOM |
---|
573 | job_on_remhost=${job_name}_${kennung}_$local_host |
---|
574 | job_to_send=job_to_send_$kennung |
---|
575 | if [[ $delete_dayfile = false ]] |
---|
576 | then |
---|
577 | remote_dayfile=${local_host}_${job_name}_result_$kennung |
---|
578 | local_dayfile=${remote_host}_${job_name} |
---|
579 | else |
---|
580 | remote_dayfile=/dev/null |
---|
581 | fi |
---|
582 | |
---|
583 | |
---|
584 | |
---|
585 | # Generate the batch job scripts (qsub/msub/LoadLeveler) |
---|
586 | if [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs != 0 ]] |
---|
587 | then |
---|
588 | |
---|
589 | # General LoadLeveler settings |
---|
590 | execute_in_shell="#!/bin/ksh" |
---|
591 | use_shell="# @ shell = /bin/ksh" |
---|
592 | consumable_memory="ConsumableMemory($memory mb)" |
---|
593 | class="# @ class = $queue" |
---|
594 | environment="# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes" |
---|
595 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
596 | data_limit="# @ data_limit = 1.76gb" |
---|
597 | image_size="# @ image_size = 50" |
---|
598 | wall_clock_limit="# @ wall_clock_limit = ${timestring},$timestring" |
---|
599 | |
---|
600 | if [[ $email_notification = none ]] |
---|
601 | then |
---|
602 | notify_user="" |
---|
603 | else |
---|
604 | notify_user="# @ notify_user = $email_notification" |
---|
605 | if [[ $delete_dayfile = true ]] |
---|
606 | then |
---|
607 | notification='# @ notification = never' |
---|
608 | fi |
---|
609 | fi |
---|
610 | |
---|
611 | if [[ $remote_host = ibmh ]] |
---|
612 | then |
---|
613 | data_limit="" |
---|
614 | network_to_use="" |
---|
615 | class="" |
---|
616 | environment="" |
---|
617 | rset="# @ rset = RSET_MCM_AFFINITY" |
---|
618 | task_affinity="# @ task_affinity = core(1)" |
---|
619 | elif [[ $remote_host = ibmkisti ]] |
---|
620 | then |
---|
621 | network_to_use="# @ network.MPI = sn_all,shared,US" |
---|
622 | wall_clock_limit="# @ wall_clock_limit = $timestring" |
---|
623 | if [[ $threads_per_task = 1 ]] |
---|
624 | then |
---|
625 | rset="# @ rset = RSET_MCM_AFFINITY" |
---|
626 | mcm_affinity_options="# @ mcm_affinity_options = mcm_mem_pref mcm_sni_none mcm_distribute" |
---|
627 | fi |
---|
628 | environment="" |
---|
629 | use_shell="" |
---|
630 | data_limit="" |
---|
631 | image_size="" |
---|
632 | elif [[ $remote_host = ibmku ]] |
---|
633 | then |
---|
634 | execute_in_shell="#!/usr/bin/ksh" |
---|
635 | use_shell="# @ shell = /usr/bin/ksh" |
---|
636 | consumable_memory="" |
---|
637 | environment="" |
---|
638 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
639 | data_limit="" |
---|
640 | image_size="" |
---|
641 | elif [[ $remote_host = ibms ]] |
---|
642 | then |
---|
643 | network_to_use="# @ network.mpi = csss,shared,us" |
---|
644 | elif [[ $remote_host = ibmy ]] |
---|
645 | then |
---|
646 | consumable_memory="" |
---|
647 | network_to_use="" |
---|
648 | fi |
---|
649 | |
---|
650 | cat > $job_to_send << %%END%% |
---|
651 | $execute_in_shell |
---|
652 | $use_shell |
---|
653 | |
---|
654 | # @ job_type = parallel |
---|
655 | # @ job_name = $job_name |
---|
656 | # @ resources = ConsumableCpus($threads_per_task) $consumable_memory |
---|
657 | # @ output = $remote_dayfile |
---|
658 | # @ error = $remote_dayfile |
---|
659 | $wall_clock_limit |
---|
660 | $image_size |
---|
661 | $class |
---|
662 | $environment |
---|
663 | $network_to_use |
---|
664 | $data_limit |
---|
665 | $rset |
---|
666 | $mcm_affinity_options |
---|
667 | $task_affinity |
---|
668 | $notification |
---|
669 | $notify_user |
---|
670 | |
---|
671 | %%END%% |
---|
672 | |
---|
673 | if (( nodes > 0 )) |
---|
674 | then |
---|
675 | |
---|
676 | if [[ $remote_host != ibmkisti ]] |
---|
677 | then |
---|
678 | |
---|
679 | cat >> $job_to_send << %%END%% |
---|
680 | # @ node = $nodes |
---|
681 | # @ tasks_per_node = $processes_per_node |
---|
682 | # @ node_usage = $node_usage |
---|
683 | # @ queue |
---|
684 | |
---|
685 | %%END%% |
---|
686 | |
---|
687 | else |
---|
688 | |
---|
689 | cat >> $job_to_send << %%END%% |
---|
690 | # @ total_tasks = $mpi_tasks |
---|
691 | # @ blocking = unlimited |
---|
692 | # @ queue |
---|
693 | |
---|
694 | %%END%% |
---|
695 | |
---|
696 | fi |
---|
697 | |
---|
698 | else |
---|
699 | |
---|
700 | if [[ $remote_host != ibmy ]] |
---|
701 | then |
---|
702 | |
---|
703 | cat >> $job_to_send << %%END%% |
---|
704 | # @ blocking = unlimited |
---|
705 | # @ total_tasks = $numprocs |
---|
706 | # @ node_usage = $node_usage |
---|
707 | # @ queue |
---|
708 | |
---|
709 | %%END%% |
---|
710 | |
---|
711 | else |
---|
712 | |
---|
713 | cat >> $job_to_send << %%END%% |
---|
714 | # @ node = 1 |
---|
715 | # @ total_tasks = $numprocs |
---|
716 | # @ queue |
---|
717 | |
---|
718 | %%END%% |
---|
719 | |
---|
720 | fi |
---|
721 | |
---|
722 | fi |
---|
723 | |
---|
724 | # workaround because of silly job filter on ibmkisti |
---|
725 | if [[ $remote_host = ibmkisti && $threads_per_task != 1 ]] |
---|
726 | then |
---|
727 | echo "export OMP_NUM_THREADS=$threads_per_task" >> $job_to_send |
---|
728 | fi |
---|
729 | |
---|
730 | elif [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs = 0 ]] |
---|
731 | then |
---|
732 | |
---|
733 | cat > $job_to_send << %%END%% |
---|
734 | #!/bin/ksh |
---|
735 | |
---|
736 | # @ job_type = serial |
---|
737 | # @ node_usage = $node_usage |
---|
738 | # @ job_name = palm |
---|
739 | # @ wall_clock_limit = ${timestring},$timestring |
---|
740 | # @ resources = ConsumableCpus(1) ConsumableMemory(1 gb) |
---|
741 | # @ output = $remote_dayfile |
---|
742 | # @ error = $remote_dayfile |
---|
743 | $class |
---|
744 | $notification |
---|
745 | |
---|
746 | # @ queue |
---|
747 | |
---|
748 | %%END%% |
---|
749 | |
---|
750 | elif [[ $remote_host = lcfimm ]] |
---|
751 | then |
---|
752 | |
---|
753 | if [[ $numprocs != 0 ]] |
---|
754 | then |
---|
755 | cat > $job_to_send << %%END%% |
---|
756 | #!/bin/ksh |
---|
757 | #PBS -N $job_name |
---|
758 | #PBS -A $project_account |
---|
759 | #PBS -l walltime=$timestring |
---|
760 | #PBS -l nodes=${nodes}:ppn=$processes_per_node |
---|
761 | #PBS -l pmem=${memory}mb |
---|
762 | #PBS -m abe |
---|
763 | #PBS -o $remote_dayfile |
---|
764 | #PBS -j oe |
---|
765 | mpd & |
---|
766 | |
---|
767 | %%END%% |
---|
768 | |
---|
769 | else |
---|
770 | cat > $job_to_send << %%END%% |
---|
771 | #!/bin/ksh |
---|
772 | #PBS -N $job_name |
---|
773 | #PBS -A $project_account |
---|
774 | #PBS -l walltime=$timestring |
---|
775 | #PBS -l ncpus=1 |
---|
776 | #PBS -l pmem=${memory}mb |
---|
777 | #PBS -m abe |
---|
778 | #PBS -o $remote_dayfile |
---|
779 | #PBS -j oe |
---|
780 | |
---|
781 | %%END%% |
---|
782 | |
---|
783 | fi |
---|
784 | |
---|
785 | elif [[ $remote_host = lcflow ]] |
---|
786 | then |
---|
787 | if [ $memory -gt 1900 ]; then |
---|
788 | use_himem="" |
---|
789 | else |
---|
790 | use_himem="#" |
---|
791 | fi |
---|
792 | if [[ $numprocs != 0 ]] |
---|
793 | then |
---|
794 | pe_set="#$ -pe impi $numprocs" |
---|
795 | else |
---|
796 | pe_set="#$ -pe impi 1" |
---|
797 | fi |
---|
798 | if [[ $queue = default ]] |
---|
799 | then |
---|
800 | queue_set="" |
---|
801 | else |
---|
802 | queue_set="#$ -q $queue" |
---|
803 | fi |
---|
804 | [[ "$disc_space" = "" ]] && disc_space=50 |
---|
805 | |
---|
806 | cat > $job_to_send << %%END%% |
---|
807 | #!/bin/bash |
---|
808 | #$ -S /bin/bash |
---|
809 | #$ -N $job_name |
---|
810 | #$ -cwd |
---|
811 | #$ -l h_rt=$timestring |
---|
812 | #$ -l h_vmem=${memory}M |
---|
813 | #$ -o $remote_dayfile |
---|
814 | #$ -j y |
---|
815 | $pe_set |
---|
816 | #$ -R y |
---|
817 | ${use_himem}#$ -l highmem=true |
---|
818 | #$ -l h_fsize=${disc_space}G |
---|
819 | $queue_set |
---|
820 | |
---|
821 | %%END%% |
---|
822 | |
---|
823 | elif [[ $remote_host = lck || $remote_host = lckordi || $remote_host = lcsb ]] |
---|
824 | then |
---|
825 | |
---|
826 | if [[ $numprocs != 0 ]] |
---|
827 | then |
---|
828 | cat > $job_to_send << %%END%% |
---|
829 | #!/bin/ksh |
---|
830 | #PBS -N $job_name |
---|
831 | #PBS -l walltime=$timestring |
---|
832 | #PBS -l ncpus=$numprocs |
---|
833 | #PBS -l pmem=${memory}mb |
---|
834 | #PBS -o $remote_dayfile |
---|
835 | #PBS -l nodes=$nodes:ppn=${processes_per_node} |
---|
836 | #PBS -j oe |
---|
837 | |
---|
838 | mpd & |
---|
839 | |
---|
840 | %%END%% |
---|
841 | |
---|
842 | else |
---|
843 | cat > $job_to_send << %%END%% |
---|
844 | #!/bin/ksh |
---|
845 | #PBS -N $job_name |
---|
846 | #PBS -l walltime=$timestring |
---|
847 | #PBS -l ncpus=1 |
---|
848 | #PBS -l pmem=${memory}mb |
---|
849 | #PBS -o $remote_dayfile |
---|
850 | #PBS -j oe |
---|
851 | |
---|
852 | %%END%% |
---|
853 | |
---|
854 | fi |
---|
855 | |
---|
856 | elif [[ $remote_host = lckiaps ]] |
---|
857 | then |
---|
858 | |
---|
859 | if [[ $numprocs != 0 ]] |
---|
860 | then |
---|
861 | cat > $job_to_send << %%END%% |
---|
862 | #!/bin/ksh |
---|
863 | #PBS -N $job_name |
---|
864 | #PBS -l walltime=$timestring |
---|
865 | #PBS -l select=1:ncpus=$numprocs |
---|
866 | #PBS -l pmem=${memory}mb |
---|
867 | #PBS -q $queue |
---|
868 | #PBS -o $remote_dayfile |
---|
869 | #PBS -j oe |
---|
870 | #PBS -V |
---|
871 | |
---|
872 | %%END%% |
---|
873 | |
---|
874 | else |
---|
875 | cat > $job_to_send << %%END%% |
---|
876 | #!/bin/ksh |
---|
877 | #PBS -N $job_name |
---|
878 | #PBS -l walltime=$timestring |
---|
879 | #PBS -l ncpus=1 |
---|
880 | #PBS -l pmem=${memory}mb |
---|
881 | #PBS -o $remote_dayfile |
---|
882 | #PBS -j oe |
---|
883 | |
---|
884 | %%END%% |
---|
885 | |
---|
886 | fi |
---|
887 | |
---|
888 | elif [[ $remote_host = lcyon ]] |
---|
889 | then |
---|
890 | |
---|
891 | if [[ $numprocs != 0 ]] |
---|
892 | then |
---|
893 | cat > $job_to_send << %%END%% |
---|
894 | #!/bin/ksh |
---|
895 | #PBS -N $job_name |
---|
896 | #PBS -l walltime=$timestring |
---|
897 | #PBS -l ncpus=$numprocs |
---|
898 | #PBS -l pmem=${memory}mb |
---|
899 | #PBS -o $remote_dayfile |
---|
900 | #PBS -j oe |
---|
901 | |
---|
902 | %%END%% |
---|
903 | |
---|
904 | else |
---|
905 | cat > $job_to_send << %%END%% |
---|
906 | #!/bin/ksh |
---|
907 | #PBS -N $job_name |
---|
908 | #PBS -l walltime=$timestring |
---|
909 | #PBS -l ncpus=1 |
---|
910 | #PBS -l pmem=${memory}mb |
---|
911 | #PBS -o $remote_dayfile |
---|
912 | #PBS -j oe |
---|
913 | |
---|
914 | %%END%% |
---|
915 | |
---|
916 | fi |
---|
917 | |
---|
918 | elif [[ $remote_host = lcsgih || $remote_host = lcsgib ]] |
---|
919 | then |
---|
920 | |
---|
921 | if [[ "$sgi_feature" != "" ]] |
---|
922 | then |
---|
923 | feature_directive="#PBS -l feature=$sgi_feature" |
---|
924 | else |
---|
925 | feature_directive="" |
---|
926 | fi |
---|
927 | |
---|
928 | if [[ $queue = dataq || $queue = permq ]] |
---|
929 | then |
---|
930 | feature_directive="#PBS -l feature=data" |
---|
931 | fi |
---|
932 | |
---|
933 | if [[ $queue = testq || $queue = mediumq || $queue = bigq || $queue = workq || $queue = dataq || $queue = permq || $queue = serialq || $queue = special1q ]] |
---|
934 | then |
---|
935 | queue_directive="#PBS -q $queue" |
---|
936 | else |
---|
937 | queue_directive="" |
---|
938 | fi |
---|
939 | |
---|
940 | if [[ $email_notification = none ]] |
---|
941 | then |
---|
942 | email_directive="" |
---|
943 | else |
---|
944 | email_directive="#PBS -M $email_notification" |
---|
945 | fi |
---|
946 | |
---|
947 | if [[ $numprocs != 0 ]] |
---|
948 | then |
---|
949 | cat > $job_to_send << %%END%% |
---|
950 | #!/bin/bash |
---|
951 | #PBS -N $job_name |
---|
952 | #PBS -l walltime=$timestring |
---|
953 | #PBS -l nodes=$nodes:ppn=${processes_per_node} |
---|
954 | #PBS -l naccesspolicy=$node_usage |
---|
955 | #PBS -o $remote_dayfile |
---|
956 | #PBS -j oe |
---|
957 | $feature_directive |
---|
958 | $queue_directive |
---|
959 | $email_directive |
---|
960 | |
---|
961 | eval \`/sw/swdist/bin/modulesinit\` |
---|
962 | #. /usr/share/modules/init/bash |
---|
963 | $init_cmds |
---|
964 | $module_calls |
---|
965 | |
---|
966 | echo ld_library_path=\$LD_LIBRARY_PATH |
---|
967 | |
---|
968 | %%END%% |
---|
969 | |
---|
970 | else |
---|
971 | cat > $job_to_send << %%END%% |
---|
972 | #PBS -S /bin/bash |
---|
973 | #PBS -N $job_name |
---|
974 | #PBS -l walltime=$timestring |
---|
975 | #PBS -l ncpus=1 |
---|
976 | #PBS -o $remote_dayfile |
---|
977 | #PBS -j oe |
---|
978 | $queue_directive |
---|
979 | $email_directive |
---|
980 | |
---|
981 | eval \`/sw/swdist/bin/modulesinit\` |
---|
982 | #. /usr/share/modules/init/bash |
---|
983 | $init_cmds |
---|
984 | $module_calls |
---|
985 | |
---|
986 | %%END%% |
---|
987 | |
---|
988 | fi |
---|
989 | |
---|
990 | elif [[ $remote_host = lcxe6 ]] |
---|
991 | then |
---|
992 | |
---|
993 | if [[ $numprocs != 0 ]] |
---|
994 | then |
---|
995 | cat > $job_to_send << %%END%% |
---|
996 | #!/bin/ksh |
---|
997 | #PBS -S /bin/ksh |
---|
998 | #PBS -N $job_name |
---|
999 | #PBS -A $project_account |
---|
1000 | #PBS -j oe |
---|
1001 | #PBS -l walltime=$timestring |
---|
1002 | #PBS -l mppwidth=${numprocs} |
---|
1003 | #PBS -l mppnppn=${processes_per_node} |
---|
1004 | #PBS -m abe |
---|
1005 | #PBS -o $remote_dayfile |
---|
1006 | $email_directive |
---|
1007 | |
---|
1008 | $init_cmds |
---|
1009 | $module_calls |
---|
1010 | |
---|
1011 | %%END%% |
---|
1012 | |
---|
1013 | else |
---|
1014 | cat > $job_to_send << %%END%% |
---|
1015 | #!/bin/ksh |
---|
1016 | #PBS -S /bin/ksh |
---|
1017 | #PBS -N $job_name |
---|
1018 | #PBS -A $project_account |
---|
1019 | #PBS -j oe |
---|
1020 | #PBS -l walltime=$timestring |
---|
1021 | #PBS -l ncpus=1 |
---|
1022 | #PBS -l pmem=${memory}mb |
---|
1023 | #PBS -m abe |
---|
1024 | $email_directive |
---|
1025 | #PBS -o $remote_dayfile |
---|
1026 | |
---|
1027 | $init_cmds |
---|
1028 | $module_calls |
---|
1029 | |
---|
1030 | %%END%% |
---|
1031 | |
---|
1032 | fi |
---|
1033 | |
---|
1034 | elif [[ $remote_host = lckyoto ]] |
---|
1035 | then |
---|
1036 | |
---|
1037 | cat > $job_to_send << %%END%% |
---|
1038 | #!/bin/ksh |
---|
1039 | # @\$-o $remote_dayfile |
---|
1040 | # @\$-eo -oi |
---|
1041 | # @\$-lP 16 |
---|
1042 | # @\$-lp 1 |
---|
1043 | # @\$-lm 28gb -llm unlimited -ls unlimited |
---|
1044 | # @\$-q $queue |
---|
1045 | # @\$-Pvn abs_pack |
---|
1046 | ##for intel? @\$-Pvn abs_unpack -Pvs unpack -Pvc unpack |
---|
1047 | #. /thin/local/etc/setprofile/intel-11.0.sh |
---|
1048 | #. /thin/local/etc/setprofile/mvapich2-1.4+intel-11.0.sh |
---|
1049 | . ~/.myprofile |
---|
1050 | #. /home2/t/t51254/palm/current_version/myprofile |
---|
1051 | #. /thin/apps/pgi/mpi.sh |
---|
1052 | # |
---|
1053 | env |
---|
1054 | # |
---|
1055 | set -x |
---|
1056 | |
---|
1057 | %%END%% |
---|
1058 | |
---|
1059 | elif [[ $remote_host = lcxt5m ]] |
---|
1060 | then |
---|
1061 | |
---|
1062 | if [[ $numprocs != 0 ]] |
---|
1063 | then |
---|
1064 | cat > $job_to_send << %%END%% |
---|
1065 | #!/bin/ksh |
---|
1066 | #PBS -S /bin/ksh |
---|
1067 | #PBS -N $job_name |
---|
1068 | #PBS -j oe |
---|
1069 | #PBS -l walltime=$timestring |
---|
1070 | #PBS -l mppwidth=${numprocs} |
---|
1071 | #PBS -l mppnppn=${processes_per_node} |
---|
1072 | #PBS -m abe |
---|
1073 | #PBS -o $remote_dayfile |
---|
1074 | |
---|
1075 | $init_cmds |
---|
1076 | $module_calls |
---|
1077 | |
---|
1078 | %%END%% |
---|
1079 | |
---|
1080 | else |
---|
1081 | cat > $job_to_send << %%END%% |
---|
1082 | #!/bin/ksh |
---|
1083 | #PBS -S /bin/ksh |
---|
1084 | #PBS -N $job_name |
---|
1085 | #PBS -j oe |
---|
1086 | #PBS -l walltime=$timestring |
---|
1087 | #PBS -l ncpus=1 |
---|
1088 | #PBS -l pmem=${memory}mb |
---|
1089 | #PBS -m abe |
---|
1090 | #PBS -o $remote_dayfile |
---|
1091 | |
---|
1092 | $init_cmds |
---|
1093 | $module_calls |
---|
1094 | |
---|
1095 | %%END%% |
---|
1096 | |
---|
1097 | fi |
---|
1098 | |
---|
1099 | elif [[ $remote_host = lckyuh ]] |
---|
1100 | then |
---|
1101 | cat > $job_to_send << %%END%% |
---|
1102 | #!/bin/bash |
---|
1103 | #PJM -L "rscgrp=$queue" |
---|
1104 | #PJM -L "node=$nodes" |
---|
1105 | #PJM --mpi "proc=$numprocs" |
---|
1106 | #PJM -L "elapse=$timestring" |
---|
1107 | #PJM -o $remote_dayfile |
---|
1108 | #PJM -j |
---|
1109 | #PJM -X |
---|
1110 | #PJM --no-stging |
---|
1111 | |
---|
1112 | export LANG=en_US.UTF-8 |
---|
1113 | %%END%% |
---|
1114 | |
---|
1115 | elif [[ $remote_host = lckyut ]] |
---|
1116 | then |
---|
1117 | cat > $job_to_send << %%END%% |
---|
1118 | #!/bin/bash |
---|
1119 | #PJM -L "rscgrp=$queue" |
---|
1120 | #PJM -L "vnode=$numprocs" |
---|
1121 | #PJM -L "vnode-core=1" |
---|
1122 | #PJM -L "elapse=$timestring" |
---|
1123 | #PJM --mpi proc=$numprocs |
---|
1124 | #PJM -o $remote_dayfile |
---|
1125 | #PJM -j |
---|
1126 | #PJM -X |
---|
1127 | #PJM --no-stging |
---|
1128 | |
---|
1129 | export LANG=en_US.UTF-8 |
---|
1130 | %%END%% |
---|
1131 | |
---|
1132 | elif [[ $remote_host = nech ]] |
---|
1133 | then |
---|
1134 | |
---|
1135 | if (( nodes > 1 )) |
---|
1136 | then |
---|
1137 | cat > $job_to_send << %%END%% |
---|
1138 | #!/bin/ksh |
---|
1139 | #PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime |
---|
1140 | #PBS -l ${qsubmem}=${Memory}gb |
---|
1141 | #PBS -b $nodes |
---|
1142 | #PBS -o $remote_dayfile |
---|
1143 | #PBS -N palm |
---|
1144 | #PBS -j o |
---|
1145 | #PBS -T mpisx |
---|
1146 | |
---|
1147 | %%END%% |
---|
1148 | |
---|
1149 | elif [[ $numprocs != 0 ]] |
---|
1150 | then |
---|
1151 | cat > $job_to_send << %%END%% |
---|
1152 | #!/bin/ksh |
---|
1153 | #PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime |
---|
1154 | #PBS -l ${qsubmem}=${Memory}gb |
---|
1155 | #PBS -o $remote_dayfile |
---|
1156 | #PBS -N palm |
---|
1157 | #PBS -j o |
---|
1158 | |
---|
1159 | %%END%% |
---|
1160 | |
---|
1161 | else |
---|
1162 | cat > $job_to_send << %%END%% |
---|
1163 | #!/bin/ksh |
---|
1164 | #PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime |
---|
1165 | #PBS -o $remote_dayfile |
---|
1166 | #PBS -j o |
---|
1167 | |
---|
1168 | %%END%% |
---|
1169 | |
---|
1170 | fi |
---|
1171 | |
---|
1172 | elif [[ $remote_host = necriam ]] |
---|
1173 | then |
---|
1174 | |
---|
1175 | if (( nodes > 1 )) |
---|
1176 | then |
---|
1177 | cat > $job_to_send << %%END%% |
---|
1178 | #!/bin/ksh |
---|
1179 | #PBS -b $nodes |
---|
1180 | #PBS -o $remote_dayfile |
---|
1181 | #PBS -N $job_name |
---|
1182 | #PBS -j o |
---|
1183 | #PBS -v MPIPROGINV=YES |
---|
1184 | |
---|
1185 | %%END%% |
---|
1186 | |
---|
1187 | elif [[ $numprocs != 0 ]] |
---|
1188 | then |
---|
1189 | cat > $job_to_send << %%END%% |
---|
1190 | #!/bin/ksh |
---|
1191 | #PBS -q ${queue} |
---|
1192 | #PBS -o $remote_dayfile |
---|
1193 | #PBS -N $job_name |
---|
1194 | #PBS -j o |
---|
1195 | #PBS -v MPIPROGINV=YES |
---|
1196 | |
---|
1197 | %%END%% |
---|
1198 | |
---|
1199 | else |
---|
1200 | cat > $job_to_send << %%END%% |
---|
1201 | #!/bin/ksh |
---|
1202 | #PBS -o $remote_dayfile |
---|
1203 | #PBS -j o |
---|
1204 | |
---|
1205 | %%END%% |
---|
1206 | |
---|
1207 | fi |
---|
1208 | |
---|
1209 | elif [[ $remote_host = lctit ]] |
---|
1210 | then |
---|
1211 | cat > $job_to_send << %%END%% |
---|
1212 | #!/bin/ksh |
---|
1213 | $init_cmds |
---|
1214 | $module_calls |
---|
1215 | |
---|
1216 | %%END%% |
---|
1217 | |
---|
1218 | # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN |
---|
1219 | if [[ $tasks_per_node != $processes_per_node ]] |
---|
1220 | then |
---|
1221 | 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 " |
---|
1222 | else |
---|
1223 | 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 " |
---|
1224 | fi |
---|
1225 | |
---|
1226 | else |
---|
1227 | |
---|
1228 | cat > $job_to_send << %%END%% |
---|
1229 | # @\$-q ${queue} |
---|
1230 | # @\$-l${qsubtime} $timestring |
---|
1231 | # @\$-l${qsubmem} ${memory}mb |
---|
1232 | # @\$-o $remote_dayfile |
---|
1233 | # @\$-eo |
---|
1234 | |
---|
1235 | %%END%% |
---|
1236 | |
---|
1237 | fi |
---|
1238 | |
---|
1239 | |
---|
1240 | # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP |
---|
1241 | # BEI EXIT VERANLASSEN |
---|
1242 | # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT |
---|
1243 | # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH |
---|
1244 | if [[ $delete_dayfile = false && $remote_host != $local_host ]] |
---|
1245 | then |
---|
1246 | echo "set +vx" >> $job_to_send |
---|
1247 | echo "trap '" >> $job_to_send |
---|
1248 | echo "set +vx" >> $job_to_send |
---|
1249 | if [[ $(echo $remote_host | cut -c1-3) = ibm || $(echo $remote_host | cut -c1-5) = lcsgi || $(echo $remote_host | cut -c1-3) = nec || $remote_host = lcflow || $remote_host = lckiaps || $remote_host = lckyu* ]] |
---|
1250 | then |
---|
1251 | if [[ $remote_host = ibmh ]] |
---|
1252 | then |
---|
1253 | return_queue=c1 |
---|
1254 | elif [[ $remote_host = ibmkisti ]] |
---|
1255 | then |
---|
1256 | return_queue=class.1-2 |
---|
1257 | elif [[ $remote_host = ibmku ]] |
---|
1258 | then |
---|
1259 | return_queue=sdbg2 |
---|
1260 | elif [[ $remote_host = ibms ]] |
---|
1261 | then |
---|
1262 | return_queue=p_normal |
---|
1263 | elif [[ $remote_host = ibmy ]] |
---|
1264 | then |
---|
1265 | return_queue=serial |
---|
1266 | elif [[ $remote_host = lcsgih || $remote_host = lcsgib ]] |
---|
1267 | then |
---|
1268 | return_queue=serialq |
---|
1269 | elif [[ $remote_host = necriam ]] |
---|
1270 | then |
---|
1271 | return_queue=SP |
---|
1272 | elif [[ $remote_host = lckiaps ]] |
---|
1273 | then |
---|
1274 | return_queue=express |
---|
1275 | elif [[ $remote_host = lckyuh ]] |
---|
1276 | then |
---|
1277 | return_queue=cx-single |
---|
1278 | elif [[ $remote_host = lckyut ]] |
---|
1279 | then |
---|
1280 | return_queue=cx-single |
---|
1281 | else |
---|
1282 | return_queue=unknown |
---|
1283 | fi |
---|
1284 | |
---|
1285 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
1286 | then |
---|
1287 | |
---|
1288 | if [[ $remote_host = ibmku ]] |
---|
1289 | then |
---|
1290 | echo "echo \"#!/usr/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
1291 | echo "echo \"# @ shell = /usr/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
1292 | else |
---|
1293 | echo "echo \"#!/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
1294 | fi |
---|
1295 | echo "echo \"# @ job_type = serial\" >> scpjob.$kennung" >> $job_to_send |
---|
1296 | echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung" >> $job_to_send |
---|
1297 | echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$kennung" >> $job_to_send |
---|
1298 | echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$kennung " >> $job_to_send |
---|
1299 | echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
1300 | echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
1301 | if [[ $host != "ibmh" ]] |
---|
1302 | then |
---|
1303 | echo "echo \"# @ class = $return_queue\" >> scpjob.$kennung" >> $job_to_send |
---|
1304 | fi |
---|
1305 | echo "echo \"# @ image_size = 10\" >> scpjob.$kennung" >> $job_to_send |
---|
1306 | echo "echo \"# @ notification = never\" >> scpjob.$kennung" >> $job_to_send |
---|
1307 | |
---|
1308 | echo "echo \"# @ queue\" >> scpjob.$kennung" >> $job_to_send |
---|
1309 | echo "echo \" \" >> scpjob.$kennung" >> $job_to_send |
---|
1310 | |
---|
1311 | echo "echo \"set -x\" >> scpjob.$kennung" >> $job_to_send |
---|
1312 | echo "echo \"batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \\\"$job_catalog\\\" $local_dayfile\" >> scpjob.$kennung" >> $job_to_send |
---|
1313 | if [[ $remote_host = ibmku ]] |
---|
1314 | then |
---|
1315 | echo "echo \"rm scpjob.$kennung\" >> scpjob.$kennung" >> $job_to_send |
---|
1316 | fi |
---|
1317 | echo "echo \"exit\" >> scpjob.$kennung" >> $job_to_send |
---|
1318 | |
---|
1319 | elif [[ $remote_host = nech ]] |
---|
1320 | then |
---|
1321 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
1322 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
1323 | echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send |
---|
1324 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
1325 | echo "#PBS -j o" >> $job_to_send |
---|
1326 | echo " " >> $job_to_send |
---|
1327 | echo "set -x" >> $job_to_send |
---|
1328 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
1329 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1330 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1331 | echo "%%END%%" >> $job_to_send |
---|
1332 | |
---|
1333 | elif [[ $remote_host = necriam ]] |
---|
1334 | then |
---|
1335 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
1336 | echo "#PBS -q $return_queue" >> $job_to_send |
---|
1337 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
1338 | echo "#PBS -j o" >> $job_to_send |
---|
1339 | echo " " >> $job_to_send |
---|
1340 | echo "set -x" >> $job_to_send |
---|
1341 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1342 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1343 | echo "%%END%%" >> $job_to_send |
---|
1344 | |
---|
1345 | elif [[ $remote_host = lckyuh ]] |
---|
1346 | then |
---|
1347 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
1348 | echo "#!/bin/bash" >> $job_to_send |
---|
1349 | echo "#PJM -L \"node=1\"" >> $job_to_send |
---|
1350 | echo "#PJM -L \"rscgrp=$return_queue\"" >> $job_to_send |
---|
1351 | echo "#PJM --no-stging" >> $job_to_send |
---|
1352 | echo "#PJM -L \"elapse=30:00\"" >> $job_to_send |
---|
1353 | echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1354 | echo "#PJM -j" >> $job_to_send |
---|
1355 | echo " " >> $job_to_send |
---|
1356 | echo "export LANG=en_US.UTF-8" >> $job_to_send |
---|
1357 | echo "set -x" >> $job_to_send |
---|
1358 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1359 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1360 | echo "%%END%%" >> $job_to_send |
---|
1361 | |
---|
1362 | elif [[ $remote_host = lckyut ]] |
---|
1363 | then |
---|
1364 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
1365 | echo "#!/bin/bash" >> $job_to_send |
---|
1366 | echo "#PJM -L \"vnode=1\"" >> $job_to_send |
---|
1367 | echo "#PJM -L \"rscgrp=$return_queue\"" >> $job_to_send |
---|
1368 | echo "#PJM --no-stging" >> $job_to_send |
---|
1369 | echo "#PJM -L \"elapse=30:00\"" >> $job_to_send |
---|
1370 | echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1371 | echo "#PJM -j" >> $job_to_send |
---|
1372 | echo " " >> $job_to_send |
---|
1373 | echo "export LANG=en_US.UTF-8" >> $job_to_send |
---|
1374 | echo "set -x" >> $job_to_send |
---|
1375 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1376 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1377 | echo "%%END%%" >> $job_to_send |
---|
1378 | |
---|
1379 | elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]] |
---|
1380 | then |
---|
1381 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
1382 | echo "#!/bin/bash" >> $job_to_send |
---|
1383 | echo "#PBS -N job_protocol_transfer" >> $job_to_send |
---|
1384 | echo "#PBS -l walltime=00:30:00" >> $job_to_send |
---|
1385 | echo "#PBS -l nodes=1:ppn=1" >> $job_to_send |
---|
1386 | echo "#PBS -l feature=data" >> $job_to_send |
---|
1387 | echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1388 | echo "#PBS -j oe" >> $job_to_send |
---|
1389 | echo " " >> $job_to_send |
---|
1390 | echo ". /usr/share/modules/init/bash" >> $job_to_send |
---|
1391 | echo "set -x" >> $job_to_send |
---|
1392 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1393 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1394 | echo "%%END%%" >> $job_to_send |
---|
1395 | |
---|
1396 | elif [[ $remote_host = lcflow ]] |
---|
1397 | then |
---|
1398 | echo "cat > scpjob.${kennung}.tmp << %%END%%" >> $job_to_send |
---|
1399 | echo "#!/bin/bash" >> $job_to_send |
---|
1400 | echo "SGEPREFIX -S /bin/bash" >> $job_to_send |
---|
1401 | echo "SGEPREFIX -N transfer_$job_name" >> $job_to_send |
---|
1402 | echo "SGEPREFIX -cwd" >> $job_to_send |
---|
1403 | echo "SGEPREFIX -l h_rt=01:00:00" >> $job_to_send |
---|
1404 | echo "SGEPREFIX -l h_vmem=100M" >> $job_to_send |
---|
1405 | echo "SGEPREFIX -j y" >> $job_to_send |
---|
1406 | echo "SGEPREFIX -o ${local_host}_${job_name}_scpjob_$kennung" >> $job_to_send |
---|
1407 | echo " " >> $job_to_send |
---|
1408 | echo "set -x" >> $job_to_send |
---|
1409 | echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:' >> $job_to_send |
---|
1410 | echo "export PATH=\$PATH:\$PALM_BIN" >> $job_to_send |
---|
1411 | echo "" >> $job_to_send |
---|
1412 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1413 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1414 | echo "rm -f scpjob.${kennung}" >> $job_to_send |
---|
1415 | echo "%%END%%" >> $job_to_send |
---|
1416 | echo "sed -e 's/SGEPREFIX/#$/g' scpjob.${kennung}.tmp > scpjob.${kennung}" >> $job_to_send |
---|
1417 | echo "rm -f scpjob.${kennung}.tmp" >> $job_to_send |
---|
1418 | |
---|
1419 | else |
---|
1420 | |
---|
1421 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
1422 | echo "# @\\\$-q $return_queue" >> $job_to_send |
---|
1423 | echo "# @\\\$-l${qsubtime} 10" >> $job_to_send |
---|
1424 | echo "# @\\\$-l${qsubmem} 10mb" >> $job_to_send |
---|
1425 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es ]] |
---|
1426 | then |
---|
1427 | echo "# @\$-l mpp_p=0" >> $job_to_send |
---|
1428 | fi |
---|
1429 | echo '# @\$-lF 10mb' >> $job_to_send |
---|
1430 | # echo '# @\$-o /dev/null' >> $job_to_send |
---|
1431 | echo '# @\$-o job_queue/last_job_transfer_protocol' >> $job_to_send |
---|
1432 | echo '# @\\\$-eo' >> $job_to_send |
---|
1433 | echo " " >> $job_to_send |
---|
1434 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
1435 | then |
---|
1436 | echo "set +vx" >> $job_to_send |
---|
1437 | echo ". .profile" >> $job_to_send |
---|
1438 | fi |
---|
1439 | echo "set -x" >> $job_to_send |
---|
1440 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null" >> $job_to_send |
---|
1441 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
1442 | echo "%%END%%" >> $job_to_send |
---|
1443 | fi |
---|
1444 | |
---|
1445 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
1446 | then |
---|
1447 | echo "llsubmit scpjob.$kennung" >> $job_to_send |
---|
1448 | elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]] |
---|
1449 | then |
---|
1450 | echo "rm -rf \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
1451 | echo "chmod u+x scpjob.$kennung" >> $job_to_send |
---|
1452 | echo "msub scpjob.$kennung" >> $job_to_send |
---|
1453 | elif [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
1454 | then |
---|
1455 | echo "qsub -J n scpjob.$kennung" >> $job_to_send |
---|
1456 | elif [[ $remote_host = t3es ]] |
---|
1457 | then |
---|
1458 | echo "qsub -J n -s /bin/ksh scpjob.$kennung" >> $job_to_send |
---|
1459 | elif [[ $remote_host = lckiaps ]] |
---|
1460 | then |
---|
1461 | echo "mv scpjob.$kennung $job_catalog" >> $job_to_send |
---|
1462 | echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"$submcom ${job_catalog}/scpjob.$kennung\" " >> $job_to_send |
---|
1463 | echo "rm ${job_catalog}/scpjob.$kennung" >> $job_to_send |
---|
1464 | elif [[ $remote_host = lckyu* ]] |
---|
1465 | then |
---|
1466 | echo "scp $PORTOPT scpjob.$kennung ${remote_username}@${remote_addres}:job_queue" >> $job_to_send |
---|
1467 | echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"cd job_queue; $submcom scpjob.$kennung; rm scpjob.$kennung\" " >> $job_to_send |
---|
1468 | elif [[ $remote_host = lcflow ]] |
---|
1469 | then |
---|
1470 | echo "mv scpjob.$kennung $job_catalog" >> $job_to_send |
---|
1471 | echo "ssh ${remote_username}@${remote_addres} \"$init_cmds $module_calls cd $job_catalog; $submcom scpjob.$kennung\" " >> $job_to_send |
---|
1472 | else |
---|
1473 | echo "$submcom scpjob.$kennung" >> $job_to_send |
---|
1474 | fi |
---|
1475 | if [[ $remote_host != ibmku && $remote_host != lckiaps ]] |
---|
1476 | then |
---|
1477 | echo "rm scpjob.$kennung" >> $job_to_send |
---|
1478 | fi |
---|
1479 | if [[ $remote_host = nech ]] |
---|
1480 | then |
---|
1481 | echo "cd -" >> $job_to_send |
---|
1482 | fi |
---|
1483 | else |
---|
1484 | # echo "ftpcopy -d $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
1485 | echo "nohup ftpcopy -d -w 15 $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null &" >> $job_to_send |
---|
1486 | fi |
---|
1487 | echo "set -x" >> $job_to_send |
---|
1488 | echo " ' exit" >> $job_to_send |
---|
1489 | echo "set -x" >> $job_to_send |
---|
1490 | fi |
---|
1491 | |
---|
1492 | |
---|
1493 | |
---|
1494 | # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN |
---|
1495 | cat $file_to_send >> $job_to_send |
---|
1496 | |
---|
1497 | if [[ $remote_host = ibm ]] |
---|
1498 | then |
---|
1499 | echo " " >> $job_to_send |
---|
1500 | echo "exit" >> $job_to_send |
---|
1501 | fi |
---|
1502 | |
---|
1503 | # remove job file |
---|
1504 | if [[ $remote_host = lctit || $remote_host = ibmku || $remote_host = lcflow ]] |
---|
1505 | then |
---|
1506 | echo " " >> $job_to_send |
---|
1507 | echo "rm ~/job_queue/$job_on_remhost" >> $job_to_send |
---|
1508 | fi |
---|
1509 | |
---|
1510 | |
---|
1511 | |
---|
1512 | # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN |
---|
1513 | if [[ -z $remote_user ]] |
---|
1514 | then |
---|
1515 | if [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es || $remote_host = vpp ]] |
---|
1516 | then |
---|
1517 | grep $remote_addres ~/.netrc | read dum dum dum remote_user dum dum |
---|
1518 | fi |
---|
1519 | fi |
---|
1520 | |
---|
1521 | |
---|
1522 | |
---|
1523 | # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN |
---|
1524 | if [[ $no_submit = false ]] |
---|
1525 | then |
---|
1526 | if [[ $remote_host != $local_host ]] |
---|
1527 | then |
---|
1528 | [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." |
---|
1529 | if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" |
---|
1530 | then |
---|
1531 | job_catalog_save=$job_catalog |
---|
1532 | job_catalog=job_queue |
---|
1533 | elif [[ $remote_host = nech ]] |
---|
1534 | then |
---|
1535 | job_catalog_save=$job_catalog |
---|
1536 | job_catalog=/hpf/b/${remote_user}/job_queue |
---|
1537 | fi |
---|
1538 | if [[ $remote_host = nech ]] |
---|
1539 | then |
---|
1540 | # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ |
---|
1541 | # TRANSFERIERT WERDEN |
---|
1542 | scp $PORTOPT $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost |
---|
1543 | else |
---|
1544 | scp $PORTOPT $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost |
---|
1545 | fi |
---|
1546 | if [[ $? = 1 ]] |
---|
1547 | then |
---|
1548 | locat=scp; exit |
---|
1549 | fi |
---|
1550 | if [[ $remote_host = ibms ]] |
---|
1551 | then |
---|
1552 | job_catalog=$job_catalog_save |
---|
1553 | fi |
---|
1554 | [[ $verify = true ]] && printf "\n >>> finished\n" |
---|
1555 | else |
---|
1556 | eval job_catalog=$job_catalog |
---|
1557 | cp $job_to_send ${job_catalog}/$job_on_remhost |
---|
1558 | fi |
---|
1559 | |
---|
1560 | |
---|
1561 | |
---|
1562 | # NQS- BZW. LOADLEVELER-JOB STARTEN |
---|
1563 | if [[ $remote_host != $local_host ]] |
---|
1564 | then |
---|
1565 | [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" |
---|
1566 | |
---|
1567 | if [[ $(echo $remote_host | cut -c1-5) = lcsgi && $prio = true ]] |
---|
1568 | then |
---|
1569 | printf "\n >>> submit with HLRN qos-feature hiprio...\n" |
---|
1570 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom -l qos=hiprio $job_on_remhost; rm $job_on_remhost" |
---|
1571 | elif [[ $remote_host = ibmku ]] |
---|
1572 | then |
---|
1573 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost" |
---|
1574 | elif [[ $remote_host = lcflow ]] |
---|
1575 | then |
---|
1576 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "$init_cmds $module_calls cd $job_catalog; $submcom $job_on_remhost" |
---|
1577 | else |
---|
1578 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" |
---|
1579 | fi |
---|
1580 | |
---|
1581 | [[ $verify = true ]] && printf " >>> o.k.\n" |
---|
1582 | else |
---|
1583 | cd $job_catalog |
---|
1584 | if [[ $(echo $local_host | cut -c1-5) = lcsgi || $(echo $local_host | cut -c1-3) = ibm ]] |
---|
1585 | then |
---|
1586 | eval $submcom $job_on_remhost |
---|
1587 | elif [[ $local_host = lcfimm || $local_host = lctit || $localhost = lcxe6 || $localhost = lck || $localhost = lckordi || $localhost = lcyon || $localhost = lcsb || $localhost = lckyu* ]] |
---|
1588 | then |
---|
1589 | chmod u+x $job_on_remhost |
---|
1590 | eval $submcom $job_on_remhost |
---|
1591 | elif [[ $local_host = nech ]] |
---|
1592 | then |
---|
1593 | if [[ $queue = default ]] |
---|
1594 | then |
---|
1595 | eval $submcom $job_on_remhost |
---|
1596 | else |
---|
1597 | eval $submcom -q $queue $job_on_remhost |
---|
1598 | fi |
---|
1599 | else |
---|
1600 | qsub $job_on_remhost |
---|
1601 | fi |
---|
1602 | |
---|
1603 | # Jobfile must not be deleted on lctit/ibmku!! This will be done |
---|
1604 | # only at the end of the job. |
---|
1605 | if [[ $local_host != lctit && $local_host != ibmku && $local_host != lcflow ]] |
---|
1606 | then |
---|
1607 | rm $job_on_remhost |
---|
1608 | fi |
---|
1609 | cd - > /dev/null |
---|
1610 | fi |
---|
1611 | fi |
---|
1612 | |
---|
1613 | |
---|
1614 | |
---|
1615 | # ABSCHLUSSARBEITEN |
---|
1616 | |
---|
1617 | if [[ $no_submit = false ]] |
---|
1618 | then |
---|
1619 | rm -f $job_to_send |
---|
1620 | fi |
---|
1621 | [[ $verify = true ]] && printf "\n\n *** SUBJOB finished \n\n" |
---|