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