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