Closed
Description
According to the standard, MPI_Alltoallw
and MPI_Ialltoallw
should ignore the sendcounts
, sdispls
, and sendtypes
arguments if sendbuf
is MPI_IN_PLACE
. Open MPI (tested with 3.0.0) takes this into account for sendcounts
and sdispls
, but not for sendtypes
. This leads to a segmentation fault with the following test code:
PROGRAM main
USE mpi
IMPLICIT NONE
INTEGER :: size
INTEGER :: rank
INTEGER :: ierr
INTEGER :: i
INTEGER, ALLOCATABLE :: recvbuf(:)
INTEGER, ALLOCATABLE :: recvcounts(:)
INTEGER, ALLOCATABLE :: recvdispls(:)
INTEGER, ALLOCATABLE :: recvtypes(:)
INTEGER, ALLOCATABLE :: NULL(:)
CALL MPI_Init(ierr)
CALL MPI_Comm_size(MPI_COMM_WORLD, size, ierr)
CALL MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
ALLOCATE(recvbuf(size))
ALLOCATE(recvcounts(size))
ALLOCATE(recvdispls(size))
ALLOCATE(recvtypes(size))
DO i = 1, size
recvcounts(i) = 1
recvdispls(i) = i * (storage_size(recvbuf) / 8)
recvtypes(i) = MPI_INTEGER
recvbuf(i) = rank
END DO
CALL MPI_Alltoallw(MPI_IN_PLACE, NULL, NULL, NULL, &
recvbuf, recvcounts, recvdispls, recvtypes, &
MPI_COMM_WORLD, ierr)
CALL MPI_Finalize(ierr)
END PROGRAM
It seems that the loops at
ompi/ompi/mpi/fortran/mpif-h/alltoallw_f.c
Lines 95 to 99 in e172849
ompi/ompi/mpi/fortran/mpif-h/ialltoallw_f.c
Lines 96 to 100 in e172849