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