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