source: palm/trunk/SCRIPTS/subjob @ 2007

Last change on this file since 2007 was 1945, checked in by raasch, 8 years ago

last commit documented

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