[Mpi-comments] Error in MPI_Neighbor_alltoallw example?

Timothy Brown Timothy.Brown-1 at Colorado.EDU
Fri Dec 5 09:41:59 CST 2014


Hello.

I was trying to use MPI_Neighbor_alltoallw() and was following the example on page 333 of the MPI-3.0 standard. However I believe the send and receive counts are incorrect. Lines 21 to 25:

DO i=1,num_neigh
  sndcounts(i) = 100
  rcvcounts(i) = 100
  rcvtypes(i)  = sndtypes(i)
END DO

Since the send/receive counts for 1 and 2 are vectors types of length 100, we should be sending/receiving only 1 type/element. As follows:

sndcounts(1) = 1
sndcounts(2) = 1
sndcounts(3) = 100
sndcounts(4) = 100

rcvcounts = sndcounts

Indeed if I compile the example as per the standard, I get data corruption.

I couldn't find this in the errata published on May 14, 2014.  However if it is a known mistake please ignore my comment. 

Regards
Timothy Brown


More information about the mpi-comments mailing list