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: 2004-05-30 14:25:02


On Mon, 24 May 2004, Graziano Giuliani wrote:

>> 0: init_descriptor: invalid target descriptor
> [snipped]
> The problem was solved simply using:
>
> /*
> int argc;
> char **argv;
>
> MPI_Init(&argc, &argv);
>
> */
> MPI_Init(NULL, NULL);

Ah, I see! Just FYI: your previous code was definitely faulty. If you
pass in uninitialized values to MPI_Init (i.e., you simply *declared* argc
and argv, but you didn't initialize them to anything), you'll get
undefined results. :-) The intent is that you are supposed to pass in
argc and argv from main(). LAM allows the (NULL, NULL) form, though, so
that's fine as well.

> Note this problems did not show up with MPICH or using Intel compilers.
> Hope this helps.

You were getting lucky with MPICH and/or the Intel compilers (e.g.,
perhaps the Intel compiler initializes them to (0, NULL), respectively --
but the C language does not guarantee this).

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