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