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