Fortrna program with arguments
Pete Wyckoff
pw at osc.edu
Thu Nov 14 18:34:54 EST 2002
luet said:
> I am having problem running even a simple Fortran program with arguments
> as input. Mpiexec seems to pass some additional arguments to the executable
> and that causes the program to fail. I don't have this problem when I use
> mpirun. Neither do I have it with C programs.
>
> I am using mpiexec-0.71, OpenPBS_2_3_16, and I get the problem with
> Intel (v6), PGI (3.2) and GNU (2.96) compilers.
>
> Here is the mpiexec command I use, the executable is called temp,
> and I use qsub -I -l nodes=4 to connect onto the nodes through PBS:
>
> mpiexec temp arg1 arg2
>
> I include the program's source at the end of this message, but here
> is the output I get:
>
> 6365E93606DF93DCCCA252AED46353F16365E93606DF93DCCCA252AED46353F1
> i: 25
> 0./temp
> 1-p4wd
> 2/home/david/mpiexec_pb
> 3-execer_id
> 4mpiexec
[...]
>
> So I first get a random string of characters. Then it says that the
> program temp got 25 arguments (i=25). The first argument is the
> executable followed with all sort of information that I guess mpiexec adds
> and the initial arguments are only at position 24 and 25.
>
> Whereas if I do the same with mpirun I get:
>
> i: 6
> 0/home/david/mpiexec_pb/./temp
> 1arg1
> 2arg2
> 3-p4pg
[...]
Full message at
http://email.osc.edu/pipermail/mpiexec/2002-November/000136.html.
The random string of characters is PBS trying to talk to its demuxer
with some weak security by ensuring that they both have the same
"cookie". The patch provided in mpiexec/patch/pbs-2.3.12-mpiexec.diff
gets rid of this and adds the ability to forward stdin/stdout/stderr
from the application processes back to mpiexec. But things should work
at least even without the PBS patch. You still should apply it and
restart the pbs moms if you can.
The huge number of extra arguments are what is necessary to get an
MPICH/P4 application to start itself in parallel. If you call
MPI_Init(&argc, &argv) early in your program, these arguments are
stripped out so that the application does not see them after that call.
The same thing happens with mpirun.
Note that the above is _not_ true with old mpich versions.
How old is your mpich? Before 1.2.4 it was not possible to start
mpich/p4 codes using mpiexec. Remnants of the patch necessary to update
older versions of mpich are in mpiexec/patch/mpich-1.2.3-alpha-... .
And, as you've noticed, the mpirun interface with rsh still leaves a
bunch of arguments in the command line too.
-- Pete
[P.S. I've tried to disable the mailing list accepting html in the future.
Full text repeated below non-htmlized. ]
More information about the mpiexec
mailing list