[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 | # |
---|
| 20 | # Copyright 1997-2012 Leibniz University Hannover |
---|
| 21 | #--------------------------------------------------------------------------------# |
---|
| 22 | # |
---|
| 23 | # Current revisions: |
---|
[1090] | 24 | # ------------------ |
---|
[1104] | 25 | # |
---|
[1046] | 26 | # |
---|
| 27 | # Former revisions: |
---|
| 28 | # ----------------- |
---|
[169] | 29 | # $Id: subjob 1104 2013-02-20 02:37:12Z fricke $ |
---|
[1047] | 30 | # |
---|
[1104] | 31 | # 1103 2013-02-20 02:15:53Z raasch |
---|
| 32 | # bash compatibility adjustments (usage of OPTIND, output formatting with printf |
---|
| 33 | # instead typeset -L/R), |
---|
| 34 | # further adjustments for lckyuh |
---|
| 35 | # |
---|
[1100] | 36 | # 2013-02-10 01:47:43Z raasch |
---|
| 37 | # adjustments for Kyushu-Univeristy computing center (lckyuh - hayaka) |
---|
| 38 | # and for Forwind cluster (lcflow) |
---|
| 39 | # |
---|
[1096] | 40 | # 1094 2013-02-03 01:52:12Z raasch |
---|
| 41 | # new option -P for explicit setting of ssh/scp port, |
---|
| 42 | # decalpha parts (yonsei) removed |
---|
| 43 | # |
---|
[1091] | 44 | # 2013-02-02 07:06:13Z raasch |
---|
[1099] | 45 | # adjustments for Kyushu-University computing center (lckyut - tatara) |
---|
[1091] | 46 | # old changelog messages removed |
---|
| 47 | # |
---|
[1047] | 48 | # 1046 2012-11-09 14:38:45Z maronga |
---|
| 49 | # code put under GPL (PALM 3.9) |
---|
| 50 | # |
---|
[1090] | 51 | # 08/07/94 - Siggi - first version finished |
---|
| 52 | # 29/06/94 - Siggi - script development started |
---|
| 53 | #--------------------------------------------------------------------------------# |
---|
| 54 | # subjob - script for automatic generation and submission of batch-job files |
---|
| 55 | # for various batch queuing systems |
---|
| 56 | #--------------------------------------------------------------------------------# |
---|
[1] | 57 | |
---|
| 58 | |
---|
| 59 | # VARIABLENVEREINBARUNGEN + DEFAULTWERTE |
---|
[352] | 60 | delete_dayfile=false |
---|
[799] | 61 | email_notification=none |
---|
[122] | 62 | group_number=none |
---|
[1] | 63 | locat=normal |
---|
| 64 | no_default_queue=none |
---|
| 65 | no_submit=false |
---|
| 66 | job_catalog="~/job_queue" |
---|
| 67 | job_name=none |
---|
| 68 | local_user=$LOGNAME |
---|
| 69 | node_usage=shared |
---|
[475] | 70 | numprocs=0 |
---|
[1] | 71 | punkte="..........................................................." |
---|
| 72 | submcom=qsub |
---|
| 73 | queue=default |
---|
| 74 | remote_host=none |
---|
| 75 | remote_user="" |
---|
| 76 | verify=true |
---|
| 77 | |
---|
| 78 | typeset -i cputime=0 memory=0 Memory=0 minuten resttime sekunden stunden |
---|
[696] | 79 | typeset -i inumprocs mpi_tasks=0 nodes=0 processes_per_node=0 tasks_per_node=0 threads_per_task=1 |
---|
[1] | 80 | |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | # FEHLERBEHANDLUNG |
---|
| 84 | # BEI EXIT: |
---|
| 85 | trap 'if [[ $locat != normal ]] |
---|
| 86 | then |
---|
| 87 | case $locat in |
---|
| 88 | (option) printf "\n --> available optios can be displayed" |
---|
| 89 | printf " by typing:" |
---|
| 90 | printf "\n \"subjob ?\" \n";; |
---|
| 91 | (ftpcopy|parameter|scp|verify) printf "\n";; |
---|
| 92 | (*) printf "\n +++ unknown error" |
---|
| 93 | printf "\n please inform S. Raasch!\n" |
---|
| 94 | esac |
---|
| 95 | [[ -f $job_to_send ]] && rm $job_to_send |
---|
| 96 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
| 97 | fi' exit |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | # BEI TERMINAL-BREAK: |
---|
| 101 | trap '[[ -f $job_to_send ]] && rm $job_to_send |
---|
| 102 | printf "\n\n+++ SUBJOB killed \n\n" |
---|
| 103 | exit |
---|
| 104 | ' 2 |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | |
---|
| 108 | |
---|
| 109 | # LOKALEN HOSTNAMEN FESTSTELLEN |
---|
| 110 | local_host=$(hostname) |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | # HOSTSPEZIFISCHE VARIABLEN VEREINBAREN BZW. PRUEFEN, OB LOKALER HOST |
---|
| 115 | # UEBERHAUPT ZULAESSIG IST |
---|
[717] | 116 | # Note: One of the entries for "lck" or "lckordi" always has to be |
---|
| 117 | # comment out, because the hostname (node*) is same for both machines |
---|
[1] | 118 | case $local_host in |
---|
| 119 | (atmos) local_addres=172.20.25.35; local_host=lcide;; |
---|
[102] | 120 | (autan) local_addres=130.75.105.57; local_host=lcmuk;; |
---|
[5] | 121 | (bora) local_addres=130.75.105.103; local_host=lcmuk;; |
---|
[400] | 122 | (bd1) local_addres=130.73.232.64; local_host=lcsgib;; |
---|
| 123 | (bd2) local_addres=130.73.232.65; local_host=lcsgib;; |
---|
| 124 | (bd3) local_addres=130.73.232.66; local_host=lcsgib;; |
---|
| 125 | (bd4) local_addres=130.73.232.67; local_host=lcsgib;; |
---|
| 126 | (b01*|bicegate1) local_addres=130.73.232.102; local_host=lcsgib;; |
---|
[1103] | 127 | (b04*) local_addres=133.5.4.33; local_host=lckyuh;; |
---|
[291] | 128 | (bicegate2) local_addres=130.73.232.103; local_host=lcsgib;; |
---|
[749] | 129 | (blizzard1) local_addres=136.172.40.15; local_host=ibmh;; |
---|
[12] | 130 | (breva) local_addres=130.75.105.98; local_host=lcmuk;; |
---|
[372] | 131 | (caurus) local_addres=130.75.105.19; local_host=lcmuk;; |
---|
[693] | 132 | (climate*) local_addres=165.132.26.68; local_host=lcyon;; |
---|
[108] | 133 | (compute-*.local) local_addres=172.20.4.2; local_host=lcfimm;; |
---|
[1] | 134 | (cs*) local_addres=136.172.44.131; local_host=nech;; |
---|
[5] | 135 | (elephanta) local_addres=130.75.105.6; local_host=lcmuk;; |
---|
[108] | 136 | (fimm.bccs.uib.no) local_addres=172.20.4.2; local_host=lcfimm;; |
---|
[1099] | 137 | (flow01) local_addres=10.141.255.71; local_host=lcflow;; |
---|
| 138 | (flow02) local_addres=10.141.255.72; local_host=lcflow;; |
---|
[367] | 139 | (node*) local_addres=165.132.26.61 local_host=lck;; |
---|
[717] | 140 | # (node*) local_addres=210.219.61.8 local_host=lckordi;; |
---|
[693] | 141 | (gaia*) local_addres=150.183.146.24; local_host=ibmkisti;; |
---|
[101] | 142 | (gallego) local_addres=130.75.105.10; local_host=lcmuk;; |
---|
[1] | 143 | (gfdl5) local_addres=165.132.26.58; local_host=ibmy;; |
---|
[5] | 144 | (gregale) local_addres=130.75.105.109; local_host=lcmuk;; |
---|
| 145 | (hababai) local_addres=130.75.105.108; local_host=lcmuk;; |
---|
[1099] | 146 | (hayaka*) local_addres=133.5.4.33; local_host=lckyuh;; |
---|
[892] | 147 | (hexagon.bccs.uib.no) local_addres=129.177.20.113; local_host=lcxe6;; |
---|
[400] | 148 | (hd1) local_addres=130.75.4.104; local_host=lcsgih;; |
---|
| 149 | (hd2) local_addres=130.75.4.105; local_host=lcsgih;; |
---|
| 150 | (hd3) local_addres=130.75.4.106; local_host=lcsgih;; |
---|
| 151 | (hd4) local_addres=130.75.4.107; local_host=lcsgih;; |
---|
[739] | 152 | (hicegate0) local_addres=130.75.4.101; local_host=lcsgih;; |
---|
[292] | 153 | (h01*|hicegate1) local_addres=130.75.4.102; local_host=lcsgih;; |
---|
[210] | 154 | (hicegate2) local_addres=130.75.4.103; local_host=lcsgih;; |
---|
[440] | 155 | (hx*) local_addres=133.3.51.11; local_host=lckyoto;; |
---|
[749] | 156 | (inferno) local_addres=130.75.105.5; local_host=lcmuk;; |
---|
[5] | 157 | (irifi) local_addres=130.75.105.104; local_host=lcmuk;; |
---|
[407] | 158 | (sno) local_addres=130.75.105.113; local_host=lcmuk;; |
---|
[5] | 159 | (levanto) local_addres=130.75.105.45; local_host=lcmuk;; |
---|
[1040] | 160 | (login*) local_addres=118.128.66.223; local_host=lckiaps;; |
---|
[5] | 161 | (maestro) local_addres=130.75.105.2; local_host=lcmuk;; |
---|
[1099] | 162 | (meller) local_addres=134.106.74.155; local_host=lcfor;; |
---|
[437] | 163 | (meteo-login*) local_addres=193.166.211.144;local_host=lcxt5m;; |
---|
[892] | 164 | (hexagon*) local_addres=129.177.20.113; local_host=lcxe6;; |
---|
[1] | 165 | (nobel*) local_addres=150.183.5.101; local_host=ibms;; |
---|
[5] | 166 | (orkan) local_addres=130.75.105.3; local_host=lcmuk;; |
---|
| 167 | (ostria) local_addres=130.75.105.106; local_host=lcmuk;; |
---|
[205] | 168 | (paesano) local_addres=130.75.105.46; local_host=lcmuk;; |
---|
[1099] | 169 | (pcj*) local_addres=172.31.120.1; local_host=lckyut;; |
---|
[789] | 170 | (pingui) local_addres=134.106.74.118; local_host=lcfor;; |
---|
[5] | 171 | (quanero) local_addres=130.75.105.107; local_host=lcmuk;; |
---|
[622] | 172 | (rte*) local_addres=133.5.185.60; local_host=lcrte;; |
---|
[1] | 173 | (scirocco) local_addres=172.20.25.41; local_host=lcmuk;; |
---|
[799] | 174 | (solano) local_addres=130.75.105.110; local_host=lcmuk;; |
---|
[1090] | 175 | (sugoka*) local_addres=172.31.120.1; local_host=lckyut;; |
---|
[1] | 176 | (sun1|sun2) local_addres=130.75.6.1; local_host=unics;; |
---|
[259] | 177 | (sx-*) local_addres=172.16.1.131; local_host=necriam;; |
---|
[181] | 178 | (r1*) local_addres=130.75.4.102; local_host=lcsgih;; |
---|
[196] | 179 | (r2*) local_addres=130.73.232.102; local_host=lcsgib;; |
---|
[635] | 180 | (t2a*) local_addres=10.1.6.165; local_host=lctit;; |
---|
[1021] | 181 | (urban*) local_addres=147.46.30.151 local_host=lcsb;; |
---|
[1] | 182 | (vorias) local_addres=172.20.25.43; local_host=lcmuk;; |
---|
[622] | 183 | (*.cc.kyushu-u.ac.jp) local_addres=133.5.4.129; local_host=ibmku;; |
---|
[1] | 184 | (*) printf "\n +++ \"$local_host\" unknown"; |
---|
| 185 | printf "\n please inform S. Raasch!"; |
---|
| 186 | locat=parameter; exit;; |
---|
| 187 | esac |
---|
| 188 | |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | # REMOTE HOST DEFAULTMAESSIG = LOCAL HOST SETZEN |
---|
| 192 | remote_host=$local_host |
---|
| 193 | |
---|
| 194 | |
---|
| 195 | |
---|
| 196 | |
---|
| 197 | # PROZEDUROPTIONEN EINLESEN |
---|
[1094] | 198 | while getopts :c:dDe:g:h:m:n:N:O:P:q:t:T:u:vX: option |
---|
[1] | 199 | do |
---|
| 200 | case $option in |
---|
| 201 | (c) job_catalog=$OPTARG;; |
---|
| 202 | (d) delete_dayfile=true;; |
---|
| 203 | (D) no_submit=true;; |
---|
[352] | 204 | (e) email_notification=$OPTARG;; |
---|
[125] | 205 | (g) group_number=$OPTARG;; |
---|
[1] | 206 | (h) remote_host=$OPTARG;; |
---|
| 207 | (m) memory=$OPTARG;; |
---|
| 208 | (n) job_name=$OPTARG;; |
---|
| 209 | (N) node_usage=$OPTARG;; |
---|
| 210 | (O) threads_per_task=$OPTARG;; |
---|
[1094] | 211 | (P) scp_port=$OPTARG;; |
---|
[1] | 212 | (q) no_default_queue=$OPTARG;; |
---|
| 213 | (t) cputime=$OPTARG;; |
---|
| 214 | (T) tasks_per_node=$OPTARG;; |
---|
| 215 | (u) remote_user=$OPTARG;; |
---|
| 216 | (v) verify=false;; |
---|
| 217 | (X) numprocs=$OPTARG;; |
---|
| 218 | (\?) printf "\n +++ Option $OPTARG unknown \n"; |
---|
| 219 | locat=option; exit;; |
---|
| 220 | esac |
---|
| 221 | done |
---|
| 222 | |
---|
| 223 | |
---|
| 224 | # JOBDATEINAMEN ALS NAECHSTES ARGUMENT HOLEN |
---|
[1103] | 225 | (( to_shift = $OPTIND - 1 )) |
---|
| 226 | shift $to_shift; file_to_send=$1 |
---|
[1] | 227 | |
---|
| 228 | |
---|
| 229 | # KURZE AUFRUFBESCHREIBUNG WIRD HIER AUSGEGEBEN |
---|
| 230 | if [ "$1" = "?" ] |
---|
| 231 | then |
---|
| 232 | (printf "\n *** subjob can be called as follows:\n" |
---|
| 233 | printf "\n subjob -c.. -d -D -h.. -m.. -q.. -t.. -u.. -v <jobfile>\n" |
---|
| 234 | printf "\n Description of available options:\n" |
---|
| 235 | printf "\n Option Description Default-Value" |
---|
| 236 | printf "\n -c job-input- and output-catalog ~/job_queue" |
---|
| 237 | printf "\n -d no job-protocol will be created ---" |
---|
| 238 | printf "\n -D only the job-file will be created ---" |
---|
| 239 | printf "\n -h execution host, available hosts: $remote_host" |
---|
[693] | 240 | printf "\n ibm, ibmh, ibmkisti, ibmku, ibms, ibmy, lc...," |
---|
[1040] | 241 | printf "\n lckiaps, lctit, nech, necriam, unics" |
---|
[1] | 242 | printf "\n -m memory demand per process in MByte ---" |
---|
| 243 | printf "\n -n jobname <jobdatei>" |
---|
| 244 | printf "\n -O threads per task (for OpenMP usage) 1" |
---|
[1094] | 245 | printf "\n -P ssh/scp port default port" |
---|
[1] | 246 | printf "\n -q job-queue to be used default" |
---|
| 247 | printf "\n -t allowed cpu-time in seconds ---" |
---|
| 248 | printf "\n -T tasks per node (on parallel hosts) ---" |
---|
| 249 | printf "\n -u username on execution host from .netrc" |
---|
| 250 | printf "\n -v no prompt for confirmation ---" |
---|
| 251 | printf "\n -X # of processors (on parallel hosts) 1" |
---|
| 252 | printf "\n " |
---|
| 253 | printf "\n The only possible positional parameter is <jobfile>:" |
---|
| 254 | printf "\n The complete NQS-job must be provided here." |
---|
| 255 | printf "\n <jobfile>=? creates this outline\n\n") | more |
---|
| 256 | exit |
---|
| 257 | fi |
---|
| 258 | |
---|
| 259 | |
---|
| 260 | |
---|
| 261 | # PRUEFEN, OB JOBDATEI ANGEGEBEN WURDE UND OB SIE AUCH EXISTIERT |
---|
| 262 | if [[ "$file_to_send" = "" ]] |
---|
| 263 | then |
---|
| 264 | printf "\n +++ job-file missing" |
---|
| 265 | locat=parameter; exit |
---|
| 266 | else |
---|
| 267 | if [[ -f $file_to_send ]] |
---|
| 268 | then |
---|
| 269 | true |
---|
| 270 | else |
---|
| 271 | printf "\n +++ job-file: " |
---|
| 272 | printf "\n $file_to_send" |
---|
| 273 | printf "\n does not exist" |
---|
| 274 | locat=parameter; exit |
---|
| 275 | fi |
---|
| 276 | fi |
---|
| 277 | |
---|
| 278 | |
---|
| 279 | |
---|
| 280 | # FALLS KEIN JOBNAME ANGEGEBEN WURDE, WIRD JOBNAME = JOBDATEINAME |
---|
| 281 | # GESETZT. VORAUSSETZUNG: JOBDATEINAME BEINHALTET KEINE PFADE |
---|
| 282 | if [[ $job_name = none ]] |
---|
| 283 | then |
---|
| 284 | job_name=$file_to_send |
---|
| 285 | fi |
---|
| 286 | if [[ $(echo $job_name | grep -c "/") != 0 ]] |
---|
| 287 | then |
---|
| 288 | printf "\n +++ job-file name: " |
---|
| 289 | printf "\n $job_name" |
---|
| 290 | printf "\n must not contain \"/\"-characters" |
---|
| 291 | locat=parameter; exit |
---|
| 292 | fi |
---|
| 293 | |
---|
| 294 | |
---|
| 295 | |
---|
| 296 | |
---|
| 297 | # HOSTSPEZIFISCHE GROESSEN VEREINBAREN BZW. ABBRUCH BEI UNZULAESSIGEM HOST |
---|
| 298 | # ODER WENN HOST NICHT ANGEGEBEN WURDE |
---|
| 299 | if [[ $remote_host = none ]] |
---|
| 300 | then |
---|
| 301 | printf "\n +++ host missing" |
---|
| 302 | locat=option; exit |
---|
| 303 | else |
---|
| 304 | case $remote_host in |
---|
[251] | 305 | (ibm) queue=p690_standard; remote_addres=134.76.99.81; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
[312] | 306 | (ibmh) queue=no_class; remote_addres=136.172.40.15; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
[693] | 307 | (ibmkisti) queue=class.32plus; remote_addres=150.183.146.24; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
[622] | 308 | (ibmku) queue=s4; remote_addres=133.5.4.129; submcom=/usr/local/bin/llsubmit;; |
---|
[251] | 309 | (ibms) queue=p_normal; remote_addres=150.183.5.101; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
| 310 | (ibmy) queue=parallel; remote_addres=165.132.26.58; submcom=/usr/lpp/LoadL/full/bin/llsubmit;; |
---|
| 311 | (lcfimm) remote_addres=172.20.4.2; submcom=/opt/torque/bin/qsub;; |
---|
[1099] | 312 | (lcflow) remote_addres=10.140.1.71; submcom=/cm/shared/apps/sge/6.2u5p2/bin/lx26-amd64/qsub;; |
---|
[440] | 313 | (lckyoto) remote_addres=133.3.51.11; submcom=/thin/local/bin/qsub;; |
---|
[540] | 314 | (lcsgib) queue=smallq; remote_addres=130.73.232.104; submcom=/opt/moab/bin/msub;; |
---|
| 315 | (lcsgih) queue=smallq; remote_addres=130.75.4.101; submcom=/opt/moab/bin/msub;; |
---|
[367] | 316 | (lck) remote_addres=165.132.26.61; submcom=/usr/torque/bin/qsub;; |
---|
[1040] | 317 | (lckiaps) remote_addres=118.128.66.223; submcom=/cm/shared/apps/pbspro/11.0.2.110766/bin/qsub;; |
---|
[717] | 318 | (lckordi) remote_addres=210.219.61.8; submcom=/usr/torque/bin/qsub;; |
---|
[1099] | 319 | (lckyuh) remote_addres=133.5.4.33; submcom=/usr/bin/pjsub;; |
---|
[1090] | 320 | (lckyut) remote_addres=133.5.4.37; submcom=/usr/bin/pjsub;; |
---|
[1021] | 321 | (lcsb) remote_addres=147.46.30.151; submcom=/usr/torque/bin/qsub;; |
---|
[635] | 322 | (lctit) queue=S; remote_addres=10.1.6.165; submcom=/opt/pbs/tools/bin/t2sub;; |
---|
[892] | 323 | (lcxe6) remote_addres=129.177.20.113; submcom=/opt/torque/2.5.10/bin/qsub;; |
---|
[437] | 324 | (lcxt5m) remote_addres=193.166.211.144; submcom=/opt/pbs/10.1.0.91350/bin/qsub;; |
---|
[693] | 325 | (lcyon) remote_addres=165.132.26.68; submcom=/usr/torque/bin/qsub;; |
---|
[251] | 326 | (nech) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=136.172.44.147; submcom="/usr/local/bin/qsub";; |
---|
| 327 | (necriam) qsubmem=memsz_job; qsubtime=cputim_job; remote_addres=172.16.1.131; submcom="/usr/bin/nqsII/qsub";; |
---|
| 328 | (vpp) qsubmem=m; qsubtime=t; queue=vpp; remote_addres=130.75.4.130;; |
---|
| 329 | (unics) qsubmem=d; qsubtime=t; queue=unics; remote_addres=130.75.6.1;; |
---|
| 330 | (*) printf "\n +++ hostname \"$remote_host\" not allowed"; |
---|
| 331 | locat=parameter; exit;; |
---|
[1] | 332 | esac |
---|
| 333 | fi |
---|
| 334 | |
---|
| 335 | |
---|
| 336 | # EVTL. PRUEFEN, OB ANGEGEBENE QUEUE ZULAESSIG IST |
---|
| 337 | if [[ $no_default_queue != none ]] |
---|
| 338 | then |
---|
| 339 | error=false |
---|
| 340 | ndq=$no_default_queue |
---|
| 341 | case $remote_host in |
---|
| 342 | (ibm) case $ndq in |
---|
| 343 | (p690_express|p690_standard|p690_long) error=false;; |
---|
| 344 | (*) error=true;; |
---|
| 345 | esac;; |
---|
| 346 | (ibmh) case $ndq in |
---|
[312] | 347 | (no_class) error=false;; |
---|
[1] | 348 | (*) error=true;; |
---|
| 349 | esac;; |
---|
[693] | 350 | (ibmkisti) case $ndq in |
---|
| 351 | (class.32plus|class.1-2|class.2-32) error=false;; |
---|
| 352 | (*) error=true;; |
---|
| 353 | esac;; |
---|
[622] | 354 | (ibmku) case $ndq in |
---|
| 355 | (sdbg1|sdbg2|sdbg4|s4|s16|s32|s32-s) error=false;; |
---|
| 356 | (*) error=true;; |
---|
| 357 | esac;; |
---|
[1] | 358 | (ibms) case $ndq in |
---|
| 359 | (express|normal|p_express|p_normal|p_normal_1.3|p_normal_1.7|grand) error=false;; |
---|
| 360 | (*) error=true;; |
---|
| 361 | esac;; |
---|
| 362 | (ibmy) case $ndq in |
---|
| 363 | (parallel) error=false;; |
---|
| 364 | (*) error=true;; |
---|
| 365 | esac;; |
---|
[1099] | 366 | (lcflow) case $ndq in |
---|
| 367 | (cfd_lom_long.q|cfd_him_long.q|cfd_lom_serl.q|cfd_lom_shrt.q|cfd_him_shrt.q) error=false;; |
---|
| 368 | (*) error=true;; |
---|
| 369 | esac;; |
---|
[1040] | 370 | (lckiaps) case $ndq in |
---|
| 371 | (express|normal) error=false;; |
---|
| 372 | (*) error=true;; |
---|
| 373 | esac;; |
---|
[440] | 374 | (lckyoto) case $ndq in |
---|
| 375 | (eh|ph) error=false;; |
---|
| 376 | (*) error=true;; |
---|
| 377 | esac;; |
---|
[1099] | 378 | (lckyuh) case $ndq in |
---|
| 379 | (fx-dbg|fx-single|fx-small|fx-middle|fx-large) error=false;; |
---|
| 380 | (*) error=true;; |
---|
| 381 | esac;; |
---|
[1090] | 382 | (lckyut) case $ndq in |
---|
| 383 | (cx-dbg|cx-single|cx-small|cx-middle|cx-large) error=false;; |
---|
| 384 | (*) error=true;; |
---|
| 385 | esac;; |
---|
[191] | 386 | (lcsgib|lcsgih) case $ndq in |
---|
[416] | 387 | (testq|serialq|smallq|mediumq|bigq|workq|dataq|permq|special1q) error=false;; |
---|
[191] | 388 | (*) error=true;; |
---|
| 389 | esac;; |
---|
[1] | 390 | (lctit) case $ndq in |
---|
[635] | 391 | (G|L128|L256|L512H|S|S96|V) error=false;; |
---|
[1] | 392 | (*) error=true;; |
---|
| 393 | esac;; |
---|
| 394 | (t3eb) case $ndq in |
---|
| 395 | (berte|p50|p100|p392|forfree|p25himem) error=false;; |
---|
| 396 | (*) error=true;; |
---|
| 397 | esac;; |
---|
[251] | 398 | (necriam) case $ndq in |
---|
[253] | 399 | (SP|SS|P6) error=false;; |
---|
[251] | 400 | (*) error=true;; |
---|
| 401 | esac;; |
---|
[1] | 402 | (t3eh) case $ndq in |
---|
| 403 | (para_t3e|em|k|l|lm|comp_t3e|c|p|ht) error=false;; |
---|
| 404 | (*) error=true;; |
---|
| 405 | esac;; |
---|
| 406 | (t3ej2|t3ej5) case $ndq in |
---|
| 407 | (low|normal|high) error=false;; |
---|
| 408 | (*) error=true;; |
---|
| 409 | esac;; |
---|
| 410 | (t3es) case $ndq in |
---|
| 411 | (batch|serial-4|pe4|p48|pe16|pe32|pe64|pe128) error=false;; |
---|
| 412 | (*) error=true;; |
---|
| 413 | esac;; |
---|
| 414 | (unics) case $ndq in |
---|
| 415 | (unics|ht) error=false;; |
---|
| 416 | (*) error=true;; |
---|
| 417 | esac;; |
---|
| 418 | esac |
---|
| 419 | if [[ $error = true ]] |
---|
| 420 | then |
---|
| 421 | printf "\n +++ queue \"$no_default_queue\" on host \"$remote_host\" not allowed" |
---|
| 422 | locat=parameter; exit |
---|
| 423 | else |
---|
| 424 | queue=$no_default_queue |
---|
| 425 | fi |
---|
| 426 | fi |
---|
| 427 | |
---|
| 428 | |
---|
| 429 | |
---|
| 430 | # PRUEFEN DER CPU-ZEIT, ZEIT NACH STUNDEN, MINUTEN UND SEKUNDEN |
---|
| 431 | # AUFTEILEN |
---|
| 432 | done=false |
---|
| 433 | while [[ $done = false ]] |
---|
| 434 | do |
---|
| 435 | if (( $cputime <= 0 )) |
---|
| 436 | then |
---|
| 437 | printf "\n +++ wrong cpu-time or cpu-time missing" |
---|
| 438 | printf "\n >>> Please type cpu-time in seconds as INTEGER:" |
---|
| 439 | printf "\n >>> " |
---|
| 440 | read cputime 1>/dev/null 2>&1 |
---|
| 441 | else |
---|
| 442 | done=true |
---|
| 443 | fi |
---|
| 444 | done |
---|
| 445 | if [[ $remote_host = nech ]] |
---|
| 446 | then |
---|
| 447 | if (( tasks_per_node != 0 )) |
---|
| 448 | then |
---|
| 449 | (( cputime = cputime * tasks_per_node )) |
---|
| 450 | elif [[ $numprocs != 0 ]] |
---|
| 451 | then |
---|
| 452 | (( cputime = cputime * numprocs )) |
---|
| 453 | fi |
---|
| 454 | fi |
---|
| 455 | (( stunden = cputime / 3600 )) |
---|
| 456 | (( resttime = cputime - stunden * 3600 )) |
---|
| 457 | (( minuten = resttime / 60 )) |
---|
| 458 | (( sekunden = resttime - minuten * 60 )) |
---|
| 459 | timestring=${stunden}:${minuten}:${sekunden} |
---|
| 460 | |
---|
| 461 | |
---|
| 462 | |
---|
| 463 | # PRUEFEN DER KERNSPEICHERANFORDERUNG |
---|
| 464 | done=false |
---|
| 465 | while [[ $done = false ]] |
---|
| 466 | do |
---|
| 467 | if (( memory <= 0 )) |
---|
| 468 | then |
---|
| 469 | printf "\n +++ wrong memory demand or memory demand missing" |
---|
| 470 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
| 471 | printf "\n >>> " |
---|
| 472 | read memory 1>/dev/null 2>&1 |
---|
| 473 | else |
---|
| 474 | done=true |
---|
| 475 | fi |
---|
| 476 | done |
---|
| 477 | |
---|
[251] | 478 | if [[ $remote_host = nech || $remote_host = necriam ]] |
---|
[1] | 479 | then |
---|
| 480 | if (( tasks_per_node != 0 )) |
---|
| 481 | then |
---|
| 482 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
| 483 | elif [[ $numprocs != 0 ]] |
---|
| 484 | then |
---|
| 485 | (( Memory = memory * numprocs / 1000 )) |
---|
| 486 | else |
---|
| 487 | (( Memory = memory / 1000 )) |
---|
| 488 | fi |
---|
[635] | 489 | elif [[ $remote_host = lctit ]] |
---|
| 490 | then |
---|
| 491 | (( Memory = memory * tasks_per_node / 1000 )) |
---|
[1] | 492 | fi |
---|
| 493 | |
---|
| 494 | |
---|
| 495 | # SPEICHERBERECHNUNG BEI OPENMP-NUTZUNG |
---|
| 496 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
| 497 | then |
---|
| 498 | (( memory = memory * threads_per_task )) |
---|
| 499 | fi |
---|
| 500 | |
---|
| 501 | |
---|
| 502 | # BERECHNUNG DER ANZAHL DER ZU VERWENDENDEN KNOTEN |
---|
| 503 | if (( tasks_per_node != 0 )) |
---|
| 504 | then |
---|
[622] | 505 | (( nodes = numprocs / ( tasks_per_node * threads_per_task ) )) |
---|
[1] | 506 | fi |
---|
| 507 | |
---|
[1094] | 508 | |
---|
[622] | 509 | # Calculate number of processes per node |
---|
| 510 | (( processes_per_node = tasks_per_node * threads_per_task )) |
---|
[1] | 511 | |
---|
[1094] | 512 | |
---|
[696] | 513 | # Calculate number of MPI tasks |
---|
| 514 | (( mpi_tasks = numprocs / threads_per_task )) |
---|
[1] | 515 | |
---|
[696] | 516 | |
---|
[1094] | 517 | # Set port number option for calls of ssh/scp, subjob and batch_scp scripts |
---|
| 518 | if [[ "$scp_port" != "" ]] |
---|
| 519 | then |
---|
| 520 | PORTOPT="-P $scp_port" |
---|
| 521 | SSH_PORTOPT="-p $scp_port" |
---|
| 522 | fi |
---|
| 523 | |
---|
| 524 | |
---|
[1] | 525 | # HEADER-AUSGABE |
---|
| 526 | if [[ $verify = true ]] |
---|
| 527 | then |
---|
| 528 | printf "\n\n" |
---|
| 529 | printf "#--------------------------------------------------------------# \n" |
---|
| 530 | spalte1=SUBJOB;spalte2=$(date) |
---|
[1103] | 531 | printf "| %-20s%40s | \n" "$spalte1" "$spalte2" |
---|
[1] | 532 | printf "| | \n" |
---|
| 533 | printf "| values of parameters/options: | \n" |
---|
[1103] | 534 | spalte1=$(echo local_host$punkte | cut -c-20) |
---|
| 535 | spalte2=$punkte$local_host |
---|
| 536 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
| 537 | spalte1=$(echo remote_host$punkte | cut -c-20) |
---|
| 538 | spalte2=$punkte$remote_host |
---|
| 539 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
| 540 | spalte1=$(echo queue$punkte | cut -c-20) |
---|
| 541 | spalte2=$punkte$queue |
---|
| 542 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
| 543 | spalte1=$(echo memory$punkte | cut -c-20) |
---|
| 544 | spalte2="$punkte$memory mb" |
---|
| 545 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
| 546 | spalte1=$(echo cputime$punkte | cut -c-20) |
---|
| 547 | spalte2="$punkte$cputime sec" |
---|
| 548 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
| 549 | spalte1=$(echo job_name$punkte | cut -c-20) |
---|
| 550 | spalte2="$punkte$job_name" |
---|
| 551 | printf "| %-20s%40s | \n" "$spalte1" "${spalte2: -40}" |
---|
[1] | 552 | printf "#--------------------------------------------------------------# \n\n" |
---|
| 553 | |
---|
| 554 | |
---|
| 555 | # KONTROLLABFRAGE, OB ALLES O.K. |
---|
| 556 | antwort="dummy" |
---|
| 557 | while [[ $antwort != y && $antwort != Y && $antwort != n && $antwort != N ]] |
---|
| 558 | do |
---|
| 559 | read antwort?" >>> continue (y/n) ? " |
---|
| 560 | done |
---|
| 561 | if [[ $antwort = n || $antwort = N ]] |
---|
| 562 | then |
---|
| 563 | locat=verify; exit |
---|
| 564 | fi |
---|
| 565 | printf "\n" |
---|
| 566 | fi |
---|
| 567 | |
---|
| 568 | |
---|
| 569 | |
---|
| 570 | # ZUFALLSKENNUNG GENERIEREN UND JOBNAMEN AUF ZIELRECHNER BESTIMMEN |
---|
| 571 | kennung=$RANDOM |
---|
| 572 | job_on_remhost=${job_name}_${kennung}_$local_host |
---|
| 573 | job_to_send=job_to_send_$kennung |
---|
| 574 | if [[ $delete_dayfile = false ]] |
---|
| 575 | then |
---|
| 576 | remote_dayfile=${local_host}_${job_name}_result_$kennung |
---|
| 577 | local_dayfile=${remote_host}_${job_name} |
---|
| 578 | else |
---|
| 579 | remote_dayfile=/dev/null |
---|
| 580 | fi |
---|
| 581 | |
---|
| 582 | |
---|
| 583 | |
---|
[622] | 584 | # Generate the batch job scripts (qsub/msub/LoadLeveler) |
---|
[1] | 585 | if [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs != 0 ]] |
---|
| 586 | then |
---|
| 587 | |
---|
[622] | 588 | # General LoadLeveler settings |
---|
| 589 | execute_in_shell="#!/bin/ksh" |
---|
| 590 | use_shell="# @ shell = /bin/ksh" |
---|
| 591 | consumable_memory="ConsumableMemory($memory mb)" |
---|
| 592 | class="# @ class = $queue" |
---|
| 593 | environment="# @ environment = OMP_NUM_THREADS=$threads_per_task; MP_SHARED_MEMORY=yes" |
---|
| 594 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
| 595 | data_limit="# @ data_limit = 1.76gb" |
---|
| 596 | image_size="# @ image_size = 50" |
---|
[693] | 597 | wall_clock_limit="# @ wall_clock_limit = ${timestring},$timestring" |
---|
[312] | 598 | |
---|
[693] | 599 | if [[ $email_notification = none ]] |
---|
| 600 | then |
---|
| 601 | notify_user="" |
---|
| 602 | else |
---|
| 603 | notify_user="# @ notify_user = $email_notification" |
---|
| 604 | if [[ $delete_dayfile = true ]] |
---|
| 605 | then |
---|
| 606 | notification='# @ notification = never' |
---|
| 607 | fi |
---|
| 608 | fi |
---|
[622] | 609 | |
---|
[312] | 610 | if [[ $remote_host = ibmh ]] |
---|
[1] | 611 | then |
---|
[312] | 612 | data_limit="" |
---|
| 613 | network_to_use="" |
---|
| 614 | class="" |
---|
| 615 | environment="" |
---|
[814] | 616 | rset="# @ rset = RSET_MCM_AFFINITY" |
---|
| 617 | task_affinity="# @ task_affinity = core(1)" |
---|
[693] | 618 | elif [[ $remote_host = ibmkisti ]] |
---|
| 619 | then |
---|
| 620 | network_to_use="# @ network.MPI = sn_all,shared,US" |
---|
| 621 | wall_clock_limit="# @ wall_clock_limit = $timestring" |
---|
[696] | 622 | if [[ $threads_per_task = 1 ]] |
---|
| 623 | then |
---|
| 624 | rset="# @ rset = RSET_MCM_AFFINITY" |
---|
| 625 | mcm_affinity_options="# @ mcm_affinity_options = mcm_mem_pref mcm_sni_none mcm_distribute" |
---|
| 626 | fi |
---|
[693] | 627 | environment="" |
---|
| 628 | use_shell="" |
---|
| 629 | data_limit="" |
---|
| 630 | image_size="" |
---|
[622] | 631 | elif [[ $remote_host = ibmku ]] |
---|
| 632 | then |
---|
| 633 | execute_in_shell="#!/usr/bin/ksh" |
---|
| 634 | use_shell="# @ shell = /usr/bin/ksh" |
---|
| 635 | consumable_memory="" |
---|
| 636 | environment="" |
---|
| 637 | network_to_use="# @ network.mpi = sn_all,shared,us" |
---|
| 638 | data_limit="" |
---|
| 639 | image_size="" |
---|
| 640 | elif [[ $remote_host = ibms ]] |
---|
| 641 | then |
---|
| 642 | network_to_use="# @ network.mpi = csss,shared,us" |
---|
| 643 | elif [[ $remote_host = ibmy ]] |
---|
| 644 | then |
---|
| 645 | consumable_memory="" |
---|
| 646 | network_to_use="" |
---|
[1] | 647 | fi |
---|
| 648 | |
---|
| 649 | cat > $job_to_send << %%END%% |
---|
[622] | 650 | $execute_in_shell |
---|
| 651 | $use_shell |
---|
[1] | 652 | |
---|
| 653 | # @ job_type = parallel |
---|
[693] | 654 | # @ job_name = $job_name |
---|
[1] | 655 | # @ resources = ConsumableCpus($threads_per_task) $consumable_memory |
---|
| 656 | # @ output = $remote_dayfile |
---|
| 657 | # @ error = $remote_dayfile |
---|
[693] | 658 | $wall_clock_limit |
---|
[622] | 659 | $image_size |
---|
[312] | 660 | $class |
---|
| 661 | $environment |
---|
[1] | 662 | $network_to_use |
---|
| 663 | $data_limit |
---|
[693] | 664 | $rset |
---|
| 665 | $mcm_affinity_options |
---|
[814] | 666 | $task_affinity |
---|
[1] | 667 | $notification |
---|
[693] | 668 | $notify_user |
---|
[1] | 669 | |
---|
| 670 | %%END%% |
---|
| 671 | |
---|
| 672 | if (( nodes > 0 )) |
---|
| 673 | then |
---|
| 674 | |
---|
[693] | 675 | if [[ $remote_host != ibmkisti ]] |
---|
| 676 | then |
---|
| 677 | |
---|
| 678 | cat >> $job_to_send << %%END%% |
---|
[1] | 679 | # @ node = $nodes |
---|
[622] | 680 | # @ tasks_per_node = $processes_per_node |
---|
[1] | 681 | # @ node_usage = $node_usage |
---|
| 682 | # @ queue |
---|
| 683 | |
---|
| 684 | %%END%% |
---|
| 685 | |
---|
[693] | 686 | else |
---|
| 687 | |
---|
| 688 | cat >> $job_to_send << %%END%% |
---|
[696] | 689 | # @ total_tasks = $mpi_tasks |
---|
[693] | 690 | # @ blocking = unlimited |
---|
| 691 | # @ queue |
---|
| 692 | |
---|
| 693 | %%END%% |
---|
| 694 | |
---|
| 695 | fi |
---|
| 696 | |
---|
[1] | 697 | else |
---|
| 698 | |
---|
| 699 | if [[ $remote_host != ibmy ]] |
---|
| 700 | then |
---|
| 701 | |
---|
| 702 | cat >> $job_to_send << %%END%% |
---|
| 703 | # @ blocking = unlimited |
---|
| 704 | # @ total_tasks = $numprocs |
---|
| 705 | # @ node_usage = $node_usage |
---|
| 706 | # @ queue |
---|
| 707 | |
---|
| 708 | %%END%% |
---|
| 709 | |
---|
| 710 | else |
---|
| 711 | |
---|
| 712 | cat >> $job_to_send << %%END%% |
---|
| 713 | # @ node = 1 |
---|
| 714 | # @ total_tasks = $numprocs |
---|
| 715 | # @ queue |
---|
| 716 | |
---|
| 717 | %%END%% |
---|
| 718 | |
---|
| 719 | fi |
---|
| 720 | |
---|
| 721 | fi |
---|
| 722 | |
---|
[696] | 723 | # workaround because of silly job filter on ibmkisti |
---|
| 724 | if [[ $remote_host = ibmkisti && $threads_per_task != 1 ]] |
---|
| 725 | then |
---|
| 726 | echo "export OMP_NUM_THREADS=$threads_per_task" >> $job_to_send |
---|
| 727 | fi |
---|
| 728 | |
---|
[1] | 729 | elif [[ $(echo $remote_host | cut -c1-3) = ibm && $numprocs = 0 ]] |
---|
| 730 | then |
---|
| 731 | |
---|
| 732 | cat > $job_to_send << %%END%% |
---|
| 733 | #!/bin/ksh |
---|
| 734 | |
---|
| 735 | # @ job_type = serial |
---|
| 736 | # @ node_usage = $node_usage |
---|
| 737 | # @ job_name = palm |
---|
| 738 | # @ wall_clock_limit = ${timestring},$timestring |
---|
| 739 | # @ resources = ConsumableCpus(1) ConsumableMemory(1 gb) |
---|
| 740 | # @ output = $remote_dayfile |
---|
| 741 | # @ error = $remote_dayfile |
---|
[312] | 742 | $class |
---|
[1] | 743 | $notification |
---|
| 744 | |
---|
| 745 | # @ queue |
---|
| 746 | |
---|
| 747 | %%END%% |
---|
| 748 | |
---|
[108] | 749 | elif [[ $remote_host = lcfimm ]] |
---|
| 750 | then |
---|
| 751 | |
---|
| 752 | if [[ $numprocs != 0 ]] |
---|
| 753 | then |
---|
| 754 | cat > $job_to_send << %%END%% |
---|
| 755 | #!/bin/ksh |
---|
| 756 | #PBS -N $job_name |
---|
[552] | 757 | #PBS -A $project_account |
---|
[108] | 758 | #PBS -l walltime=$timestring |
---|
[622] | 759 | #PBS -l nodes=${nodes}:ppn=$processes_per_node |
---|
[108] | 760 | #PBS -l pmem=${memory}mb |
---|
| 761 | #PBS -m abe |
---|
| 762 | #PBS -o $remote_dayfile |
---|
| 763 | #PBS -j oe |
---|
| 764 | mpd & |
---|
| 765 | |
---|
| 766 | %%END%% |
---|
| 767 | |
---|
[168] | 768 | else |
---|
| 769 | cat > $job_to_send << %%END%% |
---|
| 770 | #!/bin/ksh |
---|
| 771 | #PBS -N $job_name |
---|
[552] | 772 | #PBS -A $project_account |
---|
[168] | 773 | #PBS -l walltime=$timestring |
---|
| 774 | #PBS -l ncpus=1 |
---|
| 775 | #PBS -l pmem=${memory}mb |
---|
| 776 | #PBS -m abe |
---|
| 777 | #PBS -o $remote_dayfile |
---|
| 778 | #PBS -j oe |
---|
| 779 | |
---|
| 780 | %%END%% |
---|
| 781 | |
---|
| 782 | fi |
---|
| 783 | |
---|
[1099] | 784 | elif [[ $remote_host = lcflow ]] |
---|
| 785 | then |
---|
| 786 | if [ $memory -gt 1900 ]; then |
---|
| 787 | use_himem="" |
---|
| 788 | else |
---|
| 789 | use_himem="#" |
---|
| 790 | fi |
---|
| 791 | if [[ $numprocs != 0 ]] |
---|
| 792 | then |
---|
| 793 | pe_set="#$ -pe impi $numprocs" |
---|
| 794 | else |
---|
| 795 | pe_set="#$ -pe impi 1" |
---|
| 796 | fi |
---|
| 797 | if [[ $queue = default ]] |
---|
| 798 | then |
---|
| 799 | queue_set="" |
---|
| 800 | else |
---|
| 801 | queue_set="#$ -q $queue" |
---|
| 802 | fi |
---|
| 803 | [[ "$disc_space" = "" ]] && disc_space=50 |
---|
| 804 | |
---|
| 805 | cat > $job_to_send << %%END%% |
---|
| 806 | #!/bin/bash |
---|
| 807 | #$ -S /bin/bash |
---|
| 808 | #$ -N $job_name |
---|
| 809 | #$ -cwd |
---|
| 810 | #$ -l h_rt=$timestring |
---|
| 811 | #$ -l h_vmem=${memory}M |
---|
| 812 | #$ -o $remote_dayfile |
---|
| 813 | #$ -j y |
---|
| 814 | $pe_set |
---|
| 815 | #$ -R y |
---|
| 816 | ${use_himem}#$ -l highmem=true |
---|
| 817 | #$ -l h_fsize=${disc_space}G |
---|
| 818 | $queue_set |
---|
| 819 | |
---|
| 820 | %%END%% |
---|
| 821 | |
---|
[1021] | 822 | elif [[ $remote_host = lck || $remote_host = lckordi || $remote_host = lcsb ]] |
---|
[368] | 823 | then |
---|
| 824 | |
---|
| 825 | if [[ $numprocs != 0 ]] |
---|
| 826 | then |
---|
| 827 | cat > $job_to_send << %%END%% |
---|
| 828 | #!/bin/ksh |
---|
| 829 | #PBS -N $job_name |
---|
| 830 | #PBS -l walltime=$timestring |
---|
| 831 | #PBS -l ncpus=$numprocs |
---|
| 832 | #PBS -l pmem=${memory}mb |
---|
| 833 | #PBS -o $remote_dayfile |
---|
[1021] | 834 | #PBS -l nodes=$nodes:ppn=${processes_per_node} |
---|
[368] | 835 | #PBS -j oe |
---|
| 836 | |
---|
| 837 | mpd & |
---|
| 838 | |
---|
| 839 | %%END%% |
---|
| 840 | |
---|
| 841 | else |
---|
| 842 | cat > $job_to_send << %%END%% |
---|
| 843 | #!/bin/ksh |
---|
| 844 | #PBS -N $job_name |
---|
| 845 | #PBS -l walltime=$timestring |
---|
| 846 | #PBS -l ncpus=1 |
---|
| 847 | #PBS -l pmem=${memory}mb |
---|
| 848 | #PBS -o $remote_dayfile |
---|
| 849 | #PBS -j oe |
---|
| 850 | |
---|
| 851 | %%END%% |
---|
| 852 | |
---|
| 853 | fi |
---|
| 854 | |
---|
[1040] | 855 | elif [[ $remote_host = lckiaps ]] |
---|
| 856 | then |
---|
| 857 | |
---|
| 858 | if [[ $numprocs != 0 ]] |
---|
| 859 | then |
---|
| 860 | cat > $job_to_send << %%END%% |
---|
| 861 | #!/bin/ksh |
---|
| 862 | #PBS -N $job_name |
---|
| 863 | #PBS -l walltime=$timestring |
---|
| 864 | #PBS -l select=1:ncpus=$numprocs |
---|
| 865 | #PBS -l pmem=${memory}mb |
---|
| 866 | #PBS -q $queue |
---|
| 867 | #PBS -o $remote_dayfile |
---|
| 868 | #PBS -j oe |
---|
| 869 | #PBS -V |
---|
| 870 | |
---|
| 871 | %%END%% |
---|
| 872 | |
---|
| 873 | else |
---|
| 874 | cat > $job_to_send << %%END%% |
---|
| 875 | #!/bin/ksh |
---|
| 876 | #PBS -N $job_name |
---|
| 877 | #PBS -l walltime=$timestring |
---|
| 878 | #PBS -l ncpus=1 |
---|
| 879 | #PBS -l pmem=${memory}mb |
---|
| 880 | #PBS -o $remote_dayfile |
---|
| 881 | #PBS -j oe |
---|
| 882 | |
---|
| 883 | %%END%% |
---|
| 884 | |
---|
| 885 | fi |
---|
| 886 | |
---|
[693] | 887 | elif [[ $remote_host = lcyon ]] |
---|
| 888 | then |
---|
| 889 | |
---|
| 890 | if [[ $numprocs != 0 ]] |
---|
| 891 | then |
---|
| 892 | cat > $job_to_send << %%END%% |
---|
| 893 | #!/bin/ksh |
---|
| 894 | #PBS -N $job_name |
---|
| 895 | #PBS -l walltime=$timestring |
---|
| 896 | #PBS -l ncpus=$numprocs |
---|
| 897 | #PBS -l pmem=${memory}mb |
---|
| 898 | #PBS -o $remote_dayfile |
---|
| 899 | #PBS -j oe |
---|
| 900 | |
---|
| 901 | %%END%% |
---|
| 902 | |
---|
| 903 | else |
---|
| 904 | cat > $job_to_send << %%END%% |
---|
| 905 | #!/bin/ksh |
---|
| 906 | #PBS -N $job_name |
---|
| 907 | #PBS -l walltime=$timestring |
---|
| 908 | #PBS -l ncpus=1 |
---|
| 909 | #PBS -l pmem=${memory}mb |
---|
| 910 | #PBS -o $remote_dayfile |
---|
| 911 | #PBS -j oe |
---|
| 912 | |
---|
| 913 | %%END%% |
---|
| 914 | |
---|
| 915 | fi |
---|
| 916 | |
---|
[181] | 917 | elif [[ $remote_host = lcsgih || $remote_host = lcsgib ]] |
---|
[179] | 918 | then |
---|
| 919 | |
---|
[376] | 920 | if [[ "$sgi_feature" != "" ]] |
---|
| 921 | then |
---|
| 922 | feature_directive="#PBS -l feature=$sgi_feature" |
---|
| 923 | else |
---|
| 924 | feature_directive="" |
---|
| 925 | fi |
---|
[799] | 926 | |
---|
[416] | 927 | if [[ $queue = dataq || $queue = permq ]] |
---|
[399] | 928 | then |
---|
| 929 | feature_directive="#PBS -l feature=data" |
---|
| 930 | fi |
---|
[376] | 931 | |
---|
[789] | 932 | if [[ $queue = testq || $queue = mediumq || $queue = bigq || $queue = workq || $queue = dataq || $queue = permq || $queue = serialq || $queue = special1q ]] |
---|
[191] | 933 | then |
---|
| 934 | queue_directive="#PBS -q $queue" |
---|
| 935 | else |
---|
| 936 | queue_directive="" |
---|
| 937 | fi |
---|
| 938 | |
---|
[352] | 939 | if [[ $email_notification = none ]] |
---|
| 940 | then |
---|
| 941 | email_directive="" |
---|
| 942 | else |
---|
| 943 | email_directive="#PBS -M $email_notification" |
---|
| 944 | fi |
---|
| 945 | |
---|
[179] | 946 | if [[ $numprocs != 0 ]] |
---|
| 947 | then |
---|
| 948 | cat > $job_to_send << %%END%% |
---|
[181] | 949 | #!/bin/bash |
---|
[179] | 950 | #PBS -N $job_name |
---|
| 951 | #PBS -l walltime=$timestring |
---|
[622] | 952 | #PBS -l nodes=$nodes:ppn=${processes_per_node} |
---|
[181] | 953 | #PBS -l naccesspolicy=$node_usage |
---|
[179] | 954 | #PBS -o $remote_dayfile |
---|
| 955 | #PBS -j oe |
---|
[376] | 956 | $feature_directive |
---|
[191] | 957 | $queue_directive |
---|
[352] | 958 | $email_directive |
---|
[179] | 959 | |
---|
[622] | 960 | eval \`/sw/swdist/bin/modulesinit\` |
---|
| 961 | #. /usr/share/modules/init/bash |
---|
[892] | 962 | $init_cmds |
---|
[493] | 963 | $module_calls |
---|
[374] | 964 | |
---|
[181] | 965 | echo ld_library_path=\$LD_LIBRARY_PATH |
---|
[179] | 966 | |
---|
| 967 | %%END%% |
---|
| 968 | |
---|
| 969 | else |
---|
| 970 | cat > $job_to_send << %%END%% |
---|
| 971 | #PBS -S /bin/bash |
---|
| 972 | #PBS -N $job_name |
---|
| 973 | #PBS -l walltime=$timestring |
---|
| 974 | #PBS -l ncpus=1 |
---|
| 975 | #PBS -o $remote_dayfile |
---|
[475] | 976 | #PBS -j oe |
---|
[400] | 977 | $queue_directive |
---|
| 978 | $email_directive |
---|
[179] | 979 | |
---|
[622] | 980 | eval \`/sw/swdist/bin/modulesinit\` |
---|
| 981 | #. /usr/share/modules/init/bash |
---|
[892] | 982 | $init_cmds |
---|
[493] | 983 | $module_calls |
---|
[475] | 984 | |
---|
[179] | 985 | %%END%% |
---|
| 986 | |
---|
| 987 | fi |
---|
| 988 | |
---|
[892] | 989 | elif [[ $remote_host = lcxe6 ]] |
---|
[164] | 990 | then |
---|
| 991 | |
---|
| 992 | if [[ $numprocs != 0 ]] |
---|
| 993 | then |
---|
| 994 | cat > $job_to_send << %%END%% |
---|
[799] | 995 | #!/bin/ksh |
---|
[164] | 996 | #PBS -S /bin/ksh |
---|
| 997 | #PBS -N $job_name |
---|
[552] | 998 | #PBS -A $project_account |
---|
[206] | 999 | #PBS -j oe |
---|
[164] | 1000 | #PBS -l walltime=$timestring |
---|
| 1001 | #PBS -l mppwidth=${numprocs} |
---|
[622] | 1002 | #PBS -l mppnppn=${processes_per_node} |
---|
[164] | 1003 | #PBS -m abe |
---|
| 1004 | #PBS -o $remote_dayfile |
---|
[492] | 1005 | $email_directive |
---|
[164] | 1006 | |
---|
[892] | 1007 | $init_cmds |
---|
[493] | 1008 | $module_calls |
---|
[343] | 1009 | |
---|
[164] | 1010 | %%END%% |
---|
| 1011 | |
---|
[108] | 1012 | else |
---|
| 1013 | cat > $job_to_send << %%END%% |
---|
| 1014 | #!/bin/ksh |
---|
[168] | 1015 | #PBS -S /bin/ksh |
---|
[108] | 1016 | #PBS -N $job_name |
---|
[552] | 1017 | #PBS -A $project_account |
---|
[206] | 1018 | #PBS -j oe |
---|
[108] | 1019 | #PBS -l walltime=$timestring |
---|
| 1020 | #PBS -l ncpus=1 |
---|
| 1021 | #PBS -l pmem=${memory}mb |
---|
| 1022 | #PBS -m abe |
---|
[492] | 1023 | $email_directive |
---|
[108] | 1024 | #PBS -o $remote_dayfile |
---|
| 1025 | |
---|
[892] | 1026 | $init_cmds |
---|
[493] | 1027 | $module_calls |
---|
[343] | 1028 | |
---|
[108] | 1029 | %%END%% |
---|
| 1030 | |
---|
| 1031 | fi |
---|
| 1032 | |
---|
[440] | 1033 | elif [[ $remote_host = lckyoto ]] |
---|
[437] | 1034 | then |
---|
| 1035 | |
---|
[440] | 1036 | cat > $job_to_send << %%END%% |
---|
[799] | 1037 | #!/bin/ksh |
---|
[440] | 1038 | # @\$-o $remote_dayfile |
---|
| 1039 | # @\$-eo -oi |
---|
| 1040 | # @\$-lP 16 |
---|
[799] | 1041 | # @\$-lp 1 |
---|
[440] | 1042 | # @\$-lm 28gb -llm unlimited -ls unlimited |
---|
| 1043 | # @\$-q $queue |
---|
| 1044 | # @\$-Pvn abs_pack |
---|
| 1045 | ##for intel? @\$-Pvn abs_unpack -Pvs unpack -Pvc unpack |
---|
| 1046 | #. /thin/local/etc/setprofile/intel-11.0.sh |
---|
| 1047 | #. /thin/local/etc/setprofile/mvapich2-1.4+intel-11.0.sh |
---|
| 1048 | . ~/.myprofile |
---|
| 1049 | #. /home2/t/t51254/palm/current_version/myprofile |
---|
| 1050 | #. /thin/apps/pgi/mpi.sh |
---|
| 1051 | # |
---|
| 1052 | env |
---|
| 1053 | # |
---|
| 1054 | set -x |
---|
| 1055 | |
---|
| 1056 | %%END%% |
---|
| 1057 | |
---|
| 1058 | elif [[ $remote_host = lcxt5m ]] |
---|
| 1059 | then |
---|
| 1060 | |
---|
[437] | 1061 | if [[ $numprocs != 0 ]] |
---|
| 1062 | then |
---|
| 1063 | cat > $job_to_send << %%END%% |
---|
[799] | 1064 | #!/bin/ksh |
---|
[437] | 1065 | #PBS -S /bin/ksh |
---|
| 1066 | #PBS -N $job_name |
---|
| 1067 | #PBS -j oe |
---|
| 1068 | #PBS -l walltime=$timestring |
---|
| 1069 | #PBS -l mppwidth=${numprocs} |
---|
[622] | 1070 | #PBS -l mppnppn=${processes_per_node} |
---|
[437] | 1071 | #PBS -m abe |
---|
| 1072 | #PBS -o $remote_dayfile |
---|
| 1073 | |
---|
[892] | 1074 | $init_cmds |
---|
[493] | 1075 | $module_calls |
---|
[437] | 1076 | |
---|
| 1077 | %%END%% |
---|
| 1078 | |
---|
| 1079 | else |
---|
| 1080 | cat > $job_to_send << %%END%% |
---|
| 1081 | #!/bin/ksh |
---|
| 1082 | #PBS -S /bin/ksh |
---|
| 1083 | #PBS -N $job_name |
---|
| 1084 | #PBS -j oe |
---|
| 1085 | #PBS -l walltime=$timestring |
---|
| 1086 | #PBS -l ncpus=1 |
---|
| 1087 | #PBS -l pmem=${memory}mb |
---|
| 1088 | #PBS -m abe |
---|
| 1089 | #PBS -o $remote_dayfile |
---|
| 1090 | |
---|
[892] | 1091 | $init_cmds |
---|
[493] | 1092 | $module_calls |
---|
[437] | 1093 | |
---|
| 1094 | %%END%% |
---|
| 1095 | |
---|
| 1096 | fi |
---|
| 1097 | |
---|
[1099] | 1098 | elif [[ $remote_host = lckyuh ]] |
---|
| 1099 | then |
---|
| 1100 | cat > $job_to_send << %%END%% |
---|
| 1101 | #!/bin/bash |
---|
| 1102 | #PJM -L "rscgrp=$queue" |
---|
| 1103 | #PJM -L "node=$nodes" |
---|
| 1104 | #PJM --mpi "proc=$numprocs" |
---|
| 1105 | #PJM -L "elapse=$timestring" |
---|
| 1106 | #PJM -o $remote_dayfile |
---|
| 1107 | #PJM -j |
---|
| 1108 | #PJM -X |
---|
| 1109 | #PJM --no-stging |
---|
| 1110 | |
---|
| 1111 | export LANG=en_US.UTF-8 |
---|
| 1112 | %%END%% |
---|
| 1113 | |
---|
[1090] | 1114 | elif [[ $remote_host = lckyut ]] |
---|
| 1115 | then |
---|
| 1116 | cat > $job_to_send << %%END%% |
---|
| 1117 | #!/bin/bash |
---|
[1099] | 1118 | #PJM -L "rscgrp=$queue" |
---|
[1090] | 1119 | #PJM -L "vnode=$numprocs" |
---|
| 1120 | #PJM -L "vnode-core=1" |
---|
| 1121 | #PJM -L "elapse=$timestring" |
---|
| 1122 | #PJM --mpi proc=$numprocs |
---|
| 1123 | #PJM -o $remote_dayfile |
---|
| 1124 | #PJM -j |
---|
[1099] | 1125 | #PJM -X |
---|
| 1126 | #PJM --no-stging |
---|
[1090] | 1127 | |
---|
| 1128 | export LANG=en_US.UTF-8 |
---|
| 1129 | %%END%% |
---|
| 1130 | |
---|
[1] | 1131 | elif [[ $remote_host = nech ]] |
---|
| 1132 | then |
---|
| 1133 | |
---|
| 1134 | if (( nodes > 1 )) |
---|
| 1135 | then |
---|
| 1136 | cat > $job_to_send << %%END%% |
---|
| 1137 | #!/bin/ksh |
---|
[622] | 1138 | #PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime |
---|
[1] | 1139 | #PBS -l ${qsubmem}=${Memory}gb |
---|
| 1140 | #PBS -b $nodes |
---|
| 1141 | #PBS -o $remote_dayfile |
---|
| 1142 | #PBS -N palm |
---|
| 1143 | #PBS -j o |
---|
| 1144 | #PBS -T mpisx |
---|
| 1145 | |
---|
| 1146 | %%END%% |
---|
| 1147 | |
---|
| 1148 | elif [[ $numprocs != 0 ]] |
---|
| 1149 | then |
---|
| 1150 | cat > $job_to_send << %%END%% |
---|
| 1151 | #!/bin/ksh |
---|
[622] | 1152 | #PBS -l cpunum_prc=$processes_per_node,cputim_job=$cputime |
---|
[1] | 1153 | #PBS -l ${qsubmem}=${Memory}gb |
---|
| 1154 | #PBS -o $remote_dayfile |
---|
| 1155 | #PBS -N palm |
---|
| 1156 | #PBS -j o |
---|
| 1157 | |
---|
| 1158 | %%END%% |
---|
| 1159 | |
---|
| 1160 | else |
---|
| 1161 | cat > $job_to_send << %%END%% |
---|
| 1162 | #!/bin/ksh |
---|
| 1163 | #PBS -l ${qsubmem}=${Memory}gb,${qsubtime}=$cputime |
---|
| 1164 | #PBS -o $remote_dayfile |
---|
| 1165 | #PBS -j o |
---|
| 1166 | |
---|
| 1167 | %%END%% |
---|
| 1168 | |
---|
| 1169 | fi |
---|
| 1170 | |
---|
[251] | 1171 | elif [[ $remote_host = necriam ]] |
---|
[35] | 1172 | then |
---|
| 1173 | |
---|
| 1174 | if (( nodes > 1 )) |
---|
| 1175 | then |
---|
| 1176 | cat > $job_to_send << %%END%% |
---|
| 1177 | #!/bin/ksh |
---|
| 1178 | #PBS -b $nodes |
---|
| 1179 | #PBS -o $remote_dayfile |
---|
[253] | 1180 | #PBS -N $job_name |
---|
[35] | 1181 | #PBS -j o |
---|
[251] | 1182 | #PBS -v MPIPROGINV=YES |
---|
[35] | 1183 | |
---|
| 1184 | %%END%% |
---|
| 1185 | |
---|
| 1186 | elif [[ $numprocs != 0 ]] |
---|
| 1187 | then |
---|
| 1188 | cat > $job_to_send << %%END%% |
---|
| 1189 | #!/bin/ksh |
---|
| 1190 | #PBS -q ${queue} |
---|
| 1191 | #PBS -o $remote_dayfile |
---|
[253] | 1192 | #PBS -N $job_name |
---|
[35] | 1193 | #PBS -j o |
---|
[251] | 1194 | #PBS -v MPIPROGINV=YES |
---|
[35] | 1195 | |
---|
| 1196 | %%END%% |
---|
| 1197 | |
---|
| 1198 | else |
---|
| 1199 | cat > $job_to_send << %%END%% |
---|
| 1200 | #!/bin/ksh |
---|
| 1201 | #PBS -o $remote_dayfile |
---|
| 1202 | #PBS -j o |
---|
| 1203 | |
---|
| 1204 | %%END%% |
---|
| 1205 | |
---|
| 1206 | fi |
---|
| 1207 | |
---|
[1] | 1208 | elif [[ $remote_host = lctit ]] |
---|
| 1209 | then |
---|
| 1210 | cat > $job_to_send << %%END%% |
---|
[635] | 1211 | #!/bin/ksh |
---|
[892] | 1212 | $init_cmds |
---|
[678] | 1213 | $module_calls |
---|
| 1214 | |
---|
[1] | 1215 | %%END%% |
---|
| 1216 | |
---|
| 1217 | # OPTIONEN FUER SUBMIT-KOMMANDO ZUSAMMENSTELLEN |
---|
[678] | 1218 | if [[ $tasks_per_node != $processes_per_node ]] |
---|
| 1219 | then |
---|
| 1220 | 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 " |
---|
| 1221 | else |
---|
| 1222 | 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 " |
---|
| 1223 | fi |
---|
[1] | 1224 | |
---|
| 1225 | else |
---|
| 1226 | |
---|
| 1227 | cat > $job_to_send << %%END%% |
---|
| 1228 | # @\$-q ${queue} |
---|
| 1229 | # @\$-l${qsubtime} $timestring |
---|
| 1230 | # @\$-l${qsubmem} ${memory}mb |
---|
| 1231 | # @\$-o $remote_dayfile |
---|
| 1232 | # @\$-eo |
---|
| 1233 | |
---|
| 1234 | %%END%% |
---|
| 1235 | |
---|
| 1236 | fi |
---|
| 1237 | |
---|
| 1238 | |
---|
| 1239 | # BEI RECHNUNG AUF REMOTE-MASCHINEN RUECKTRANSFER DES DAYFILES PER TRAP |
---|
| 1240 | # BEI EXIT VERANLASSEN |
---|
| 1241 | # VEKTORRECHNER MUSS EIGENEN JOB STARTEN, DA DORT NOHUP NICHT FUNKTIONIERT |
---|
| 1242 | # AUF IBM IN SEOUL IST RUECKTRANSFER ZUR ZEIT GENERELL NICHT MOEGLICH |
---|
| 1243 | if [[ $delete_dayfile = false && $remote_host != $local_host ]] |
---|
| 1244 | then |
---|
| 1245 | echo "set +vx" >> $job_to_send |
---|
| 1246 | echo "trap '" >> $job_to_send |
---|
| 1247 | echo "set +vx" >> $job_to_send |
---|
[1099] | 1248 | if [[ $(echo $remote_host | cut -c1-3) = ibm || $(echo $remote_host | cut -c1-5) = lcsgi || $(echo $remote_host | cut -c1-3) = nec || $remote_host = lcflow || $remote_host = lckiaps || $remote_host = lckyu* ]] |
---|
[1] | 1249 | then |
---|
[622] | 1250 | if [[ $remote_host = ibmh ]] |
---|
[1] | 1251 | then |
---|
| 1252 | return_queue=c1 |
---|
[693] | 1253 | elif [[ $remote_host = ibmkisti ]] |
---|
| 1254 | then |
---|
| 1255 | return_queue=class.1-2 |
---|
[622] | 1256 | elif [[ $remote_host = ibmku ]] |
---|
| 1257 | then |
---|
| 1258 | return_queue=sdbg2 |
---|
[1] | 1259 | elif [[ $remote_host = ibms ]] |
---|
| 1260 | then |
---|
| 1261 | return_queue=p_normal |
---|
| 1262 | elif [[ $remote_host = ibmy ]] |
---|
| 1263 | then |
---|
| 1264 | return_queue=serial |
---|
[325] | 1265 | elif [[ $remote_host = lcsgih || $remote_host = lcsgib ]] |
---|
| 1266 | then |
---|
[326] | 1267 | return_queue=serialq |
---|
[251] | 1268 | elif [[ $remote_host = necriam ]] |
---|
[1] | 1269 | then |
---|
[253] | 1270 | return_queue=SP |
---|
[1040] | 1271 | elif [[ $remote_host = lckiaps ]] |
---|
| 1272 | then |
---|
| 1273 | return_queue=express |
---|
[1099] | 1274 | elif [[ $remote_host = lckyuh ]] |
---|
| 1275 | then |
---|
| 1276 | return_queue=cx-single |
---|
[1090] | 1277 | elif [[ $remote_host = lckyut ]] |
---|
| 1278 | then |
---|
| 1279 | return_queue=cx-single |
---|
[1] | 1280 | else |
---|
| 1281 | return_queue=unknown |
---|
| 1282 | fi |
---|
| 1283 | |
---|
| 1284 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
| 1285 | then |
---|
| 1286 | |
---|
[622] | 1287 | if [[ $remote_host = ibmku ]] |
---|
| 1288 | then |
---|
| 1289 | echo "echo \"#!/usr/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1290 | echo "echo \"# @ shell = /usr/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1291 | else |
---|
| 1292 | echo "echo \"#!/bin/ksh\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1293 | fi |
---|
[1] | 1294 | echo "echo \"# @ job_type = serial\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1295 | echo "echo \"# @ job_name = transfer\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1296 | echo "echo \"# @ resources = ConsumableCpus(1) ConsumableMemory(1 gb)\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1297 | echo "echo \"# @ wall_clock_limit = 00:10:00,00:10:00\" >> scpjob.$kennung " >> $job_to_send |
---|
| 1298 | echo "echo \"# @ output = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1299 | echo "echo \"# @ error = job_queue/last_job_transfer_protocol\" >> scpjob.$kennung" >> $job_to_send |
---|
[312] | 1300 | if [[ $host != "ibmh" ]] |
---|
| 1301 | then |
---|
| 1302 | echo "echo \"# @ class = $return_queue\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1303 | fi |
---|
[1] | 1304 | echo "echo \"# @ image_size = 10\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1305 | echo "echo \"# @ notification = never\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1306 | |
---|
| 1307 | echo "echo \"# @ queue\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1308 | echo "echo \" \" >> scpjob.$kennung" >> $job_to_send |
---|
| 1309 | |
---|
| 1310 | echo "echo \"set -x\" >> scpjob.$kennung" >> $job_to_send |
---|
[1094] | 1311 | echo "echo \"batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \\\"$job_catalog\\\" $local_dayfile\" >> scpjob.$kennung" >> $job_to_send |
---|
[622] | 1312 | if [[ $remote_host = ibmku ]] |
---|
| 1313 | then |
---|
| 1314 | echo "echo \"rm scpjob.$kennung\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1315 | fi |
---|
[1] | 1316 | echo "echo \"exit\" >> scpjob.$kennung" >> $job_to_send |
---|
| 1317 | |
---|
| 1318 | elif [[ $remote_host = nech ]] |
---|
| 1319 | then |
---|
| 1320 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
| 1321 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 1322 | echo "#PBS -l ${qsubmem}=1GB,${qsubtime}=100" >> $job_to_send |
---|
| 1323 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
| 1324 | echo "#PBS -j o" >> $job_to_send |
---|
| 1325 | echo " " >> $job_to_send |
---|
| 1326 | echo "set -x" >> $job_to_send |
---|
| 1327 | echo "cd /pf/b/${remote_user}/job_queue" >> $job_to_send |
---|
[1094] | 1328 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
[1] | 1329 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 1330 | echo "%%END%%" >> $job_to_send |
---|
| 1331 | |
---|
[251] | 1332 | elif [[ $remote_host = necriam ]] |
---|
[35] | 1333 | then |
---|
| 1334 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 1335 | echo "#PBS -q $return_queue" >> $job_to_send |
---|
| 1336 | echo "#PBS -o last_job_transfer_protocol" >> $job_to_send |
---|
| 1337 | echo "#PBS -j o" >> $job_to_send |
---|
| 1338 | echo " " >> $job_to_send |
---|
| 1339 | echo "set -x" >> $job_to_send |
---|
[1094] | 1340 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
[35] | 1341 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 1342 | echo "%%END%%" >> $job_to_send |
---|
| 1343 | |
---|
[1099] | 1344 | elif [[ $remote_host = lckyuh ]] |
---|
| 1345 | then |
---|
| 1346 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 1347 | echo "#!/bin/bash" >> $job_to_send |
---|
| 1348 | echo "#PJM -L \"node=1\"" >> $job_to_send |
---|
| 1349 | echo "#PJM -L \"rscgrp=$return_queue\"" >> $job_to_send |
---|
| 1350 | echo "#PJM --no-stging" >> $job_to_send |
---|
| 1351 | echo "#PJM -L \"elapse=30:00\"" >> $job_to_send |
---|
| 1352 | echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
| 1353 | echo "#PJM -j" >> $job_to_send |
---|
| 1354 | echo " " >> $job_to_send |
---|
| 1355 | echo "export LANG=en_US.UTF-8" >> $job_to_send |
---|
| 1356 | echo "set -x" >> $job_to_send |
---|
| 1357 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
| 1358 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 1359 | echo "%%END%%" >> $job_to_send |
---|
| 1360 | |
---|
[1090] | 1361 | elif [[ $remote_host = lckyut ]] |
---|
| 1362 | then |
---|
| 1363 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 1364 | echo "#!/bin/bash" >> $job_to_send |
---|
| 1365 | echo "#PJM -L \"vnode=1\"" >> $job_to_send |
---|
| 1366 | echo "#PJM -L \"rscgrp=$return_queue\"" >> $job_to_send |
---|
| 1367 | echo "#PJM --no-stging" >> $job_to_send |
---|
| 1368 | echo "#PJM -L \"elapse=30:00\"" >> $job_to_send |
---|
| 1369 | echo "#PJM -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
| 1370 | echo "#PJM -j" >> $job_to_send |
---|
| 1371 | echo " " >> $job_to_send |
---|
| 1372 | echo "export LANG=en_US.UTF-8" >> $job_to_send |
---|
| 1373 | echo "set -x" >> $job_to_send |
---|
[1094] | 1374 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres $remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
[1090] | 1375 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 1376 | echo "%%END%%" >> $job_to_send |
---|
| 1377 | |
---|
[181] | 1378 | elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]] |
---|
| 1379 | then |
---|
| 1380 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 1381 | echo "#!/bin/bash" >> $job_to_send |
---|
| 1382 | echo "#PBS -N job_protocol_transfer" >> $job_to_send |
---|
[325] | 1383 | echo "#PBS -l walltime=00:30:00" >> $job_to_send |
---|
[181] | 1384 | echo "#PBS -l nodes=1:ppn=1" >> $job_to_send |
---|
[366] | 1385 | echo "#PBS -l feature=data" >> $job_to_send |
---|
[181] | 1386 | echo "#PBS -o \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
| 1387 | echo "#PBS -j oe" >> $job_to_send |
---|
| 1388 | echo " " >> $job_to_send |
---|
| 1389 | echo ". /usr/share/modules/init/bash" >> $job_to_send |
---|
| 1390 | echo "set -x" >> $job_to_send |
---|
[1094] | 1391 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
[181] | 1392 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 1393 | echo "%%END%%" >> $job_to_send |
---|
| 1394 | |
---|
[1099] | 1395 | elif [[ $remote_host = lcflow ]] |
---|
| 1396 | then |
---|
| 1397 | echo "cat > scpjob.${kennung}.tmp << %%END%%" >> $job_to_send |
---|
| 1398 | echo "#!/bin/bash" >> $job_to_send |
---|
| 1399 | echo "SGEPREFIX -S /bin/bash" >> $job_to_send |
---|
| 1400 | echo "SGEPREFIX -N transfer_$job_name" >> $job_to_send |
---|
| 1401 | echo "SGEPREFIX -cwd" >> $job_to_send |
---|
| 1402 | echo "SGEPREFIX -l h_rt=01:00:00" >> $job_to_send |
---|
| 1403 | echo "SGEPREFIX -l h_vmem=100M" >> $job_to_send |
---|
| 1404 | echo "SGEPREFIX -j y" >> $job_to_send |
---|
| 1405 | echo "SGEPREFIX -o ${local_host}_${job_name}_scpjob_$kennung" >> $job_to_send |
---|
| 1406 | echo " " >> $job_to_send |
---|
| 1407 | echo "set -x" >> $job_to_send |
---|
| 1408 | echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:' >> $job_to_send |
---|
| 1409 | echo "export PATH=\$PATH:\$PALM_BIN" >> $job_to_send |
---|
| 1410 | echo "" >> $job_to_send |
---|
| 1411 | echo "batch_scp $PORTOPT -d -w 10 -u $local_user $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
| 1412 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 1413 | echo "rm -f scpjob.${kennung}" >> $job_to_send |
---|
| 1414 | echo "%%END%%" >> $job_to_send |
---|
| 1415 | echo "sed -e 's/SGEPREFIX/#$/g' scpjob.${kennung}.tmp > scpjob.${kennung}" >> $job_to_send |
---|
| 1416 | echo "rm -f scpjob.${kennung}.tmp" >> $job_to_send |
---|
| 1417 | |
---|
[1] | 1418 | else |
---|
| 1419 | |
---|
| 1420 | echo "cat > scpjob.$kennung << %%END%%" >> $job_to_send |
---|
| 1421 | echo "# @\\\$-q $return_queue" >> $job_to_send |
---|
| 1422 | echo "# @\\\$-l${qsubtime} 10" >> $job_to_send |
---|
| 1423 | echo "# @\\\$-l${qsubmem} 10mb" >> $job_to_send |
---|
| 1424 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es ]] |
---|
| 1425 | then |
---|
| 1426 | echo "# @\$-l mpp_p=0" >> $job_to_send |
---|
| 1427 | fi |
---|
| 1428 | echo '# @\$-lF 10mb' >> $job_to_send |
---|
| 1429 | # echo '# @\$-o /dev/null' >> $job_to_send |
---|
| 1430 | echo '# @\$-o job_queue/last_job_transfer_protocol' >> $job_to_send |
---|
| 1431 | echo '# @\\\$-eo' >> $job_to_send |
---|
| 1432 | echo " " >> $job_to_send |
---|
| 1433 | if [[ $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
| 1434 | then |
---|
| 1435 | echo "set +vx" >> $job_to_send |
---|
| 1436 | echo ". .profile" >> $job_to_send |
---|
| 1437 | fi |
---|
| 1438 | echo "set -x" >> $job_to_send |
---|
[1094] | 1439 | 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] | 1440 | echo "[[ \"\$for_subjob_to_do\" != \"\" ]] && eval \$for_subjob_to_do" >> $job_to_send |
---|
| 1441 | echo "%%END%%" >> $job_to_send |
---|
| 1442 | fi |
---|
| 1443 | |
---|
| 1444 | if [[ $(echo $remote_host | cut -c1-3) = ibm ]] |
---|
| 1445 | then |
---|
| 1446 | echo "llsubmit scpjob.$kennung" >> $job_to_send |
---|
[181] | 1447 | elif [[ $(echo $remote_host | cut -c1-5) = lcsgi ]] |
---|
| 1448 | then |
---|
[748] | 1449 | echo "rm -rf \$HOME/job_queue/last_job_transfer_protocol" >> $job_to_send |
---|
| 1450 | echo "chmod u+x scpjob.$kennung" >> $job_to_send |
---|
| 1451 | echo "msub scpjob.$kennung" >> $job_to_send |
---|
[1] | 1452 | elif [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 ]] |
---|
| 1453 | then |
---|
| 1454 | echo "qsub -J n scpjob.$kennung" >> $job_to_send |
---|
| 1455 | elif [[ $remote_host = t3es ]] |
---|
| 1456 | then |
---|
| 1457 | echo "qsub -J n -s /bin/ksh scpjob.$kennung" >> $job_to_send |
---|
[1043] | 1458 | elif [[ $remote_host = lckiaps ]] |
---|
| 1459 | then |
---|
| 1460 | echo "mv scpjob.$kennung $job_catalog" >> $job_to_send |
---|
[1094] | 1461 | echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"$submcom ${job_catalog}/scpjob.$kennung\" " >> $job_to_send |
---|
[1043] | 1462 | echo "rm ${job_catalog}/scpjob.$kennung" >> $job_to_send |
---|
[1099] | 1463 | elif [[ $remote_host = lckyu* ]] |
---|
[1090] | 1464 | then |
---|
[1094] | 1465 | echo "scp $PORTOPT scpjob.$kennung ${remote_username}@${remote_addres}:job_queue" >> $job_to_send |
---|
| 1466 | echo "ssh $SSH_PORTOPT ${remote_username}@${remote_addres} \"cd job_queue; $submcom scpjob.$kennung; rm scpjob.$kennung\" " >> $job_to_send |
---|
[1099] | 1467 | elif [[ $remote_host = lcflow ]] |
---|
| 1468 | then |
---|
| 1469 | echo "mv scpjob.$kennung $job_catalog" >> $job_to_send |
---|
| 1470 | echo "ssh ${remote_username}@${remote_addres} \"$init_cmds $module_calls cd $job_catalog; $submcom scpjob.$kennung\" " >> $job_to_send |
---|
[1] | 1471 | else |
---|
[1040] | 1472 | echo "$submcom scpjob.$kennung" >> $job_to_send |
---|
[1] | 1473 | fi |
---|
[1043] | 1474 | if [[ $remote_host != ibmku && $remote_host != lckiaps ]] |
---|
[622] | 1475 | then |
---|
| 1476 | echo "rm scpjob.$kennung" >> $job_to_send |
---|
| 1477 | fi |
---|
[1] | 1478 | if [[ $remote_host = nech ]] |
---|
| 1479 | then |
---|
| 1480 | echo "cd -" >> $job_to_send |
---|
| 1481 | fi |
---|
| 1482 | else |
---|
| 1483 | # echo "ftpcopy -d $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile" >> $job_to_send |
---|
| 1484 | echo "nohup ftpcopy -d -w 15 $local_addres ${job_catalog}/$remote_dayfile \"$job_catalog\" $local_dayfile > /dev/null &" >> $job_to_send |
---|
| 1485 | fi |
---|
| 1486 | echo "set -x" >> $job_to_send |
---|
| 1487 | echo " ' exit" >> $job_to_send |
---|
| 1488 | echo "set -x" >> $job_to_send |
---|
| 1489 | fi |
---|
| 1490 | |
---|
| 1491 | |
---|
| 1492 | |
---|
| 1493 | # EIGENTLICHE JOB-DATEI AN QSUB-KOMMANDOS ANHAENGEN |
---|
| 1494 | cat $file_to_send >> $job_to_send |
---|
[69] | 1495 | |
---|
[1] | 1496 | if [[ $remote_host = ibm ]] |
---|
| 1497 | then |
---|
| 1498 | echo " " >> $job_to_send |
---|
| 1499 | echo "exit" >> $job_to_send |
---|
| 1500 | fi |
---|
[635] | 1501 | |
---|
| 1502 | # remove job file |
---|
[1099] | 1503 | if [[ $remote_host = lctit || $remote_host = ibmku || $remote_host = lcflow ]] |
---|
[69] | 1504 | then |
---|
| 1505 | echo " " >> $job_to_send |
---|
| 1506 | echo "rm ~/job_queue/$job_on_remhost" >> $job_to_send |
---|
| 1507 | fi |
---|
[1] | 1508 | |
---|
| 1509 | |
---|
| 1510 | |
---|
| 1511 | # USER-NAME AUF ZIELRECHNER AUS .NETRC-DATEI ERMITTELN |
---|
| 1512 | if [[ -z $remote_user ]] |
---|
| 1513 | then |
---|
| 1514 | if [[ $remote_host = t3eb || $remote_host = t3eh || $remote_host = t3ej2 || $remote_host = t3ej5 || $remote_host = t3es || $remote_host = vpp ]] |
---|
| 1515 | then |
---|
| 1516 | grep $remote_addres ~/.netrc | read dum dum dum remote_user dum dum |
---|
| 1517 | fi |
---|
| 1518 | fi |
---|
| 1519 | |
---|
| 1520 | |
---|
| 1521 | |
---|
| 1522 | # JOB AUF ZIELRECHNER TRANSFERIEREN BZW. INS JOBVERZEICHNIS KOPIEREN |
---|
| 1523 | if [[ $no_submit = false ]] |
---|
| 1524 | then |
---|
| 1525 | if [[ $remote_host != $local_host ]] |
---|
| 1526 | then |
---|
| 1527 | [[ $verify = true ]] && printf "\n >>> transfering job to \"$remote_host\"..." |
---|
[82] | 1528 | if [[ $remote_host = ibms || $remote_host = ibmy ]] # ssh on ibms cannot handle "~/" |
---|
[1] | 1529 | then |
---|
[82] | 1530 | job_catalog_save=$job_catalog |
---|
| 1531 | job_catalog=job_queue |
---|
| 1532 | elif [[ $remote_host = nech ]] |
---|
| 1533 | then |
---|
| 1534 | job_catalog_save=$job_catalog |
---|
| 1535 | job_catalog=/hpf/b/${remote_user}/job_queue |
---|
| 1536 | fi |
---|
[1096] | 1537 | if [[ $remote_host = nech ]] |
---|
[82] | 1538 | then |
---|
| 1539 | # DATEIEN KOENNEN NUR UEBER DEN ARCHIVE-SERVER DES DKRZ |
---|
| 1540 | # TRANSFERIERT WERDEN |
---|
[1094] | 1541 | scp $PORTOPT $job_to_send ${remote_user}@136.172.44.205:${job_catalog}/$job_on_remhost |
---|
[1] | 1542 | else |
---|
[1094] | 1543 | scp $PORTOPT $job_to_send ${remote_user}@${remote_addres}:${job_catalog}/$job_on_remhost |
---|
[1] | 1544 | fi |
---|
[82] | 1545 | if [[ $? = 1 ]] |
---|
| 1546 | then |
---|
| 1547 | locat=scp; exit |
---|
| 1548 | fi |
---|
| 1549 | if [[ $remote_host = ibms ]] |
---|
| 1550 | then |
---|
| 1551 | job_catalog=$job_catalog_save |
---|
| 1552 | fi |
---|
[1] | 1553 | [[ $verify = true ]] && printf "\n >>> finished\n" |
---|
| 1554 | else |
---|
| 1555 | eval job_catalog=$job_catalog |
---|
| 1556 | cp $job_to_send ${job_catalog}/$job_on_remhost |
---|
| 1557 | fi |
---|
| 1558 | |
---|
| 1559 | |
---|
| 1560 | |
---|
| 1561 | # NQS- BZW. LOADLEVELER-JOB STARTEN |
---|
| 1562 | if [[ $remote_host != $local_host ]] |
---|
| 1563 | then |
---|
| 1564 | [[ $verify = true ]] && printf "\n >>> submitting job using \"qsub\"...\n" |
---|
[635] | 1565 | |
---|
| 1566 | if [[ $(echo $remote_host | cut -c1-5) = lcsgi && $prio = true ]] |
---|
[1] | 1567 | then |
---|
[635] | 1568 | printf "\n >>> submit with HLRN qos-feature hiprio...\n" |
---|
[1094] | 1569 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom -l qos=hiprio $job_on_remhost; rm $job_on_remhost" |
---|
[635] | 1570 | elif [[ $remote_host = ibmku ]] |
---|
| 1571 | then |
---|
[1094] | 1572 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost" |
---|
[1099] | 1573 | elif [[ $remote_host = lcflow ]] |
---|
| 1574 | then |
---|
| 1575 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "$init_cmds $module_calls cd $job_catalog; $submcom $job_on_remhost" |
---|
[1] | 1576 | else |
---|
[1094] | 1577 | ssh $SSH_PORTOPT $remote_addres -l $remote_user "cd $job_catalog; $submcom $job_on_remhost; rm $job_on_remhost" |
---|
[82] | 1578 | fi |
---|
[1] | 1579 | |
---|
| 1580 | [[ $verify = true ]] && printf " >>> o.k.\n" |
---|
| 1581 | else |
---|
| 1582 | cd $job_catalog |
---|
[210] | 1583 | if [[ $(echo $local_host | cut -c1-5) = lcsgi || $(echo $local_host | cut -c1-3) = ibm ]] |
---|
[1] | 1584 | then |
---|
| 1585 | eval $submcom $job_on_remhost |
---|
[1099] | 1586 | elif [[ $local_host = lcfimm || $local_host = lctit || $localhost = lcxe6 || $localhost = lck || $localhost = lckordi || $localhost = lcyon || $localhost = lcsb || $localhost = lckyu* ]] |
---|
[108] | 1587 | then |
---|
[635] | 1588 | chmod u+x $job_on_remhost |
---|
[108] | 1589 | eval $submcom $job_on_remhost |
---|
[1] | 1590 | elif [[ $local_host = nech ]] |
---|
| 1591 | then |
---|
| 1592 | if [[ $queue = default ]] |
---|
| 1593 | then |
---|
[799] | 1594 | eval $submcom $job_on_remhost |
---|
[1] | 1595 | else |
---|
[799] | 1596 | eval $submcom -q $queue $job_on_remhost |
---|
[1] | 1597 | fi |
---|
| 1598 | else |
---|
| 1599 | qsub $job_on_remhost |
---|
| 1600 | fi |
---|
[622] | 1601 | |
---|
| 1602 | # Jobfile must not be deleted on lctit/ibmku!! This will be done |
---|
| 1603 | # only at the end of the job. |
---|
[1099] | 1604 | if [[ $local_host != lctit && $local_host != ibmku && $local_host != lcflow ]] |
---|
[622] | 1605 | then |
---|
| 1606 | rm $job_on_remhost |
---|
| 1607 | fi |
---|
[1] | 1608 | cd - > /dev/null |
---|
| 1609 | fi |
---|
| 1610 | fi |
---|
| 1611 | |
---|
| 1612 | |
---|
| 1613 | |
---|
| 1614 | # ABSCHLUSSARBEITEN |
---|
| 1615 | |
---|
| 1616 | if [[ $no_submit = false ]] |
---|
| 1617 | then |
---|
[1099] | 1618 | rm -f $job_to_send |
---|
[1] | 1619 | fi |
---|
| 1620 | [[ $verify = true ]] && printf "\n\n *** SUBJOB finished \n\n" |
---|