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: 2005-08-12 07:31:46


On Aug 11, 2005, at 10:49 PM, Lei_at_ICS wrote:

> But a more serious problem arises. MPI_Init() crashes Matlab.
> This is the C code:
> int error=0, mp_init=0;
> int argc=2, num_proc, my_rank;
> char **argv;
>
> MPI_Initialized(&mp_init);
> if(mp_init == 1)
> printf("***** MPI_Init called.\n");
> else {
> printf("***** MPI_Init NOT called. Calling ...\n");
> MPI_Init(&argc, &argv);
> printf("***** Now MPI_Init called.\n");
> }
>
> "***** MPI_Init NOT called. Calling ..." is printed out
> before crashing.
>
> Is it because I faked argc and argv (this C code is called
> from another C code, which is called by Matlab via MEX,
> so I don't have any real argc and argv)?

Don't try to fake them out -- the value of argv is not initialized, for
example. Just go ahead and use MPI_Init(NULL, NULL) -- that should
work fine (LAM doesn't use those values, anyway).

> Or is it because of the following (quoted from this group):
>
> -----
> 3.4.3 Dynamic/Embedded Environments
>
> In LAM/MPI version 7.1.1, some RPI modules may utilize an additional

Yes, it is likely because of this.

Try compiling LAM/MPI without thread support and without a memory
manager:

./configure --without-threads --with-memory-manager=none ...

This should allow you to use the wrapper compiler, too (just slightly
neater / more transparent to you, rather than using -showme and
manually stripping out -pthread).

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