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
handle MPI_IN_PLACE for basic reduce
[simgrid.git]
/
src
/
smpi
/
smpi_base.c
diff --git
a/src/smpi/smpi_base.c
b/src/smpi/smpi_base.c
index
e4ab83b
..
84c53dc
100644
(file)
--- a/
src/smpi/smpi_base.c
+++ b/
src/smpi/smpi_base.c
@@
-527,7
+527,12
@@
void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
MPI_Request requests[2];
MPI_Status stats[2];
-
+ int myid=smpi_process_index();
+ if ((dst == myid) && (src == myid)) {
+ smpi_datatype_copy(sendbuf, sendcount, sendtype,
+ recvbuf, recvcount, recvtype);
+ return;
+ }
requests[0] =
smpi_isend_init(sendbuf, sendcount, sendtype, dst, sendtag, comm);
requests[1] =
@@
-1171,24
+1176,29
@@
void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count,
MPI_Request *requests;
void **tmpbufs;
+ char* sendtmpbuf = (char*) sendbuf;
+ if( sendbuf == MPI_IN_PLACE ) {
+ sendtmpbuf = (char *)recvbuf;
+ }
+
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
//non commutative case, use a working algo from openmpi
if(!smpi_op_is_commute(op)){
- smpi_coll_tuned_reduce_ompi_basic_linear(sendbuf, recvbuf, count,
+ smpi_coll_tuned_reduce_ompi_basic_linear(send
tmp
buf, recvbuf, count,
datatype, op, root, comm);
return;
}
if(rank != root) {
// Send buffer to root
- smpi_mpi_send(sendbuf, count, datatype, root, system_tag, comm);
+ smpi_mpi_send(send
tmp
buf, count, datatype, root, system_tag, comm);
} else {
// FIXME: check for errors
smpi_datatype_extent(datatype, &lb, &dataext);
// Local copy from root
- if (sendbuf && recvbuf)
- smpi_datatype_copy(sendbuf, count, datatype, recvbuf, count, datatype);
+ if (send
tmp
buf && recvbuf)
+ smpi_datatype_copy(send
tmp
buf, count, datatype, recvbuf, count, datatype);
// Receive buffers from senders
//TODO: make a MPI_barrier here ?
requests = xbt_new(MPI_Request, size - 1);