source: palm/trunk/SCRIPTS/subjob @ 1261

Last change on this file since 1261 was 1261, checked in by raasch, 10 years ago

last commit documented

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