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