1
1

Minor updated on the validity checks for the alltoall collectives.

Этот коммит содержится в:
George Bosilca 2015-10-24 15:25:28 -04:00
родитель 6c28f114f1
Коммит 4ac247b1da
4 изменённых файлов: 27 добавлений и 25 удалений

Просмотреть файл

@ -46,8 +46,8 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
{
size_t sendtype_size, recvtype_size;
int err;
size_t recvtype_size;
MEMCHECKER(
memchecker_comm(comm);
@ -64,11 +64,6 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
/* Unrooted operation -- same checks for all ranks on both
intracommunicators and intercommunicators */
if (MPI_IN_PLACE == sendbuf) {
sendcount = recvcount;
sendtype = recvtype;
}
err = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
if (ompi_comm_invalid(comm)) {
@ -79,13 +74,16 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME);
} else {
if(MPI_IN_PLACE != sendbuf) {
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcount);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
size_t sendtype_size, recvtype_size;
ompi_datatype_type_size(sendtype, &sendtype_size);
ompi_datatype_type_size(recvtype, &recvtype_size);
if ((sendtype_size*sendcount) != (recvtype_size*recvcount)) {
@ -94,13 +92,11 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
}
}
/* Do we need to do anything? */
ompi_datatype_type_size(sendtype, &sendtype_size);
/* Do we need to do anything? Per MPI standard the (v3.1 page 168 line 48)
* the amount of data sent must be equal to the amount of data received.
*/
ompi_datatype_type_size(recvtype, &recvtype_size);
if (((MPI_IN_PLACE == sendbuf) ||
(0 == sendcount) || (0 == sendtype_size)) &&
((0 == recvcount) || (0 == recvtype_size))) {
if( (0 == recvcount) || (0 == recvtype_size) ) {
return MPI_SUCCESS;
}

Просмотреть файл

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* Copyright (c) 2004-2015 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
@ -80,8 +80,10 @@ int MPI_Ialltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
FUNC_NAME);
} else {
if (MPI_IN_PLACE != sendbuf) {
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcount);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}

Просмотреть файл

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2012 The University of Tennessee and The University
* Copyright (c) 2004-2015 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
@ -48,7 +48,6 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
MPI_Request *request)
{
int i, size, err;
size_t sendtype_size, recvtype_size;
MEMCHECKER(
ptrdiff_t recv_ext;
@ -104,14 +103,17 @@ int MPI_Ialltoallv(const void *sendbuf, const int sendcounts[], const int sdispl
size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm);
for (i = 0; i < size; ++i) {
if (MPI_IN_PLACE != sendbuf) {
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcounts[i]);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
int me = ompi_comm_rank(comm);
size_t sendtype_size, recvtype_size;
ompi_datatype_type_size(sendtype, &sendtype_size);
ompi_datatype_type_size(recvtype, &recvtype_size);
if ((sendtype_size*sendcounts[me]) != (recvtype_size*recvcounts[me])) {

Просмотреть файл

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2012 The University of Tennessee and The University
* Copyright (c) 2004-2015 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
@ -48,7 +48,6 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
MPI_Request *request)
{
int i, size, err;
size_t sendtype_size, recvtype_size;
MEMCHECKER(
ptrdiff_t recv_ext;
@ -100,14 +99,17 @@ int MPI_Ialltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm);
for (i = 0; i < size; ++i) {
if (MPI_IN_PLACE != sendbuf) {
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
OMPI_CHECK_DATATYPE_FOR_RECV(err, recvtypes[i], recvcounts[i]);
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
}
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
int me = ompi_comm_rank(comm);
size_t sendtype_size, recvtype_size;
ompi_datatype_type_size(sendtypes[me], &sendtype_size);
ompi_datatype_type_size(recvtypes[me], &recvtype_size);
if ((sendtype_size*sendcounts[me]) != (recvtype_size*recvcounts[me])) {