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