Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] Bogus memcpy or bogus valgrind record
From: Eugene Loh (Eugene.Loh_at_[hidden])
Date: 2009-03-30 21:38:29


Jeff Squyres wrote:

> On Mar 28, 2009, at 5:31 AM, François PELLEGRINI wrote:
>
>> MPI_Comm_size (MPI_COMM_WORLD, &procglbnbr);
>>
>> MPI_Comm_rank (MPI_COMM_WORLD, &proclocnum);
>>
>> dataloctab = malloc (2 * (procglbnbr + 1) * sizeof (int));
>> dataglbtab = dataloctab + 2;
>
> Why +2? Shouldn't it be +procglbnbr?

I think this is okay. There is a local buffer (2 elements long) and a
global buffer (2*np long, into which Allgather elements are placed).
They're concatenated. So, glb starts 2 elements after local.