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