Newsgroups: comp.parallel.mpi
From: lusk@mcs.anl.gov (Rusty Lusk)
Subject: Re: What are the parameters in MPI_Init ()?
Organization: Math and Computer Science, Argonne.
Date: 3 Jul 1995 15:54:24 GMT
Message-ID: <3t93rg$odk@milo.mcs.anl.gov>

In article <1995Jul3.040710.18973@uxmail.ust.hk>, ma_adlum@uxmail.ust.hk (Lum Wing Fung Adrian) writes:
|> Dear all,
|> 	What are the arguements in the function MPI_Init?  What should
|> I passed into it?  What is the usage of passing those parameters?  Should
|> I just pass two NULL when start the program?  Thanks.
|> 

The arguments to MPI_Init in C are the addresses of argc and argv, the
traditional arguments to a C main program.  You should not set them
yourself, they are passed in by whatever program started yours, and
your MPI implementation, whichever one it might be, would probably
like to see them.  So your program should look something like this:

main(argc,argv)
int argc;
char *argv[];
{
    MPI_Init(&argc,&argv);

    ...

    MPI_Finalize();
}

The addresses are passed so that the implementation may alter the
command-line arguments passed in (especially, to delete any of its own
and leave the user's command line arguments.

In Fortran, MPI_INIT() has no arguments.  

I hope this helps.

Rusty

