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