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