help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPI


From: John W. Eaton
Subject: Re: MPI
Date: Sat, 3 Feb 2001 18:30:33 -0600

On  3-Feb-2001, Alex Verstak <address@hidden> wrote:

| On Fri, 2 Feb 2001, John W. Eaton wrote:
| > On  2-Feb-2001, Alex Verstak <address@hidden> wrote:
| > | I cannot give you an example, but I can explain why they wrote
| > | it in the standard this way.  MPI/C is a low-level API for a
| > | low-level language, so this requirement is not unreasonable.
| > 
| > I think it is, unless you can explain what good purpose it serves to
| > *require* that the MPI_Init function must receive exactly the same
| > argv/argc that main() sees.
| 
| I think it's their way of saying that the arguments are not
| standardized.  Keep in mind, MPI only standardizes the API, not
| the mechanisms for executing parallel programs.  The latter are
| still a research topic.  Command-line arguments are in the fuzzy
| land in-between the API and program execution, so they left this
| hole open.

I took the time to look up the MPI standard, and here is what I found at
http://www-unix.mcs.anl.gov/mpi/mpi-standard/mpi-report-2.0/node43.htm#Node43:

  In MPI-1.1, it is explicitly stated that an implementation is allowed
  to require that the arguments argc and argv passed by an application
  to MPI_INIT in C be the same arguments passed into the application as
  the arguments to main. In MPI-2 implementations are not allowed to
  impose this requirement. Conforming implementations of MPI are
  required to allow applications to pass NULL for both the argc and argv
  arguments of main. In C++, there is an alternative binding for
  MPI::Init that does not have these arguments at all.

  Rationale. 

  In some applications, libraries may be making the call to MPI_Init,
  and may not have access to argc and argv from main. It is anticipated
  that applications requiring special information about the environment
  or information supplied by mpiexec can get that information from
  environment variables.  (End of rationale.)

So I don't think it matters whether you have the exact argv/argc that
are passed to main.  (BTW, I think there is a slight error in the
standard, since an argc == NULL doesn't make sense.)

However, at http://www-unix.mcs.anl.gov/mpi/www/www3/MPI_Init.html I
see that

  The MPI standard does not say what a program can do before an MPI_INIT
  or after an MPI_FINALIZE. In the MPICH implementation, you should do
  as little as possible. In particular, avoid anything that changes the
  external state of the program, such as opening files, reading standard
  input or writing to standard output.

But I suspect that this still doesn't mean that Octave must call
MPI_Init before doing anything, or that it must be done in main(), or
that it can't go in a .oct file, though you may need to call MPI_Init
before doing any other operations in your program.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]