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
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
smpi
/
colls
/
allreduce-mvapich-rs.c
diff --git
a/src/smpi/colls/allreduce-mvapich-rs.c
b/src/smpi/colls/allreduce-mvapich-rs.c
index
352fd25
..
0bd2dbe
100644
(file)
--- a/
src/smpi/colls/allreduce-mvapich-rs.c
+++ b/
src/smpi/colls/allreduce-mvapich-rs.c
@@
-20,21
+20,22
@@
* copyright file COPYRIGHT in the top level MVAPICH2 directory.
*
*/
* copyright file COPYRIGHT in the top level MVAPICH2 directory.
*
*/
-
-
#include "colls_private.h"
-
-
int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
-
void *recvbuf,
-
int count,
-
MPI_Datatype datatype,
-
MPI_Op op, MPI_Comm comm)
+
+#include "colls_private.h"
+
+int smpi_coll_tuned_allreduce_mvapich2_rs(void *sendbuf,
+ void *recvbuf,
+ int count,
+ MPI_Datatype datatype,
+ MPI_Op op, MPI_Comm comm)
{
{
- int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
int mpi_errno = MPI_SUCCESS;
- int mask, dst, is_commutative, pof2, newrank = 0, rem, newdst, i,
+ int newrank = 0;
+ unsigned int mask, pof2;
+ int dst, is_commutative, rem, newdst, i,
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint true_lb, true_extent, extent;
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint true_lb, true_extent, extent;
- void *tmp_buf;
+ void *tmp_buf
, *tmp_buf_free
;
if (count == 0) {
return MPI_SUCCESS;
if (count == 0) {
return MPI_SUCCESS;
@@
-42,8
+43,8
@@
/* homogeneous */
/* homogeneous */
- comm_size = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+
unsigned int
comm_size = smpi_comm_size(comm);
+
unsigned int
rank = smpi_comm_rank(comm);
is_commutative = smpi_op_is_commute(op);
is_commutative = smpi_op_is_commute(op);
@@
-51,10
+52,10
@@
smpi_datatype_extent(datatype, &true_lb, &true_extent);
extent = smpi_datatype_get_extent(datatype);
smpi_datatype_extent(datatype, &true_lb, &true_extent);
extent = smpi_datatype_get_extent(datatype);
- tmp_buf
= xbt_malloc
(count * (MAX(extent, true_extent)));
+ tmp_buf
_free= smpi_get_tmp_recvbuffer
(count * (MAX(extent, true_extent)));
/* adjust for potential negative lower bound in datatype */
/* adjust for potential negative lower bound in datatype */
- tmp_buf = (void *) ((char *) tmp_buf - true_lb);
+ tmp_buf = (void *) ((char *) tmp_buf
_free
- true_lb);
/* copy local data into recvbuf */
if (sendbuf != MPI_IN_PLACE) {
/* copy local data into recvbuf */
if (sendbuf != MPI_IN_PLACE) {
@@
-263,6
+264,8
@@
mask >>= 1;
}
mask >>= 1;
}
+ xbt_free(disps);
+ xbt_free(cnts);
}
}
}
}
@@
-281,7
+284,7
@@
MPI_STATUS_IGNORE);
}
}
MPI_STATUS_IGNORE);
}
}
-
+ smpi_free_tmp_buffer(tmp_buf_free);
return (mpi_errno);
}
return (mpi_errno);
}