LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2003-06-14 05:15:46


On Sat, 14 Jun 2003, Maiko Wessel wrote:

> We must modify LAM at MPI_Init.
> We've added two global variables to the init.c file.

Just out of curiosity -- what are you doing?

> But when I compile my own program i get errors:
>
> multiple definition of (names of variable)
> in libmpi.a and libpmpi.a
>
> Why is there a definition in MPI and PMPI functions ??

Most of the files in share/mpi are compiled again in the share/pmpi
directory, but with their function names shifted (e.g., MPI_Init ->
PMPI_Init). Since MPI_Init also needs to appear as PMPI_Init, it is
compiled twice. As such, LAM takes care to avoid this situation -- global
variables are only defined in files that are only compiled once. This is
the MPI profiling layer, as described in chapter 8 of MPI-1. Hence, when
you added variables to share/mpi/init.c, it was compiled twice.

If you are using 6.5.x, you probably want to add the new globals to
share/mpi/laminit.c, which is the back-end functionality for MPI_INIT, and
is *not* compiled a second time in the PMPI library. In 7.x, the correct
file to edit is share/mpi/lammpiinit.c.

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/