Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Beginner Problem with OpenMPI (MPI_Waitall)
From: Matt Hughes (matt.c.hughes+ompi_at_[hidden])
Date: 2008-06-27 10:44:15


2008/6/27 Joao Marcelo <jmarcelo.alencar_at_[hidden]>:
> Hi,
>
> I'm starting to code with MPI and decided to use openmpi. I'm using
> Ubuntu Linux with GCC version 4.2.3 and OpenMPI 1.2.5 (distribution
> package). The output of "ompi_info -- all" is attached. I'm also
> sending a copy of the source code I'm trying to run.

One problem I see is that you are incorrectly indexing the reqs array:

        for ( i = 1; i < numtasks; ++i){
                rc = MPI_Isend(&a , 1 , MPI_INT , i , 0 , MPI_COMM_WORLD , &reqs[i]);
        }

        MPI_Waitall(numtasks - 1 , reqs , stats);

If size = 3, you allocate enough space for two items in reqs but you
index starting at one, so you access memory past the end of the array.
 Additional, MPI_Waitall will be looking at uninitialized memory in
the first element of reqs. This is not immediately causing the crash,
but it may be messing with MPI enough that Finalize crashes. Try:

        for ( i = 0; i < numtasks-1; ++i)

Fixing that *might* fix your crash.

mch