Minor updated on the validity checks for the alltoall collectives.
Этот коммит содержится в:
родитель
6c28f114f1
Коммит
4ac247b1da
@ -46,8 +46,8 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
|||||||
void *recvbuf, int recvcount, MPI_Datatype recvtype,
|
void *recvbuf, int recvcount, MPI_Datatype recvtype,
|
||||||
MPI_Comm comm)
|
MPI_Comm comm)
|
||||||
{
|
{
|
||||||
size_t sendtype_size, recvtype_size;
|
|
||||||
int err;
|
int err;
|
||||||
|
size_t recvtype_size;
|
||||||
|
|
||||||
MEMCHECKER(
|
MEMCHECKER(
|
||||||
memchecker_comm(comm);
|
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
|
/* Unrooted operation -- same checks for all ranks on both
|
||||||
intracommunicators and intercommunicators */
|
intracommunicators and intercommunicators */
|
||||||
|
|
||||||
if (MPI_IN_PLACE == sendbuf) {
|
|
||||||
sendcount = recvcount;
|
|
||||||
sendtype = recvtype;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = MPI_SUCCESS;
|
err = MPI_SUCCESS;
|
||||||
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
||||||
if (ompi_comm_invalid(comm)) {
|
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,
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
|
||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
} else {
|
} else {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
if(MPI_IN_PLACE != sendbuf) {
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
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_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcount);
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
|
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(sendtype, &sendtype_size);
|
||||||
ompi_datatype_type_size(recvtype, &recvtype_size);
|
ompi_datatype_type_size(recvtype, &recvtype_size);
|
||||||
if ((sendtype_size*sendcount) != (recvtype_size*recvcount)) {
|
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? */
|
/* 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(sendtype, &sendtype_size);
|
*/
|
||||||
ompi_datatype_type_size(recvtype, &recvtype_size);
|
ompi_datatype_type_size(recvtype, &recvtype_size);
|
||||||
if (((MPI_IN_PLACE == sendbuf) ||
|
if( (0 == recvcount) || (0 == recvtype_size) ) {
|
||||||
(0 == sendcount) || (0 == sendtype_size)) &&
|
|
||||||
((0 == recvcount) || (0 == recvtype_size))) {
|
|
||||||
return MPI_SUCCESS;
|
return MPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||||
* University Research and Technology
|
* University Research and Technology
|
||||||
* Corporation. All rights reserved.
|
* 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
|
* of Tennessee Research Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
* 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,
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_INTERN,
|
||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
} else {
|
} else {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
if (MPI_IN_PLACE != sendbuf) {
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
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_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcount);
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||||
* University Research and Technology
|
* University Research and Technology
|
||||||
* Corporation. All rights reserved.
|
* 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
|
* of Tennessee Research Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
* 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)
|
MPI_Request *request)
|
||||||
{
|
{
|
||||||
int i, size, err;
|
int i, size, err;
|
||||||
size_t sendtype_size, recvtype_size;
|
|
||||||
|
|
||||||
MEMCHECKER(
|
MEMCHECKER(
|
||||||
ptrdiff_t recv_ext;
|
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);
|
size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm);
|
||||||
for (i = 0; i < size; ++i) {
|
for (i = 0; i < size; ++i) {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
if (MPI_IN_PLACE != sendbuf) {
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
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_CHECK_DATATYPE_FOR_RECV(err, recvtype, recvcounts[i]);
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
|
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
|
||||||
int me = ompi_comm_rank(comm);
|
int me = ompi_comm_rank(comm);
|
||||||
|
size_t sendtype_size, recvtype_size;
|
||||||
ompi_datatype_type_size(sendtype, &sendtype_size);
|
ompi_datatype_type_size(sendtype, &sendtype_size);
|
||||||
ompi_datatype_type_size(recvtype, &recvtype_size);
|
ompi_datatype_type_size(recvtype, &recvtype_size);
|
||||||
if ((sendtype_size*sendcounts[me]) != (recvtype_size*recvcounts[me])) {
|
if ((sendtype_size*sendcounts[me]) != (recvtype_size*recvcounts[me])) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
||||||
* University Research and Technology
|
* University Research and Technology
|
||||||
* Corporation. All rights reserved.
|
* 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
|
* of Tennessee Research Foundation. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
|
* 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)
|
MPI_Request *request)
|
||||||
{
|
{
|
||||||
int i, size, err;
|
int i, size, err;
|
||||||
size_t sendtype_size, recvtype_size;
|
|
||||||
|
|
||||||
MEMCHECKER(
|
MEMCHECKER(
|
||||||
ptrdiff_t recv_ext;
|
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);
|
size = OMPI_COMM_IS_INTER(comm)?ompi_comm_remote_size(comm):ompi_comm_size(comm);
|
||||||
for (i = 0; i < size; ++i) {
|
for (i = 0; i < size; ++i) {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]);
|
if (MPI_IN_PLACE != sendbuf) {
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
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_CHECK_DATATYPE_FOR_RECV(err, recvtypes[i], recvcounts[i]);
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
|
if (MPI_IN_PLACE != sendbuf && !OMPI_COMM_IS_INTER(comm)) {
|
||||||
int me = ompi_comm_rank(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(sendtypes[me], &sendtype_size);
|
||||||
ompi_datatype_type_size(recvtypes[me], &recvtype_size);
|
ompi_datatype_type_size(recvtypes[me], &recvtype_size);
|
||||||
if ((sendtype_size*sendcounts[me]) != (recvtype_size*recvcounts[me])) {
|
if ((sendtype_size*sendcounts[me]) != (recvtype_size*recvcounts[me])) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user