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