Correctly use remote size where necessary. Completements the
patches for ticket #3105. This commit was SVN r26490.
Этот коммит содержится в:
родитель
4bda5da63a
Коммит
5ff74babc6
@ -2,7 +2,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-2012 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,
|
||||||
@ -54,24 +54,24 @@ int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
|||||||
|
|
||||||
if (MPI_PARAM_CHECK) {
|
if (MPI_PARAM_CHECK) {
|
||||||
|
|
||||||
/* Unrooted operation -- same checks for all ranks on both
|
/* Unrooted operation -- same checks for all ranks on both
|
||||||
intracommunicators and intercommunicators */
|
intracommunicators and intercommunicators */
|
||||||
|
|
||||||
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)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
err = MPI_ERR_TYPE;
|
err = MPI_ERR_TYPE;
|
||||||
} else if (recvcount < 0) {
|
} else if (recvcount < 0) {
|
||||||
err = MPI_ERR_COUNT;
|
err = MPI_ERR_COUNT;
|
||||||
} else if (MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) {
|
} else if (MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) {
|
||||||
err = MPI_ERR_ARG;
|
err = MPI_ERR_ARG;
|
||||||
} else {
|
} else {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
||||||
}
|
}
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do we need to do anything? */
|
/* Do we need to do anything? */
|
||||||
|
@ -2,7 +2,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-2012 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,
|
||||||
@ -49,7 +49,7 @@ int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls,
|
|||||||
ptrdiff_t recv_ext;
|
ptrdiff_t recv_ext;
|
||||||
ptrdiff_t send_ext;
|
ptrdiff_t send_ext;
|
||||||
|
|
||||||
size = ompi_comm_size(comm);
|
size = ompi_comm_remote_size(comm);
|
||||||
ompi_datatype_type_extent(recvtype, &recv_ext);
|
ompi_datatype_type_extent(recvtype, &recv_ext);
|
||||||
ompi_datatype_type_extent(sendtype, &send_ext);
|
ompi_datatype_type_extent(sendtype, &send_ext);
|
||||||
|
|
||||||
@ -71,37 +71,37 @@ int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls,
|
|||||||
|
|
||||||
if (MPI_PARAM_CHECK) {
|
if (MPI_PARAM_CHECK) {
|
||||||
|
|
||||||
/* Unrooted operation -- same checks for all ranks */
|
/* Unrooted operation -- same checks for all ranks */
|
||||||
|
|
||||||
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)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((NULL == sendcounts) || (NULL == sdispls) ||
|
if ((NULL == sendcounts) || (NULL == sdispls) ||
|
||||||
(NULL == recvcounts) || (NULL == rdispls) ||
|
(NULL == recvcounts) || (NULL == rdispls) ||
|
||||||
MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) {
|
MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We always define the remote group to be the same as the local
|
/* We always define the remote group to be the same as the local
|
||||||
group in the case of an intracommunicator, so it's safe to
|
group in the case of an intracommunicator, so it's safe to
|
||||||
get the size of the remote group here for both intra- and
|
get the size of the remote group here for both intra- and
|
||||||
intercommunicators */
|
intercommunicators */
|
||||||
|
|
||||||
size = ompi_comm_remote_size(comm);
|
size = ompi_comm_remote_size(comm);
|
||||||
for (i = 0; i < size; ++i) {
|
for (i = 0; i < size; ++i) {
|
||||||
if (recvcounts[i] < 0) {
|
if (recvcounts[i] < 0) {
|
||||||
err = MPI_ERR_COUNT;
|
err = MPI_ERR_COUNT;
|
||||||
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
err = MPI_ERR_TYPE;
|
err = MPI_ERR_TYPE;
|
||||||
} else {
|
} else {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
||||||
|
}
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OPAL_CR_ENTER_LIBRARY();
|
OPAL_CR_ENTER_LIBRARY();
|
||||||
|
@ -2,7 +2,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-2012 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,
|
||||||
@ -49,7 +49,7 @@ int MPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls,
|
|||||||
ptrdiff_t recv_ext;
|
ptrdiff_t recv_ext;
|
||||||
ptrdiff_t send_ext;
|
ptrdiff_t send_ext;
|
||||||
|
|
||||||
size = ompi_comm_size(comm);
|
size = ompi_comm_remote_size(comm);
|
||||||
|
|
||||||
memchecker_comm(comm);
|
memchecker_comm(comm);
|
||||||
for ( i = 0; i < size; i++ ) {
|
for ( i = 0; i < size; i++ ) {
|
||||||
@ -70,37 +70,37 @@ int MPI_Alltoallw(void *sendbuf, int *sendcounts, int *sdispls,
|
|||||||
|
|
||||||
if (MPI_PARAM_CHECK) {
|
if (MPI_PARAM_CHECK) {
|
||||||
|
|
||||||
/* Unrooted operation -- same checks for all ranks */
|
/* Unrooted operation -- same checks for all ranks */
|
||||||
|
|
||||||
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)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes) ||
|
if ((NULL == sendcounts) || (NULL == sdispls) || (NULL == sendtypes) ||
|
||||||
(NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes) ||
|
(NULL == recvcounts) || (NULL == rdispls) || (NULL == recvtypes) ||
|
||||||
MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) {
|
MPI_IN_PLACE == sendbuf || MPI_IN_PLACE == recvbuf) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We always define the remote group to be the same as the local
|
/* We always define the remote group to be the same as the local
|
||||||
group in the case of an intracommunicator, so it's safe to
|
group in the case of an intracommunicator, so it's safe to
|
||||||
get the size of the remote group here for both intra- and
|
get the size of the remote group here for both intra- and
|
||||||
intercommunicators */
|
intercommunicators */
|
||||||
|
|
||||||
size = ompi_comm_remote_size(comm);
|
size = ompi_comm_remote_size(comm);
|
||||||
for (i = 0; i < size; ++i) {
|
for (i = 0; i < size; ++i) {
|
||||||
if (recvcounts[i] < 0) {
|
if (recvcounts[i] < 0) {
|
||||||
err = MPI_ERR_COUNT;
|
err = MPI_ERR_COUNT;
|
||||||
} else if (MPI_DATATYPE_NULL == recvtypes[i] || NULL == recvtypes[i]) {
|
} else if (MPI_DATATYPE_NULL == recvtypes[i] || NULL == recvtypes[i]) {
|
||||||
err = MPI_ERR_TYPE;
|
err = MPI_ERR_TYPE;
|
||||||
} else {
|
} else {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]);
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtypes[i], sendcounts[i]);
|
||||||
|
}
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OPAL_CR_ENTER_LIBRARY();
|
OPAL_CR_ENTER_LIBRARY();
|
||||||
|
@ -2,7 +2,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-2012 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,
|
||||||
@ -101,62 +101,62 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
|||||||
|
|
||||||
if (OMPI_COMM_IS_INTRA(comm)) {
|
if (OMPI_COMM_IS_INTRA(comm)) {
|
||||||
|
|
||||||
/* Errors for all ranks */
|
/* Errors for all ranks */
|
||||||
|
|
||||||
if ((root >= ompi_comm_size(comm)) || (root < 0)) {
|
if ((root >= ompi_comm_size(comm)) || (root < 0)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
||||||
}
|
|
||||||
|
|
||||||
if (MPI_IN_PLACE != sendbuf) {
|
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
|
||||||
}
|
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
|
|
||||||
/* Errors for the root. Some of these could have been
|
|
||||||
combined into compound if statements above, but since
|
|
||||||
this whole section can be compiled out (or turned off at
|
|
||||||
run time) for efficiency, it's more clear to separate
|
|
||||||
them out into individual tests. */
|
|
||||||
|
|
||||||
if (ompi_comm_rank(comm) == root) {
|
|
||||||
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recvcount < 0) {
|
if (MPI_IN_PLACE != sendbuf) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
||||||
|
}
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
|
|
||||||
|
/* Errors for the root. Some of these could have been
|
||||||
|
combined into compound if statements above, but since
|
||||||
|
this whole section can be compiled out (or turned off at
|
||||||
|
run time) for efficiency, it's more clear to separate
|
||||||
|
them out into individual tests. */
|
||||||
|
|
||||||
|
if (ompi_comm_rank(comm) == root) {
|
||||||
|
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (recvcount < 0) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Errors for intercommunicators */
|
/* Errors for intercommunicators */
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (! ((root >= 0 && root < ompi_comm_remote_size(comm)) ||
|
if (! ((root >= 0 && root < ompi_comm_remote_size(comm)) ||
|
||||||
MPI_ROOT == root || MPI_PROC_NULL == root)) {
|
MPI_ROOT == root || MPI_PROC_NULL == root)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
||||||
}
|
|
||||||
|
|
||||||
/* Errors for the senders */
|
|
||||||
|
|
||||||
if (MPI_ROOT != root && MPI_PROC_NULL != root) {
|
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Errors for the root. Ditto on the comment above -- these
|
|
||||||
error checks could have been combined above, but let's
|
|
||||||
make the code easier to read. */
|
|
||||||
|
|
||||||
else if (MPI_ROOT == root) {
|
|
||||||
if (recvcount < 0) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
/* Errors for the senders */
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
|
||||||
|
if (MPI_ROOT != root && MPI_PROC_NULL != root) {
|
||||||
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Errors for the root. Ditto on the comment above -- these
|
||||||
|
error checks could have been combined above, but let's
|
||||||
|
make the code easier to read. */
|
||||||
|
|
||||||
|
else if (MPI_ROOT == root) {
|
||||||
|
if (recvcount < 0) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
|||||||
(ompi_comm_rank(comm) == root && MPI_IN_PLACE != sendbuf))) ||
|
(ompi_comm_rank(comm) == root && MPI_IN_PLACE != sendbuf))) ||
|
||||||
(ompi_comm_rank(comm) == root && MPI_IN_PLACE == sendbuf &&
|
(ompi_comm_rank(comm) == root && MPI_IN_PLACE == sendbuf &&
|
||||||
0 == recvcount) ||
|
0 == recvcount) ||
|
||||||
(0 == recvcount && (MPI_ROOT == root || MPI_PROC_NULL == root))) {
|
(0 == recvcount && (MPI_ROOT == root || MPI_PROC_NULL == root))) {
|
||||||
return MPI_SUCCESS;
|
return MPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,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-2012 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,
|
||||||
@ -47,7 +47,7 @@ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
|||||||
int rank;
|
int rank;
|
||||||
ptrdiff_t ext;
|
ptrdiff_t ext;
|
||||||
|
|
||||||
size = ompi_comm_size(comm);
|
size = ompi_comm_remote_size(comm);
|
||||||
rank = ompi_comm_rank(comm);
|
rank = ompi_comm_rank(comm);
|
||||||
ompi_datatype_type_extent(recvtype, &ext);
|
ompi_datatype_type_extent(recvtype, &ext);
|
||||||
|
|
||||||
@ -110,83 +110,78 @@ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
|||||||
|
|
||||||
if (OMPI_COMM_IS_INTRA(comm)) {
|
if (OMPI_COMM_IS_INTRA(comm)) {
|
||||||
|
|
||||||
/* Errors for all ranks */
|
/* Errors for all ranks */
|
||||||
|
|
||||||
if ((root >= ompi_comm_size(comm)) || (root < 0)) {
|
if ((root >= ompi_comm_size(comm)) || (root < 0)) {
|
||||||
err = MPI_ERR_ROOT;
|
err = MPI_ERR_ROOT;
|
||||||
} else if (MPI_IN_PLACE != sendbuf) {
|
} else if (MPI_IN_PLACE != sendbuf) {
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
||||||
}
|
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
|
|
||||||
/* Errors for the root. Some of these could have been
|
|
||||||
combined into compound if statements above, but since
|
|
||||||
this whole section can be compiled out (or turned off at
|
|
||||||
run time) for efficiency, it's more clear to separate
|
|
||||||
them out into individual tests. */
|
|
||||||
|
|
||||||
if (ompi_comm_rank(comm) == root) {
|
|
||||||
if (NULL == displs) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
|
||||||
}
|
}
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
|
|
||||||
if (NULL == recvcounts) {
|
/* Errors for the root. Some of these could have been
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
combined into compound if statements above, but since
|
||||||
|
this whole section can be compiled out (or turned off at
|
||||||
|
run time) for efficiency, it's more clear to separate
|
||||||
|
them out into individual tests. */
|
||||||
|
|
||||||
|
if (ompi_comm_rank(comm) == root) {
|
||||||
|
if (NULL == displs) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NULL == recvcounts) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
size = ompi_comm_size(comm);
|
||||||
|
for (i = 0; i < size; ++i) {
|
||||||
|
if (recvcounts[i] < 0) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
|
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We always define the remote group to be the same as the
|
|
||||||
local group in the case of an intracommunicator, so
|
|
||||||
it's safe to get the size of the remote group here for
|
|
||||||
both intra- and intercommunicators */
|
|
||||||
|
|
||||||
size = ompi_comm_remote_size(comm);
|
|
||||||
for (i = 0; i < size; ++i) {
|
|
||||||
if (recvcounts[i] < 0) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
|
||||||
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Errors for intercommunicators */
|
/* Errors for intercommunicators */
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (! ((root >= 0 && root < ompi_comm_remote_size(comm)) ||
|
if (! ((root >= 0 && root < ompi_comm_remote_size(comm)) ||
|
||||||
MPI_ROOT == root || MPI_PROC_NULL == root)) {
|
MPI_ROOT == root || MPI_PROC_NULL == root)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
||||||
}
|
|
||||||
|
|
||||||
/* Errors for the senders */
|
|
||||||
|
|
||||||
if (MPI_ROOT != root && MPI_PROC_NULL != root) {
|
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Errors for the root. Ditto on the comment above -- these
|
|
||||||
error checks could have been combined above, but let's
|
|
||||||
make the code easier to read. */
|
|
||||||
|
|
||||||
else if (MPI_ROOT == root) {
|
|
||||||
if (NULL == displs) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == recvcounts) {
|
/* Errors for the senders */
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
|
||||||
|
if (MPI_ROOT != root && MPI_PROC_NULL != root) {
|
||||||
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcount);
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
size = ompi_comm_size(comm);
|
/* Errors for the root. Ditto on the comment above -- these
|
||||||
for (i = 0; i < size; ++i) {
|
error checks could have been combined above, but let's
|
||||||
if (recvcounts[i] < 0) {
|
make the code easier to read. */
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
|
||||||
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
else if (MPI_ROOT == root) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
if (NULL == displs) {
|
||||||
}
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NULL == recvcounts) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
size = ompi_comm_remote_size(comm);
|
||||||
|
for (i = 0; i < size; ++i) {
|
||||||
|
if (recvcounts[i] < 0) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
|
} else if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,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-2012 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,
|
||||||
@ -46,7 +46,7 @@ int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
|
|||||||
MEMCHECKER(
|
MEMCHECKER(
|
||||||
int rank;
|
int rank;
|
||||||
|
|
||||||
size = ompi_comm_size(comm);
|
size = ompi_comm_remote_size(comm);
|
||||||
rank = ompi_comm_rank(comm);
|
rank = ompi_comm_rank(comm);
|
||||||
for (count = i = 0; i < size; ++i) {
|
for (count = i = 0; i < size; ++i) {
|
||||||
if (0 == recvcounts[i]) {
|
if (0 == recvcounts[i]) {
|
||||||
|
@ -2,7 +2,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-2012 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,
|
||||||
@ -46,7 +46,7 @@ int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
|
|||||||
MEMCHECKER(
|
MEMCHECKER(
|
||||||
ptrdiff_t ext;
|
ptrdiff_t ext;
|
||||||
|
|
||||||
size = ompi_comm_size(comm);
|
size = ompi_comm_remote_size(comm);
|
||||||
ompi_datatype_type_extent(recvtype, &ext);
|
ompi_datatype_type_extent(recvtype, &ext);
|
||||||
|
|
||||||
memchecker_comm(comm);
|
memchecker_comm(comm);
|
||||||
@ -100,91 +100,86 @@ int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
|
|||||||
|
|
||||||
if (OMPI_COMM_IS_INTRA(comm)) {
|
if (OMPI_COMM_IS_INTRA(comm)) {
|
||||||
|
|
||||||
/* Errors for all ranks */
|
/* Errors for all ranks */
|
||||||
|
|
||||||
if ((root >= ompi_comm_size(comm)) || (root < 0)) {
|
if ((root >= ompi_comm_size(comm)) || (root < 0)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MPI_IN_PLACE != recvbuf) {
|
if (MPI_IN_PLACE != recvbuf) {
|
||||||
if (recvcount < 0) {
|
if (recvcount < 0) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT,
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT,
|
||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE,
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE,
|
||||||
FUNC_NAME);
|
FUNC_NAME);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Errors for the root. Some of these could have been
|
|
||||||
combined into compound if statements above, but since
|
|
||||||
this whole section can be compiled out (or turned off at
|
|
||||||
run time) for efficiency, it's more clear to separate
|
|
||||||
them out into individual tests. */
|
|
||||||
|
|
||||||
if (ompi_comm_rank(comm) == root) {
|
|
||||||
if (NULL == displs) {
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == sendcounts) {
|
/* Errors for the root. Some of these could have been
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
combined into compound if statements above, but since
|
||||||
}
|
this whole section can be compiled out (or turned off at
|
||||||
|
run time) for efficiency, it's more clear to separate
|
||||||
|
them out into individual tests. */
|
||||||
|
|
||||||
/* We always define the remote group to be the same as the
|
if (ompi_comm_rank(comm) == root) {
|
||||||
local group in the case of an intracommunicator, so
|
if (NULL == displs) {
|
||||||
it's safe to get the size of the remote group here for
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
||||||
both intra- and intercommunicators */
|
}
|
||||||
|
|
||||||
size = ompi_comm_remote_size(comm);
|
if (NULL == sendcounts) {
|
||||||
for (i = 0; i < size; ++i) {
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
}
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
|
size = ompi_comm_size(comm);
|
||||||
|
for (i = 0; i < size; ++i) {
|
||||||
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Errors for intercommunicators */
|
/* Errors for intercommunicators */
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (! ((root >= 0 && root < ompi_comm_remote_size(comm)) ||
|
if (! ((root >= 0 && root < ompi_comm_remote_size(comm)) ||
|
||||||
MPI_ROOT == root || MPI_PROC_NULL == root)) {
|
MPI_ROOT == root || MPI_PROC_NULL == root)) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ROOT, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Errors for the receivers */
|
/* Errors for the receivers */
|
||||||
|
|
||||||
if (MPI_ROOT != root && MPI_PROC_NULL != root) {
|
if (MPI_ROOT != root && MPI_PROC_NULL != root) {
|
||||||
if (recvcount < 0) {
|
if (recvcount < 0) {
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MPI_DATATYPE_NULL == recvtype || NULL == recvtype) {
|
/* Errors for the root. Ditto on the comment above -- these
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_TYPE, FUNC_NAME);
|
error checks could have been combined above, but let's
|
||||||
}
|
make the code easier to read. */
|
||||||
}
|
|
||||||
|
|
||||||
/* Errors for the root. Ditto on the comment above -- these
|
else if (MPI_ROOT == root) {
|
||||||
error checks could have been combined above, but let's
|
if (NULL == displs) {
|
||||||
make the code easier to read. */
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
else if (MPI_ROOT == root) {
|
if (NULL == sendcounts) {
|
||||||
if (NULL == displs) {
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (NULL == sendcounts) {
|
size = ompi_comm_remote_size(comm);
|
||||||
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_COUNT, FUNC_NAME);
|
for (i = 0; i < size; ++i) {
|
||||||
|
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
||||||
|
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size = ompi_comm_size(comm);
|
|
||||||
for (i = 0; i < size; ++i) {
|
|
||||||
OMPI_CHECK_DATATYPE_FOR_SEND(err, sendtype, sendcounts[i]);
|
|
||||||
OMPI_ERRHANDLER_CHECK(err, comm, err, FUNC_NAME);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user