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