extra command line arguments
Pete Wyckoff
pw at osc.edu
Tue Apr 5 15:23:51 EDT 2005
vanw at tticluster.com wrote on Mon, 04 Apr 2005 13:16 -0400:
> I have a user who is seeing the problems as described in #6 of the README
> (below). Unfortunately, my user is using a commerical package for which we
> don't have the source. Is there any way around besides using mpirun?
>
> ---from README---
> 6. My program sees extra weird command line arguments.
>
> In the MPICH/p4 library, the only way to start processes is to
> provide them with command-line arguments specifying information about
> their environment: hostname and port number of the "master", own node
> ID, total number of nodes, etc. These appear in main() in the argv[]
> array and are passed into MPI_Init() which interprets them to construct
> the parallel environment. It then removes from argv[] the arguments
> it understands and leaves the rest for the main program.
>
> If your code tries to parse the arguments in argv[] _before_ calling
> MPI_Init(&argc, &argv), you will unfortunately see, and not understand,
> these extra arguments. The best solution is to put the call to
> MPI_Init before any argument processing.
I thought about this a bit. With the constraint that you cannot change
the code, you may be stuck. If you use a shared mpich library (.so),
then we could figure out how to fix it there.
Is there some application specific way you can make it ignore the extra
options? Like the gnuish "--" separator.
Just fyi, the other case where people see these extra options is with a
fortran MAIN that calls MPI_Init. Even if it does that before looking
at argc/argv. A flaw in the mpich1 fortran interface causes it not to
strip out the extra arguments like it would for C.
-- Pete
More information about the mpiexec
mailing list