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