A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MPI_Iallreduce
[simgrid.git]
/
src
/
smpi
/
bindings
/
smpi_pmpi_coll.cpp
diff --git
a/src/smpi/bindings/smpi_pmpi_coll.cpp
b/src/smpi/bindings/smpi_pmpi_coll.cpp
index
5f71a34
..
cc86aec
100644
(file)
--- a/
src/smpi/bindings/smpi_pmpi_coll.cpp
+++ b/
src/smpi/bindings/smpi_pmpi_coll.cpp
@@
-389,6
+389,11
@@
int PMPI_Iscatterv(void *sendbuf, int *sendcounts, int *displs,
}
int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
}
int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
+{
+ return PMPI_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* request)
{
int retval = 0;
{
int retval = 0;
@@
-401,12
+406,15
@@
int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
} else {
int rank = simgrid::s4u::this_actor::get_pid();
} else {
int rank = simgrid::s4u::this_actor::get_pid();
- TRACE_smpi_comm_in(rank,
__func__
,
- new simgrid::instr::CollTIData(
"
reduce", root, 0,
+ TRACE_smpi_comm_in(rank,
request==MPI_REQUEST_IGNORED ? "PMPI_Reduce":"PMPI_Ireduce"
,
+ new simgrid::instr::CollTIData(
request==MPI_REQUEST_IGNORED ? "reduce":"i
reduce", root, 0,
datatype->is_replayable() ? count : count * datatype->size(), -1,
simgrid::smpi::Datatype::encode(datatype), ""));
datatype->is_replayable() ? count : count * datatype->size(), -1,
simgrid::smpi::Datatype::encode(datatype), ""));
+ if(request == MPI_REQUEST_IGNORED)
+ simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
+ else
+ simgrid::smpi::Colls::ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request);
- simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
retval = MPI_SUCCESS;
TRACE_smpi_comm_out(rank);
retval = MPI_SUCCESS;
TRACE_smpi_comm_out(rank);
@@
-447,11
+455,7
@@
int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
- } else if (request != MPI_REQUEST_IGNORED) {
- xbt_die("Iallreduce is not yet implemented. WIP");
- retval = MPI_ERR_ARG;
} else {
} else {
-
char* sendtmpbuf = static_cast<char*>(sendbuf);
if( sendbuf == MPI_IN_PLACE ) {
sendtmpbuf = static_cast<char*>(xbt_malloc(count*datatype->get_extent()));
char* sendtmpbuf = static_cast<char*>(sendbuf);
if( sendbuf == MPI_IN_PLACE ) {
sendtmpbuf = static_cast<char*>(xbt_malloc(count*datatype->get_extent()));
@@
-464,10
+468,10
@@
int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty
datatype->is_replayable() ? count : count * datatype->size(), -1,
simgrid::smpi::Datatype::encode(datatype), ""));
datatype->is_replayable() ? count : count * datatype->size(), -1,
simgrid::smpi::Datatype::encode(datatype), ""));
-
//
if(request == MPI_REQUEST_IGNORED)
+ if(request == MPI_REQUEST_IGNORED)
simgrid::smpi::Colls::allreduce(sendtmpbuf, recvbuf, count, datatype, op, comm);
simgrid::smpi::Colls::allreduce(sendtmpbuf, recvbuf, count, datatype, op, comm);
-
//
else
-
//
simgrid::smpi::Colls::iallreduce(sendtmpbuf, recvbuf, count, datatype, op, comm, request);
+ else
+ simgrid::smpi::Colls::iallreduce(sendtmpbuf, recvbuf, count, datatype, op, comm, request);
if( sendbuf == MPI_IN_PLACE )
xbt_free(sendtmpbuf);
if( sendbuf == MPI_IN_PLACE )
xbt_free(sendtmpbuf);