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