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