LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Brian Barrett (brbarret_at_[hidden])
Date: 2005-12-13 17:32:26


On Dec 13, 2005, at 4:57 PM, Anthony Chan wrote:

> On Mon, 12 Dec 2005, Qiang Xu wrote:
>> PMPI_Init(argc, argv) is the problem, why? And why argv[ ] only
>> contain one element "LAM_MPI_Fortran_program"?
>
> In terms of capturing fortran application name in a C profiling
> library,
> it is a tricking issue. AFAIK, it is related to the fortran compiler
> and its provided functionalities of accessing command line
> argument. I
> believe that this is the reason that LAM-MPI provides a generic name,
> LAM_MPI_Fortran_program, to avoid the complication. (LAM-MPI
> experts can
> confirm if I am wrong ?) In general, it has nothing to do with MPI.
> Some MPI implementations use command line argument to start up the
> parallel job, you will see altered command line argument in your
> profiled
> MPI_Init(). For those implementations, if you were to hack into
> implementation code, you may be able to fetch the fortran application
> name.

Anthony is exactly right. Fortran 77 doesn't provide a portable way
to access argv/argc, so we fill in a default when MPI_INIT is called
from Fortran. The default can be overriden by the environment
variable LAM_MPI_PROCESS_NAME, as long as that environment variable
is set before MPI_INIT is called. Open MPI, on the other hand,
passes an argv of NULL and an argc of 0 from the Fortran bindings to
the C implementation.

Brian

-- 
   Brian Barrett
   LAM/MPI developer and all around nice guy
   Have a LAM/MPI day: http://www.lam-mpi.org/