source: palm/trunk/SCRIPTS/subjob @ 1278

Last change on this file since 1278 was 1275, checked in by heinze, 10 years ago

last commit documented

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