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