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