extra command line arguments
Anton Starikov
A.Starikov at tnw.utwente.nl
Mon Apr 4 21:09:01 EDT 2005
If this code is written in Fortran - that's clear, and this should be
done via proper compillation of MPI library. It should be separate
library for fortran, compilled with Fortran (not Fortran interface,
compilled with C), which include different version of MPI_Init, which
does replacement of command-line parameters. And Fortran "iargc" and
"getarg" will return proper things.
Because Fortran... born to crawl, can't fly.
If code is written in C/C++ I would rather prefere not to trust to the
code written by such "programmers" :)
This is rock-solid standard and, AFAIR, first thing which you will find
in any MPI documentation: "Call 'MPI_Init' before parsing 'argv' and
argc"'. And if programmers don't know even that, what kind of MPI code
can they produce? :)
Anton.
Kevin Van Workum wrote:
> Hi,
>
> 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.
>
>
More information about the mpiexec
mailing list