1 | #!/bin/bash |
---|
2 | |
---|
3 | # mrun - script for running PALM jobs |
---|
4 | |
---|
5 | #--------------------------------------------------------------------------------# |
---|
6 | # This file is part of PALM. |
---|
7 | # |
---|
8 | # PALM is free software: you can redistribute it and/or modify it under the terms |
---|
9 | # of the GNU General Public License as published by the Free Software Foundation, |
---|
10 | # either version 3 of the License, or (at your option) any later version. |
---|
11 | # |
---|
12 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
13 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
14 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
15 | # |
---|
16 | # You should have received a copy of the GNU General Public License along with |
---|
17 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | # |
---|
19 | # Copyright 1997-2015 Leibniz Universitaet Hannover |
---|
20 | #--------------------------------------------------------------------------------# |
---|
21 | # |
---|
22 | # Current revisions: |
---|
23 | # ------------------ |
---|
24 | # |
---|
25 | # |
---|
26 | # Former revisions: |
---|
27 | # ----------------- |
---|
28 | # $Id: mrun 2298 2017-06-29 09:28:18Z raasch $ |
---|
29 | # write_binary in ENVPAR has type LOGICAL now, |
---|
30 | # MPI2 coupling removed |
---|
31 | # |
---|
32 | # 2297 2017-06-28 14:35:57Z scharf |
---|
33 | # adjustments for using lcgeohu (cirrus @ HUB) |
---|
34 | # cpp_opts removed |
---|
35 | # |
---|
36 | # 2290 2017-06-19 11:03:06Z raasch |
---|
37 | # further test output removed |
---|
38 | # |
---|
39 | # 2286 2017-06-15 13:31:57Z raasch |
---|
40 | # test output for cycle number removed |
---|
41 | # |
---|
42 | # 2268 2017-06-09 10:34:09Z raasch |
---|
43 | # bugfix for calculating cycle numbers for output files in r2261 |
---|
44 | # |
---|
45 | # 2262 2017-06-08 14:52:23Z raasch |
---|
46 | # bugfix for r2261 |
---|
47 | # |
---|
48 | # 2261 2017-06-08 14:25:57Z raasch |
---|
49 | # unified cycle numbers for output files are used, |
---|
50 | # paths and filenames are allowed to contain arbitrary numbers of dots ".", |
---|
51 | # creation of file OUTPUT_FILE_CONNECTIONS removed, |
---|
52 | # archive feature completely removed from the script, |
---|
53 | # nech related parts completely removed |
---|
54 | # |
---|
55 | # 2257 2017-06-07 14:07:05Z witha |
---|
56 | # adjustments for lceddy, removed lcflow-specific code |
---|
57 | # |
---|
58 | # 2186 2017-03-21 05:36:31Z raasch |
---|
59 | # |
---|
60 | # 2185 2017-03-21 05:09:29Z raasch |
---|
61 | # adjustment for lykyo*-hosts (PJM_ENVIRONMENT defines BATCH) |
---|
62 | # |
---|
63 | # 2148 2017-02-09 16:56:42Z scharf |
---|
64 | # changed allocation of resources for lcbullhh in srun command |
---|
65 | # |
---|
66 | # 2141 2017-02-06 10:19:32Z gronemeier |
---|
67 | # made check for existing files language independent |
---|
68 | # |
---|
69 | # 1944 2016-06-15 06:29:00Z raasch |
---|
70 | # adjustments for using HLRN ssh-keys |
---|
71 | # |
---|
72 | # 1940 2016-06-14 05:15:20Z raasch $ |
---|
73 | # adjustments for lckiaps |
---|
74 | # |
---|
75 | # 1866 2016-04-15 06:50:59Z raasch |
---|
76 | # adjusted for lcocean |
---|
77 | # |
---|
78 | # 1841 2016-04-07 19:14:06Z raasch |
---|
79 | # script now running under bash |
---|
80 | # |
---|
81 | # 1804 2016-04-05 16:30:18Z maronga |
---|
82 | # test: implementing an execute mechanism where the execute command is given in the |
---|
83 | # configuration file |
---|
84 | # ROPTS removed from execution commands |
---|
85 | # Warnings about missing optional files or user code changed to informative messages |
---|
86 | # Removed parameter file check |
---|
87 | # |
---|
88 | # 1755 2016-02-22 13:53:39Z maronga |
---|
89 | # Minor bugfix to last commit |
---|
90 | # |
---|
91 | # 1753 2016-02-22 13:49:49Z maronga |
---|
92 | # Bugfix: use random job number when PBS job nummer retrieval fails on lccray* |
---|
93 | # |
---|
94 | # 1622 2015-07-20 06:21:36Z heinze |
---|
95 | # bugfix for Mistral (lcbullhh) |
---|
96 | # |
---|
97 | # 1621 2015-07-17 11:39:33Z heinze |
---|
98 | # adjustments for Mistral at DKRZ Hamburg (lcbullhh) |
---|
99 | # |
---|
100 | # 1609 2015-07-03 15:37:58Z maronga |
---|
101 | # Modified the random number of the temporary working directory to match the |
---|
102 | # queuing system number on HLRN-III (lccray*). |
---|
103 | # |
---|
104 | # 1604 2015-06-23 15:48:03Z suehring |
---|
105 | # Enable coupled runs for lcmuk |
---|
106 | # |
---|
107 | # 1598 2015-05-29 06:45:40Z raasch |
---|
108 | # bugfix for creating hostfile and total number of MPI tasks if run in openmp-mode on one node |
---|
109 | # |
---|
110 | # 1549 2015-01-30 14:26:16Z suehring |
---|
111 | # Enable interactive debug sessions with allinea debugger |
---|
112 | # |
---|
113 | # 1547 2015-01-29 15:09:12Z witha |
---|
114 | # adjustments for ForWind computing cluster (lcflow) |
---|
115 | # |
---|
116 | # 1491 2014-11-12 08:12:57Z heinze |
---|
117 | # correct setting of batch_job allowed for ibm-machines |
---|
118 | # |
---|
119 | # 1468 2014-09-24 14:06:57Z maronga |
---|
120 | # Typo removed (addres->address) |
---|
121 | # Bugfix: returning files to IMUK via ssh did not work for lccrayh and lcycrayb |
---|
122 | # Added support for restart runs (remote) for lcxe6 |
---|
123 | # |
---|
124 | # 1442 2014-07-28 07:09:10Z raasch |
---|
125 | # default queues for HLRN-III (lccrayb/lccrayh) defined |
---|
126 | # |
---|
127 | # 1422 2014-07-02 10:01:25Z kanani |
---|
128 | # automatic restarts enabled for lccrayb, |
---|
129 | # adjustment of path to compilervars.sh at IMUK (see automatic restarts) |
---|
130 | # |
---|
131 | # 1420 2014-06-10 06:24:14Z raasch |
---|
132 | # -j1 option added to aprung command for lccrayf (CSC) |
---|
133 | # |
---|
134 | # 1402 2014-05-09 14:25:13Z raasch |
---|
135 | # batch_job added to envpar-NAMELIST |
---|
136 | # |
---|
137 | # 1357 2014-04-11 15:02:03Z witha |
---|
138 | # adjustments for lccrayh (automatic restarts on lccrayh outside of IMUK are now |
---|
139 | # possible) |
---|
140 | # |
---|
141 | # 1320 2014-03-20 08:40:49Z raasch |
---|
142 | # check namelist file set false by default |
---|
143 | # |
---|
144 | # 1304 2014-03-12 10:29:42Z raasch |
---|
145 | # ulimit option changed from -Ss to -s |
---|
146 | # |
---|
147 | # bugfix: missing "fi" in r1289 |
---|
148 | # |
---|
149 | # 1289 2014-03-04 07:12:34Z raasch |
---|
150 | # comments translated to English |
---|
151 | # necriam-, fimm-, ibmy-, and sgi-specific code removed |
---|
152 | # export of variables for palm and interpret_config removed |
---|
153 | # |
---|
154 | # 1281 2014-02-01 07:55:49Z raasch |
---|
155 | # rsync-copy restricted to Cray machines, since command is unavailable on some |
---|
156 | # other systems |
---|
157 | # |
---|
158 | # 1279 2014-01-28 12:10:14Z raasch |
---|
159 | # tasks_per_node must not be an integral divisor of numprocs any more. This was done |
---|
160 | # in order to remove annoying restrictions concerning the number of processors which |
---|
161 | # appear on machines with larger nodes (e.g. containing 24 cores). Now without this |
---|
162 | # restriction, one of the nodes will be filled with less than the given number of |
---|
163 | # tasks per node. A respective warning is given. |
---|
164 | # |
---|
165 | # 1274 2014-01-09 13:14:54Z heinze |
---|
166 | # adjustments for lccrayh |
---|
167 | # |
---|
168 | # 1272 2014-01-08 10:19:32Z witha |
---|
169 | # small adjustment for lcflow |
---|
170 | # |
---|
171 | # 1270 2013-12-16 11:05:01Z fricke |
---|
172 | # call of combine_plot_fields adjusted for lccrayb/lccrayh |
---|
173 | # |
---|
174 | # 1255 2013-11-07 14:43:35Z raasch |
---|
175 | # further adjustments for lccrayb remote access |
---|
176 | # |
---|
177 | # 1241 2013-10-30 11:36:58Z heinze |
---|
178 | # Enable use of nudging input and input of large scale forcing from |
---|
179 | # external files |
---|
180 | # |
---|
181 | # 1229 2013-09-20 06:55:19Z raasch |
---|
182 | # further adjustments for lccrayb |
---|
183 | # |
---|
184 | # 1224 2013-09-16 07:27:23Z raasch |
---|
185 | # first adjustments for lccrayb |
---|
186 | # |
---|
187 | # 1210 2013-08-14 10:58:20Z raasch |
---|
188 | # fftw support added |
---|
189 | # |
---|
190 | # 1201 2013-07-10 16:17:59Z witha |
---|
191 | # adjustments for Forwind cluster (lcflow) |
---|
192 | # |
---|
193 | # 1199 2013-07-05 14:52:22Z raasch |
---|
194 | # adjustments for CSC Helsinki (lccrayf), |
---|
195 | # executables for batch jobs can be created in advance, in order to avoid calling |
---|
196 | # the compiler within the batch job (only works if batch jobs are submitted on |
---|
197 | # local host) |
---|
198 | # |
---|
199 | # 1190 2013-06-25 09:39:21Z heinze |
---|
200 | # enable use of automatic restarts for ibmh |
---|
201 | # use of cluster/express queue enabled (ibmh) |
---|
202 | # |
---|
203 | # 1124 2013-04-09 15:46:52Z raasch |
---|
204 | # variable "memory" is exported via typeset option -x, because otherwise an unknown |
---|
205 | # side effect may lead to data loss while getopts is reading the script-option arguments |
---|
206 | # |
---|
207 | # 1122 2013-04-09 08:37:16Z heinze |
---|
208 | # Bugfix: change type of variable last_char |
---|
209 | # |
---|
210 | # 1119 2013-04-05 15:11:19Z raasch |
---|
211 | # Bugfix for setting -T option for subjob |
---|
212 | # |
---|
213 | # 1108 2013-03-05 07:03:32Z raasch |
---|
214 | # bugfix for coupled runs on lckyut/lckyuh |
---|
215 | # |
---|
216 | # 1106 2013-03-04 05:31:38Z raasch |
---|
217 | # --stdin argument for mpiexec on lckyuh |
---|
218 | # -y and -Y settings output to header |
---|
219 | # |
---|
220 | # 1103 2013-02-20 02:15:53Z raasch |
---|
221 | # default script runs again under ksh, because of unsolved problems with read |
---|
222 | # from stdin: when bash script is called from a ksh, message "read error: 0: |
---|
223 | # Resource temporarily unavailable" appears and script does not stop, |
---|
224 | # further bash compatibility adjustments, |
---|
225 | # shebang line replaced by /bin/bash when running jobs on lckyuh; no restarts |
---|
226 | # on lckyuh, but mrun does not terminate and issues a warning instead |
---|
227 | # |
---|
228 | # 1101 2013-02-17 10:20:21Z raasch |
---|
229 | # script now running under bash instead of ksh, which required small adjustments |
---|
230 | # (output formatting with printf instead "typeset -L/-R", print replaced by echo, |
---|
231 | # read from stdin), |
---|
232 | # cross compilername on lckyuh compute nodes replaced by real compiler name |
---|
233 | # |
---|
234 | # 1099 2013-02-10 01:47:43Z raasch |
---|
235 | # adjustments for Kyushu-University computing center (lckyuh - hayaka) |
---|
236 | # and for Forwind cluster (lcflow) |
---|
237 | # small further adjustments for lckyut |
---|
238 | # |
---|
239 | # 1094 2013-02-03 01:52:12Z raasch |
---|
240 | # explicit ssh/scp port can be set in config file with environment variable |
---|
241 | # scp_port. This port is handled to all ssh/scp/batch_scp calls. |
---|
242 | # decalpha parts (yonsei) removed |
---|
243 | # |
---|
244 | # 2013-02-02 07:06:13Z raasch |
---|
245 | # adjustments for Kyushu-University computing center (lckyut - tatara) |
---|
246 | # |
---|
247 | # 1083 2013-01-04 10:22:09Z maronga |
---|
248 | # bugfix in parameter file check (read %cpp_options was missing) |
---|
249 | # |
---|
250 | # 1069 2012-11-28 16:18:43Z maronga |
---|
251 | # bugfix: coupling mode was always set to mpi2, typos removed |
---|
252 | # |
---|
253 | # 1058 2012-11-21 07:00:35Z raasch |
---|
254 | # Intel inspector (inspxe) is given the number of PEs instead of the number of |
---|
255 | # nodes |
---|
256 | # |
---|
257 | # 1046 2012-11-09 14:38:45Z maronga |
---|
258 | # code put under GPL (PALM 3.9) |
---|
259 | # |
---|
260 | # 21/03/94 - Siggi - first version finished |
---|
261 | # 03/03/94 - Siggi - script development started |
---|
262 | # |
---|
263 | #--------------------------------------------------------------------------------# |
---|
264 | # mrun - script for running PALM jobs |
---|
265 | #--------------------------------------------------------------------------------# |
---|
266 | |
---|
267 | |
---|
268 | |
---|
269 | # DECLARATION OF VARIABLES AND THEIR DEFUALT VALUES |
---|
270 | |
---|
271 | set +o allexport # SUPPRESS EXPORT OF ALL VARIABLES, SINCE IN THE PAST THIS |
---|
272 | # LES TO PROBLEMS IN ROUTINES CALLED BY MRUN |
---|
273 | # (TOO MANY ARGUMENTS - PROBLEM) |
---|
274 | set +o noclobber # EXISTING FILES ARE ALLOWED TO BE OVERWRITTEN |
---|
275 | |
---|
276 | AddFilenames="" |
---|
277 | additional_conditions="" |
---|
278 | add_source_path="" |
---|
279 | afname="" |
---|
280 | check_namelist_files=false |
---|
281 | combine_plot_fields=true |
---|
282 | compiler_name="" |
---|
283 | cond1="" |
---|
284 | cond2="" |
---|
285 | config_file=.mrun.config |
---|
286 | coupled_dist="" |
---|
287 | cpp_options="" |
---|
288 | cpumax=0 |
---|
289 | cpurest=0 |
---|
290 | create_executable_for_batch=false |
---|
291 | delete_temporary_catalog=true |
---|
292 | do_batch=false |
---|
293 | do_compile=true |
---|
294 | do_remote=false |
---|
295 | do_stagein=true |
---|
296 | do_stageout=true |
---|
297 | do_trace=false |
---|
298 | email_notification="none" |
---|
299 | exclude="" |
---|
300 | executable="" |
---|
301 | execute_command="none" |
---|
302 | execution_error=false |
---|
303 | fftw_inc="" |
---|
304 | fftw_lib="" |
---|
305 | fftw_support=false |
---|
306 | fname=test |
---|
307 | fromhost="" |
---|
308 | global_revision="" |
---|
309 | group_number=none |
---|
310 | host="" |
---|
311 | host_file="" |
---|
312 | hp="" |
---|
313 | input_list="" |
---|
314 | interpreted_config_file="" |
---|
315 | job_catalog="~/job_queue" |
---|
316 | job_on_file="" |
---|
317 | keep_data_from_previous_run=false |
---|
318 | link_local_input=false |
---|
319 | link_local_output=false |
---|
320 | localhost_realname=$(hostname) |
---|
321 | local_dvrserver_running=.FALSE. |
---|
322 | locat=normal |
---|
323 | mainprog="" |
---|
324 | makefile="" |
---|
325 | max_par_io_str="" |
---|
326 | mc=$0 |
---|
327 | while [[ $(echo $mc | grep -c "/") != 0 ]] |
---|
328 | do |
---|
329 | mc=`echo $mc | cut -f2- -d"/"` |
---|
330 | done |
---|
331 | module_calls="" |
---|
332 | mrun_script_name=$mc |
---|
333 | netcdf_inc="" |
---|
334 | netcdf_lib="" |
---|
335 | netcdf_support=false |
---|
336 | node_usage=default |
---|
337 | numprocs="" |
---|
338 | numprocs_atmos=0 |
---|
339 | numprocs_ocean=0 |
---|
340 | OOPT="" |
---|
341 | openmp=false |
---|
342 | output_list="" |
---|
343 | package_list="" |
---|
344 | queue=none |
---|
345 | read_from_config="" |
---|
346 | restart_run=false |
---|
347 | if [[ `hostname` = rte10 ]] |
---|
348 | then |
---|
349 | return_address=133.5.185.60 |
---|
350 | echo "+++ WARNING: fixed return_address = $return_address is used !!!!!" |
---|
351 | elif [[ `hostname` = climate0 ]] |
---|
352 | then |
---|
353 | return_address=165.132.26.68 |
---|
354 | echo "+++ WARNING: fixed return_address = $return_address is used !!!!!" |
---|
355 | elif [[ `hostname` = "schultzl-Latitude-E6540" ]] |
---|
356 | then |
---|
357 | return_address="schultzl-Latitude-E6540" |
---|
358 | echo "+++ WARNING: fixed return_address = $return_address is used !!!!!" |
---|
359 | elif [[ `hostname` = urban00 ]] |
---|
360 | then |
---|
361 | return_address=147.46.30.151 |
---|
362 | echo "+++ WARNING: fixed return_address = $return_address is used !!!!!" |
---|
363 | else |
---|
364 | return_address=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}') |
---|
365 | fi |
---|
366 | return_password="" |
---|
367 | return_username=$LOGNAME |
---|
368 | remotecall=false |
---|
369 | remote_username="" |
---|
370 | run_coupled_model=false |
---|
371 | run_mode="" |
---|
372 | dashes=" ----------------------------------------------------------------------------" |
---|
373 | silent=false |
---|
374 | source_list="" |
---|
375 | source_path=SOURCE |
---|
376 | tasks_per_node="" |
---|
377 | threads_per_task=1 |
---|
378 | tmpcreate=false |
---|
379 | tmp_data_catalog="" |
---|
380 | transfer_problems=false |
---|
381 | usern=$LOGNAME |
---|
382 | use_openmp=false |
---|
383 | version="MRUN 2.1 Rev$Rev: 2298 $" |
---|
384 | working_directory=`pwd` |
---|
385 | TOPT="" |
---|
386 | XOPT="" |
---|
387 | zeit=$( date | cut -c 12-19 ) |
---|
388 | |
---|
389 | typeset -i iec=0 iic=0 iin=0 ioc=0 iout=0 stagein_anz=0 stageout_anz=0 |
---|
390 | typeset -x -i memory=0 # HAS TO BE EXPORTED HERE, OTHERWISE AN UNKNOWN SIDE |
---|
391 | # SIDE EFFECT MAY CAUSE DATA LOSS WHEN GETOPTS IS READING THE |
---|
392 | # SCRIPT-OPTION ARGUMENTS |
---|
393 | typeset -i cputime i ii iia iii iio icycle inode ival jobges jobsek last_char_int maxcycle minuten nodes pes remaining_pes run_number sekunden tp1 |
---|
394 | |
---|
395 | # ERROR HANDLING IN CASE OF EXIT |
---|
396 | trap 'rm -rf $working_directory/tmp_mrun |
---|
397 | if [[ $locat != normal && $locat != control_c ]] |
---|
398 | then |
---|
399 | |
---|
400 | # CARRY OUT ERROR-COMMANDS GIVEN IN THE CONFIGURATION FILE (EC:) |
---|
401 | (( i = 0 )) |
---|
402 | while (( i < iec )) |
---|
403 | do |
---|
404 | (( i = i + 1 )) |
---|
405 | printf "\n *** Execution of ERROR-command:\n" |
---|
406 | printf " >>> ${err_command[$i]}\n" |
---|
407 | eval ${err_command[$i]} |
---|
408 | done |
---|
409 | if [[ -n $interpreted_config_file ]] |
---|
410 | then |
---|
411 | rm -rf $interpreted_config_file |
---|
412 | fi |
---|
413 | if [[ -n .mrun_environment ]] |
---|
414 | then |
---|
415 | rm -rf .mrun_environment |
---|
416 | fi |
---|
417 | if [[ $tmpcreate = true ]] |
---|
418 | then |
---|
419 | # printf "\n *** Contents of \"$TEMPDIR\":\n" |
---|
420 | # ls -al; cd |
---|
421 | [[ $delete_temporary_catalog = true ]] && rm -rf $TEMPDIR |
---|
422 | fi |
---|
423 | if [[ "$dvrserver_id" != "" ]] |
---|
424 | then |
---|
425 | echo "+++ killing dvrserver_id=$dvrserver_id" |
---|
426 | kill $dvrserver_id |
---|
427 | fi |
---|
428 | if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]] |
---|
429 | then |
---|
430 | rm -rf ~/job_queue/JOBINFO.$QSUB_REQID |
---|
431 | fi |
---|
432 | printf "\n\n+++ MRUN killed \n\n" |
---|
433 | elif [[ $locat != control_c ]] |
---|
434 | then |
---|
435 | printf "\n\n --> all actions finished\n\n" |
---|
436 | printf " Bye, bye $usern !!\n\n" |
---|
437 | fi' exit |
---|
438 | |
---|
439 | |
---|
440 | # ACTIONS IN CASE OF TERMINAL-BREAK (CONTROL-C): |
---|
441 | trap 'rm -rf $working_directory/tmp_mrun |
---|
442 | rm -rf $working_directory/tmp_check_namelist_files |
---|
443 | [[ $tmpcreate = true ]] && (cd; rm -rf $TEMPDIR) |
---|
444 | if [[ -f ~/job_queue/JOBINFO.$QSUB_REQID ]] |
---|
445 | then |
---|
446 | rm -rf ~/job_queue/JOBINFO.$QSUB_REQID |
---|
447 | fi |
---|
448 | if [[ "$dvrserver_id" != "" ]] |
---|
449 | then |
---|
450 | echo "+++ killing dvrserver_id=$dvrserver_id" |
---|
451 | kill $dvrserver_id |
---|
452 | fi |
---|
453 | printf "\n+++ MRUN killed by \"^C\" \n\n" |
---|
454 | locat=control_c |
---|
455 | exit |
---|
456 | ' 2 |
---|
457 | |
---|
458 | |
---|
459 | # CHECK IF THE PATH FOR THE PALM BINARIES (SCRIPTS+UTILITY-PROGRAMS) HAS |
---|
460 | # BEEN SET |
---|
461 | if [[ "$PALM_BIN" = "" ]] |
---|
462 | then |
---|
463 | printf "\n +++ environment variable PALM_BIN has not been set" |
---|
464 | printf "\n please set it to the directory where the PALM scripts are located" |
---|
465 | locat=palm_bin; exit |
---|
466 | fi |
---|
467 | export PATH=$PALM_BIN:$PATH |
---|
468 | |
---|
469 | |
---|
470 | |
---|
471 | # READ SHELLSCRIPT-OPTIONS AND REBUILD THE MRUN-COMMAND STRING (MC), |
---|
472 | # WHICH WILL BE USED TO START RESTART-JOBS |
---|
473 | while getopts :a:bBc:Cd:Fg:G:h:H:i:kK:m:M:n:o:O:p:P:q:r:R:s:St:T:u:U:vw:xX:yY:zZ option |
---|
474 | do |
---|
475 | case $option in |
---|
476 | (a) afname=$OPTARG;; |
---|
477 | (b) do_batch=true; mc="$mc -b";; |
---|
478 | (B) delete_temporary_catalog=false; mc="$mc -B";; |
---|
479 | (c) config_file=$OPTARG; mc="$mc -c$OPTARG";; |
---|
480 | (C) restart_run=true; mc="$mc -C";; |
---|
481 | (d) fname=$OPTARG; mc="$mc -d$OPTARG";; |
---|
482 | (F) job_on_file="-D"; mc="$mc -F";; |
---|
483 | (g) group_number=$OPTARG; mc="$mc -g$OPTARG";; |
---|
484 | (G) global_revision=$OPTARG; mc="$mc -G'$OPTARG'";; |
---|
485 | (h) host=$OPTARG; mc="$mc -h$OPTARG";; |
---|
486 | (H) fromhost=$OPTARG; mc="$mc -H$OPTARG";; |
---|
487 | (i) input_list=$OPTARG; mc="$mc -i'$OPTARG'";; |
---|
488 | (k) keep_data_from_previous_run=true; mc="$mc -k";; |
---|
489 | (K) additional_conditions="$OPTARG"; mc="$mc -K'$OPTARG'";; |
---|
490 | (m) memory=$OPTARG; mc="$mc -m$OPTARG";; |
---|
491 | (M) makefile=$OPTARG; mc="$mc -M$OPTARG";; |
---|
492 | (n) node_usage=$OPTARG; mc="$mc -n$OPTARG";; |
---|
493 | (o) output_list=$OPTARG; mc="$mc -o'$OPTARG'";; |
---|
494 | (O) use_openmp=true; threads_per_task=$OPTARG; mc="$mc -O$OPTARG";; |
---|
495 | (p) package_list=$OPTARG; mc="$mc -p'$OPTARG'";; |
---|
496 | (P) return_password=$OPTARG; mc="$mc -P$OPTARG";; |
---|
497 | (q) queue=$OPTARG; mc="$mc -q$OPTARG";; |
---|
498 | (r) run_mode=$OPTARG; mc="$mc -r'$OPTARG'";; |
---|
499 | (R) remotecall=true;return_address=$OPTARG; mc="$mc -R$OPTARG";; |
---|
500 | (s) source_list=$OPTARG; mc="$mc -s'$OPTARG'";; |
---|
501 | (S) read_from_config=false; mc="$mc -S";; |
---|
502 | (t) cpumax=$OPTARG; mc="$mc -t$OPTARG";; |
---|
503 | (T) mrun_tasks_per_node=$OPTARG; mc="$mc -T$OPTARG";; |
---|
504 | (u) remote_username=$OPTARG; mc="$mc -u$OPTARG";; |
---|
505 | (U) return_username=$OPTARG; mc="$mc -U$OPTARG";; |
---|
506 | (v) silent=true; mc="$mc -v";; |
---|
507 | (w) max_par_io_str=$OPTARG; mc="$mc -w$OPTARG";; |
---|
508 | (x) do_trace=true;set -x; mc="$mc -x";; |
---|
509 | (X) numprocs=$OPTARG; mc="$mc -X$OPTARG";; |
---|
510 | (y) ocean_file_appendix=true; mc="$mc -y";; |
---|
511 | (Y) run_coupled_model=true; coupled_dist=$OPTARG; mc="$mc -Y'$OPTARG'";; |
---|
512 | (z) check_namelist_files=false; mc="$mc -z";; |
---|
513 | (Z) combine_plot_fields=false; mc="$mc -Z";; |
---|
514 | (\?) printf "\n +++ unknown option $OPTARG \n" |
---|
515 | printf "\n --> type \"$0 ?\" for available options \n" |
---|
516 | locat=parameter;exit;; |
---|
517 | esac |
---|
518 | done |
---|
519 | |
---|
520 | |
---|
521 | # SKIP GIVEN OPTIONS TO READ POSITIONAL PARAMETER, IF GIVEN |
---|
522 | # CURRENTLY ONLY PARAMETER ? (TO OUTPUT A SHORT COMMAND INFO) IS ALLOWED |
---|
523 | (( to_shift = $OPTIND - 1 )) |
---|
524 | shift $to_shift |
---|
525 | |
---|
526 | # PRINT SHORT DESCRIPTION OF MRUN OPTIONS |
---|
527 | if [[ "$1" = "?" ]] |
---|
528 | then |
---|
529 | (printf "\n *** mrun can be called as follows:\n" |
---|
530 | printf "\n $mrun_script_name -b -c.. -d.. -f.. -F -h.. -i.. -I -K.. -m.. -o.. -p.. -r.. -R -s.. -t.. -T.. -v -x -X.. -y -Y.. -Z <modus> \n" |
---|
531 | printf "\n Description of available options:\n" |
---|
532 | printf "\n Option Description Default-Value" |
---|
533 | printf "\n -a base name of input files equiv. -d" |
---|
534 | printf "\n -b batch-job on local machine ---" |
---|
535 | printf "\n -B do not delete temporary directory at end ---" |
---|
536 | printf "\n -c configuration file .mrun.config" |
---|
537 | printf "\n -d base name of files attached to program test" |
---|
538 | printf "\n -F create remote job file only ---" |
---|
539 | printf "\n -h execution host $localhost_realname" |
---|
540 | printf "\n -i INPUT control list \"\" " |
---|
541 | printf "\n -k keep data from previous run" |
---|
542 | printf "\n -K additional conditions for controling" |
---|
543 | printf "\n usage of conditional code and" |
---|
544 | printf "\n env-variables in configuration file \"\" " |
---|
545 | printf "\n -m memory demand in MB (batch-jobs) 0 MB" |
---|
546 | printf "\n -M Makefile name Makefile" |
---|
547 | printf "\n -n node usage (shared/not_shared) depending on -h" |
---|
548 | printf "\n -o OUTPUT control list \"\" " |
---|
549 | printf "\n -O threads per openMP task ---" |
---|
550 | printf "\n -p software package list \"\" " |
---|
551 | printf "\n -q queue \"$queue\" " |
---|
552 | printf "\n -r run control list (combines -i -o) \"\" " |
---|
553 | printf "\n -s filenames of routines to be compiled \"\" " |
---|
554 | printf "\n must end with .f, .f90, .F, or .c !" |
---|
555 | printf "\n use \"..\" for more than one file and wildcards" |
---|
556 | printf "\n -s LM compiles all locally modified files" |
---|
557 | printf "\n -S config file interpreted by shellscript ---" |
---|
558 | printf "\n -t allowed cpu-time in seconds (batch) 0" |
---|
559 | printf "\n -T tasks per node depending on -h" |
---|
560 | printf "\n -u username on remote machine \"\" " |
---|
561 | printf "\n -v no prompt for confirmation ---" |
---|
562 | printf "\n -w maximum parallel io streams as given by -X" |
---|
563 | printf "\n -x tracing of mrun for debug purposes ---" |
---|
564 | printf "\n -X # of processors (on parallel machines) 1" |
---|
565 | printf "\n -y add appendix \"_O\" to all local output" |
---|
566 | printf "\n files (ocean precursor runs followed by" |
---|
567 | printf "\n coupled atmosphere-ocean runs) ---" |
---|
568 | printf "\n -Y run coupled model, \"#1 #2\" with" |
---|
569 | printf "\n #1 atmosphere and #2 ocean processors \"#/2 #/2\" depending on -X" |
---|
570 | printf "\n -Z skip combine_plot_fields at the end of " |
---|
571 | printf "\n the simulation ---" |
---|
572 | printf "\n " |
---|
573 | printf "\n Possible values of positional parameter <modus>:" |
---|
574 | printf "\n \"?\" - this outline \n\n") | more |
---|
575 | exit |
---|
576 | elif [[ "$1" != "" ]] |
---|
577 | then |
---|
578 | printf "\n +++ positional parameter $1 unknown \n" |
---|
579 | locat=parameter; exit |
---|
580 | fi |
---|
581 | |
---|
582 | |
---|
583 | |
---|
584 | # SHORT STARTING MESSAGE |
---|
585 | printf "\n*** $version " |
---|
586 | printf "\n will be executed. Please wait ..." |
---|
587 | |
---|
588 | |
---|
589 | |
---|
590 | # CHECK, IF CONFIGURATION FILE EXISTS |
---|
591 | if [[ ! -f $config_file ]] |
---|
592 | then |
---|
593 | printf "\n\n +++ configuration file: " |
---|
594 | printf "\n $config_file" |
---|
595 | printf "\n does not exist" |
---|
596 | locat=connect; exit |
---|
597 | fi |
---|
598 | |
---|
599 | |
---|
600 | # DETERMINE THE HOST-IDENTIFIER (localhost) FROM THE CONFIGURATION FILE |
---|
601 | line="" |
---|
602 | grep "%host_identifier" $config_file > tmp_mrun |
---|
603 | while read line |
---|
604 | do |
---|
605 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
606 | then |
---|
607 | HOSTNAME=`echo $line | cut -d" " -s -f2` |
---|
608 | host_identifier=`echo $line | cut -d" " -s -f3` |
---|
609 | if [[ $localhost_realname = $HOSTNAME ]] |
---|
610 | then |
---|
611 | localhost=$host_identifier |
---|
612 | break |
---|
613 | fi |
---|
614 | fi |
---|
615 | done < tmp_mrun |
---|
616 | |
---|
617 | if [[ "$localhost" = "" ]] |
---|
618 | then |
---|
619 | printf "\n\n +++ no host identifier found in configuration file \"$config_file\"" |
---|
620 | printf "\n for local host \"$localhost_realname\"." |
---|
621 | printf "\n Please add line" |
---|
622 | printf "\n \"\%host_identifier $localhost_realname <identifier>\"" |
---|
623 | printf "\n to the configuration file." |
---|
624 | locat=localhost; exit |
---|
625 | fi |
---|
626 | |
---|
627 | |
---|
628 | # ??? THIS SHOULD BE DECRIBED IN THE MRUN DOCUMENTATION ??? |
---|
629 | # SET BASENAME OF THE INPUT-FILES TO THE GENERAL BASENAME (GIVEN BY OPTION -d), |
---|
630 | # IF IT HAS NOT BEEN SET BY THE USER DIFFERENTLY (USING OPTION -a) |
---|
631 | [[ "$afname" = "" ]] && afname=$fname |
---|
632 | |
---|
633 | |
---|
634 | # ADD RUN-FILE ACTIVATION STRINGS (GIVEN BY OPTION -r) TO THE |
---|
635 | # RESPECTIVE LISTS FOR ACTIVATING THE INPUT/OUTPUT FILE CONNECTION |
---|
636 | # STATEMENTS IN THE CONFIGURATION FILE |
---|
637 | if [[ "$run_mode" != "" ]] |
---|
638 | then |
---|
639 | input_list="$input_list $run_mode" |
---|
640 | output_list="$output_list $run_mode" |
---|
641 | fi |
---|
642 | |
---|
643 | |
---|
644 | # ??? is this (and the respective option -H) really required ??? |
---|
645 | # STORE HOSTNAME, FROM WHICH THE JOB IS STARTED, |
---|
646 | # BUT ONLY IF IT HASN'T BEEN ALREADY SET BY OPTION -H |
---|
647 | # (MRUN IS AUTOMATICALLY SETTING THIS OPTION IN THE MRUN-CALLS WITHIN |
---|
648 | # THOSE BATCH-JOBS, WHICH ARE CREATED BY MRUN ITSELF) |
---|
649 | if [[ "$fromhost" = "" ]] |
---|
650 | then |
---|
651 | fromhost=$localhost |
---|
652 | fi |
---|
653 | |
---|
654 | |
---|
655 | # CHECK, IF EXECUTION SHALL TO BE DONE ON THE REMOTE-MACHINE. |
---|
656 | # VALUE OF do_remote IS IMPORTANT FOR THE FILE CONNECTIONS. |
---|
657 | # IN CASE OF EXECUTION ON A REMOTE-MACHINE, A BATCH-JOB HAS |
---|
658 | # TO BE SUBMITTED (I.E. do_batch=true) |
---|
659 | if [[ -n $host && "$host" != $localhost ]] |
---|
660 | then |
---|
661 | do_batch=true |
---|
662 | do_remote=true |
---|
663 | case $host in |
---|
664 | (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb|lcgeohu) true;; |
---|
665 | (*) printf "\n" |
---|
666 | printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" |
---|
667 | printf "\n is not available" |
---|
668 | locat=nqs; (( iec = 0 )); exit;; |
---|
669 | esac |
---|
670 | else |
---|
671 | host=$localhost |
---|
672 | fi |
---|
673 | |
---|
674 | |
---|
675 | # EVALUATE ADDITIONAL CONDITIONS GIVEN BY OPTION -K |
---|
676 | if [[ -n $additional_conditions ]] |
---|
677 | then |
---|
678 | cond1=`echo $additional_conditions | cut -d" " -f1` |
---|
679 | cond2=`echo $additional_conditions | cut -d" " -s -f2` |
---|
680 | dummy=`echo $additional_conditions | cut -d" " -s -f3` |
---|
681 | if [[ -n $dummy ]] |
---|
682 | then |
---|
683 | printf "\n +++ more than 2 additional conditions given for Option \"-K\"" |
---|
684 | locat=options; exit |
---|
685 | fi |
---|
686 | block=_$cond1 |
---|
687 | [[ -n $cond2 ]] && block=${block}_$cond2 |
---|
688 | fi |
---|
689 | |
---|
690 | |
---|
691 | # EVALUATE MODEL COUPLING FEATURES (OPTION -Y) |
---|
692 | if [[ $run_coupled_model = true ]] |
---|
693 | then |
---|
694 | |
---|
695 | numprocs_atmos=`echo $coupled_dist | cut -d" " -s -f1` |
---|
696 | numprocs_ocean=`echo $coupled_dist | cut -d" " -s -f2` |
---|
697 | |
---|
698 | if (( $numprocs_ocean + $numprocs_atmos != $numprocs )) |
---|
699 | then |
---|
700 | |
---|
701 | printf "\n +++ number of processors does not fit to specification by \"-Y\"." |
---|
702 | printf "\n PEs (total) : $numprocs" |
---|
703 | printf "\n PEs (atmosphere): $numprocs_atmos" |
---|
704 | printf "\n PEs (ocean) : $numprocs_ocean" |
---|
705 | locat=coupling; exit |
---|
706 | |
---|
707 | fi |
---|
708 | |
---|
709 | fi |
---|
710 | |
---|
711 | # SAVE VALUES OF MRUN-OPTIONS SICHERN IN ORDER TO OVERWRITE |
---|
712 | # THOSE VALUES GIVEN IN THE CONFIGURATION-FILE |
---|
713 | mrun_memory=$memory |
---|
714 | mrun_group_number=$group_number |
---|
715 | mrun_cpumax=$cpumax |
---|
716 | mrun_numprocs=$numprocs |
---|
717 | |
---|
718 | |
---|
719 | # READ AND EVALUATE THE CONFIGURATION-FILE FROM WITHIN THIS SHELLSCRIPT |
---|
720 | # (OPTION -S). THE DEFAULT IS USING THE ROUTINE <<<< |
---|
721 | if [[ "$read_from_config" = false ]] |
---|
722 | then |
---|
723 | [[ $silent = false ]] && printf "\n Reading the configuration file... " |
---|
724 | |
---|
725 | # READ THE CONFIGURATION FILE LINE BY LINE |
---|
726 | while read zeile |
---|
727 | do |
---|
728 | [[ $silent = false ]] && printf "." |
---|
729 | |
---|
730 | |
---|
731 | # FIRST REPLACE ENVIRONMENT-VARIABLES BY THEIR RESPECTIVE VALUES |
---|
732 | eval zeile=\"$zeile\" |
---|
733 | |
---|
734 | |
---|
735 | # INTERPRET THE LINE |
---|
736 | if [[ "$(echo $zeile)" = "" ]] |
---|
737 | then |
---|
738 | # EMPTY LINE, NO ACTION |
---|
739 | continue |
---|
740 | |
---|
741 | elif [[ "$(echo $zeile | cut -c1)" = "#" ]] |
---|
742 | then |
---|
743 | |
---|
744 | # LINE IS A COMMENT LINE |
---|
745 | true |
---|
746 | |
---|
747 | elif [[ "$(echo $zeile | cut -c1)" = "%" ]] |
---|
748 | then |
---|
749 | |
---|
750 | # LINE DEFINES AN ENVIRONMENT-VARIABLE |
---|
751 | zeile=$(echo $zeile | cut -c2-) |
---|
752 | var=`echo $zeile | cut -d" " -f1` |
---|
753 | value=`echo $zeile | cut -d" " -s -f2` |
---|
754 | for_host=`echo $zeile | cut -d" " -s -f3` |
---|
755 | for_cond1=`echo $zeile | cut -d" " -s -f4` |
---|
756 | for_cond2=`echo $zeile | cut -d" " -s -f5` |
---|
757 | |
---|
758 | if [[ "$for_host" = "" || ( "$for_host" = $host && "$for_cond1" = "$cond1" && "$for_cond2" = "$cond2" ) || $(echo "$input_list$output_list"|grep -c "$for_host") != 0 ]] |
---|
759 | then |
---|
760 | |
---|
761 | # REPLACE ":" BY " " IN COMPILER- CPP- OR LINKER-OPTIONS, |
---|
762 | # "::" IS REPLACED BY ":". |
---|
763 | value=`echo $value | sed 's/::/%DUM%/g' | sed 's/:/ /g' | sed 's/%DUM%/:/g'` |
---|
764 | |
---|
765 | |
---|
766 | # VALUE FROM THE CONFIGURATION-FILE IS ASSIGNED TO THE |
---|
767 | # ENVIRONMENT-VARIABLE, BUT ONLY IF NO VALUE HAS BEEN ALREADY |
---|
768 | # ASSIGNED WITHIN THIS SCRIPT (E.G. BY SCRIPT-OPTIONS). |
---|
769 | # NON-ASSIGNED VARIABLES HAVE VALUE "" OR 0 (IN CASE OF INTEGER). |
---|
770 | # HENCE THE GENERAL RULE IS: SCRIPT-OPTION OVERWRITES THE |
---|
771 | # CONFIGURATION-FILE. |
---|
772 | if [[ "$(eval echo \$$var)" = "" || "$(eval echo \$$var)" = "0" ]] |
---|
773 | then |
---|
774 | eval $var=\$value |
---|
775 | |
---|
776 | # TERMINAL OUTPUT OF ENVIRONMENT-VARIABLES, IF TRACEBACK IS SWITCHED on |
---|
777 | if [[ $do_trace = true ]] |
---|
778 | then |
---|
779 | printf "\n*** ENVIRONMENT-VARIABLE $var = $value" |
---|
780 | fi |
---|
781 | fi |
---|
782 | |
---|
783 | # IF AN ENVIRONMENT-VARIABLE DETERMINES THE HOST, THEN EVALUATE IT IMMEDIATELY: |
---|
784 | # VALUE OF do-remote IS REQUIRED FOR THE FILE CONNECTIONS (COPY OF I/O FILES). |
---|
785 | # IF EXECUTION IS SCHEDULED FOR A REMOTE-MASCHINE, A BATCH-JOB |
---|
786 | # MUST HAVE TO BE STARTED |
---|
787 | if [[ $var = host ]] |
---|
788 | then |
---|
789 | if [[ -n $host && "$host" != $localhost ]] |
---|
790 | then |
---|
791 | do_batch=true |
---|
792 | do_remote=true |
---|
793 | case $host in |
---|
794 | (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb|lcgeohu) true;; |
---|
795 | (*) printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" |
---|
796 | printf "\n is not available" |
---|
797 | locat=nqs; exit;; |
---|
798 | esac |
---|
799 | else |
---|
800 | host=$localhost |
---|
801 | fi |
---|
802 | fi |
---|
803 | |
---|
804 | # USER-DEFINED ENVIRONMENT VARIABLES MUST BE EXPORTED, |
---|
805 | # BECAUSE THEY MAY BE REQUIRED IN OTHER SCRIPTS CALLED |
---|
806 | # BY MRUN (E.G. subjob) |
---|
807 | export $var |
---|
808 | fi |
---|
809 | |
---|
810 | |
---|
811 | |
---|
812 | |
---|
813 | elif [[ "$(echo $zeile | cut -c1-3)" = "EC:" ]] |
---|
814 | then |
---|
815 | |
---|
816 | # LINE DEFINES ERROR-COMMAND |
---|
817 | (( iec = iec + 1 )) |
---|
818 | zeile=$(echo $zeile | cut -c4-) |
---|
819 | err_command[$iec]="$zeile" |
---|
820 | |
---|
821 | elif [[ "$(echo $zeile | cut -c1-3)" = "IC:" ]] |
---|
822 | then |
---|
823 | |
---|
824 | # LINE DEFINES INPUT-COMMAND |
---|
825 | (( iic = iic + 1 )) |
---|
826 | zeile=$(echo $zeile | cut -c4-) |
---|
827 | in_command[$iic]="$zeile" |
---|
828 | |
---|
829 | elif [[ "$(echo $zeile | cut -c1-3)" = "OC:" ]] |
---|
830 | then |
---|
831 | |
---|
832 | # LINE DEFINES OUTPUT-COMMAND |
---|
833 | (( ioc = ioc + 1 )) |
---|
834 | zeile=$(echo $zeile | cut -c4-) |
---|
835 | out_command[$ioc]="$zeile" |
---|
836 | |
---|
837 | else |
---|
838 | |
---|
839 | # LINE DEFINES FILE CONNECTION. READ THE FILE ATTRIBUTES. |
---|
840 | # s2a: in/out - field |
---|
841 | # s2b: loc - field (optional) |
---|
842 | # s2c: tr/ar - field (optional) |
---|
843 | s1=`echo $zeile | cut -d" " -f1` |
---|
844 | s2=`echo $zeile | cut -d" " -s -f2` |
---|
845 | s2a=$(echo $s2 | cut -d":" -f1) |
---|
846 | if [[ $(echo $s2 | grep -c ":") = 0 ]] |
---|
847 | then |
---|
848 | s2b="" |
---|
849 | s2c="" |
---|
850 | else |
---|
851 | s2b=`echo $s2 | cut -d":" -f2 | sed 's/:/ /g'` |
---|
852 | s2c=`echo $s2 | cut -d":" -s -f3 | sed 's/:/ /g'` |
---|
853 | fi |
---|
854 | s3=`echo $zeile | cut -d" " -f3` |
---|
855 | s4=`echo $zeile | cut -d" " -s -f4` |
---|
856 | s5=`echo $zeile | cut -d" " -s -f5` |
---|
857 | s6=`echo $zeile | cut -d" " -s -f6` |
---|
858 | |
---|
859 | |
---|
860 | # STORE FILE CONNECTION, IF ACTIVATED BY ACTIVATION-STRING FROM |
---|
861 | # INPUT- OR OUTPUT-LIST. |
---|
862 | # VARIABLE S3 MAY CONTAIN A LIST OF ACTIVATION STRINGS (FIELD-SEPERATOR ":"). |
---|
863 | # IF EXECUTION IS SCHEDULED FOR A REMOTE-MACHINE AND THE FILE IS ONLY |
---|
864 | # LOCALLY REQUIRED ON THAT MACHINE (I.E. s2b = loc), THE FILE CONNECTION |
---|
865 | # IS NOT CHECKED AND STORED. |
---|
866 | IFSALT="$IFS"; IFS="$IFS:" |
---|
867 | if [[ "$s2a" = in && ! ( $do_remote = true && ( "$s2b" = loc || "$s2b" = locopt ) ) ]] |
---|
868 | then |
---|
869 | found=false |
---|
870 | for actual in $input_list |
---|
871 | do |
---|
872 | for formal in $s3 |
---|
873 | do |
---|
874 | [[ $actual = $formal || "$formal" = "-" ]] && found=true |
---|
875 | done |
---|
876 | done |
---|
877 | if [[ $found = true ]] |
---|
878 | then |
---|
879 | (( iin = iin + 1 )) |
---|
880 | localin[$iin]=$s1; transin[$iin]=$s2b; actionin[$iin]=$s2c; |
---|
881 | typein[$iin]=$s3; pathin[$iin]=$s4; endin[$iin]=$s5; |
---|
882 | extin[$iin]=$s6 |
---|
883 | fi |
---|
884 | elif [[ "$s2a" = out && ! ( $do_remote = true && "$s2b" = loc ) ]] |
---|
885 | then |
---|
886 | found=false |
---|
887 | for actual in $output_list |
---|
888 | do |
---|
889 | for formal in $s3 |
---|
890 | do |
---|
891 | [[ $actual = $formal || "$formal" = "-" ]] && found=true |
---|
892 | done |
---|
893 | done |
---|
894 | if [[ $found = true ]] |
---|
895 | then |
---|
896 | (( iout = iout + 1 )) |
---|
897 | localout[$iout]=$s1; actionout[$iout]=$s2c; typeout[$iout]=$s3; |
---|
898 | pathout[$iout]=$s4; endout[$iout]=$s5; extout[$iout]=$s6 |
---|
899 | fi |
---|
900 | elif [[ "$s2a" != in && "$s2a" != out ]] |
---|
901 | then |
---|
902 | printf "\n +++ I/O-attribute in configuration file $config_file has the invalid" |
---|
903 | printf "\n value \"$s2\". Only \"in\" and \"out\" are allowed!" |
---|
904 | locat=connect; exit |
---|
905 | fi |
---|
906 | IFS="$IFSALT" |
---|
907 | fi |
---|
908 | done < $config_file |
---|
909 | |
---|
910 | else |
---|
911 | |
---|
912 | # EVALUATE THE CONFIGURATION-FILE BY FORTRAN-PROGRAM |
---|
913 | [[ $silent = false ]] && printf "..." |
---|
914 | interpreted_config_file=.icf.$RANDOM |
---|
915 | |
---|
916 | |
---|
917 | |
---|
918 | # PROVIDE VALUES OF ENVIRONMENT-VARIABLE FOR interpret_config VIA NAMELIST-FILE |
---|
919 | cat > .mrun_environment << EOF |
---|
920 | &mrun_environment cond1 = '$cond1', cond2 = '$cond2', |
---|
921 | config_file = '$config_file', do_remote = '$do_remote', |
---|
922 | do_trace = '$do_trace', host = '$host', |
---|
923 | input_list = '$input_list', icf = '$interpreted_config_file', |
---|
924 | localhost = '$localhost', output_list = '$output_list' / |
---|
925 | |
---|
926 | EOF |
---|
927 | |
---|
928 | if [[ "$host" != $localhost ]] |
---|
929 | then |
---|
930 | |
---|
931 | # REMOTE JOB FROM LOCAL HOST: JUST TAKE THE FIRST EXECUTABLE FOUND |
---|
932 | interpret_config_executable=`ls -1 ${PALM_BIN}/interpret_config*.x 2>/dev/null` |
---|
933 | if [[ $? != 0 ]] |
---|
934 | then |
---|
935 | printf "\n\n +++ no interpret_config found" |
---|
936 | printf "\n run \"mbuild -u -h ...\" to generate utilities for this host" |
---|
937 | locat=interpret_config; exit |
---|
938 | fi |
---|
939 | interpret_config_executable=`echo $interpret_config_executable | cut -d" " -f1` |
---|
940 | $interpret_config_executable |
---|
941 | |
---|
942 | else |
---|
943 | |
---|
944 | # CHECK, IF THERE IS AN EXECUTABLE FOR THE BLOCK |
---|
945 | if [[ ! -f ${PALM_BIN}/interpret_config${block}.x ]] |
---|
946 | then |
---|
947 | printf "\n\n +++ no interpret_config found for given block \"$cond1 $cond2\"" |
---|
948 | printf "\n run \"mbuild -u -h ...\" to generate utilities for this block" |
---|
949 | locat=interpret_config; exit |
---|
950 | else |
---|
951 | interpret_config${block}.x |
---|
952 | fi |
---|
953 | |
---|
954 | fi |
---|
955 | rm .mrun_environment |
---|
956 | |
---|
957 | |
---|
958 | # EXECUTE SHELL-COMMANDS GENERATED BY interpret_config WITHIN THIS SHELL |
---|
959 | chmod u+x $interpreted_config_file |
---|
960 | export PATH=$PATH:. |
---|
961 | . $interpreted_config_file |
---|
962 | rm $interpreted_config_file |
---|
963 | |
---|
964 | fi |
---|
965 | |
---|
966 | |
---|
967 | # VALUES OF MRUN-OPTIONS OVERWRITE THOSE FROM THE CONFIGURATION-FILE |
---|
968 | [[ $mrun_memory != 0 ]] && memory=$mrun_memory |
---|
969 | [[ "$mrun_group_number" != "none" ]] && group_number=$mrun_group_number |
---|
970 | [[ $mrun_cpumax != 0 ]] && cpumax=$mrun_cpumax |
---|
971 | [[ "$mrun_numprocs" != "" ]] && numprocs=$mrun_numprocs |
---|
972 | [[ "$max_par_io_str" != "" ]] && maximum_parallel_io_streams=$max_par_io_str |
---|
973 | [[ "$mrun_tasks_per_node" != "" ]] && tasks_per_node=$mrun_tasks_per_node |
---|
974 | |
---|
975 | |
---|
976 | # ON THE LOCAL MACHINE, DETERMINE (FROM THE CONFIGURATION-FILE) THE PATH |
---|
977 | # FOR SOURCE-FILES TO BE COMPILED. |
---|
978 | # IN A BATCH-JOB, SOURCES (ROUTINES TO BE COMPILED) ARE COMPLETE ALREADY. |
---|
979 | # BEFORE MRUN IS CALLED IN THE JOB, SOURCES_COMPLETE = true IS ASSIGNED (SEE FURTHER BELOW). |
---|
980 | if [[ "$SOURCES_COMPLETE" = "" ]] |
---|
981 | then |
---|
982 | |
---|
983 | # FIRST CHECK, IF A GLOBAL SOURCE PATH (TO BE USED FOR ALL HOSTS) |
---|
984 | # HAS BEEN DEFINED |
---|
985 | source_path="" |
---|
986 | line="" |
---|
987 | grep "%source_path" $config_file > tmp_mrun |
---|
988 | while read line |
---|
989 | do |
---|
990 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
991 | then |
---|
992 | if [[ "$(echo $line | cut -d" " -f3)" = "" ]] |
---|
993 | then |
---|
994 | global_source_path=`echo $line | cut -d" " -f2` |
---|
995 | fi |
---|
996 | fi |
---|
997 | done < tmp_mrun |
---|
998 | |
---|
999 | line="" |
---|
1000 | found=false |
---|
1001 | grep " $localhost" $config_file | grep "%source_path" > tmp_mrun |
---|
1002 | while read line |
---|
1003 | do |
---|
1004 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
1005 | then |
---|
1006 | if [[ $found = true ]] |
---|
1007 | then |
---|
1008 | printf "\n\n +++ more than one source path found in configuration file" |
---|
1009 | printf "\n for local host \"$localhost\" " |
---|
1010 | locat=source_path; exit |
---|
1011 | fi |
---|
1012 | source_path=`echo $line | cut -d" " -f2` |
---|
1013 | found=true |
---|
1014 | fi |
---|
1015 | done < tmp_mrun |
---|
1016 | rm tmp_mrun |
---|
1017 | |
---|
1018 | if [[ "$source_path" = "" ]] |
---|
1019 | then |
---|
1020 | if [[ "$global_source_path" != "" ]] |
---|
1021 | then |
---|
1022 | source_path=$global_source_path |
---|
1023 | else |
---|
1024 | printf "\n\n +++ no source path found in configuration file" |
---|
1025 | printf "\n for local host \"$localhost\" " |
---|
1026 | locat=source_path; exit |
---|
1027 | fi |
---|
1028 | fi |
---|
1029 | eval source_path=$source_path |
---|
1030 | |
---|
1031 | if [[ ! -d $source_path ]] |
---|
1032 | then |
---|
1033 | printf "\n\n +++ source path \"$source_path\" on local host" |
---|
1034 | printf "\n \"$localhost\" does not exist" |
---|
1035 | locat=source_path; exit |
---|
1036 | fi |
---|
1037 | |
---|
1038 | fi |
---|
1039 | |
---|
1040 | |
---|
1041 | # GET THE GLOBAL REVISION-NUMBER OF THE SVN-REPOSITORY |
---|
1042 | # (HANDED OVER TO RESTART-RUNS USING OPTION -G) |
---|
1043 | if [[ "$global_revision" = "" && $host != "ibmkisti" ]] |
---|
1044 | then |
---|
1045 | global_revision=`svnversion $source_path 2>/dev/null` |
---|
1046 | global_revision="Rev: $global_revision" |
---|
1047 | fi |
---|
1048 | |
---|
1049 | |
---|
1050 | # ??? das darf doch eigentlich garnicht passieren, weil optionen config-datei uebersteuern ??? |
---|
1051 | # CHECK AGAIN, IF EXECUTION SHALL BE DONE ON A REMOTE-HOST (BATCH-JOB). |
---|
1052 | # (HOST MAY HAVE CHANGED DUE TO SETTINGS IN THE CONFIGURATION-FILE) |
---|
1053 | if [[ -n $host && "$host" != $localhost ]] |
---|
1054 | then |
---|
1055 | do_batch=true |
---|
1056 | do_remote=true |
---|
1057 | case $host in |
---|
1058 | (ibm|ibmh|ibmkisti|ibmku|ibms|lcbullhh|lccrayb|lccrayh|lccrayf|lceddy|lckyoto|lcocean|unics|lcxe6|lcxt5m|lck|lckiaps|lckordi|lckyuh|lckyut|lcsb|lcgeohu) true;; |
---|
1059 | (*) printf "\n" |
---|
1060 | printf "\n +++ sorry: execution of batch jobs on remote host \"$host\"" |
---|
1061 | printf "\n is not available" |
---|
1062 | locat=nqs; (( iec = 0 )); exit;; |
---|
1063 | esac |
---|
1064 | else |
---|
1065 | host=$localhost |
---|
1066 | fi |
---|
1067 | |
---|
1068 | |
---|
1069 | |
---|
1070 | # IN CASE OF PARALLEL EXECUTION, CHECK SOME SPECIFICATIONS CONCERNING PROCESSOR NUMBERS |
---|
1071 | if [[ "$cond1" = parallel || "$cond2" = parallel ]] |
---|
1072 | then |
---|
1073 | |
---|
1074 | # CHECK, IF NUMBER OF CORES TO BE USED HAS BEEN GIVEN |
---|
1075 | if [[ ! -n $numprocs ]] |
---|
1076 | then |
---|
1077 | printf "\n" |
---|
1078 | printf "\n +++ option \"-K parallel\" requires additional specification" |
---|
1079 | printf "\n of the number of processors to be used by" |
---|
1080 | printf "\n mrun-option \"-X\" or by environment-variable" |
---|
1081 | printf "\n \"numprocs\" in the configuration file" |
---|
1082 | locat=numprocs; (( iec = 0 )); exit |
---|
1083 | fi |
---|
1084 | |
---|
1085 | # CHECK, IF THE NUMBER OF CORES PER NODE HAS BEEN GIVEN UND IF IT IS AN |
---|
1086 | # INTEGRAL DIVISOR OF THE TOTAL NUMBER OF CORES GIVEN BY OPTION -X |
---|
1087 | if [[ "$tasks_per_node" = "" && $host != lcxt5m ]] |
---|
1088 | then |
---|
1089 | printf "\n" |
---|
1090 | printf "\n +++ option \"-T\" (tasks per node) is missing" |
---|
1091 | printf "\n set -T option or define tasks_per_node in the config file" |
---|
1092 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
1093 | fi |
---|
1094 | |
---|
1095 | if (( numprocs < tasks_per_node )) |
---|
1096 | then |
---|
1097 | printf "\n" |
---|
1098 | printf "\n +++ tasks per node (-T) cannot exceed total number of processors (-X)" |
---|
1099 | printf "\n given values: -T $tasks_per_node -X $numprocs" |
---|
1100 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
1101 | fi |
---|
1102 | |
---|
1103 | if [[ $host != lcxt5m ]] |
---|
1104 | then |
---|
1105 | (( nodes = numprocs / ( tasks_per_node * threads_per_task ) )) |
---|
1106 | (( ival = $tasks_per_node )) |
---|
1107 | (( pes = numprocs )) |
---|
1108 | (( ii = pes / ival )) |
---|
1109 | (( remaining_pes = pes - ii * ival )) |
---|
1110 | if (( remaining_pes > 0 )) |
---|
1111 | then |
---|
1112 | printf "\n" |
---|
1113 | printf "\n +++ WARNING: tasks per node (option \"-T\") is not an integral" |
---|
1114 | printf "\n divisor of the total number of processors (option \"-X\")" |
---|
1115 | printf "\n values of this mrun-call: \"-T $tasks_per_node\" \"-X $numprocs\"" |
---|
1116 | printf "\n One of the nodes is filled with $remaining_pes instead of $tasks_per_node tasks" |
---|
1117 | (( nodes = nodes + 1 )) |
---|
1118 | fi |
---|
1119 | fi |
---|
1120 | |
---|
1121 | |
---|
1122 | # SETTINGS FOR SUBJOB-COMMAND |
---|
1123 | OOPT="-O $threads_per_task" |
---|
1124 | |
---|
1125 | # SET THE TOTAL NUMBER OF NODES, REQUIRED FOR THE SUBJOB-COMMAND (SEE FURTHER BELOW) |
---|
1126 | if [[ "$tasks_per_node" != "" ]] |
---|
1127 | then |
---|
1128 | TOPT="-T $tasks_per_node" |
---|
1129 | fi |
---|
1130 | |
---|
1131 | # CHECK node_usage FOR ALLOWED VALUES AND SET DEFAULT VALUE, IF NECESSARY |
---|
1132 | if [[ $node_usage = default ]] |
---|
1133 | then |
---|
1134 | if [[ $host = ibms ]] |
---|
1135 | then |
---|
1136 | node_usage=shared |
---|
1137 | else |
---|
1138 | node_usage=not_shared |
---|
1139 | fi |
---|
1140 | fi |
---|
1141 | |
---|
1142 | if [[ $node_usage != shared && $node_usage != not_shared && $node_usage != singlejob && "$(echo $node_usage | cut -c1-3)" != "sla" ]] |
---|
1143 | then |
---|
1144 | printf "\n" |
---|
1145 | printf "\n +++ node usage (option \"-n\") is only allowed to be set" |
---|
1146 | printf "\n \"shared\" or \"not_shared\"" |
---|
1147 | locat=tasks_per_node; (( iec = 0 )); exit |
---|
1148 | fi |
---|
1149 | |
---|
1150 | fi |
---|
1151 | |
---|
1152 | # CHECK IF HOSTFILE EXISTS |
---|
1153 | if [[ -n $hostfile ]] |
---|
1154 | then |
---|
1155 | if [[ ! -f $hostfile ]] |
---|
1156 | then |
---|
1157 | printf "\n" |
---|
1158 | printf "\n +++ hostfile \"$hostfile\" does not exist" |
---|
1159 | locat=hostfile; exit |
---|
1160 | fi |
---|
1161 | fi |
---|
1162 | |
---|
1163 | |
---|
1164 | # SET DEFAULT VALUE FOR THE MAXIMUM NUMBER OF PARALLEL IO STREAMS |
---|
1165 | if [[ "$maximum_parallel_io_streams" = "" ]] |
---|
1166 | then |
---|
1167 | maximum_parallel_io_streams=$numprocs |
---|
1168 | fi |
---|
1169 | |
---|
1170 | |
---|
1171 | # SET PORT NUMBER OPTION FOR CALLS OF SSH/SCP, subjob AND batch_scp SCRIPTS |
---|
1172 | if [[ "$scp_port" != "" ]] |
---|
1173 | then |
---|
1174 | PORTOPT="-P $scp_port" |
---|
1175 | SSH_PORTOPT="-p $scp_port" |
---|
1176 | fi |
---|
1177 | |
---|
1178 | |
---|
1179 | # DETERMINE THE SSH-OPTION IN CASE THAT AN SSH-KEY IS EXPLICITLY GIVEN IN THE |
---|
1180 | # CONFIG-FILE |
---|
1181 | if [[ "$ssh_key" != "" ]] |
---|
1182 | then |
---|
1183 | ssh_key="-i $HOME/.ssh/$ssh_key" |
---|
1184 | fi |
---|
1185 | |
---|
1186 | |
---|
1187 | # SET DEFAULT-QUEUE, IF NOT GIVEN |
---|
1188 | if [[ $queue = none ]] |
---|
1189 | then |
---|
1190 | case $host in |
---|
1191 | (ibmh) queue=cluster;; |
---|
1192 | (ibmkisti) queue=class.32plus;; |
---|
1193 | (lcbullhh) queue=compute;; |
---|
1194 | (lccrayb) queue=mpp1q;; |
---|
1195 | (lccrayh) queue=mpp1q;; |
---|
1196 | (lcgeohu) queue=short;; |
---|
1197 | (lckiaps) queue=normal;; |
---|
1198 | (lckyoto) queue=ph;; |
---|
1199 | (lckyuh) queue=fx-single;; |
---|
1200 | (lckyut) queue=cx-single;; |
---|
1201 | (lctit) queue=S;; |
---|
1202 | (unics) queue=unics;; |
---|
1203 | esac |
---|
1204 | fi |
---|
1205 | |
---|
1206 | |
---|
1207 | # GENERATE FULL FILENAMES OF INPUT-FILES, INCLUDING THEIR PATH |
---|
1208 | # CHECK, IF INPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST) |
---|
1209 | (( i = 0 )) |
---|
1210 | while (( i < iin )) |
---|
1211 | do |
---|
1212 | (( i = i + 1 )) |
---|
1213 | (( maxcycle = 0 )) |
---|
1214 | |
---|
1215 | # GENERATE PATH AND FULL FILE NAME (then-BRANCH: FIXED FULL NAME IS GIVEN, I.E. THE |
---|
1216 | # FILE IDENTIFIER IS NOT PART OF THE FILENAME)) |
---|
1217 | if [[ "${actionin[$i]}" = di ]] |
---|
1218 | then |
---|
1219 | remotepathin[$i]=${pathin[$i]}/${endin[$i]} # EVALUATE REMOTE-PATH ON THE REMOTE |
---|
1220 | # HOST ONLY |
---|
1221 | eval filename=${pathin[$i]}/${endin[$i]} |
---|
1222 | else |
---|
1223 | remotepathin[$i]=${pathin[$i]}/${afname}${endin[$i]} # EVALUATE REMOTE-PATH ON THE REMOTE |
---|
1224 | # HOST ONLY |
---|
1225 | eval filename=${pathin[$i]}/${afname}${endin[$i]} |
---|
1226 | fi |
---|
1227 | eval pathname=${pathin[$i]} |
---|
1228 | |
---|
1229 | # CHECK IF FILE EXISTS |
---|
1230 | if ! ls $filename* 1>/dev/null 2>&1 |
---|
1231 | then |
---|
1232 | |
---|
1233 | # FILES WITH ATTRIBUTE locopt ARE OPTIONAL. NO ABORT, IF THEY DO NOT EXIST. |
---|
1234 | if [[ "${transin[$i]}" != "locopt" ]] |
---|
1235 | then |
---|
1236 | printf "\n\n +++ INPUT-file: " |
---|
1237 | if [[ "${extin[$i]}" = "" || "${extin[$i]}" = " " ]] |
---|
1238 | then |
---|
1239 | printf "\n $filename" |
---|
1240 | else |
---|
1241 | printf "\n $filename.${extin[$i]}" |
---|
1242 | fi |
---|
1243 | printf "\n does not exist\n" |
---|
1244 | locat=input; exit |
---|
1245 | else |
---|
1246 | transin[$i]="unavailable" |
---|
1247 | fi |
---|
1248 | else |
---|
1249 | |
---|
1250 | # DETERMINE THE FILE'S CYCLE NUMBER |
---|
1251 | ls -1 -d $filename > filelist 2>/dev/null |
---|
1252 | ls -1 -d $filename.* >> filelist 2>/dev/null |
---|
1253 | while read zeile |
---|
1254 | do |
---|
1255 | # filename without path (i.e. after the last "/") |
---|
1256 | basefilename=$(basename ${zeile}) |
---|
1257 | |
---|
1258 | # check if there is an extension |
---|
1259 | extension=${basefilename##*.} |
---|
1260 | if [[ "$extension" = "$extin[$i]" ]] |
---|
1261 | then |
---|
1262 | basefilename=${basefilename&.*} |
---|
1263 | fi |
---|
1264 | |
---|
1265 | # check for an existing cycle number |
---|
1266 | cycle=${basefilename##*.} |
---|
1267 | if [[ $cycle =~ ^-?[0-9]+$ ]] |
---|
1268 | then |
---|
1269 | (( icycle = $cycle )) |
---|
1270 | else |
---|
1271 | (( icycle = 0 )) |
---|
1272 | fi |
---|
1273 | |
---|
1274 | if (( icycle > maxcycle )) |
---|
1275 | then |
---|
1276 | (( maxcycle = icycle )) |
---|
1277 | fi |
---|
1278 | |
---|
1279 | # cycle=$(echo $zeile | cut -f2 -d".") |
---|
1280 | # if [[ "$cycle" = "$zeile" ]] |
---|
1281 | # then |
---|
1282 | # (( icycle = 0 )) |
---|
1283 | # elif [[ "$cycle" = "${extin[$i]}" ]] |
---|
1284 | # then |
---|
1285 | # (( icycle = 0 )) |
---|
1286 | # else |
---|
1287 | # (( icycle = $cycle )) |
---|
1288 | # fi |
---|
1289 | # if (( icycle > maxcycle )) |
---|
1290 | # then |
---|
1291 | # (( maxcycle = icycle )) |
---|
1292 | # fi |
---|
1293 | done <filelist |
---|
1294 | rm filelist |
---|
1295 | |
---|
1296 | # APPEND CYCLE NUMBER TO FILENAME |
---|
1297 | if (( maxcycle > 0 )) |
---|
1298 | then |
---|
1299 | if [[ "${extin[$i]}" != " " && "${extin[$i]}" != "" ]] |
---|
1300 | then |
---|
1301 | filename=${filename}.$maxcycle.${extin[$i]} |
---|
1302 | else |
---|
1303 | filename=${filename}.$maxcycle |
---|
1304 | fi |
---|
1305 | else |
---|
1306 | if [[ "${extin[$i]}" != " " && "${extin[$i]}" != "" ]] |
---|
1307 | then |
---|
1308 | filename=${filename}.${extin[$i]} |
---|
1309 | fi |
---|
1310 | fi |
---|
1311 | |
---|
1312 | # STORE FILENAME WITHOUT PATH BUT WITH CYCLE NUMBER, |
---|
1313 | # IS LATER USED FOR TRANSFERRING FILES WIHIN THE JOB (SEE END OF FILE) |
---|
1314 | absnamein[$i]=$filename |
---|
1315 | if (( maxcycle > 0 )) |
---|
1316 | then |
---|
1317 | if [[ "${actionin[$i]}" = di ]] |
---|
1318 | then |
---|
1319 | frelin[$i]=${endin[$i]}.$maxcycle |
---|
1320 | else |
---|
1321 | frelin[$i]=${afname}${endin[$i]}.$maxcycle |
---|
1322 | fi |
---|
1323 | else |
---|
1324 | if [[ "${actionin[$i]}" = di ]] |
---|
1325 | then |
---|
1326 | frelin[$i]=${endin[$i]} |
---|
1327 | else |
---|
1328 | frelin[$i]=${afname}${endin[$i]} |
---|
1329 | fi |
---|
1330 | fi |
---|
1331 | |
---|
1332 | fi |
---|
1333 | done |
---|
1334 | |
---|
1335 | # GENERATE FULL FILENAMES OF OUTPUT-FILES (WITHOUT $ OR ~), |
---|
1336 | # CHECK, IF OUTPUT-FILES EXIST, AND DETERMINE HIGHEST CYCLE NUMBER (IF CYCLES EXIST), |
---|
1337 | # OR, IN CASE THAT FILE DOES NOT EXIST, CHECK, IF IT CAN BE CREATED |
---|
1338 | # THESE ACTIONS ARE NOT CARRIED OUT, IF FILES SHALL BE TRASFERRED FROM THE REMOTE TO |
---|
1339 | # THE LOCAL HOST (BECAUSE THEIR IS NO DIRECT ACCESS TO THE LOCAL DIRECTORIES FROM THE |
---|
1340 | # REMOTE HOST) |
---|
1341 | (( i = 0 )) |
---|
1342 | while (( i < iout )) |
---|
1343 | do |
---|
1344 | (( i = i + 1 )) |
---|
1345 | if [[ ! ( $fromhost != $localhost && ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]] |
---|
1346 | then |
---|
1347 | if [[ "${actionout[$i]}" = tr ]] |
---|
1348 | then |
---|
1349 | actionout[$i]="" |
---|
1350 | elif [[ "${actionout[$i]}" = trpe ]] |
---|
1351 | then |
---|
1352 | actionout[$i]=pe |
---|
1353 | elif [[ "${actionout[$i]}" = tra ]] |
---|
1354 | then |
---|
1355 | actionout[$i]=a |
---|
1356 | fi |
---|
1357 | (( maxcycle = 0 )) |
---|
1358 | eval filename=${pathout[$i]}/${fname}${endout[$i]} |
---|
1359 | eval catalogname=${pathout[$i]} |
---|
1360 | if ! ls $filename* 1>/dev/null 2>&1 |
---|
1361 | then |
---|
1362 | |
---|
1363 | # IF OUTPUT-FILE DOES NOT EXIST CHECK, IF IT CAN BE CREATED |
---|
1364 | if cat /dev/null > $filename |
---|
1365 | then |
---|
1366 | rm $filename |
---|
1367 | else |
---|
1368 | |
---|
1369 | # CHECK, IF THE DIRECTORY WHERE FILE SHALL BE COPIED TO EXISTS |
---|
1370 | # IF IT DOES NOT EXIST, TRY TO CREATE IT |
---|
1371 | if [[ ! -d $catalogname ]] |
---|
1372 | then |
---|
1373 | if mkdir -p $catalogname |
---|
1374 | then |
---|
1375 | printf "\n\n *** directory:" |
---|
1376 | printf "\n $catalogname" |
---|
1377 | printf "\n was created\n" |
---|
1378 | else |
---|
1379 | printf "\n\n +++ OUTPUT-file:" |
---|
1380 | printf "\n $filename" |
---|
1381 | printf "\n cannot be created, because directory does not exist" |
---|
1382 | printf "\n and cannot be created either" |
---|
1383 | printf "\n" |
---|
1384 | locat=output ; exit |
---|
1385 | fi 2>/dev/null |
---|
1386 | else |
---|
1387 | printf "\n\n +++ OUTPUT-file:" |
---|
1388 | printf "\n $filename" |
---|
1389 | printf "\n cannot be created, although directory exists" |
---|
1390 | printf "\n" |
---|
1391 | locat=output ; exit |
---|
1392 | fi |
---|
1393 | fi 2>/dev/null |
---|
1394 | else |
---|
1395 | |
---|
1396 | # DETERMINE THE CYCLE NUMBER |
---|
1397 | ls -1 -d $filename > filelist 2>/dev/null |
---|
1398 | ls -1 -d $filename.* >> filelist 2>/dev/null |
---|
1399 | while read zeile |
---|
1400 | do |
---|
1401 | |
---|
1402 | # filename without path (i.e. after the last "/") |
---|
1403 | basefilename=$(basename ${zeile}) |
---|
1404 | |
---|
1405 | # check if there is an extension |
---|
1406 | extension=${basefilename##*.} |
---|
1407 | if [[ "$extension" = "${extout[$i]}" ]] |
---|
1408 | then |
---|
1409 | basefilename=${basefilename%.*} |
---|
1410 | fi |
---|
1411 | |
---|
1412 | # check for an existing cycle number |
---|
1413 | cycle=${basefilename##*.} |
---|
1414 | if [[ $cycle =~ ^-?[0-9]+$ ]] |
---|
1415 | then |
---|
1416 | (( icycle = $cycle + 1 )) |
---|
1417 | else |
---|
1418 | (( icycle = 1 )) |
---|
1419 | fi |
---|
1420 | |
---|
1421 | if (( icycle > maxcycle )) |
---|
1422 | then |
---|
1423 | (( maxcycle = icycle )) |
---|
1424 | fi |
---|
1425 | |
---|
1426 | done <filelist |
---|
1427 | rm filelist |
---|
1428 | fi |
---|
1429 | |
---|
1430 | # APPEND CYCLE NUMBER TO FILENAME AND CHECK, IF FILE CAN BE CREATED |
---|
1431 | # IN CASE OF FILE-APPEND, FILE MUST BE APPENDED TO THE ONE WITH HIGHEST CYCLE NUMBER |
---|
1432 | if [[ "${actionout[$i]}" != a ]] |
---|
1433 | then |
---|
1434 | if (( maxcycle > 0 )) |
---|
1435 | then |
---|
1436 | filename_tmp=${filename}.$maxcycle |
---|
1437 | if cat /dev/null > $filename_tmp |
---|
1438 | then |
---|
1439 | rm $filename_tmp |
---|
1440 | else |
---|
1441 | printf "\n +++ OUTPUT-file:" |
---|
1442 | printf "\n $filename_tmp" |
---|
1443 | printf "\n cannot be created" |
---|
1444 | locat=output ; exit |
---|
1445 | fi |
---|
1446 | fi |
---|
1447 | else |
---|
1448 | (( maxcycle = maxcycle - 1 )) |
---|
1449 | fi |
---|
1450 | |
---|
1451 | (( cycnum[$i] = maxcycle )) |
---|
1452 | pathout[$i]=$filename |
---|
1453 | |
---|
1454 | fi |
---|
1455 | done |
---|
1456 | |
---|
1457 | |
---|
1458 | # THE DVR-PACKAGE REQUIRES ITS OWN LIBRARY |
---|
1459 | if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] |
---|
1460 | then |
---|
1461 | if [[ "$dvr_inc" = "" ]] |
---|
1462 | then |
---|
1463 | printf "\n\n +++ no value for \"dvr_inc\" given in configuration file" |
---|
1464 | printf "\n This is required for the dvrp_graphics package.\n" |
---|
1465 | locat=dvr; exit |
---|
1466 | fi |
---|
1467 | if [[ "$dvr_lib" = "" ]] |
---|
1468 | then |
---|
1469 | printf "\n\n +++ no value for \"dvr_lib\" given in configuration file" |
---|
1470 | printf "\n This is required for the dvrp_graphics package.\n" |
---|
1471 | locat=dvr; exit |
---|
1472 | fi |
---|
1473 | fi |
---|
1474 | |
---|
1475 | |
---|
1476 | # CHECK, WETHER A MAIN PROGRAM OR AN EXECUTABLE HAVE BEEN DECLARED. |
---|
1477 | # EXECUTABLES DO NOT NEED TO BE COMPILED. |
---|
1478 | if [[ "$mainprog" = "" && "$executable" = "" ]] |
---|
1479 | then |
---|
1480 | printf "\n +++ neither main program nor executable defined" |
---|
1481 | locat=source; exit |
---|
1482 | elif [[ "$mainprog" != "" && "$executable" != "" ]] |
---|
1483 | then |
---|
1484 | printf "\n +++ main program as well as executable defined" |
---|
1485 | locat=source; exit |
---|
1486 | elif [[ "$mainprog" = "" && "$executable" != "" ]] |
---|
1487 | then |
---|
1488 | do_compile=false |
---|
1489 | fi |
---|
1490 | |
---|
1491 | |
---|
1492 | # CREATE SOURCE-DIRECTORY TO COLLECT ROUTINES TO BE COMPILED. |
---|
1493 | # LATER THE MRUN-SCRIPT AND CONFIGURATION-FILE WILL ALSO BE COPIED TO THIS DIRECTORY. |
---|
1494 | if [[ $restart_run != true && "$SOURCES_COMPLETE" = "" ]] |
---|
1495 | then |
---|
1496 | rm -rf SOURCES_FOR_RUN_$fname |
---|
1497 | mkdir SOURCES_FOR_RUN_$fname |
---|
1498 | fi |
---|
1499 | |
---|
1500 | |
---|
1501 | # COLLECT ALL ROUTINES TO BE COMPILED |
---|
1502 | # THIS IS NOT REQUIRED WITHIN BATCH-JOBS, BECAUSE ROUTINES HAVE ALREADY BEEN COLLECTED |
---|
1503 | # BY THE MRUN-CALL WHICH CREATED THE BATCH-JOB. |
---|
1504 | if [[ $do_compile = true && "$SOURCES_COMPLETE" = "" ]] |
---|
1505 | then |
---|
1506 | |
---|
1507 | [[ "$source_list" = LM ]] && source_list=LOCALLY_MODIFIED |
---|
1508 | |
---|
1509 | if [[ "$source_list" = LOCALLY_MODIFIED ]] |
---|
1510 | then |
---|
1511 | |
---|
1512 | # DETERMINE MODIFIED FILES OF THE SVN WORKING COPY |
---|
1513 | source_list="" |
---|
1514 | cd $source_path |
---|
1515 | |
---|
1516 | |
---|
1517 | # CHECK, IF DIRECTORY IS UNDER SVN CONTROL |
---|
1518 | if [[ ! -d .svn ]] |
---|
1519 | then |
---|
1520 | printf "\n\n +++ source directory" |
---|
1521 | printf "\n \"$source_path\" " |
---|
1522 | printf "\n is not under control of \"subversion\"." |
---|
1523 | printf "\n Please do not use mrun-option \"-s LOCALLY_MODIFIED\"\n" |
---|
1524 | fi |
---|
1525 | |
---|
1526 | |
---|
1527 | # LIST ALL MODIFIED SOURCE CODE FILES |
---|
1528 | Filenames="" |
---|
1529 | svn status > tmp_mrun |
---|
1530 | while read line |
---|
1531 | do |
---|
1532 | firstc=`echo $line | cut -c1` |
---|
1533 | if [[ $firstc = M || $firstc = "?" ]] |
---|
1534 | then |
---|
1535 | Name=`echo "$line" | cut -c8-` |
---|
1536 | extension=`echo $Name | cut -d. -f2` |
---|
1537 | if [[ "$extension" = f90 || "$extension" = F90 || "$extension" = f || "$extension" = F || "$extension" = c ]] |
---|
1538 | then |
---|
1539 | Filenames="$Filenames "$Name |
---|
1540 | fi |
---|
1541 | fi |
---|
1542 | done < tmp_mrun |
---|
1543 | |
---|
1544 | |
---|
1545 | # COPY FILES TO SOURCES_FOR_RUN_... |
---|
1546 | for dateiname in $Filenames |
---|
1547 | do |
---|
1548 | cp $dateiname $working_directory/SOURCES_FOR_RUN_$fname |
---|
1549 | source_list=$source_list"$dateiname " |
---|
1550 | done |
---|
1551 | |
---|
1552 | cd - > /dev/null |
---|
1553 | |
---|
1554 | |
---|
1555 | # COPY FILES GIVEN BY OPTION -s TO DIRECTORY SOURCES_FOR_RUN_... |
---|
1556 | # AUTOMATIC RESTART RUNS JUST ACCESS THE DIRECTORY CREATED BY THE INITIAL RUN |
---|
1557 | elif [[ "$source_list" != "" && $restart_run != true ]] |
---|
1558 | then |
---|
1559 | |
---|
1560 | cd $source_path |
---|
1561 | |
---|
1562 | for filename in $source_list |
---|
1563 | do |
---|
1564 | |
---|
1565 | # SOURCE CODE FILE IS NOT ALLOWED TO INCLUDE PATH |
---|
1566 | if [[ $(echo $filename | grep -c "/") != 0 ]] |
---|
1567 | then |
---|
1568 | printf "\n +++ source code file: $filename" |
---|
1569 | printf "\n must not contain (\"/\") " |
---|
1570 | locat=source; exit |
---|
1571 | fi |
---|
1572 | |
---|
1573 | if [[ ! -f $filename ]] |
---|
1574 | then |
---|
1575 | printf "\n +++ source code file: $filename" |
---|
1576 | printf "\n does not exist" |
---|
1577 | locat=source; exit |
---|
1578 | else |
---|
1579 | cp $filename $working_directory/SOURCES_FOR_RUN_$fname |
---|
1580 | fi |
---|
1581 | |
---|
1582 | done |
---|
1583 | |
---|
1584 | cd - > /dev/null |
---|
1585 | |
---|
1586 | fi |
---|
1587 | |
---|
1588 | |
---|
1589 | # CHECK, IF A MAIN PROGRAM EXISTS AND IF IT IS PART OF THE LIST OF FILES |
---|
1590 | # TO BE COMPILED. IF NOT, ADD IT TO THE LIST. |
---|
1591 | if [[ $restart_run != true ]] |
---|
1592 | then |
---|
1593 | |
---|
1594 | if [[ ! -f "$source_path/$mainprog" ]] |
---|
1595 | then |
---|
1596 | printf "\n\n +++ main program: $mainprog" |
---|
1597 | printf "\n does not exist in source directory" |
---|
1598 | printf "\n \"$source_path\"\n" |
---|
1599 | locat=source; exit |
---|
1600 | else |
---|
1601 | if [[ $(echo $source_list | grep -c $mainprog) = 0 ]] |
---|
1602 | then |
---|
1603 | cp $source_path/$mainprog SOURCES_FOR_RUN_$fname |
---|
1604 | source_list=${mainprog}" $source_list" |
---|
1605 | fi |
---|
1606 | fi |
---|
1607 | fi |
---|
1608 | |
---|
1609 | |
---|
1610 | # CHECK, IF MAKEFILE EXISTS AND COPY IT TO THE SOURCES_FOR_RUN... DIRECTORY |
---|
1611 | # NOT REQUIRED FOR RESTART RUNS, SOURCES_FOR_RUN... HAS BEEN CREATED BY THE INITIAL RUN |
---|
1612 | if [[ "$restart_run" != true ]] |
---|
1613 | then |
---|
1614 | [[ "$makefile" = "" ]] && makefile=$source_path/Makefile |
---|
1615 | if [[ ! -f $makefile ]] |
---|
1616 | then |
---|
1617 | printf "\n +++ file \"$makefile\" does not exist" |
---|
1618 | locat=make; exit |
---|
1619 | else |
---|
1620 | cp $makefile SOURCES_FOR_RUN_$fname/Makefile |
---|
1621 | fi |
---|
1622 | fi |
---|
1623 | |
---|
1624 | |
---|
1625 | # COPY FILES FROM OPTIONAL SOURCE PATH GIVEN IN THE CONFIGURATION FILE |
---|
1626 | if [[ $restart_run != true && "$add_source_path" != "" ]] |
---|
1627 | then |
---|
1628 | |
---|
1629 | # DOES THE DIRECTORY EXIST? |
---|
1630 | if [[ ! -d $add_source_path ]] |
---|
1631 | then |
---|
1632 | printf "\n\n *** INFORMATIVE: additional source code directory" |
---|
1633 | printf "\n \"$add_source_path\" " |
---|
1634 | printf "\n does not exist or is not a directory." |
---|
1635 | printf "\n No source code will be used from this directory!\n" |
---|
1636 | add_source_path="" |
---|
1637 | if [[ $silent == false ]] |
---|
1638 | then |
---|
1639 | sleep 3 |
---|
1640 | fi |
---|
1641 | else |
---|
1642 | |
---|
1643 | cd $add_source_path |
---|
1644 | found=false |
---|
1645 | |
---|
1646 | Names=$(ls -1 *.f90 2>&1) |
---|
1647 | [[ $(echo $Names | grep -c '*.f90') = 0 ]] && AddFilenames="$Names" |
---|
1648 | Names=$(ls -1 *.F90 2>&1) |
---|
1649 | [[ $(echo $Names | grep -c '*.F90') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1650 | Names=$(ls -1 *.F 2>&1) |
---|
1651 | [[ $(echo $Names | grep -c '*.F') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1652 | Names=$(ls -1 *.f 2>&1) |
---|
1653 | [[ $(echo $Names | grep -c '*.f') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1654 | Names=$(ls -1 *.c 2>&1) |
---|
1655 | [[ $(echo $Names | grep -c '*.c') = 0 ]] && AddFilenames="$AddFilenames $Names" |
---|
1656 | |
---|
1657 | cd - > /dev/null |
---|
1658 | cd SOURCES_FOR_RUN_$fname |
---|
1659 | |
---|
1660 | # COPY MAKEFILE IF EXISTING |
---|
1661 | if [[ -f $add_source_path/Makefile ]] |
---|
1662 | then |
---|
1663 | printf "\n\n *** user Makefile from directory" |
---|
1664 | printf "\n \"$add_source_path\" is used \n" |
---|
1665 | if [[ $silent == false ]] |
---|
1666 | then |
---|
1667 | sleep 1 |
---|
1668 | fi |
---|
1669 | cp $add_source_path/Makefile . |
---|
1670 | fi |
---|
1671 | |
---|
1672 | for dateiname in $AddFilenames |
---|
1673 | do |
---|
1674 | if [[ -f $dateiname ]] |
---|
1675 | then |
---|
1676 | printf "\n +++ source code file \"$dateiname\" found in additional" |
---|
1677 | printf "\n source code directory \"$add_source_path\" " |
---|
1678 | printf "\n but was also given with option \"-s\" which means that it should be taken" |
---|
1679 | printf "\n from directory \"$source_path\"." |
---|
1680 | locat=source; exit |
---|
1681 | fi |
---|
1682 | |
---|
1683 | cp $add_source_path/$dateiname . |
---|
1684 | source_list="$source_list $dateiname" |
---|
1685 | |
---|
1686 | # CHECK IF FILE IS CONTAINED IN MAKEFILE |
---|
1687 | if [[ $(grep -c $dateiname Makefile) = 0 ]] |
---|
1688 | then |
---|
1689 | printf "\n\n +++ user file \"$dateiname\" " |
---|
1690 | printf "\n is not listed in Makefile \n" |
---|
1691 | locat=source; exit |
---|
1692 | else |
---|
1693 | |
---|
1694 | if [[ $found = false ]] |
---|
1695 | then |
---|
1696 | found=true |
---|
1697 | printf "\n\n *** following user file(s) added to the" |
---|
1698 | printf " files to be translated:\n " |
---|
1699 | fi |
---|
1700 | printf "$dateiname " |
---|
1701 | if [[ $silent == false ]] |
---|
1702 | then |
---|
1703 | sleep 0.5 |
---|
1704 | fi |
---|
1705 | |
---|
1706 | fi |
---|
1707 | done |
---|
1708 | [[ $found = true ]] && printf "\n" |
---|
1709 | cd - > /dev/null |
---|
1710 | fi |
---|
1711 | fi |
---|
1712 | |
---|
1713 | |
---|
1714 | # ADD ALL ROUTINES BELONGING TO SOFTWARE PACKAGES (GIVEN BY OPTION -p) |
---|
1715 | # TO THE LIST OF FILES TO BE COMPILED |
---|
1716 | if [[ $restart_run != true && -n $package_list ]] |
---|
1717 | then |
---|
1718 | |
---|
1719 | cd $source_path |
---|
1720 | |
---|
1721 | for package in $package_list |
---|
1722 | do |
---|
1723 | |
---|
1724 | [[ $package = "dvrp_graphics+1PE" ]] && package=dvrp_graphics |
---|
1725 | |
---|
1726 | # DETERMINE FILES BELONGING TO THE PACKAGE |
---|
1727 | # ERROR MESSAGE ARE REDIRECTED TO /dev/null, BECAUSE WILDCARD (*) ALSO GIVES |
---|
1728 | # THE NAME OF THE DIRECTORY |
---|
1729 | package_source_list=`grep "defined( __$package " * 2>/dev/null | cut -f1 -d:` |
---|
1730 | |
---|
1731 | |
---|
1732 | # ADD THESE FILES TO THE LIST OF FILES TO BE COMPILED, |
---|
1733 | # IF THEY ARE NOT ALREADY PART OF THE LIST |
---|
1734 | for source_list_name in $package_source_list |
---|
1735 | do |
---|
1736 | if [[ $(echo $source_list | grep -c $source_list_name) = 0 ]] |
---|
1737 | then |
---|
1738 | |
---|
1739 | # ONLY TAKE FILES WITH VALID SUFFIX |
---|
1740 | ending=`echo $source_list_name | cut -f2 -d.` |
---|
1741 | if [[ "$ending" = f90 || "$ending" = F90 || "$ending" = f || "$ending" = F || "$ending" = c ]] |
---|
1742 | then |
---|
1743 | cp $source_list_name $working_directory/SOURCES_FOR_RUN_$fname |
---|
1744 | source_list="$source_list $source_list_name" |
---|
1745 | fi |
---|
1746 | fi |
---|
1747 | done |
---|
1748 | done |
---|
1749 | |
---|
1750 | cd - > /dev/null |
---|
1751 | fi |
---|
1752 | |
---|
1753 | fi # do_compile=true |
---|
1754 | |
---|
1755 | |
---|
1756 | # IF SOURCE CODE IS TO BE COMPILED, DO SOME MORE CHECKS |
---|
1757 | # AND SET PRE-PROCESSOR DIRECTIVES |
---|
1758 | if [[ $do_compile = true || $create_executable_for_batch = true ]] |
---|
1759 | then |
---|
1760 | |
---|
1761 | # SET PREPROCESSOR-DIRECTIVES TO SELECT OPERATING SYSTEM SPECIFIC CODE |
---|
1762 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1763 | then |
---|
1764 | cpp_options="${cpp_options},-D__ibm=__ibm" |
---|
1765 | elif [[ $(echo $localhost | cut -c1-3) = nec ]] |
---|
1766 | then |
---|
1767 | cpp_options="$cpp_options -D__nec" |
---|
1768 | elif [[ $(echo $localhost | cut -c1-2) = lc ]] |
---|
1769 | then |
---|
1770 | cpp_options="$cpp_options -D__lc" |
---|
1771 | else |
---|
1772 | cpp_options="$cpp_options -D__$localhost" |
---|
1773 | fi |
---|
1774 | |
---|
1775 | # SET DIRECTIVES GIVEN BY OPTION -K (E.G. parallel) |
---|
1776 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1777 | then |
---|
1778 | [[ -n $cond1 ]] && cpp_options="${cpp_options},-D__$cond1=__$cond1" |
---|
1779 | [[ -n $cond2 ]] && cpp_options="${cpp_options},-D__$cond2=__$cond2" |
---|
1780 | else |
---|
1781 | [[ -n $cond1 ]] && cpp_options="$cpp_options -D__$cond1" |
---|
1782 | [[ -n $cond2 ]] && cpp_options="$cpp_options -D__$cond2" |
---|
1783 | fi |
---|
1784 | |
---|
1785 | # SET DIRECTIVES FOR ACTIVATING SOFTWARE-PACKAGES (OPTION -p) |
---|
1786 | if [[ -n $package_list ]] |
---|
1787 | then |
---|
1788 | for package in $package_list |
---|
1789 | do |
---|
1790 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1791 | then |
---|
1792 | if [[ $package != "dvrp_graphics+1PE" ]] |
---|
1793 | then |
---|
1794 | cpp_options="${cpp_options},-D__$package=__$package" |
---|
1795 | else |
---|
1796 | cpp_options="${cpp_options},-D__dvrp_graphics=__dvrp_graphics" |
---|
1797 | export use_seperate_pe_for_dvrp_output=true |
---|
1798 | fi |
---|
1799 | else |
---|
1800 | if [[ $package != "dvrp_graphics+1PE" ]] |
---|
1801 | then |
---|
1802 | cpp_options="$cpp_options -D__$package" |
---|
1803 | else |
---|
1804 | cpp_options="$cpp_options -D__dvrp_graphics" |
---|
1805 | export use_seperate_pe_for_dvrp_output=true |
---|
1806 | fi |
---|
1807 | fi |
---|
1808 | done |
---|
1809 | fi |
---|
1810 | |
---|
1811 | else |
---|
1812 | |
---|
1813 | |
---|
1814 | # FOR LOCAL RUNS CHECK AGAIN, IF EXECUTABLE EXISTS |
---|
1815 | if [[ $do_remote = false ]] |
---|
1816 | then |
---|
1817 | if [[ ! -f $executable ]] |
---|
1818 | then |
---|
1819 | printf "\n +++ executable file: $executable" |
---|
1820 | printf "\n does not exist" |
---|
1821 | locat=executable; exit |
---|
1822 | fi |
---|
1823 | fi |
---|
1824 | fi |
---|
1825 | |
---|
1826 | |
---|
1827 | # DETERMINE THE JOB MODE |
---|
1828 | if [[ $(echo $localhost | cut -c1-3) = ibm ]] |
---|
1829 | then |
---|
1830 | if [[ "$LOADLBATCH" = yes ]] |
---|
1831 | then |
---|
1832 | batch_job=.TRUE. |
---|
1833 | jobmo=BATCH |
---|
1834 | else |
---|
1835 | batch_job=.FALSE. |
---|
1836 | jobmo=INTERACTIVE |
---|
1837 | fi |
---|
1838 | else |
---|
1839 | if [[ "$ENVIRONMENT" = BATCH || "$PJM_ENVIRONMENT" = BATCH ]] |
---|
1840 | then |
---|
1841 | batch_job=.TRUE. |
---|
1842 | jobmo=BATCH |
---|
1843 | else |
---|
1844 | batch_job=.FALSE. |
---|
1845 | jobmo=INTERACTIVE |
---|
1846 | fi |
---|
1847 | fi |
---|
1848 | |
---|
1849 | # NO INTERACTIVE RUNS ALLOWED ON LCTIT |
---|
1850 | if [[ $host = lctit && $jobmo = INTERACTIVE && $do_batch = false ]] |
---|
1851 | then |
---|
1852 | printf "\n +++ no interactive runs allowed on host \"$host\" " |
---|
1853 | printf "\n please submit batch job using mrun option \"-b\" \n" |
---|
1854 | locat=normal; exit |
---|
1855 | fi |
---|
1856 | |
---|
1857 | |
---|
1858 | # CHECK, IF USER DEFINED A COMPILER |
---|
1859 | if [[ "$compiler_name" = "" ]] |
---|
1860 | then |
---|
1861 | |
---|
1862 | printf "\n +++ no compiler specified for \"$host $cond1 $cond2\"" |
---|
1863 | locat=compiler_name; exit |
---|
1864 | |
---|
1865 | fi |
---|
1866 | |
---|
1867 | |
---|
1868 | # DETERMINE THE NAME OF MRUN'S TEMPORARY WORKING DIRECTORY |
---|
1869 | |
---|
1870 | # ON HLRN-III, USE THE QUEUING NAME. OTHERWISE USE USERNAME AND RANDOM NUMBER |
---|
1871 | if [[ $do_batch = false && $(echo $host | cut -c1-6) = lccray ]] |
---|
1872 | then |
---|
1873 | kennung=$(checkjob $PBS_JOBID | grep Reservation | cut -d" " -s -f2 | cut -d"." -s -f2 | sed "s/['\"]//g") |
---|
1874 | if [[ "$kennung" = "" ]] |
---|
1875 | then |
---|
1876 | kennung=$RANDOM |
---|
1877 | fi |
---|
1878 | else |
---|
1879 | kennung=$RANDOM |
---|
1880 | fi |
---|
1881 | |
---|
1882 | if [[ "$tmp_user_catalog" = "" ]] |
---|
1883 | then |
---|
1884 | if [[ $localhost = ibmh ]] |
---|
1885 | then |
---|
1886 | tmp_user_catalog=$SCRATCH |
---|
1887 | else |
---|
1888 | tmp_user_catalog=/tmp |
---|
1889 | fi |
---|
1890 | fi |
---|
1891 | TEMPDIR=$tmp_user_catalog/${usern}.$kennung |
---|
1892 | |
---|
1893 | |
---|
1894 | # DETERMINE THE NAME OF THE DIRECTORY WHICH IS USED TO TEMPORARILY STORE DATA FOR RESTART RUNS |
---|
1895 | if [[ "$tmp_data_catalog" = "" ]] |
---|
1896 | then |
---|
1897 | tmp_data_catalog=/tmp/mrun_restart_data |
---|
1898 | fi |
---|
1899 | |
---|
1900 | |
---|
1901 | # IN CASE OF LOCAL RUNS REPLACE ENVIRONMENT VARIABLES BY THEIR VALUES |
---|
1902 | if [[ $do_remote = false && $do_compile = true || $create_executable_for_batch = true ]] |
---|
1903 | then |
---|
1904 | eval fopts=\"$fopts\" |
---|
1905 | eval lopts=\"$lopts\" |
---|
1906 | fi |
---|
1907 | |
---|
1908 | |
---|
1909 | # DETERMINE COMPILE- AND LINK-OPTIONS |
---|
1910 | fopts="$fopts $netcdf_inc $fftw_inc $dvr_inc" |
---|
1911 | lopts="$lopts $netcdf_lib $fftw_lib $dvr_lib" |
---|
1912 | XOPT="-X $numprocs" |
---|
1913 | |
---|
1914 | |
---|
1915 | # CHECK THE CPU-LIMIT. IT MUST BE GIVEN FOR BATCH-JOBS AND IS COMMUNICATED TO THE |
---|
1916 | # EXECUTABLE VIA NAMELIST-PARAMETER cputime |
---|
1917 | done=false |
---|
1918 | while [[ $done = false ]] |
---|
1919 | do |
---|
1920 | cputime=$cpumax |
---|
1921 | if (( $cputime == 0 )) |
---|
1922 | then |
---|
1923 | if [[ $do_batch = true ]] |
---|
1924 | then |
---|
1925 | printf "\n +++ cpu-time is undefined" |
---|
1926 | printf "\n >>> Please type CPU-time in seconds as INTEGER:" |
---|
1927 | printf "\n >>> " |
---|
1928 | read cputime 1>/dev/null 2>&1 |
---|
1929 | else |
---|
1930 | cputime=10000000 # NO CPU LIMIT FOR INTERACTIVE RUNS |
---|
1931 | fi |
---|
1932 | else |
---|
1933 | done=true |
---|
1934 | fi |
---|
1935 | cpumax=$cputime |
---|
1936 | done |
---|
1937 | |
---|
1938 | (( minuten = cputime / 60 )) |
---|
1939 | (( sekunden = cputime - minuten * 60 )) |
---|
1940 | |
---|
1941 | |
---|
1942 | # CHECK THE MEMORY DEMAND |
---|
1943 | if [[ $do_batch = true ]] |
---|
1944 | then |
---|
1945 | done=false |
---|
1946 | while [[ $done = false ]] |
---|
1947 | do |
---|
1948 | if (( memory == 0 )) |
---|
1949 | then |
---|
1950 | printf "\n +++ memory demand is undefined" |
---|
1951 | printf "\n >>> Please type memory in MByte per process as INTEGER:" |
---|
1952 | printf "\n >>> " |
---|
1953 | read memory 1>/dev/null 2>&1 |
---|
1954 | else |
---|
1955 | done=true |
---|
1956 | fi |
---|
1957 | done |
---|
1958 | fi |
---|
1959 | |
---|
1960 | |
---|
1961 | # IN CASE OF REMOTE-JOBS CHECK, IF A USERNAME FOR THE REMOTE HOST IS GIVEN |
---|
1962 | if [[ $do_remote = true && -z $remote_username ]] |
---|
1963 | then |
---|
1964 | while [[ -z $remote_username ]] |
---|
1965 | do |
---|
1966 | printf "\n +++ username on remote host \"$host\" is undefined" |
---|
1967 | printf "\n >>> Please type username:" |
---|
1968 | printf "\n >>> " |
---|
1969 | read remote_username |
---|
1970 | done |
---|
1971 | mc="$mc -u$remote_username" |
---|
1972 | fi |
---|
1973 | |
---|
1974 | # CHECK FOR INITIAL COMMANDS AFTER LOGIN |
---|
1975 | if [[ "$login_init_cmd" != "" ]] |
---|
1976 | then |
---|
1977 | export init_cmds="${login_init_cmd};" |
---|
1978 | fi |
---|
1979 | |
---|
1980 | |
---|
1981 | # SET THE MODULE-LOAD COMMAD AND EXPORT IT FOR subjob |
---|
1982 | if [[ "$modules" != "" ]] |
---|
1983 | then |
---|
1984 | if [[ $host = lctit ]] |
---|
1985 | then |
---|
1986 | export module_calls=". $modules" |
---|
1987 | else |
---|
1988 | export module_calls="module load ${modules};" |
---|
1989 | fi |
---|
1990 | fi |
---|
1991 | |
---|
1992 | # OUTPUT OF THE MRUN-HEADER |
---|
1993 | calltime=$(date) |
---|
1994 | printf "\n" |
---|
1995 | printf "#------------------------------------------------------------------------# \n" |
---|
1996 | printf "| %-35s%35s | \n" "$version" "$calltime" |
---|
1997 | printf "| | \n" |
---|
1998 | spalte1="called on:"; spalte2=$localhost_realname |
---|
1999 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2000 | if [[ $do_remote = true ]] |
---|
2001 | then |
---|
2002 | spalte1="execution on:"; spalte2="$host (username: $remote_username)" |
---|
2003 | else |
---|
2004 | spalte1="execution on:"; spalte2="$host ($localhost_realname)" |
---|
2005 | fi |
---|
2006 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2007 | if [[ -n $numprocs ]] |
---|
2008 | then |
---|
2009 | if [[ $run_coupled_model = false ]] |
---|
2010 | then |
---|
2011 | spalte1="number of PEs:"; spalte2=$numprocs |
---|
2012 | else |
---|
2013 | spalte1="number of PEs:"; spalte2="$numprocs (atmosphere: $numprocs_atmos, ocean: $numprocs_ocean)" |
---|
2014 | fi |
---|
2015 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2016 | fi |
---|
2017 | if [[ -n $tasks_per_node ]] |
---|
2018 | then |
---|
2019 | spalte1="tasks per node:"; spalte2="$tasks_per_node (number of nodes: $nodes)" |
---|
2020 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2021 | if (( remaining_pes > 0 )) |
---|
2022 | then |
---|
2023 | spalte1=" "; spalte2="one of the nodes only filled with $remaining_pes tasks" |
---|
2024 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2025 | fi |
---|
2026 | fi |
---|
2027 | if [[ $maximum_parallel_io_streams != $numprocs ]] |
---|
2028 | then |
---|
2029 | spalte1="max par io streams:"; spalte2="$maximum_parallel_io_streams" |
---|
2030 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2031 | fi |
---|
2032 | if [[ $use_openmp = true ]] |
---|
2033 | then |
---|
2034 | spalte1="threads per task:"; spalte2="$threads_per_task" |
---|
2035 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2036 | fi |
---|
2037 | printf "| | \n" |
---|
2038 | if [[ $do_compile = true ]] |
---|
2039 | then |
---|
2040 | if [[ "$mopts" != "" ]] |
---|
2041 | then |
---|
2042 | spalte1="make options:"; spalte2=$(echo "$mopts" | cut -c-45) |
---|
2043 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2044 | zeile=$(echo "$mopts" | cut -c46-) |
---|
2045 | while [[ "$zeile" != "" ]] |
---|
2046 | do |
---|
2047 | spalte1="" |
---|
2048 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
2049 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2050 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2051 | done |
---|
2052 | fi |
---|
2053 | |
---|
2054 | spalte1="cpp directives:"; spalte2=$(echo "$cpp_options" | cut -c-45) |
---|
2055 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2056 | zeile=$(echo "$cpp_options" | cut -c46-) |
---|
2057 | while [[ "$zeile" != "" ]] |
---|
2058 | do |
---|
2059 | spalte1="" |
---|
2060 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
2061 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2062 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2063 | done |
---|
2064 | |
---|
2065 | spalte1="compiler options:"; spalte2=$(echo "$fopts" | cut -c-45) |
---|
2066 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2067 | zeile=$(echo "$fopts" | cut -c46-) |
---|
2068 | while [[ "$zeile" != "" ]] |
---|
2069 | do |
---|
2070 | spalte1="" |
---|
2071 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
2072 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2073 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2074 | done |
---|
2075 | |
---|
2076 | spalte1="linker options:"; spalte2=$(echo "$lopts" | cut -c-45) |
---|
2077 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2078 | zeile=$(echo "$lopts" | cut -c46-) |
---|
2079 | while [[ "$zeile" != "" ]] |
---|
2080 | do |
---|
2081 | spalte1="" |
---|
2082 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
2083 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2084 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2085 | done |
---|
2086 | |
---|
2087 | spalte1="modules to be load:"; spalte2=$(echo "$modules" | cut -c-45) |
---|
2088 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2089 | zeile=$(echo "$modules" | cut -c46-) |
---|
2090 | while [[ "$zeile" != "" ]] |
---|
2091 | do |
---|
2092 | spalte1="" |
---|
2093 | spalte2=$(echo "$zeile" | cut -c-45) |
---|
2094 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2095 | zeile=$(echo "$zeile" | cut -c46-) |
---|
2096 | done |
---|
2097 | |
---|
2098 | spalte1="main program:"; spalte2=$mainprog |
---|
2099 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2100 | else |
---|
2101 | spalte1=executable:; spalte2=$executable |
---|
2102 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2103 | fi |
---|
2104 | printf "| | \n" |
---|
2105 | spalte1="base name of files:"; spalte2=$fname |
---|
2106 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2107 | if [[ $fname != $afname ]] |
---|
2108 | then |
---|
2109 | spalte1="base name of input files:"; spalte2=$afname |
---|
2110 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2111 | fi |
---|
2112 | spalte1="INPUT control list:"; spalte2=$(echo $input_list) |
---|
2113 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2114 | spalte1="OUTPUT control list:"; spalte2=$(echo $output_list) |
---|
2115 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2116 | |
---|
2117 | if [[ "$ocean_file_appendix" = true ]] |
---|
2118 | then |
---|
2119 | printf "| %-35s%-35s | \n" "suffix \"_O\" is added to local files" " " |
---|
2120 | fi |
---|
2121 | |
---|
2122 | if [[ $do_batch = true || "$LOADLBATCH" = yes ]] |
---|
2123 | then |
---|
2124 | spalte1="memory demand / PE":; spalte2="$memory MB" |
---|
2125 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2126 | spalte1=CPU-time:; spalte2="$minuten:$sekunden" |
---|
2127 | printf "| %-25s%-45s | \n" "$spalte1" "$spalte2" |
---|
2128 | fi |
---|
2129 | |
---|
2130 | if [[ $do_compile = true ]] |
---|
2131 | then |
---|
2132 | printf "| | \n" |
---|
2133 | printf "| Files to be compiled: | \n" |
---|
2134 | zeile=$source_list |
---|
2135 | while [[ "$zeile" != "" ]] |
---|
2136 | do |
---|
2137 | linestart=$(echo $zeile | cut -c-70) |
---|
2138 | printf "| %-70s | \n" "$linestart" |
---|
2139 | zeile=$(echo "$zeile" | cut -c71-) |
---|
2140 | done |
---|
2141 | fi |
---|
2142 | printf "#------------------------------------------------------------------------#" |
---|
2143 | |
---|
2144 | |
---|
2145 | |
---|
2146 | # OUTPUT OF FILE CONNECTIONS IN CASE OF TRACEBACK |
---|
2147 | if [[ $do_trace = true ]] |
---|
2148 | then |
---|
2149 | (( i = 0 )) |
---|
2150 | while (( i < iin )) |
---|
2151 | do |
---|
2152 | (( i = i + 1 )) |
---|
2153 | if (( i == 1 )) |
---|
2154 | then |
---|
2155 | printf "\n\n >>> INPUT-file assignments:\n" |
---|
2156 | fi |
---|
2157 | printf "\n ${localin[$i]} : ${absnamein[$i]}" |
---|
2158 | done |
---|
2159 | (( i = 0 )) |
---|
2160 | while (( i < iout )) |
---|
2161 | do |
---|
2162 | (( i = i + 1 )) |
---|
2163 | if (( i == 1 )) |
---|
2164 | then |
---|
2165 | printf "\n\n >>> OUTPUT-file assignments:\n" |
---|
2166 | fi |
---|
2167 | printf "\n ${localout[$i]} : ${pathout[$i]}" |
---|
2168 | done |
---|
2169 | (( i = 0 )) |
---|
2170 | while (( i < iic )) |
---|
2171 | do |
---|
2172 | (( i = i + 1 )) |
---|
2173 | if (( i == 1 )) |
---|
2174 | then |
---|
2175 | printf "\n\n >>> INPUT-commands:\n" |
---|
2176 | fi |
---|
2177 | printf "\n ${in_command[$i]}" |
---|
2178 | done |
---|
2179 | (( i = 0 )) |
---|
2180 | while (( i < ioc )) |
---|
2181 | do |
---|
2182 | (( i = i + 1 )) |
---|
2183 | if (( i == 1 )) |
---|
2184 | then |
---|
2185 | printf "\n\n >>> OUTPUT-commands:\n" |
---|
2186 | fi |
---|
2187 | printf "\n ${out_command[$i]}" |
---|
2188 | done |
---|
2189 | fi |
---|
2190 | |
---|
2191 | # QUERY FOR CONTINUE (ON LOCAL MACHINES ONLY) |
---|
2192 | if [[ $remotecall = false && $silent = false && $jobmo != BATCH ]] |
---|
2193 | then |
---|
2194 | antwort=dummy |
---|
2195 | printf "\n\n" |
---|
2196 | printf " >>> everything o.k. (y/n) ? " |
---|
2197 | while read antwort |
---|
2198 | do |
---|
2199 | if [[ "$antwort" != y && "$antwort" != Y && "$antwort" != n && "$antwort" != N ]] |
---|
2200 | then |
---|
2201 | printf " >>> everything o.k. (y/n) ? " |
---|
2202 | else |
---|
2203 | break |
---|
2204 | fi |
---|
2205 | done |
---|
2206 | if [[ $antwort = n || $antwort = N ]] |
---|
2207 | then |
---|
2208 | locat=user_abort; (( iec = 0 )); exit |
---|
2209 | fi |
---|
2210 | if [[ $do_batch = true ]] |
---|
2211 | then |
---|
2212 | printf " >>> batch-job will be created and submitted" |
---|
2213 | else |
---|
2214 | printf " >>> MRUN will now continue to execute on this machine" |
---|
2215 | fi |
---|
2216 | fi |
---|
2217 | |
---|
2218 | |
---|
2219 | # DETERMINE PATH FOR MAKE DEPOSITORY |
---|
2220 | if [[ $do_batch = false || $create_executable_for_batch = true ]] |
---|
2221 | then |
---|
2222 | |
---|
2223 | line="" |
---|
2224 | grep "%depository_path" $config_file > tmp_mrun |
---|
2225 | while read line |
---|
2226 | do |
---|
2227 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2228 | then |
---|
2229 | if [[ "$(echo $line | cut -d" " -s -f3)" = "" ]] |
---|
2230 | then |
---|
2231 | global_depository_path=`echo $line | cut -d" " -s -f2` |
---|
2232 | fi |
---|
2233 | fi |
---|
2234 | done < tmp_mrun |
---|
2235 | |
---|
2236 | line="" |
---|
2237 | grep " $localhost" $config_file | grep "%depository_path" > tmp_mrun |
---|
2238 | while read line |
---|
2239 | do |
---|
2240 | if [[ "$line" != "" && $(echo $line | cut -c1) != "#" ]] |
---|
2241 | then |
---|
2242 | if [[ "$(echo $line | cut -d" " -s -f4)" = "$cond1" && "$(echo $line | cut -d" " -s -f5)" = "$cond2" ]] |
---|
2243 | then |
---|
2244 | local_depository_path=`echo $line | cut -d" " -s -f2` |
---|
2245 | fi |
---|
2246 | fi |
---|
2247 | done < tmp_mrun |
---|
2248 | |
---|
2249 | if [[ "$local_depository_path" = "" ]] |
---|
2250 | then |
---|
2251 | if [[ "$global_depository_path" != "" ]] |
---|
2252 | then |
---|
2253 | local_depository_path=$global_depository_path |
---|
2254 | else |
---|
2255 | printf "\n\n +++ no depository path found in configuration file" |
---|
2256 | printf "\n for local host \"$localhost\" " |
---|
2257 | printf "\n please set \"\%depository_path\" in configuration file\n" |
---|
2258 | locat=config_file; exit |
---|
2259 | fi |
---|
2260 | fi |
---|
2261 | eval local_depository_path=$local_depository_path |
---|
2262 | [[ "$cond1" != "" ]] && local_depository_path=${local_depository_path}_$cond1 |
---|
2263 | [[ "$cond2" != "" ]] && local_depository_path=${local_depository_path}_$cond2 |
---|
2264 | |
---|
2265 | |
---|
2266 | basename=`echo $mainprog | cut -f1 -d"."` |
---|
2267 | eval make_depository=${local_depository_path}/${basename}_current_version.tar |
---|
2268 | if [[ ! -f $make_depository ]] |
---|
2269 | then |
---|
2270 | printf "\n" |
---|
2271 | printf "\n *** WARNING: make depository \"$make_depository\" not found" |
---|
2272 | printf "\n \"make\" will fail, if the Makefile or other source files are missing\n" |
---|
2273 | fi |
---|
2274 | |
---|
2275 | fi |
---|
2276 | |
---|
2277 | |
---|
2278 | # NOW PERFORM THOSE ACTIONS REQUIRED TO EXECUTE THE PROGRAM (PALM) ON THIS MACHINE |
---|
2279 | # (COMPILING/LINKING, EXECUTING, COPYING I/O FILES) |
---|
2280 | if [[ $do_batch = false ]] |
---|
2281 | then |
---|
2282 | |
---|
2283 | |
---|
2284 | # CREATE THE TEMPORARY WORKING DIRECTORY |
---|
2285 | mkdir -p $TEMPDIR |
---|
2286 | chmod go+rx $TEMPDIR |
---|
2287 | tmpcreate=true |
---|
2288 | |
---|
2289 | |
---|
2290 | # COPY EITHER THE COMPLETE SOURCE CODE FILES TO BE COMPILED OR THE EXECUTABLE |
---|
2291 | # INTO THE TEMPORARY WORKING DIRECTORY |
---|
2292 | if [[ $do_compile = true ]] |
---|
2293 | then |
---|
2294 | |
---|
2295 | TEMPDIR_COMPILE=$TEMPDIR |
---|
2296 | |
---|
2297 | cp $make_depository $TEMPDIR_COMPILE |
---|
2298 | cd $TEMPDIR_COMPILE |
---|
2299 | tar -xf $make_depository > /dev/null 2>&1 |
---|
2300 | cd - > /dev/null |
---|
2301 | |
---|
2302 | # DUE TO UNKNOWN REASONS, COPY WITH cp COMMAND CREATES CORRUPT |
---|
2303 | # FILES ON CRAY XC30 SYSTEMS (HLRN III), rsync IS USED INSTEAD |
---|
2304 | if [[ $(echo $host | cut -c1-6) = lccray ]] |
---|
2305 | then |
---|
2306 | rsync -av -t SOURCES_FOR_RUN_$fname/* $TEMPDIR_COMPILE > /dev/null |
---|
2307 | else |
---|
2308 | cp SOURCES_FOR_RUN_$fname/* $TEMPDIR_COMPILE > /dev/null |
---|
2309 | fi |
---|
2310 | |
---|
2311 | else |
---|
2312 | |
---|
2313 | cp $executable ${TEMPDIR}/a.out |
---|
2314 | |
---|
2315 | fi |
---|
2316 | |
---|
2317 | |
---|
2318 | # CHANGE TO THE TEMPORARY WORKING DIRECTORY |
---|
2319 | cd $TEMPDIR |
---|
2320 | printf "\n *** changed to temporary directory: $TEMPDIR" |
---|
2321 | |
---|
2322 | |
---|
2323 | # IF REQUIRED, START WITH COMPILING |
---|
2324 | if [[ $do_compile = true ]] |
---|
2325 | then |
---|
2326 | |
---|
2327 | |
---|
2328 | if [[ -f a.out ]] |
---|
2329 | then |
---|
2330 | |
---|
2331 | # EXECUTABLE WAS CREATED DURING INTERACTIVE CALL OF MRUN |
---|
2332 | printf "\n\n\n *** executable a.out found" |
---|
2333 | printf "\n no compilation required \n" |
---|
2334 | |
---|
2335 | else |
---|
2336 | |
---|
2337 | # COMPILING WITH MAKE (ON NEC COMPILER IS CALLED ON HOST CROSS) |
---|
2338 | printf "\n\n\n *** compilation starts \n$dashes\n" |
---|
2339 | printf " *** compilation with make using following options:\n" |
---|
2340 | printf " make depository: $make_depository" |
---|
2341 | if [[ "$mopts" != "" ]] |
---|
2342 | then |
---|
2343 | printf " make options: $mopts\n" |
---|
2344 | fi |
---|
2345 | printf " compilername: $compiler_name\n" |
---|
2346 | printf " compiler options: $fopts\n" |
---|
2347 | printf " preprocessor directives: $cpp_options \n" |
---|
2348 | printf " linker options: $lopts \n" |
---|
2349 | if [[ "$modules" != "" ]] |
---|
2350 | then |
---|
2351 | printf " modules to be load: $modules \n" |
---|
2352 | fi |
---|
2353 | printf " source code files: $source_list \n" |
---|
2354 | |
---|
2355 | if [[ $localhost = ibmh ]] |
---|
2356 | then |
---|
2357 | printf " compiler is called via ssh on \"plogin1\" \n" |
---|
2358 | ssh $SSH_PORTOPT plogin1 -l $usern "$init_cmds export PATH=/sw/ibm/xlf/13.1.0.8/usr/bin:$PATH; $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " |
---|
2359 | [[ ! -f a.out ]] && compile_error=true |
---|
2360 | continue # STATUS=1, IF a.out EXISTS |
---|
2361 | elif [[ $localhost = lcocean ]] |
---|
2362 | then |
---|
2363 | printf " compiler is called via ssh on \"ocean\" \n" |
---|
2364 | echo $PWD |
---|
2365 | ssh $SSH_PORTOPT ocean -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " |
---|
2366 | [[ ! -f a.out ]] && compile_error=true |
---|
2367 | continue # STATUS=1, IF a.out EXISTS |
---|
2368 | elif [[ $localhost = lcbullhh || $localhost = lccrayb || $localhost = lccrayf || $localhost = lccrayh ]] |
---|
2369 | then |
---|
2370 | make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" |
---|
2371 | elif [[ $localhost = lceddy ]] |
---|
2372 | then |
---|
2373 | which mpifc |
---|
2374 | make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" |
---|
2375 | elif [[ $localhost = lcgeohu ]] |
---|
2376 | then |
---|
2377 | printf " compiler is called via ssh on \"cirrus\" \n" |
---|
2378 | ssh $SSH_PORTOPT cirrus.geo.hu-berlin.de -l $usern "$init_cmds $module_calls cd $TEMPDIR; make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT=\"$cpp_options\" F90FLAGS=\"$fopts\" LDFLAGS=\"$lopts\" " |
---|
2379 | # this check did not work. Although a.out exists, it sets compile_error to true! |
---|
2380 | # [[ ! -f a.out ]] && compile_error=true |
---|
2381 | continue # STATUS=1, IF a.out EXISTS |
---|
2382 | else |
---|
2383 | [[ "$init_cmds" != "" ]] && eval $init_cmds |
---|
2384 | [[ "$module_calls" != "" ]] && eval $module_calls |
---|
2385 | make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" |
---|
2386 | fi |
---|
2387 | |
---|
2388 | if [[ $? != 0 || "$compile_error" = true || "$module_compile_error" = true ]] |
---|
2389 | then |
---|
2390 | printf "\n +++ error occured while compiling or linking" |
---|
2391 | locat=compile |
---|
2392 | |
---|
2393 | exit |
---|
2394 | else |
---|
2395 | printf "$dashes\n *** compilation finished \n" |
---|
2396 | fi |
---|
2397 | |
---|
2398 | fi |
---|
2399 | |
---|
2400 | fi |
---|
2401 | |
---|
2402 | |
---|
2403 | # PROVIDE THE INPUT FILES |
---|
2404 | # LOOP OVER ALL ACTIVATED FILES (LISTED IN THE CONFIGURATION FILE) |
---|
2405 | (( i = 0 )) |
---|
2406 | while (( i < iin )) |
---|
2407 | do |
---|
2408 | (( i = i + 1 )) |
---|
2409 | if (( i == 1 )) |
---|
2410 | then |
---|
2411 | printf "\n\n *** providing INPUT-files:\n$dashes" |
---|
2412 | fi |
---|
2413 | |
---|
2414 | |
---|
2415 | # SKIP OPTIONAL FILES, IF THEY DO NOT EXIST |
---|
2416 | if [[ "${transin[$i]}" = unavailable ]] |
---|
2417 | then |
---|
2418 | if [[ "${extin[$i]}" = "" || "${extin[$i]}" = " " ]] |
---|
2419 | then |
---|
2420 | printf "\n *** INFORMATIVE: input file \"${pathin[$i]}/${afname}${endin[$i]}\" " |
---|
2421 | printf "\n is not available!" |
---|
2422 | else |
---|
2423 | printf "\n *** INFORMATIVE: input file \"${pathin[$i]}/${afname}${endin[$i]}.${extin[$i]}\" " |
---|
2424 | printf "\n is not available!" |
---|
2425 | fi |
---|
2426 | continue |
---|
2427 | fi |
---|
2428 | |
---|
2429 | # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION) |
---|
2430 | files_for_pes=false; datentyp=file |
---|
2431 | if [[ "${actionin[$i]}" = pe && -n $numprocs ]] |
---|
2432 | then |
---|
2433 | files_for_pes=true; datentyp=files |
---|
2434 | actionin[$i]="" |
---|
2435 | elif [[ "${actionin[$i]}" = pe && ! -n $numprocs ]] |
---|
2436 | then |
---|
2437 | actionin[$i]="" |
---|
2438 | elif [[ "${actionin[$i]}" = lnpe && -n $numprocs ]] |
---|
2439 | then |
---|
2440 | files_for_pes=true; datentyp=files |
---|
2441 | actionin[$i]="ln" |
---|
2442 | elif [[ "${actionin[$i]}" = lnpe && ! -n $numprocs ]] |
---|
2443 | then |
---|
2444 | actionin[$i]="ln" |
---|
2445 | fi |
---|
2446 | |
---|
2447 | if [[ $files_for_pes = true ]] |
---|
2448 | then |
---|
2449 | printf "\n >>> INPUT: ${absnamein[$i]}/.... to ${localin[$i]}" |
---|
2450 | else |
---|
2451 | printf "\n >>> INPUT: ${absnamein[$i]} to ${localin[$i]}" |
---|
2452 | fi |
---|
2453 | |
---|
2454 | # INPUT-FILES TO BE LINKED |
---|
2455 | if [[ "${actionin[$i]}" = ln ]] |
---|
2456 | then |
---|
2457 | |
---|
2458 | printf "\n $datentyp will be linked" |
---|
2459 | if [[ $files_for_pes = false ]] |
---|
2460 | then |
---|
2461 | if [[ -f "${absnamein[$i]}" ]] |
---|
2462 | then |
---|
2463 | ln ${absnamein[$i]} ${localin[$i]} |
---|
2464 | got_tmp[$i]=true |
---|
2465 | fi |
---|
2466 | else |
---|
2467 | if [[ -d "${absnamein[$i]}" ]] |
---|
2468 | then |
---|
2469 | mkdir ${localin[$i]} |
---|
2470 | cd ${absnamein[$i]} |
---|
2471 | for file in $(ls *) |
---|
2472 | do |
---|
2473 | ln $file $TEMPDIR/${localin[$i]} |
---|
2474 | done >|/dev/null 2>&1 |
---|
2475 | cd $TEMPDIR |
---|
2476 | fi |
---|
2477 | |
---|
2478 | # IF "ln -f" HAS FAILED DO A NORMAL COPY "cp -r" |
---|
2479 | if [[ ! -f "${localin[$i]}/_000000" ]] |
---|
2480 | then |
---|
2481 | printf "\n --- WARNING: ln failed, using cp instead (might be time consuming...)" |
---|
2482 | cp -r ${absnamein[$i]}/* ${localin[$i]} |
---|
2483 | fi |
---|
2484 | |
---|
2485 | got_tmp[$i]=true |
---|
2486 | fi |
---|
2487 | fi |
---|
2488 | |
---|
2489 | # FILE IS STORED IN THE RESPECTIVE DIRECTORY GIVEN IN THE CONFIGURATION FILE |
---|
2490 | if [[ "${actionin[$i]}" = "" || "${actionin[$i]}" = "di" || "${actionin[$i]}" = "npe" ]] |
---|
2491 | then |
---|
2492 | |
---|
2493 | if [[ "${actionin[$i]}" = "npe" && -n $numprocs ]] |
---|
2494 | then |
---|
2495 | |
---|
2496 | # FILE COPIES ARE PROVIDED FOR ALL CORES |
---|
2497 | # EACH FILE GETS A UNIQUE FILENAME WITH A FOUR DIGIT NUMBER |
---|
2498 | printf "\n file will be provided for $numprocs processors" |
---|
2499 | mkdir ${localin[$i]} |
---|
2500 | ival=$numprocs |
---|
2501 | (( ii = 0 )) |
---|
2502 | while (( ii <= ival-1 )) |
---|
2503 | do |
---|
2504 | if (( ii < 10 )) |
---|
2505 | then |
---|
2506 | cp ${absnamein[$i]} ${localin[$i]}/_000$ii |
---|
2507 | elif (( ii < 100 )) |
---|
2508 | then |
---|
2509 | cp ${absnamein[$i]} ${localin[$i]}/_00$ii |
---|
2510 | elif (( ii < 1000 )) |
---|
2511 | then |
---|
2512 | cp ${absnamein[$i]} ${localin[$i]}/_0$ii |
---|
2513 | else |
---|
2514 | cp ${absnamein[$i]} ${localin[$i]}/_$ii |
---|
2515 | fi |
---|
2516 | (( ii = ii + 1 )) |
---|
2517 | done |
---|
2518 | |
---|
2519 | else |
---|
2520 | |
---|
2521 | if [[ $files_for_pes = true ]] |
---|
2522 | then |
---|
2523 | |
---|
2524 | # PROVIDE FILES FOR EACH CORE |
---|
2525 | # FIRST CREATE THE LOCAL DIRECTORY, THEN COPY FILES |
---|
2526 | # FROM THE PERMANENT DIRECTORY BY LINKING THEM TO THE LOCAL ONE |
---|
2527 | printf "\n providing $numprocs files for the respective processors" |
---|
2528 | mkdir ${localin[$i]} |
---|
2529 | if [[ $link_local_input = true ]] |
---|
2530 | then |
---|
2531 | printf " files will be linked\n" |
---|
2532 | cd ${absnamein[$i]} |
---|
2533 | for file in $(ls *) |
---|
2534 | do |
---|
2535 | ln -f $file ${localin[$i]} |
---|
2536 | done |
---|
2537 | cd $TEMPDIR |
---|
2538 | fi |
---|
2539 | |
---|
2540 | # IF "ln -f" FAILED OR IF "$link_local_input = false" DO A NORMAL "cp -r" |
---|
2541 | if [[ ! -f "${localin[$i]}/_000000" ]] |
---|
2542 | then |
---|
2543 | if [[ $link_local_input = true ]] |
---|
2544 | then |
---|
2545 | printf "\n --- WARNING: ln failed, using cp instead (might be time consuming...)" |
---|
2546 | fi |
---|
2547 | cp -r ${absnamein[$i]}/* ${localin[$i]} |
---|
2548 | fi |
---|
2549 | |
---|
2550 | else |
---|
2551 | |
---|
2552 | # PROVIDE FILE FOR RUNS ON A SINGLE CORE |
---|
2553 | if [[ $link_local_input = true ]] |
---|
2554 | then |
---|
2555 | printf " file will be linked\n" |
---|
2556 | ln -f ${absnamein[$i]} ${localin[$i]} |
---|
2557 | fi |
---|
2558 | # If "ln -f" fails of if "$link_local_input = false" do a normal "cp" |
---|
2559 | if [[ ! -f "${localin[$i]}" ]] |
---|
2560 | then |
---|
2561 | if [[ $link_local_input = true ]] |
---|
2562 | then |
---|
2563 | printf "\n --- WARNING: ln failed, using cp instead (might be time consuming...)" |
---|
2564 | fi |
---|
2565 | cp ${absnamein[$i]} ${localin[$i]} |
---|
2566 | fi |
---|
2567 | fi |
---|
2568 | fi |
---|
2569 | fi |
---|
2570 | |
---|
2571 | done |
---|
2572 | if (( i != 0 )) |
---|
2573 | then |
---|
2574 | printf "\n$dashes\n *** all INPUT-files provided \n" |
---|
2575 | fi |
---|
2576 | |
---|
2577 | |
---|
2578 | # EXECUTE INPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE |
---|
2579 | (( i = 0 )) |
---|
2580 | while (( i < iic )) |
---|
2581 | do |
---|
2582 | (( i = i + 1 )) |
---|
2583 | if (( i == 1 )) |
---|
2584 | then |
---|
2585 | printf "\n\n *** execution of INPUT-commands:\n$dashes" |
---|
2586 | fi |
---|
2587 | printf "\n >>> ${in_command[$i]}" |
---|
2588 | eval ${in_command[$i]} |
---|
2589 | if (( i == iic )) |
---|
2590 | then |
---|
2591 | printf "\n$dashes\n" |
---|
2592 | fi |
---|
2593 | done |
---|
2594 | |
---|
2595 | |
---|
2596 | # SET THE REMAINING CPU-TIME |
---|
2597 | cpurest=${cpumax}. |
---|
2598 | |
---|
2599 | |
---|
2600 | # START DVR STREAMING SERVER |
---|
2601 | if [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] |
---|
2602 | then |
---|
2603 | if [[ "$dvr_server" != "" ]] |
---|
2604 | then |
---|
2605 | |
---|
2606 | printf "\n\n *** preparing the dvr streaming server configuration file" |
---|
2607 | |
---|
2608 | # CHECK, IF A DVR SERVER IS ALREADY RUNNING |
---|
2609 | running_dvrserver_id=`echo $(ps -edaf | grep .dvrserver.config | grep -v grep) | cut -d" " -f2` |
---|
2610 | if [[ "$running_dvrserver_id" != "" ]] |
---|
2611 | then |
---|
2612 | |
---|
2613 | printf "\n\n +++ WARNING: A dvr server with id=$running_dvrserver_id is already running!" |
---|
2614 | printf "\n This server is used instead starting a new one!" |
---|
2615 | printf "\n If required, script \"process_dvr_output\" has to be run manually." |
---|
2616 | |
---|
2617 | else |
---|
2618 | |
---|
2619 | # COPY CONFIGURATION FILE FOR STREAMING SERVER FROM REPOSITORY TO HERE |
---|
2620 | if [[ -f ${PALM_BIN}/.dvrserver.config ]] |
---|
2621 | then |
---|
2622 | cp ${PALM_BIN}/.dvrserver.config . |
---|
2623 | |
---|
2624 | # ENTERING THE BASEDIR, UID AND GID INTO THIS FILE |
---|
2625 | user_id=`id -u` |
---|
2626 | group_id=`id -g` |
---|
2627 | |
---|
2628 | # "&" IS REQUIRED AS A SEPERATOR, BECAUSE TEMPDIR CONTAINS "/" |
---|
2629 | sed "s&<replace by dvr data directory>&${TEMPDIR}&g" .dvrserver.config > .dvrserver.1 |
---|
2630 | sed "s/<replace by user id>/$user_id/g" .dvrserver.1 > .dvrserver.2 |
---|
2631 | sed "s/<replace by group id>/$group_id/g" .dvrserver.2 > .dvrserver.3 |
---|
2632 | mv .dvrserver.3 .dvrserver.config |
---|
2633 | rm .dvrserver.1 .dvrserver.2 |
---|
2634 | |
---|
2635 | # START DVR SERVER IN BACKGROUND, GET HIS ID AND PRINT ON TERMINAL |
---|
2636 | $dvr_server .dvrserver.config >> DVR_LOGFILE 2>&1 & |
---|
2637 | dvrserver_id=`echo $(ps -edaf | grep .dvrserver.config) | cut -d" " -f2` |
---|
2638 | printf "\n *** streaming server with id=$dvrserver_id is started in background" |
---|
2639 | local_dvrserver_running=.TRUE. |
---|
2640 | else |
---|
2641 | printf "\n +++ missing file \".dvrserver.config\" in directory:" |
---|
2642 | printf "\n \"$PALM_BIN\" " |
---|
2643 | locat=dvr |
---|
2644 | exit |
---|
2645 | fi |
---|
2646 | |
---|
2647 | fi |
---|
2648 | |
---|
2649 | else |
---|
2650 | printf "\n\n --- INFORMATIVE: no dvr streaming server will be started" |
---|
2651 | fi |
---|
2652 | fi |
---|
2653 | |
---|
2654 | |
---|
2655 | # CREATE THE NAMELIST-FILE WITH VALUES OF ENVIRONMENT-VARIABLES REQUIRED BY PALM |
---|
2656 | # (FILE ENVPAR WILL BE READ BY PALM) |
---|
2657 | cat > ENVPAR << EOF |
---|
2658 | &envpar run_identifier = '$fname', host = '$localhost', |
---|
2659 | write_binary = .${write_binary}., tasks_per_node = $tasks_per_node, |
---|
2660 | maximum_parallel_io_streams = $maximum_parallel_io_streams, |
---|
2661 | maximum_cpu_time_allowed = ${cpumax}., |
---|
2662 | revision = '$global_revision', |
---|
2663 | local_dvrserver_running = $local_dvrserver_running, |
---|
2664 | batch_job = $batch_job / |
---|
2665 | |
---|
2666 | EOF |
---|
2667 | |
---|
2668 | |
---|
2669 | # STARTING THE EXECUTABLE |
---|
2670 | printf "\n\n *** execution starts in directory\n \"`pwd`\"\n$dashes\n" |
---|
2671 | PATH=$PATH:$TEMPDIR |
---|
2672 | |
---|
2673 | |
---|
2674 | if [[ $execute_command != "none" ]] |
---|
2675 | then |
---|
2676 | |
---|
2677 | printf "\n +++ branch still not realized" |
---|
2678 | locat=execution |
---|
2679 | exit |
---|
2680 | |
---|
2681 | else |
---|
2682 | |
---|
2683 | # MPI DEBUG OPTION (ARGUMENT CHECKING, SLOWS DOWN EXECUTION DUE TO INCREASED LATENCY) |
---|
2684 | if [[ "$mpi_debug" = true ]] |
---|
2685 | then |
---|
2686 | export MPI_CHECK_ARGS=1 |
---|
2687 | printf "\n +++ MPI_CHECK_ARGS=$MPI_CHECK_ARGS" |
---|
2688 | fi |
---|
2689 | |
---|
2690 | if [[ "$totalview" = true ]] |
---|
2691 | then |
---|
2692 | printf "\n *** totalview debugger will be used" |
---|
2693 | tv_opt="-tv" |
---|
2694 | else |
---|
2695 | tv_opt="" |
---|
2696 | fi |
---|
2697 | |
---|
2698 | if [[ "$cond1" = debug || "$cond2" = debug ]] |
---|
2699 | then |
---|
2700 | |
---|
2701 | #Interactive ALLINEA DEBUG seesion |
---|
2702 | if [[ "$ENVIRONMENT" != BATCH ]] |
---|
2703 | then |
---|
2704 | if [[ $host = lccrayb || $host = lccrayh ]] |
---|
2705 | then |
---|
2706 | if [[ "$allinea" = true ]] |
---|
2707 | then |
---|
2708 | echo "--- aprun -n $ii -N $tasks_per_node a.out < runfile_atmos" |
---|
2709 | |
---|
2710 | ddt aprun -n $ii -N $tasks_per_node a.out |
---|
2711 | wait |
---|
2712 | fi |
---|
2713 | fi |
---|
2714 | fi |
---|
2715 | |
---|
2716 | if [[ $localhost = ibmh ]] |
---|
2717 | then |
---|
2718 | |
---|
2719 | # SETUP THE IBM MPI ENVIRONMENT |
---|
2720 | export MP_SHARED_MEMORY=yes |
---|
2721 | export AIXTHREADS_SCOPE=S |
---|
2722 | export OMP_NUM_THREADS=$threads_per_task |
---|
2723 | export AUTHSTATE=files |
---|
2724 | export XLFRTEOPTS="nlwidth=132:err_recovery=no" # RECORD-LENGTH OF NAMELIST-OUTPUT |
---|
2725 | |
---|
2726 | # FOLLOWING OPTIONS ARE MANDATORY FOR TOTALVIEW |
---|
2727 | export MP_ADAPTER_USE=shared |
---|
2728 | export MP_CPU_USE=multiple |
---|
2729 | export MP_TIMEOUT=1200 |
---|
2730 | |
---|
2731 | unset MP_TASK_AFFINITY |
---|
2732 | |
---|
2733 | if [[ "$LOADLBATCH" = yes ]] |
---|
2734 | then |
---|
2735 | totalview poe a.out |
---|
2736 | else |
---|
2737 | echo totalview poe -a a.out -procs $numprocs -rmpool 0 -nodes 1 |
---|
2738 | export TVDSVRLAUNCHCMD=ssh |
---|
2739 | totalview poe -a a.out -procs $numprocs -rmpool 0 -nodes 1 |
---|
2740 | fi |
---|
2741 | |
---|
2742 | fi # END DEBUG MODE |
---|
2743 | |
---|
2744 | else |
---|
2745 | |
---|
2746 | # NORMAL EXECUTION |
---|
2747 | if [[ -n $numprocs ]] |
---|
2748 | then |
---|
2749 | |
---|
2750 | # RUNNING THE PROGRAM ON PARALLEL MACHINES |
---|
2751 | if [[ $(echo $host | cut -c1-3) = ibm ]] |
---|
2752 | then |
---|
2753 | |
---|
2754 | # SETUP THE IBM MPI ENVIRONMENT |
---|
2755 | if [[ $host != ibmh && $host != ibmkisti ]] |
---|
2756 | then |
---|
2757 | export MP_SHARED_MEMORY=yes |
---|
2758 | export AIXTHREAD_SCOPE=S |
---|
2759 | export OMP_NUM_THREADS=$threads_per_task |
---|
2760 | export XLSMPOPTS="spins=0:yields=0:stack=20000000" |
---|
2761 | export AUTHSTATE=files |
---|
2762 | export XLFRTEOPTS="nlwidth=132:err_recovery=no" # RECORD-LENGTH OF NAMELIST-OUTPUT |
---|
2763 | # export MP_PRINTENV=yes |
---|
2764 | |
---|
2765 | # TUNING-VARIABLES TO IMPROVE COMMUNICATION SPEED |
---|
2766 | # DO NOT SHOW SIGNIFICANT EFFECTS (SEP 04, FEDERATION-SWITCH) |
---|
2767 | export MP_WAIT_MODE=poll |
---|
2768 | [[ $node_usage = not_shared ]] && export MP_SINGLE_THREAD=yes |
---|
2769 | fi |
---|
2770 | |
---|
2771 | if [[ $host = ibmkisti ]] |
---|
2772 | then |
---|
2773 | export LANG=en_US |
---|
2774 | export MP_SHARED_MEMORY=yes |
---|
2775 | if [[ $threads_per_task = 1 ]] |
---|
2776 | then |
---|
2777 | export MP_SINGLE_THREAD=yes |
---|
2778 | export MEMORY_AFFINITY=MCM |
---|
2779 | else |
---|
2780 | export OMP_NUM_THREADS=$threads_per_task |
---|
2781 | fi |
---|
2782 | fi |
---|
2783 | |
---|
2784 | if [[ "$LOADLBATCH" = yes ]] |
---|
2785 | then |
---|
2786 | printf "\n--- Control: OMP_NUM_THREADS = \"$OMP_NUM_THREADS\" \n" |
---|
2787 | if [[ "$cond1" = hpmcount || "$cond2" = hpmcount ]] |
---|
2788 | then |
---|
2789 | /opt/optibm/HPM_2_4_1/bin/hpmcount a.out |
---|
2790 | else |
---|
2791 | if [[ $run_coupled_model = false ]] |
---|
2792 | then |
---|
2793 | if [[ "$ocean_file_appendix" = true ]] |
---|
2794 | then |
---|
2795 | echo "precursor_ocean" > runfile_atmos |
---|
2796 | else |
---|
2797 | echo "precursor_atmos" > runfile_atmos |
---|
2798 | fi |
---|
2799 | else |
---|
2800 | (( iia = $numprocs_atmos / $threads_per_task )) |
---|
2801 | (( iio = $numprocs_ocean / $threads_per_task )) |
---|
2802 | printf "\n coupled run ($iia atmosphere, $iio ocean)" |
---|
2803 | printf "\n\n" |
---|
2804 | echo "coupled_run $iia $iio" > runfile_atmos |
---|
2805 | fi |
---|
2806 | poe ./a.out < runfile_atmos |
---|
2807 | fi |
---|
2808 | else |
---|
2809 | if [[ $localhost = ibmh || $localhost = ibms ]] |
---|
2810 | then |
---|
2811 | poe a.out -procs $numprocs -nodes 1 -rmpool 0 |
---|
2812 | elif [[ $localhost = ibmkisti || $localhost = ibmku ]] |
---|
2813 | then |
---|
2814 | if [[ -f $hostfile ]] |
---|
2815 | then |
---|
2816 | cp $hostfile hostfile |
---|
2817 | else |
---|
2818 | (( ii = 1 )) |
---|
2819 | while (( ii <= $numprocs )) |
---|
2820 | do |
---|
2821 | echo $localhost_realname >> hostfile |
---|
2822 | (( ii = ii + 1 )) |
---|
2823 | done |
---|
2824 | fi |
---|
2825 | export MP_HOSTFILE=hostfile |
---|
2826 | if [[ $run_coupled_model = false ]] |
---|
2827 | then |
---|
2828 | if [[ "$ocean_file_appendix" = true ]] |
---|
2829 | then |
---|
2830 | echo "precursor_ocean" > runfile_atmos |
---|
2831 | else |
---|
2832 | echo "precursor_atmos" > runfile_atmos |
---|
2833 | fi |
---|
2834 | else |
---|
2835 | (( iia = $numprocs_atmos / $threads_per_task )) |
---|
2836 | (( iio = $numprocs_ocean / $threads_per_task )) |
---|
2837 | printf "\n coupled run ($iia atmosphere, $iio ocean)" |
---|
2838 | printf "\n\n" |
---|
2839 | echo "coupled_run $iia $iio" > runfile_atmos |
---|
2840 | fi |
---|
2841 | |
---|
2842 | poe ./a.out -procs $numprocs < runfile_atmos |
---|
2843 | |
---|
2844 | else |
---|
2845 | if [[ "$host_file" = "" ]] |
---|
2846 | then |
---|
2847 | printf "\n +++ no hostfile given in configuration file" |
---|
2848 | locat=config_file |
---|
2849 | exit |
---|
2850 | else |
---|
2851 | eval host_file=$host_file |
---|
2852 | fi |
---|
2853 | export MP_HOSTFILE=$host_file |
---|
2854 | poe a.out -procs $numprocs -tasks_per_node $numprocs |
---|
2855 | fi |
---|
2856 | fi |
---|
2857 | |
---|
2858 | elif [[ $(echo $host | cut -c1-2) = lc && $host != lckyoto && $host != lctit ]] |
---|
2859 | then |
---|
2860 | |
---|
2861 | # COPY HOSTFILE FROM SOURCE DIRECTORY OR CREATE IT, IF IT |
---|
2862 | # DOES NOT EXIST |
---|
2863 | if [[ $host != lcbullhh && $host != lccrayb && $host != lccrayf && $host != lccrayh && $host != lckyuh && $host != lckyut && $host != lcocean && $host != lceddy ]] |
---|
2864 | then |
---|
2865 | if [[ -f $hostfile ]] |
---|
2866 | then |
---|
2867 | cp $hostfile hostfile |
---|
2868 | (( ii = $numprocs / $threads_per_task )) |
---|
2869 | [[ $ii = 0 ]] && (( ii = 1 )) |
---|
2870 | else |
---|
2871 | (( ii = 1 )) |
---|
2872 | while (( ii <= $numprocs / $threads_per_task )) |
---|
2873 | do |
---|
2874 | echo $localhost_realname >> hostfile |
---|
2875 | (( ii = ii + 1 )) |
---|
2876 | done |
---|
2877 | if (( $numprocs / $threads_per_task == 0 )) |
---|
2878 | then |
---|
2879 | echo $localhost_realname >> hostfile |
---|
2880 | fi |
---|
2881 | fi |
---|
2882 | eval zeile=\"`head -n $ii hostfile`\" |
---|
2883 | printf "\n *** running on: $zeile" |
---|
2884 | fi |
---|
2885 | |
---|
2886 | (( ii = $numprocs / $threads_per_task )) |
---|
2887 | [[ $ii = 0 ]] && (( ii = 1 )) |
---|
2888 | export OMP_NUM_THREADS=$threads_per_task |
---|
2889 | |
---|
2890 | if [[ $threads_per_task != 1 ]] |
---|
2891 | then |
---|
2892 | # INCREASE STACK SIZE TO UNLIMITED, BECAUSE OTHERWISE LARGE RUNS |
---|
2893 | # MAY ABORT |
---|
2894 | ulimit -s unlimited |
---|
2895 | printf "\n threads per task: $threads_per_task stacksize: unlimited" |
---|
2896 | fi |
---|
2897 | if [[ $run_coupled_model = false ]] |
---|
2898 | then |
---|
2899 | if [[ "$ocean_file_appendix" = true ]] |
---|
2900 | then |
---|
2901 | echo "precursor_ocean" > runfile_atmos |
---|
2902 | else |
---|
2903 | echo "precursor_atmos" > runfile_atmos |
---|
2904 | fi |
---|
2905 | printf "\n\n" |
---|
2906 | |
---|
2907 | if [[ $host = lccrayb || $host = lccrayh ]] |
---|
2908 | then |
---|
2909 | echo "--- aprun -n $ii -N $tasks_per_node a.out < runfile_atmos" |
---|
2910 | aprun -n $ii -N $tasks_per_node a.out < runfile_atmos |
---|
2911 | elif [[ $host = lcbullhh ]] |
---|
2912 | then |
---|
2913 | export OMPI_MCA_pml=cm |
---|
2914 | export OMPI_MCA_mtl=mxm |
---|
2915 | export OMPI_MCA_coll=^ghc |
---|
2916 | export OMPI_MCA_mtl_mxm_np=0 |
---|
2917 | export MXM_RDMA_PORTS=mlx5_0:1 |
---|
2918 | export MXM_LOG_LEVEL=ERROR |
---|
2919 | export OMP_NUM_THREADS=$threads_per_task |
---|
2920 | export KMP_AFFINITY=verbose,granularity=core,compact,1 |
---|
2921 | export KMP_STACKSIZE=64m |
---|
2922 | |
---|
2923 | srun -n $ii --ntasks-per-node=$tasks_per_node ./a.out < runfile_atmos |
---|
2924 | |
---|
2925 | elif [[ $host = lccrayf ]] |
---|
2926 | then |
---|
2927 | aprun -j1 -n $ii -N $tasks_per_node -m ${memory}M a.out < runfile_atmos |
---|
2928 | elif [[ $host = lcxe6 || $host = lcxt5m ]] |
---|
2929 | then |
---|
2930 | aprun -n $ii -N $tasks_per_node a.out < runfile_atmos |
---|
2931 | elif [[ $host = lceddy ]] |
---|
2932 | then |
---|
2933 | echo $ii |
---|
2934 | echo $tasks_per_node |
---|
2935 | echo $nodes |
---|
2936 | mpirun -n $ii a.out < runfile_atmos |
---|
2937 | elif [[ $host = lcgeohu ]] |
---|
2938 | then |
---|
2939 | srun -n $ii a.out < runfile_atmos |
---|
2940 | elif [[ $host = lcocean ]] |
---|
2941 | then |
---|
2942 | mpirun a.out $ROPTS < runfile_atmos |
---|
2943 | elif [[ $host = lcsb ]] |
---|
2944 | then |
---|
2945 | mpirun_rsh -hostfile $PBS_NODEFILE -np `cat $PBS_NODEFILE | wc -l` a.out < runfile_atmos |
---|
2946 | |
---|
2947 | elif [[ $host = lckiaps ]] |
---|
2948 | then |
---|
2949 | mpirun -np $ii -machinefile $PBS_NODEFILE ./a.out < runfile_atmos |
---|
2950 | elif [[ $host = lckyu* ]] |
---|
2951 | then |
---|
2952 | mpiexec -n $ii --stdin runfile_atmos ./a.out |
---|
2953 | else |
---|
2954 | mpiexec -machinefile hostfile -n $ii a.out < runfile_atmos |
---|
2955 | fi |
---|
2956 | |
---|
2957 | else |
---|
2958 | |
---|
2959 | # COUPLED RUN |
---|
2960 | (( iia = $numprocs_atmos / $threads_per_task )) |
---|
2961 | (( iio = $numprocs_ocean / $threads_per_task )) |
---|
2962 | printf "\n coupled run ($iia atmosphere, $iio ocean)" |
---|
2963 | printf "\n\n" |
---|
2964 | |
---|
2965 | echo "coupled_run $iia $iio" > runfile_atmos |
---|
2966 | |
---|
2967 | if [[ $host = lccrayf || $host = lcxe6 || $host = lcxt5m ]] |
---|
2968 | then |
---|
2969 | |
---|
2970 | aprun -n $ii -N $tasks_per_node a.out < runfile_atmos |
---|
2971 | |
---|
2972 | elif [[ $host = lck || $host = lckordi ]] |
---|
2973 | then |
---|
2974 | |
---|
2975 | mpiexec -n $ii ./a.out < runfile_atmos & |
---|
2976 | |
---|
2977 | elif [[ $host = lckyu* ]] |
---|
2978 | then |
---|
2979 | |
---|
2980 | mpiexec -n $ii --stdin runfile_atmos ./a.out |
---|
2981 | |
---|
2982 | elif [[ $host = lcmuk ]] |
---|
2983 | then |
---|
2984 | |
---|
2985 | mpiexec -machinefile hostfile -n $ii a.out < runfile_atmos |
---|
2986 | |
---|
2987 | fi |
---|
2988 | wait |
---|
2989 | |
---|
2990 | fi |
---|
2991 | |
---|
2992 | elif [[ $host = lckyoto ]] |
---|
2993 | then |
---|
2994 | set -xv |
---|
2995 | export P4_RSHCOMMAND=plesh |
---|
2996 | echo " P4_RSHCOMMAND = $P4_RSHCOMMAND" |
---|
2997 | if [[ "$ENVIRONMENT" = BATCH ]] |
---|
2998 | then |
---|
2999 | if [[ "$cond2" = fujitsu ]] |
---|
3000 | then |
---|
3001 | mpiexec -n $numprocs ./a.out # for fujitsu-compiler |
---|
3002 | elif [[ "cond2" = pgi ]] |
---|
3003 | then |
---|
3004 | mpirun -np $numprocs -machinefile ${QSUB_NODEINF} ./a.out |
---|
3005 | else |
---|
3006 | mpirun_rsh -np $numprocs -hostfile ${QSUB_NODEINF} MV2_USE_SRQ=0 ./a.out || /bin/true |
---|
3007 | fi |
---|
3008 | else |
---|
3009 | if [[ "$cond2" = "" ]] |
---|
3010 | then |
---|
3011 | mpiruni_rsh -np $numprocs ./a.out # for intel |
---|
3012 | else |
---|
3013 | mpirun -np $numprocs ./a.out |
---|
3014 | fi |
---|
3015 | fi |
---|
3016 | set +xv |
---|
3017 | |
---|
3018 | elif [[ $host = lctit ]] |
---|
3019 | then |
---|
3020 | export OMP_NUM_THREADS=$threads_per_task |
---|
3021 | echo "OMP_NUM_THREADS=$OMP_NUM_THREADS" |
---|
3022 | if [[ "$threads_per_task" != 1 ]] |
---|
3023 | then |
---|
3024 | export MV2_ENABLE_AFFINITY=0 |
---|
3025 | fi |
---|
3026 | echo "----- PBS_NODEFILE content:" |
---|
3027 | cat $PBS_NODEFILE |
---|
3028 | echo "-----" |
---|
3029 | (( ii = $numprocs / $threads_per_task )) |
---|
3030 | echo "mpirun -np $ii -hostfile $PBS_NODEFILE ./a.out" |
---|
3031 | mpirun -np $ii -hostfile $PBS_NODEFILE ./a.out |
---|
3032 | |
---|
3033 | else |
---|
3034 | mpprun -n $numprocs a.out |
---|
3035 | fi |
---|
3036 | else |
---|
3037 | a.out |
---|
3038 | fi |
---|
3039 | |
---|
3040 | fi # end normal (non-debug) execution |
---|
3041 | |
---|
3042 | fi # end explicit execute_command or host-specific execute actions |
---|
3043 | |
---|
3044 | if [[ $? != 0 ]] |
---|
3045 | then |
---|
3046 | |
---|
3047 | # ABORT IN CASE OF RUNTIME ERRORS |
---|
3048 | printf "\n +++ runtime error occured" |
---|
3049 | locat=execution |
---|
3050 | exit |
---|
3051 | |
---|
3052 | else |
---|
3053 | |
---|
3054 | printf "\n$dashes\n *** execution finished \n" |
---|
3055 | |
---|
3056 | # STOP THE DVR STREAMING SERVER AND PROCESS THE DVR OUTPUT IN ORDER |
---|
3057 | # TO CREAT DVRS- AND HTML-FILES CONTAINING ALL STREAMS |
---|
3058 | if [[ "$dvrserver_id" != "" ]] |
---|
3059 | then |
---|
3060 | kill $dvrserver_id |
---|
3061 | printf "\n *** dvr server with id=$dvrserver_id has been stopped" |
---|
3062 | |
---|
3063 | # IF THERE IS A DIRECTORY, DATA HAVE BEEN OUTPUT BY THE |
---|
3064 | # STREAMING SERVER. OTHERWISE, USER HAS CHOSEN dvrp_output=local |
---|
3065 | if [[ -d DATA_DVR ]] |
---|
3066 | then |
---|
3067 | |
---|
3068 | # ADD THE CURRENT DVR CONFIGURATION FILE TO THE DVR OUTPUT |
---|
3069 | # DIRECTORY |
---|
3070 | cp .dvrserver.config DATA_DVR |
---|
3071 | |
---|
3072 | # PROCESS THE DVR OUTPUT (OPTION -s FOR GENERATING |
---|
3073 | # SEQUENCE MODE DATA TOO) |
---|
3074 | process_dvr_output -d DATA_DVR -f $fname -s |
---|
3075 | |
---|
3076 | else |
---|
3077 | |
---|
3078 | # PROCESS THE LOCAL OUTPUT |
---|
3079 | process_dvr_output -l -d DATA_DVR -f $fname |
---|
3080 | |
---|
3081 | fi |
---|
3082 | |
---|
3083 | elif [[ $(echo $package_list | grep -c dvrp_graphics) != 0 ]] |
---|
3084 | then |
---|
3085 | |
---|
3086 | # PROCESS DVR OUTPUT GENERATD IN LOCAL MODE (dvrp_output=local) |
---|
3087 | process_dvr_output -l -d DATA_DVR -f $fname |
---|
3088 | |
---|
3089 | fi |
---|
3090 | fi |
---|
3091 | |
---|
3092 | |
---|
3093 | |
---|
3094 | # CALL OF combine_plot_fields IN ORDER TO MERGE SINGLE FILES WRITTEN |
---|
3095 | # BY EACH CORE INTO ONE FILE |
---|
3096 | if [[ ! -f ${PALM_BIN}/combine_plot_fields${block}.x ]] |
---|
3097 | then |
---|
3098 | printf "\n\n\n +++ WARNING: no combine_plot_fields found for given block \"$cond1 $cond2\"" |
---|
3099 | printf "\n 2d- and/or 3d-data may be incomplete!" |
---|
3100 | printf "\n Run \"mbuild -u -h $localhost\" to generate utilities for this block.\n" |
---|
3101 | elif [[ "$combine_plot_fields" == true ]] |
---|
3102 | then |
---|
3103 | if [[ $localhost = lccrayh || $localhost = lccrayb ]] |
---|
3104 | then |
---|
3105 | printf "\n\n\n *** post-processing: now executing \"aprun -n 1 -N 1 combine_plot_fields${block}.x\" ..." |
---|
3106 | aprun -n 1 -N 1 combine_plot_fields${block}.x |
---|
3107 | else |
---|
3108 | printf "\n\n\n *** post-processing: now executing \"combine_plot_fields${block}.x\" ..." |
---|
3109 | combine_plot_fields${block}.x |
---|
3110 | fi |
---|
3111 | else |
---|
3112 | |
---|
3113 | # TEMPORARY SOLUTION TO SKIP combine_plot_fields. THIS IS REQUIRED IN CASE OF HUGE AMOUNT OF |
---|
3114 | # DATA OUTPUT. TO DO: EXTEND THIS BRANCH BY CREATING A BATCH JOB for combine_plot_fields. |
---|
3115 | # ??? koennen wir das streichen ??? |
---|
3116 | printf "\n\n\n *** post-processing: skipping combine_plot_fields (-Z option set) ..." |
---|
3117 | fi |
---|
3118 | |
---|
3119 | |
---|
3120 | |
---|
3121 | # EXECUTE OUTPUT-COMMANDS GIVEN IN THE CONFIGURATION FILE |
---|
3122 | (( i = 0 )) |
---|
3123 | while (( i < ioc )) |
---|
3124 | do |
---|
3125 | (( i = i + 1 )) |
---|
3126 | if (( i == 1 )) |
---|
3127 | then |
---|
3128 | printf "\n\n *** execution of OUTPUT-commands:\n$dashes" |
---|
3129 | fi |
---|
3130 | printf "\n >>> ${out_command[$i]}" |
---|
3131 | eval ${out_command[$i]} |
---|
3132 | if (( i == ioc )) |
---|
3133 | then |
---|
3134 | printf "\n$dashes\n" |
---|
3135 | fi |
---|
3136 | done |
---|
3137 | |
---|
3138 | |
---|
3139 | # IN TRACE-MODE PRINT CONTENTS OF THE CURRENT (TEMPORARY) WORKING DIRECTORY |
---|
3140 | if [[ $do_trace = true ]] |
---|
3141 | then |
---|
3142 | printf "\n\n" |
---|
3143 | ls -al |
---|
3144 | fi |
---|
3145 | |
---|
3146 | |
---|
3147 | # COPY LOCAL OUTPUT-FILES TO THEIR PERMANENT DESTINATIONS |
---|
3148 | (( i = 0 )) |
---|
3149 | while (( i < iout )) |
---|
3150 | do |
---|
3151 | (( i = i + 1 )) |
---|
3152 | if (( i == 1 )) |
---|
3153 | then |
---|
3154 | printf "\n\n *** saving OUTPUT-files:" |
---|
3155 | |
---|
3156 | # GET RUN NUMBER ASSIGNED BY PALM |
---|
3157 | if [[ -f RUN_NUMBER ]] |
---|
3158 | then |
---|
3159 | read run_number < RUN_NUMBER |
---|
3160 | printf "\n *** PALM generated run_number = "$run_number" will be used as unified cycle number for all output files" |
---|
3161 | usecycle_option="-U $run_number" |
---|
3162 | else |
---|
3163 | run_number=0 |
---|
3164 | usecycle_option="" |
---|
3165 | fi |
---|
3166 | printf "\n$dashes" |
---|
3167 | fi |
---|
3168 | |
---|
3169 | # ADD CYCLE NUMBER TO FILENAME |
---|
3170 | if [[ ! ( $fromhost != $localhost && ( "${actionout[$i]}" = tr || "${actionout[$i]}" = tra || "${actionout[$i]}" = trpe ) ) ]] |
---|
3171 | then |
---|
3172 | |
---|
3173 | # IN APPEND MODE, FILES KEEP THEIR CURRENT CYCLE NUMBER |
---|
3174 | if [[ "${actionout[$i]}" != "a" ]] |
---|
3175 | then |
---|
3176 | # SET RUN NUMBER AS CYCLE NUMBER, IF THERE IS NOT A CONFLICT |
---|
3177 | # WITH AN EXISTING CYCLE NUMBER |
---|
3178 | if (( run_number >= cycnum[$i] )) |
---|
3179 | then |
---|
3180 | (( cycnum[$i] = run_number )) |
---|
3181 | else |
---|
3182 | if (( run_number > 0 )) |
---|
3183 | then |
---|
3184 | printf "\n --- INFORMATIVE: The following file cannot get a unified cycle number" |
---|
3185 | fi |
---|
3186 | fi |
---|
3187 | fi |
---|
3188 | if (( cycnum[$i] > 0 )) |
---|
3189 | then |
---|
3190 | pathout[$i]=${pathout[$i]}.${cycnum[$i]} |
---|
3191 | fi |
---|
3192 | fi |
---|
3193 | |
---|
3194 | # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION) |
---|
3195 | files_for_pes=false; filetyp=file |
---|
3196 | link_local_output=false |
---|
3197 | if [[ "${actionout[$i]}" = pe && -n $numprocs ]] |
---|
3198 | then |
---|
3199 | files_for_pes=true; filetyp=directory |
---|
3200 | actionout[$i]="" |
---|
3201 | elif [[ "${actionout[$i]}" = pe && ! -n $numprocs ]] |
---|
3202 | then |
---|
3203 | actionout[$i]="" |
---|
3204 | elif [[ "${actionout[$i]}" = lnpe && -n $numprocs ]] |
---|
3205 | then |
---|
3206 | files_for_pes=true; filetyp=directory |
---|
3207 | link_local_output=true |
---|
3208 | actionout[$i]="" |
---|
3209 | elif [[ "${actionout[$i]}" = lnpe && ! -n $numprocs ]] |
---|
3210 | then |
---|
3211 | link_local_output |
---|
3212 | actionout[$i]="" |
---|
3213 | elif [[ "${actionout[$i]}" = trpe && -n $numprocs ]] |
---|
3214 | then |
---|
3215 | files_for_pes=true; filetyp=directory |
---|
3216 | actionout[$i]="tr" |
---|
3217 | elif [[ "${actionout[$i]}" = trpe && ! -n $numprocs ]] |
---|
3218 | then |
---|
3219 | actionout[$i]="tr" |
---|
3220 | fi |
---|
3221 | |
---|
3222 | if [[ ! -f ${localout[$i]} && $files_for_pes = false ]] |
---|
3223 | then |
---|
3224 | printf "\n +++ temporary OUTPUT-file ${localout[$i]} does not exist\n" |
---|
3225 | elif [[ ! -d ${localout[$i]} && $files_for_pes = true ]] |
---|
3226 | then |
---|
3227 | printf "\n +++ temporary OUTPUT-file ${localout[$i]}/.... does not exist\n" |
---|
3228 | else |
---|
3229 | |
---|
3230 | |
---|
3231 | # COPY VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m) |
---|
3232 | # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT |
---|
3233 | if [[ "${actionout[$i]}" = tr ]] |
---|
3234 | then |
---|
3235 | if [[ $localhost != $fromhost ]] |
---|
3236 | then |
---|
3237 | if [[ $files_for_pes = false ]] |
---|
3238 | then |
---|
3239 | cps="" |
---|
3240 | cst="" |
---|
3241 | else |
---|
3242 | cps=-c |
---|
3243 | cst="/" |
---|
3244 | fi |
---|
3245 | |
---|
3246 | transfer_failed=false |
---|
3247 | printf "\n >>> OUTPUT: ${localout[$i]}$cst by SCP to" |
---|
3248 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}$cst\n" |
---|
3249 | if [[ $localhost = lccrayb ]] |
---|
3250 | then |
---|
3251 | ssh $usern@blogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3252 | elif [[ $localhost = lccrayh ]] |
---|
3253 | then |
---|
3254 | ssh $usern@hlogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3255 | elif [[ $localhost = lcbullhh ]] |
---|
3256 | then |
---|
3257 | ssh $usern@mlogin101 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3258 | elif [[ $localhost = lcxe6 ]] |
---|
3259 | then |
---|
3260 | ssh $usern@hexagon ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3261 | else |
---|
3262 | batch_scp $PORTOPT $cps -b -m $usecycle_option -u $return_username $return_address ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3263 | fi |
---|
3264 | [[ $? != 0 ]] && transfer_failed=true |
---|
3265 | |
---|
3266 | # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE |
---|
3267 | if [[ $transfer_failed = true ]] |
---|
3268 | then |
---|
3269 | printf " +++ transfer failed. Trying to save a copy on this host under:\n" |
---|
3270 | printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" |
---|
3271 | |
---|
3272 | # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY |
---|
3273 | eval local_catalog=${pathout[$i]} |
---|
3274 | if [[ ! -d $local_catalog ]] |
---|
3275 | then |
---|
3276 | printf " *** local directory does not exist. Trying to create:\n" |
---|
3277 | printf " $local_catalog \n" |
---|
3278 | mkdir -p $local_catalog |
---|
3279 | fi |
---|
3280 | eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung |
---|
3281 | transfer_problems=true |
---|
3282 | fi |
---|
3283 | |
---|
3284 | else |
---|
3285 | |
---|
3286 | # UNSET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE COPIED ON THIS MACHINE |
---|
3287 | actionout[$i]="" |
---|
3288 | fi |
---|
3289 | fi |
---|
3290 | |
---|
3291 | |
---|
3292 | # APPEND VIA SCP TO LOCAL HOST (ALWAYS IN BINARY MODE USING batch_scp option -m) |
---|
3293 | # IF TARGET DIRECTORY DOES NOT EXISTS, TRY TO CREATE IT |
---|
3294 | if [[ "${actionout[$i]}" = tra ]] |
---|
3295 | then |
---|
3296 | if [[ $localhost != $fromhost ]] |
---|
3297 | then |
---|
3298 | if [[ $localhost = ibmh ]] |
---|
3299 | then |
---|
3300 | |
---|
3301 | # TRANSFER IN SEPERATE JOB |
---|
3302 | # FIRST COPY FILE TO TEMPORY DATA DIRECTORY |
---|
3303 | [[ ! -d $tmp_data_catalog/TRANSFER ]] && mkdir -p $tmp_data_catalog/TRANSFER |
---|
3304 | file_to_transfer=${fname}_${localout[$i]}_to_transfer_$kennung |
---|
3305 | ln -f ${localout[$i]} $tmp_data_catalog/TRANSFER/$file_to_transfer |
---|
3306 | |
---|
3307 | echo "set -x" > transfer_${localout[$i]} |
---|
3308 | echo "cd $tmp_data_catalog/TRANSFER" >> transfer_${localout[$i]} |
---|
3309 | |
---|
3310 | printf "\n >>> OUTPUT: ${localout[$i]} append by SCP in seperate job to" |
---|
3311 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}" |
---|
3312 | printf "\n or higher cycle\n" |
---|
3313 | echo "batch_scp $PORTOPT -A -b -m -u $return_username $return_address $file_to_transfer \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" >> transfer_${localout[$i]} |
---|
3314 | |
---|
3315 | echo "[[ \$? = 0 ]] && rm $file_to_transfer" >> transfer_${localout[$i]} |
---|
3316 | |
---|
3317 | if [[ $LOGNAME = b323013 ]] |
---|
3318 | then |
---|
3319 | subjob -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} |
---|
3320 | else |
---|
3321 | subjob -d -v -q c1 -X 0 -m 1000 -t 900 -c $job_catalog $PORTOPT transfer_${localout[$i]} |
---|
3322 | fi |
---|
3323 | |
---|
3324 | else |
---|
3325 | |
---|
3326 | # TRANSFER WITHIN THIS JOB |
---|
3327 | transfer_failed=false |
---|
3328 | printf "\n >>> OUTPUT: ${localout[$i]} append by SCP to" |
---|
3329 | printf "\n ${pathout[$i]}/${localhost}_${fname}${endout[$i]}\n" |
---|
3330 | if [[ $localhost = lccrayb ]] |
---|
3331 | then |
---|
3332 | ssh $usern@blogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3333 | elif [[ $localhost = lccrayh ]] |
---|
3334 | then |
---|
3335 | ssh $usern@hlogin1 ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3336 | elif [[ $localhost = lcxe6 ]] |
---|
3337 | then |
---|
3338 | ssh $usern@hexagon ". \\$HOME/.bashrc; cd $TEMPDIR; batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} \"${pathout[$i]}\" ${localhost}_${fname}${endout[$i]} ${extout[$i]}" |
---|
3339 | else |
---|
3340 | batch_scp $PORTOPT -A -b -m -u $return_username $return_address ${localout[$i]} "${pathout[$i]}" ${localhost}_${fname}${endout[$i]} ${extout[$i]} |
---|
3341 | fi |
---|
3342 | [[ $? != 0 ]] && transfer_failed=true |
---|
3343 | |
---|
3344 | # IF TRANSFER FAILED, CREATE BACKUP COPY ON THIS MACHINE |
---|
3345 | if [[ $transfer_failed = true ]] |
---|
3346 | then |
---|
3347 | printf " +++ transfer failed. Trying to save a copy on this host under:\n" |
---|
3348 | printf " ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung\n" |
---|
3349 | |
---|
3350 | # FIRST CHECK, IF DIRECTORY EXISTS, AND CREATE IT, IF NECESSARY |
---|
3351 | eval local_catalog=${pathout[$i]} |
---|
3352 | if [[ ! -d $local_catalog ]] |
---|
3353 | then |
---|
3354 | printf " *** local directory does not exist. Trying to create:\n" |
---|
3355 | printf " $local_catalog \n" |
---|
3356 | mkdir -p $local_catalog |
---|
3357 | fi |
---|
3358 | |
---|
3359 | eval cp ${localout[$i]} ${pathout[$i]}/${localhost}_${fname}${endout[$i]}_$kennung |
---|
3360 | transfer_problems=true |
---|
3361 | fi |
---|
3362 | fi |
---|
3363 | else |
---|
3364 | |
---|
3365 | # RESET actionout. DUE TO THIS SETTING, FILE WILL LATER JUST BE APPENDED ON THIS MACHINE |
---|
3366 | actionout[$i]=a |
---|
3367 | fi |
---|
3368 | fi |
---|
3369 | |
---|
3370 | |
---|
3371 | # APPEND ON THIS MACHINE |
---|
3372 | if [[ "${actionout[$i]}" = "a" ]] |
---|
3373 | then |
---|
3374 | if [[ "${extout[$i]}" != " " && "${extout[$i]}" != "" ]] |
---|
3375 | then |
---|
3376 | printf "\n >>> OUTPUT: ${localout[$i]} append to ${pathout[$i]}.${extout[$i]}\n" |
---|
3377 | cat ${localout[$i]} >> ${pathout[$i]}.${extout[$i]} |
---|
3378 | else |
---|
3379 | printf "\n >>> OUTPUT: ${localout[$i]} append to ${pathout[$i]}\n" |
---|
3380 | cat ${localout[$i]} >> ${pathout[$i]} |
---|
3381 | fi |
---|
3382 | fi |
---|
3383 | |
---|
3384 | # COPY ON THIS MACHINE |
---|
3385 | # COPY HAS TO BE USED, BECAUSE MOVE DOES NOT WORK IF FILE-ORIGIN AND TARGET ARE |
---|
3386 | # ON DIFFERENT FILE-SYSTEMS |
---|
3387 | if [[ "${actionout[$i]}" = "" && $files_for_pes = false ]] |
---|
3388 | then |
---|
3389 | |
---|
3390 | # COPY IN CASE OF RUNS ON SINGLE CORES |
---|
3391 | if [[ "${extout[$i]}" != " " && "${extout[$i]}" != "" ]] |
---|
3392 | then |
---|
3393 | printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}.${extout[$i]}\n" |
---|
3394 | if [[ $link_local_output = true ]] |
---|
3395 | then |
---|
3396 | printf " file will be linked\n" |
---|
3397 | ln -f ${localout[$i]} ${pathout[$i]}.${extout[$i]} |
---|
3398 | fi |
---|
3399 | # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" |
---|
3400 | if [[ ! -f "${pathout[$i]}.${extout[$i]}" ]] |
---|
3401 | then |
---|
3402 | if [[ $link_local_output = true ]] |
---|
3403 | then |
---|
3404 | printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" |
---|
3405 | fi |
---|
3406 | cp ${localout[$i]} ${pathout[$i]}.${extout[$i]} |
---|
3407 | else |
---|
3408 | printf "+++ no copy because file ${pathout[$i]}.${extout[$i]} exists\n" |
---|
3409 | fi |
---|
3410 | else |
---|
3411 | printf "\n >>> OUTPUT: ${localout[$i]} to ${pathout[$i]}\n" |
---|
3412 | if [[ $link_local_output = true ]] |
---|
3413 | then |
---|
3414 | printf " file will be linked\n" |
---|
3415 | ln -f ${localout[$i]} ${pathout[$i]} |
---|
3416 | fi |
---|
3417 | # If "ln -f" fails of if "$link_local_output = false" do a normal "cp" |
---|
3418 | if [[ ! -f "${pathout[$i]}" ]] |
---|
3419 | then |
---|
3420 | if [[ $link_local_output = true ]] |
---|
3421 | then |
---|
3422 | printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" |
---|
3423 | fi |
---|
3424 | cp ${localout[$i]} ${pathout[$i]} |
---|
3425 | else |
---|
3426 | printf "+++ no copy because file ${pathout[$i]} exists\n" |
---|
3427 | fi |
---|
3428 | fi |
---|
3429 | |
---|
3430 | elif [[ "${actionout[$i]}" = "" && $files_for_pes = true ]] |
---|
3431 | then |
---|
3432 | |
---|
3433 | # FILES FROM THE DIFFERENT CORES ARE MOVED WITH ln-COMMAND TO THE PERMANENT DIRECTORY |
---|
3434 | # AS A FIRST STEP, THE PERMANENT DIRECTORY IS CREATED |
---|
3435 | printf "\n >>> OUTPUT: ${localout[$i]}/_.... to ${pathout[$i]}\n" |
---|
3436 | if [[ $link_local_output = true ]] |
---|
3437 | then |
---|
3438 | printf " files will be linked\n" |
---|
3439 | mkdir ${pathout[$i]} |
---|
3440 | cd ${localout[$i]} |
---|
3441 | for file in $(ls *) |
---|
3442 | do |
---|
3443 | ln -f $file ${pathout[$i]} |
---|
3444 | done >|/dev/null 2>&1 |
---|
3445 | cd $TEMPDIR |
---|
3446 | fi |
---|
3447 | |
---|
3448 | # IF "ln -f" HAS FAILED OR IF "$link_local_output = false" DO A NORMAL COPY "cp -r" |
---|
3449 | if [[ ! -f "${pathout[$i]}/_000000" ]] |
---|
3450 | then |
---|
3451 | if [[ $link_local_output = true ]] |
---|
3452 | then |
---|
3453 | printf " --- WARNING: ln failed, using cp instead (might be time consuming...)\n" |
---|
3454 | fi |
---|
3455 | cp -r ${localout[$i]}/* ${pathout[$i]} |
---|
3456 | fi |
---|
3457 | |
---|
3458 | fi |
---|
3459 | fi |
---|
3460 | done |
---|
3461 | if (( i != 0 )) |
---|
3462 | then |
---|
3463 | if [[ $transfer_problems = true ]] |
---|
3464 | then |
---|
3465 | printf "\n$dashes\n *** OUTPUT-files saved" |
---|
3466 | printf "\n +++ WARNING: some data transfers failed! \n" |
---|
3467 | else |
---|
3468 | printf "\n$dashes\n *** all OUTPUT-files saved \n" |
---|
3469 | fi |
---|
3470 | fi |
---|
3471 | |
---|
3472 | |
---|
3473 | # IF REQUIRED, START A RESTART-JOB |
---|
3474 | # FILE CONTINUE_RUN MUST HAVE BEEN CREATED BY THE EXECUTABLE (PALM) |
---|
3475 | if [[ -f CONTINUE_RUN ]] |
---|
3476 | then |
---|
3477 | |
---|
3478 | # ADD RESTART-OPTIONS TO THE MRUN-CALL (IF THEY ARE NOT USED ALREADY): |
---|
3479 | # -C TELLS MRUN THAT IT IS A RESTART-RUN |
---|
3480 | # -v SILENT MODE WITHOUT INTERACTIVE QUERIES |
---|
3481 | # -n BATCH-MODE (IMPORTANT ONLY IN CASE OF BATCH JOBS ON THE LOCAL MACHINE) |
---|
3482 | [[ $(echo $mc | grep -c "\-C") = 0 ]] && mc="$mc -C" |
---|
3483 | [[ $(echo $mc | grep -c "\-v") = 0 ]] && mc="$mc -v" |
---|
3484 | [[ $(echo $mc | grep -c "\-b") = 0 ]] && mc="$mc -b" |
---|
3485 | if [[ $(echo $mc | grep -c "#") != 0 ]] |
---|
3486 | then |
---|
3487 | mc=`echo $mc | sed 's/#/f/g'` |
---|
3488 | fi |
---|
3489 | |
---|
3490 | |
---|
3491 | # START THE RESTART-JOB |
---|
3492 | printf "\n\n *** initiating restart-run on \"$return_address\" using command:\n" |
---|
3493 | echo " $mc" |
---|
3494 | printf "\n$dashes\n" |
---|
3495 | if [[ $localhost != $fromhost ]] |
---|
3496 | then |
---|
3497 | |
---|
3498 | if [[ $localhost = lcbullhh || $localhost = lccrayb || $localhost = lccrayh || $localhost = ibmh || $localhost = ibmkisti || $localhost = ibmku || $localhost = ibms || $localhost = lceddy || $localhost = lckyu* || $localhost = lcxe6 || $localhost = lcgeohu ]] |
---|
3499 | then |
---|
3500 | echo "*** ssh will be used to initiate restart-runs!" |
---|
3501 | echo " return_address=\"$return_address\" " |
---|
3502 | echo " return_username=\"$return_username\" " |
---|
3503 | if [[ $(echo $return_address | grep -c "130.75.105") = 1 ]] |
---|
3504 | then |
---|
3505 | if [[ $localhost = ibmh ]] |
---|
3506 | then |
---|
3507 | ssh $SSH_PORTOPT $usern@136.172.40.15 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3508 | elif [[ $localhost = lcbullhh ]] |
---|
3509 | then |
---|
3510 | ssh $SSH_PORTOPT $usern@mlogin101 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3511 | elif [[ $localhost = lccrayb ]] |
---|
3512 | then |
---|
3513 | ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3514 | elif [[ $localhost = lccrayh ]] |
---|
3515 | then |
---|
3516 | ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3517 | elif [[ $localhost = lcxe6 ]] |
---|
3518 | then |
---|
3519 | ssh $usern@hexagon "ssh $SSH_PORTOPT $return_address -l $return_username \". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\\\$PATH:$LOCAL_MRUN_PATH; export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3520 | else |
---|
3521 | ssh $SSH_PORTOPT $return_address -l $return_username ". \\\$HOME/.profile; module load intel-compiler hdf5 netcdf; PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
3522 | fi |
---|
3523 | else |
---|
3524 | if [[ $localhost = ibmkisti ]] |
---|
3525 | then |
---|
3526 | ssh $SSH_PORTOPT $usern@gaiad "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3527 | elif [[ $localhost = lceddy ]] |
---|
3528 | then |
---|
3529 | /usr/bin/ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
3530 | elif [[ $localhost = lcocean ]] |
---|
3531 | then |
---|
3532 | /usr/bin/ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
3533 | elif [[ $localhost = lccrayb ]] |
---|
3534 | then |
---|
3535 | ssh $usern@blogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3536 | elif [[ $localhost = lccrayh ]] |
---|
3537 | then |
---|
3538 | ssh $usern@hlogin1 "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3539 | elif [[ $localhost = lccgeohu ]] |
---|
3540 | then |
---|
3541 | ssh $usern@cirrus.geo.hu-berlin.de "ssh $SSH_PORTOPT $return_address -l $return_username \"PATH=\\\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc\" " |
---|
3542 | else |
---|
3543 | ssh $SSH_PORTOPT $return_address -l $return_username "PATH=\$PATH:$LOCAL_MRUN_PATH;export PALM_BIN=$LOCAL_MRUN_PATH;cd $LOCAL_PWD; $mc " |
---|
3544 | fi |
---|
3545 | fi |
---|
3546 | else |
---|
3547 | printf "\n +++ no restart mechanism available for host \"$localhost\" " |
---|
3548 | locat=restart; exit |
---|
3549 | fi |
---|
3550 | |
---|
3551 | # WAIT TO ALLOW THE RESTART-JOB TO BE QUEUED, BEFORE THE CURRENT JOB IS FINISHED |
---|
3552 | if [[ $queue = special1q ]] |
---|
3553 | then |
---|
3554 | sleep 120 |
---|
3555 | else |
---|
3556 | sleep 30 |
---|
3557 | fi |
---|
3558 | |
---|
3559 | else |
---|
3560 | |
---|
3561 | # JOBS RUNNING (AND STARTED) ON THE LOCAL MACHINE CAN DIRECTLY CALL MRUN (WITHOUT |
---|
3562 | # USING SSH) |
---|
3563 | cd $LOCAL_PWD |
---|
3564 | if [[ $localhost = lckyuh ]] |
---|
3565 | then |
---|
3566 | printf "\n +++ WARNING: no restart mechanism available for host \"$localhost\" " |
---|
3567 | printf "\n please restart job manually using command:\n" |
---|
3568 | printf "\n \"$mc\" " |
---|
3569 | else |
---|
3570 | eval $mc # THE ' MUST BE EVALUATED |
---|
3571 | fi |
---|
3572 | cd - > /dev/null |
---|
3573 | fi |
---|
3574 | if [[ $localhost = lckyuh ]] |
---|
3575 | then |
---|
3576 | printf "\n$dashes\n *** restart-run to be initiated manually\n" |
---|
3577 | else |
---|
3578 | printf "\n$dashes\n *** restart-run initiated \n" |
---|
3579 | fi |
---|
3580 | |
---|
3581 | |
---|
3582 | # DELETE INPUT-(RESTART)FILES, WHICH HAVE BEEN FETCHED FROM THE TEMPORARY DATA |
---|
3583 | # DIRECTORY, BACAUSE THEY ARE NOT REQUIRED BY THE RESTART-JOB. |
---|
3584 | # THIS IS DONE IN ORDER TO AVOID EXCEEDING DISC QUOTAS OR DISC SPACE (RESTART-FILES |
---|
3585 | # MAY BE VERY HUGE) |
---|
3586 | (( i = 0 )) |
---|
3587 | while (( i < iin )) |
---|
3588 | do |
---|
3589 | (( i = i + 1 )) |
---|
3590 | if [[ "${got_tmp[$i]}" = true && $keep_data_from_previous_run = false ]] |
---|
3591 | then |
---|
3592 | rm -r ${absnamein[$i]} |
---|
3593 | fi |
---|
3594 | done |
---|
3595 | |
---|
3596 | fi |
---|
3597 | |
---|
3598 | |
---|
3599 | |
---|
3600 | # SEND EMAIL NOTIFICATION ABOUT THE FINISHED RUN |
---|
3601 | if [[ "$email_notification" != "none" ]] |
---|
3602 | then |
---|
3603 | |
---|
3604 | if [[ $localhost != $fromhost ]] |
---|
3605 | then |
---|
3606 | if [[ -f CONTINUE_RUN ]] |
---|
3607 | then |
---|
3608 | echo "PALM restart run necessary" > email_text |
---|
3609 | echo "description header of actual run:" >> email_text |
---|
3610 | cat CONTINUE_RUN >> email_text |
---|
3611 | echo "mrun-command to restart:" >> email_text |
---|
3612 | echo "$mc" >> email_text |
---|
3613 | else |
---|
3614 | echo "PALM run with base filename \"$fname\" on host \"$localhost\" finished" > email_text |
---|
3615 | fi |
---|
3616 | mail $email_notification < email_text |
---|
3617 | printf "\n *** email notification sent to \"$email_notification\" " |
---|
3618 | fi |
---|
3619 | fi |
---|
3620 | |
---|
3621 | |
---|
3622 | |
---|
3623 | # ALL ACTIONS FINISHED, TEMPORARY WORKING-DIRECTORY CAN BE DELETED |
---|
3624 | cd $HOME |
---|
3625 | [[ $delete_temporary_catalog = true ]] && rm -rf $TEMPDIR |
---|
3626 | |
---|
3627 | else |
---|
3628 | |
---|
3629 | # PREPARING ACTIONS, |
---|
3630 | # IF A BATCH-JOB IS TO BE GENERATED AND STARTED ON A REMOTE-MACHINE GERECHNET |
---|
3631 | |
---|
3632 | # BUILD THE MRUN-COMMAND TO BE CALLED IN THE BATCH-JOB ON THE REMOTE-MACHINE |
---|
3633 | mrun_com="$mrun_script_name -a $afname -c $config_file -d $fname -h $host -H $fromhost -m $memory -t $cpumax -q $queue -R $return_address -U $return_username -u $remote_username" |
---|
3634 | [[ "$global_revision" != "" ]] && mrun_com=${mrun_com}" -G \"$global_revision\"" |
---|
3635 | [[ $group_number != none ]] && mrun_com=${mrun_com}" -g $group_number" |
---|
3636 | [[ $do_compile = true ]] && mrun_com=${mrun_com}" -s \"$source_list\"" |
---|
3637 | [[ "$input_list" != "" ]] && mrun_com=${mrun_com}" -i \"$input_list\"" |
---|
3638 | [[ $keep_data_from_previous_run = true ]] && mrun_com=${mrun_com}" -k" |
---|
3639 | [[ "$additional_conditions" != "" ]] && mrun_com=${mrun_com}" -K \"$additional_conditions\"" |
---|
3640 | [[ "$output_list" != "" ]] && mrun_com=${mrun_com}" -o \"$output_list\"" |
---|
3641 | [[ "$read_from_config" = false ]] && mrun_com=${mrun_com}" -S" |
---|
3642 | [[ $do_trace = true ]] && mrun_com=${mrun_com}" -x" |
---|
3643 | [[ "$numprocs" != "" ]] && mrun_com=${mrun_com}" -X $numprocs" |
---|
3644 | if [[ $use_openmp = true ]] |
---|
3645 | then |
---|
3646 | mrun_com=${mrun_com}" -O $threads_per_task" |
---|
3647 | fi |
---|
3648 | [[ "$tasks_per_node" != "" ]] && mrun_com=${mrun_com}" -T $tasks_per_node" |
---|
3649 | [[ $package_list != "" ]] && mrun_com=${mrun_com}" -p \"$package_list\"" |
---|
3650 | [[ $return_password != "" ]] && mrun_com=${mrun_com}" -P $return_password" |
---|
3651 | [[ $delete_temporary_catalog = false ]] && mrun_com=${mrun_com}" -B" |
---|
3652 | [[ $node_usage != default && "$(echo $node_usage | cut -c1-3)" != "sla" && $node_usage != novice ]] && mrun_com=${mrun_com}" -n $node_usage" |
---|
3653 | [[ "$ocean_file_appendix" = true ]] && mrun_com=${mrun_com}" -y" |
---|
3654 | [[ $run_coupled_model = true ]] && mrun_com=${mrun_com}" -Y \"$coupled_dist\"" |
---|
3655 | [[ "$check_namelist_files" = false ]] && mrun_com=${mrun_com}" -z" |
---|
3656 | [[ "$combine_plot_fields" = false ]] && mrun_com=${mrun_com}" -Z" |
---|
3657 | [[ "$max_par_io_str" != "" ]] && mrun_com=${mrun_com}" -w $max_par_io_str" |
---|
3658 | if [[ $do_remote = true ]] |
---|
3659 | then |
---|
3660 | printf "\n>>>> MRUN-command on execution host:\n>>>> $mrun_com \n" |
---|
3661 | fi |
---|
3662 | |
---|
3663 | |
---|
3664 | # CREATE EXECUTABLE FOR BATCH JOB |
---|
3665 | if [[ $create_executable_for_batch = true && $restart_run != true ]] |
---|
3666 | then |
---|
3667 | |
---|
3668 | printf "\n *** creating the executable for batch job\n" |
---|
3669 | |
---|
3670 | # METHOD ONLY WORKS FOR BATCH JOBS ON LOCAL HOSTS |
---|
3671 | if [[ $host != $localhost ]] |
---|
3672 | then |
---|
3673 | printf "\n +++ creation of executables is only allowed for batch jobs on local hosts." |
---|
3674 | printf "\n Please set create_executable_for_batch = false in the config-file.\n" |
---|
3675 | locat=create_executable; exit |
---|
3676 | fi |
---|
3677 | |
---|
3678 | mkdir $working_directory/SOURCES_FOR_RUN_${fname}/TMPDIR_FOR_CREATING_EXECUTABLE |
---|
3679 | cd $working_directory/SOURCES_FOR_RUN_${fname}/TMPDIR_FOR_CREATING_EXECUTABLE |
---|
3680 | |
---|
3681 | cp $make_depository . |
---|
3682 | tar -xf $make_depository > /dev/null 2>&1 |
---|
3683 | cp ../* . > /dev/null 2>&1 |
---|
3684 | |
---|
3685 | make $mopts -f Makefile PROG=a.out F90=$compiler_name COPT="$cpp_options" F90FLAGS="$fopts" LDFLAGS="$lopts" |
---|
3686 | |
---|
3687 | if [[ $? != 0 || "$compile_error" = true || "$module_compile_error" = true ]] |
---|
3688 | then |
---|
3689 | printf "\n +++ error occured while compiling or linking" |
---|
3690 | locat=compile |
---|
3691 | exit |
---|
3692 | fi |
---|
3693 | |
---|
3694 | mv a.out .. |
---|
3695 | cd - > /dev/null 2>&1 |
---|
3696 | rm -rf $working_directory/SOURCES_FOR_RUN_${fname}/TMPDIR_FOR_CREATING_EXECUTABLE |
---|
3697 | |
---|
3698 | printf " *** executable created in \"$working_directory/SOURCES_FOR_RUN_${fname}\"\n " |
---|
3699 | |
---|
3700 | fi |
---|
3701 | |
---|
3702 | |
---|
3703 | # BUILD THE JOB-SCRIPTS ON FILE jobfile |
---|
3704 | jobfile=jobfile.$RANDOM |
---|
3705 | |
---|
3706 | |
---|
3707 | # CREATE TEMPORARY DIRECTORY AND SWITCH TO IT |
---|
3708 | echo "mkdir $TEMPDIR" >> $jobfile |
---|
3709 | echo "cd $TEMPDIR" >> $jobfile |
---|
3710 | |
---|
3711 | |
---|
3712 | # ACTIVATE ERROR-TRACEBACK |
---|
3713 | if [[ $do_trace = true ]] |
---|
3714 | then |
---|
3715 | echo "set -x" >> $jobfile |
---|
3716 | else |
---|
3717 | echo "set +vx" >> $jobfile |
---|
3718 | fi |
---|
3719 | |
---|
3720 | |
---|
3721 | # INITIALIZE THE ENVIRONMENT AND LOAD MODULES |
---|
3722 | if [[ "$init_cmds" != "" ]] |
---|
3723 | then |
---|
3724 | echo "$init_cmds" >> $jobfile |
---|
3725 | fi |
---|
3726 | if [[ "$module_calls" != "" ]] |
---|
3727 | then |
---|
3728 | echo "$module_calls" >> $jobfile |
---|
3729 | fi |
---|
3730 | |
---|
3731 | |
---|
3732 | # PROVIDE SOURCE-CODE FILES, MRUN-SCRIPT AND CONFIGURATION-FILE FOR THE JOB |
---|
3733 | # then-CLAUSE: FILES ARE COLLECTED IN THE SOURCES_FOR_RUN_... DIRECTORY ON THE LOCAL HOST, |
---|
3734 | # WHICH IS THEN FETCHED FROM THE BATCH-JOB BY USING cp/scp |
---|
3735 | # THE SOURCE-CODE FILES ALREADY EXIST IN THIS DIRECTORY |
---|
3736 | # else-CLAUSE: FILE-CONTENTS ARE PUT INTO THE JOB-FILE AS HERE-DOCUMENTS |
---|
3737 | # THIS MAY CREATE A QUITE LARGE JOB-FILE, WHICH CAN CAUSE PROBLEMS WITH SOME |
---|
3738 | # QUEUEING-SYSTEMS |
---|
3739 | if [[ $host = ibmkisti || $host = lcbullhh || $host = lccrayb || $host = lccrayf || $host = lccrayh || $host = lcocean || $host = lcgeohu ]] |
---|
3740 | then |
---|
3741 | |
---|
3742 | # COPY CONFIGURATION-FILE AND MRUN-SCRIPT INTO THE SOURCES_FOR_RUN... DIRECTORY |
---|
3743 | if [[ $restart_run != true ]] |
---|
3744 | then |
---|
3745 | cp $config_file $working_directory/SOURCES_FOR_RUN_$fname |
---|
3746 | cp ${PALM_BIN}/$mrun_script_name $working_directory/SOURCES_FOR_RUN_$fname |
---|
3747 | fi |
---|
3748 | |
---|
3749 | # COPY THE SOURCES_FOR_RUN... DIRECTORY FROM THE LOCAL HOST TO THE JOB VIA scp |
---|
3750 | # (then-CLAUSE: JOBS ON THE LOCAL HOST CAN JUST USE cp) |
---|
3751 | echo "set -x" >> $jobfile |
---|
3752 | if [[ $host = $localhost ]] |
---|
3753 | then |
---|
3754 | # DUE TO UNKNOWN REASONS, COPY WITH cp COMMAND CREATES CORRUPT |
---|
3755 | # FILES ON CRAY XC30 SYSTEMS (CSC HELSINKI), rsync IS USED INSTEAD |
---|
3756 | if [[ $(echo $host | cut -c1-6) = lccray ]] |
---|
3757 | then |
---|
3758 | echo "rsync -av -t $working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile |
---|
3759 | else |
---|
3760 | echo "cp -r $working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile |
---|
3761 | fi |
---|
3762 | |
---|
3763 | else |
---|
3764 | if [[ $host = ibmkisti ]] |
---|
3765 | then |
---|
3766 | # ON KISTI'S IBM FIREWALL IS ONLY OPENED ON INTERACTIVE NODE |
---|
3767 | echo "localdir=\`pwd\`" >> $jobfile |
---|
3768 | echo "ssh $SSH_PORTOPT $remote_username@gaiad \"cd \$localdir; scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile |
---|
3769 | elif [[ $host = lcbullhh ]] |
---|
3770 | then |
---|
3771 | echo "localdir=\`pwd\`" >> $jobfile |
---|
3772 | echo "ssh $SSH_PORTOPT $remote_username@mlogin101 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile |
---|
3773 | |
---|
3774 | elif [[ $host = lccrayb ]] |
---|
3775 | then |
---|
3776 | echo "localdir=\`pwd\`" >> $jobfile |
---|
3777 | echo "ssh $SSH_PORTOPT $remote_username@blogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile |
---|
3778 | elif [[ $host = lccrayh ]] |
---|
3779 | then |
---|
3780 | echo "localdir=\`pwd\`" >> $jobfile |
---|
3781 | echo "ssh $SSH_PORTOPT $remote_username@hlogin1 \"cd \$localdir; scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname .\" " >> $jobfile |
---|
3782 | |
---|
3783 | else |
---|
3784 | echo "scp $PORTOPT -r $return_username@$return_address:$working_directory/SOURCES_FOR_RUN_$fname ." >> $jobfile |
---|
3785 | fi |
---|
3786 | fi |
---|
3787 | echo "export SOURCES_COMPLETE=true" >> $jobfile |
---|
3788 | |
---|
3789 | # MOVE MRUN-SCRIPT AND CONFIGURATION-FILE FROM THE SOURCES_FOR_RUN... DIRECTORY TO THE |
---|
3790 | # WORKING DIRECTORY OF THE JOB |
---|
3791 | echo "mv SOURCES_FOR_RUN_$fname/$config_file . " >> $jobfile |
---|
3792 | echo "mv SOURCES_FOR_RUN_$fname/$mrun_script_name . " >> $jobfile |
---|
3793 | echo "chmod u+rwx $mrun_script_name" >> $jobfile |
---|
3794 | echo "execute_mrun=true" >> $jobfile |
---|
3795 | echo " " >> $jobfile |
---|
3796 | |
---|
3797 | else |
---|
3798 | |
---|
3799 | # PROVIDE SOURCE-CODE FILES AND MAKEFILE AS HERE DOCUMENT |
---|
3800 | if [[ $do_compile = true ]] |
---|
3801 | then |
---|
3802 | |
---|
3803 | source_catalog=SOURCES_FOR_RUN_$fname |
---|
3804 | |
---|
3805 | # CREATE SOURCES_FOR_RUN... DIRECTORY TO STORE THE SOURCE CODE FILES AND THE MAKEFILE |
---|
3806 | echo "mkdir SOURCES_FOR_RUN_$fname" >> $jobfile |
---|
3807 | echo "export SOURCES_COMPLETE=true" >> $jobfile |
---|
3808 | echo "cd SOURCES_FOR_RUN_$fname" >> $jobfile |
---|
3809 | |
---|
3810 | for filename in $source_list |
---|
3811 | do |
---|
3812 | # BACKSLASH IS USED FOR MASKING |
---|
3813 | echo "cat > $filename << \"%END%\"" >> $jobfile |
---|
3814 | cat $source_catalog/$filename >> $jobfile |
---|
3815 | echo " " >> $jobfile |
---|
3816 | echo "%END%" >> $jobfile |
---|
3817 | echo " " >> $jobfile |
---|
3818 | done |
---|
3819 | |
---|
3820 | # BACKSLASH IS USED FOR MASKING |
---|
3821 | echo "cat > Makefile << \"%END%\"" >> $jobfile |
---|
3822 | cat $source_catalog/Makefile >> $jobfile |
---|
3823 | echo " " >> $jobfile |
---|
3824 | echo "%END%" >> $jobfile |
---|
3825 | echo " " >> $jobfile |
---|
3826 | |
---|
3827 | echo "cd - > /dev/null" >> $jobfile |
---|
3828 | |
---|
3829 | fi |
---|
3830 | |
---|
3831 | |
---|
3832 | # PROVIDE THE CONFIGURATION-FILE AS HERE-DOCUMENT |
---|
3833 | # BACKSLASH IS USED FOR MASKING |
---|
3834 | # LINES WITH #$ IN THE CONFIGURATION-FILE, COMING FROM THE SVN KEYWORD SUBSTITUTION, |
---|
3835 | # ARE REMOVED FROM THE FILE IN ORDER TO AVOID PROBLEMS WITH THE SGE BATCH SYSTEM |
---|
3836 | echo "cat > $config_file << \"%END%\"" >> $jobfile |
---|
3837 | if [[ $host = lckyuh ]] |
---|
3838 | then |
---|
3839 | # NO CROSS-COMPILER ON COMPUTE NODE |
---|
3840 | sed 's/frtpx/frt/g' $config_file >> $jobfile |
---|
3841 | else |
---|
3842 | sed 's/#$.*//g' $config_file >> $jobfile |
---|
3843 | fi |
---|
3844 | echo "%END%" >> $jobfile |
---|
3845 | echo " " >> $jobfile |
---|
3846 | |
---|
3847 | |
---|
3848 | # PROVIDE THE MRUN-SCRIPTS AS HERE-DOCUMENT |
---|
3849 | # BACKSLASH IS USED FOR MASKING |
---|
3850 | echo "cat > $mrun_script_name <<\"%END%\"" >> $jobfile |
---|
3851 | if [[ $host = lckyuh ]] |
---|
3852 | then |
---|
3853 | sed 's/\/bin\/ksh/\/bin\/bash/g' ${PALM_BIN}/$mrun_script_name >> $jobfile |
---|
3854 | else |
---|
3855 | cat ${PALM_BIN}/$mrun_script_name >> $jobfile |
---|
3856 | fi |
---|
3857 | echo "%END%" >> $jobfile |
---|
3858 | echo "chmod u+x $mrun_script_name" >> $jobfile |
---|
3859 | echo "execute_mrun=true" >> $jobfile |
---|
3860 | echo " " >> $jobfile |
---|
3861 | |
---|
3862 | fi |
---|
3863 | |
---|
3864 | |
---|
3865 | # GET REQUIRED INPUT-FILES BY SCP OR BY SENDING THEM WITH THE JOB AS HERE-DOCUMENT |
---|
3866 | # PUT THESE FILES INTO THE USER'S RESPECTIVE PERMANENT DIRECTORIES ON THE REMOTE-HOST |
---|
3867 | # IF THE DIRECTORIES DO NOT EXIST, TRY TO CREATE THEM |
---|
3868 | if [[ $do_remote = true ]] |
---|
3869 | then |
---|
3870 | (( i = 0 )) |
---|
3871 | while (( i < iin )) |
---|
3872 | do |
---|
3873 | (( i = i + 1 )) |
---|
3874 | echo "[[ ! -d ${pathin[$i]} ]] && mkdir -p ${pathin[$i]}" >> $jobfile |
---|
3875 | if [[ "${transin[$i]}" = job ]] |
---|
3876 | then |
---|
3877 | echo "cat > ${remotepathin[$i]} <<\"%END%\"" >> $jobfile |
---|
3878 | eval cat ${pathin[$i]}/${frelin[$i]} >> $jobfile |
---|
3879 | echo " " >> $jobfile |
---|
3880 | echo "%END%" >> $jobfile |
---|
3881 | else |
---|
3882 | echo "batch_scp $PORTOPT -b -o -g -s -u $return_username $return_address ${remotepathin[$i]} \"${pathin[$i]}\" ${frelin[$i]}" >> $jobfile |
---|
3883 | fi |
---|
3884 | |
---|
3885 | # CHECK, IF FILE COULD BE CREATED |
---|
3886 | echo "if [[ \$? = 1 ]]" >> $jobfile |
---|
3887 | echo "then" >> $jobfile |
---|
3888 | echo " echo \" \" " >> $jobfile |
---|
3889 | echo " echo \"+++ file ${remotepathin[$i]} could not be created\" " >> $jobfile |
---|
3890 | echo " echo \" please check, if directory exists on $host!\" " >> $jobfile |
---|
3891 | echo " echo \"+++ MRUN will not be continued\" " >> $jobfile |
---|
3892 | echo " execute_mrun=false" >> $jobfile |
---|
3893 | echo "fi" >> $jobfile |
---|
3894 | done |
---|
3895 | fi |
---|
3896 | |
---|
3897 | # PROVIDE NAME OF THE CURRENT WORKING-DIRECTORY ON THE LOCAL MACHINE (FROM WHERE THE JOB IS |
---|
3898 | # STARTED) BY SETTING AN ENVIRONMENT-VARIABLE. THIS INFORMATION IS USED IN THE JOB BY MRUN |
---|
3899 | # IN CASE THAT RESTART-RUNS HAVE TO BE GENERATED |
---|
3900 | echo "LOCAL_PWD=$working_directory" >> $jobfile |
---|
3901 | echo "export LOCAL_PWD" >> $jobfile |
---|
3902 | |
---|
3903 | # PROVIDE THE PATH OF THE LOCAL MRUN-SCRIPT FOR THE SAME REASON |
---|
3904 | echo "LOCAL_MRUN_PATH=$PALM_BIN" >> $jobfile |
---|
3905 | echo "export LOCAL_MRUN_PATH" >> $jobfile |
---|
3906 | |
---|
3907 | # lceddy ALSO REQUIRES TO PROVIDE PATH FOR THE PALM-SCRIPTS |
---|
3908 | if [[ $host = lceddy || $localhost = lceddy ]] |
---|
3909 | then |
---|
3910 | echo "export PALM_BIN=$PALM_BIN" | sed -e 's:'$HOME':$HOME:' >> $jobfile |
---|
3911 | echo "export PATH=\$PATH:\$PALM_BIN" >> $jobfile |
---|
3912 | fi |
---|
3913 | |
---|
3914 | # CALL MRUN WITHIN THE JOB (SETTING QUEUE IS A WORKAROUND FOR ibmkisti) |
---|
3915 | # AS FINAL ACTION, REMOVE THE TEMPORARY DIRECTORY CREATED AT THE BEGINNING OF THE JOB |
---|
3916 | echo "set -x" >> $jobfile |
---|
3917 | echo "queue=$queue" >> $jobfile |
---|
3918 | echo "[[ \$execute_mrun = true ]] && ./$mrun_com" >> $jobfile |
---|
3919 | echo 'ls -al; echo `pwd`' >> $jobfile |
---|
3920 | echo "cd \$HOME" >> $jobfile |
---|
3921 | echo "rm -rf $TEMPDIR" >> $jobfile |
---|
3922 | |
---|
3923 | |
---|
3924 | |
---|
3925 | |
---|
3926 | # START THE JOB USING SUBJOB-COMMAND |
---|
3927 | if [[ $silent = false ]] |
---|
3928 | then |
---|
3929 | printf "\n " |
---|
3930 | else |
---|
3931 | printf "\n\n" |
---|
3932 | fi |
---|
3933 | |
---|
3934 | subjob $job_on_file -h $host -u $remote_username -g $group_number -q $queue -m $memory -N $node_usage -t $cpumax $XOPT $TOPT $OOPT -n $fname -v -c $job_catalog -e $email_notification $PORTOPT $jobfile |
---|
3935 | rm -rf $jobfile |
---|
3936 | |
---|
3937 | |
---|
3938 | fi # END OF REMOTE-PART |
---|