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
/
allgatherv-mpich-rdb.c
diff --git
a/src/smpi/colls/allgatherv-mpich-rdb.c
b/src/smpi/colls/allgatherv-mpich-rdb.c
index
8094db0
..
a3614e5
100644
(file)
--- a/
src/smpi/colls/allgatherv-mpich-rdb.c
+++ b/
src/smpi/colls/allgatherv-mpich-rdb.c
@@
-1,3
+1,9
@@
+/* Copyright (c) 2013-2014. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
/* Short or medium size message and power-of-two no. of processes. Use
* recursive doubling algorithm */
#include "colls_private.h"
/* Short or medium size message and power-of-two no. of processes. Use
* recursive doubling algorithm */
#include "colls_private.h"
@@
-11,23
+17,24
@@
int smpi_coll_tuned_allgatherv_mpich_rdb (
MPI_Datatype recvtype,
MPI_Comm comm)
{
MPI_Datatype recvtype,
MPI_Comm comm)
{
- int
comm_size, rank,
j, i;
+ int j, i;
MPI_Status status;
MPI_Aint recvtype_extent, recvtype_true_extent, recvtype_true_lb;
int curr_cnt, dst, total_count;
MPI_Status status;
MPI_Aint recvtype_extent, recvtype_true_extent, recvtype_true_lb;
int curr_cnt, dst, total_count;
- void *tmp_buf;
- int mask, dst_tree_root, my_tree_root, position,
+ void *tmp_buf
, *tmp_buf_rl
;
+
unsigned
int mask, dst_tree_root, my_tree_root, position,
send_offset, recv_offset, last_recv_cnt=0, nprocs_completed, k,
offset, tmp_mask, tree_root;
send_offset, recv_offset, last_recv_cnt=0, nprocs_completed, k,
offset, tmp_mask, tree_root;
- 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);
total_count = 0;
for (i=0; i<comm_size; i++)
total_count += recvcounts[i];
total_count = 0;
for (i=0; i<comm_size; i++)
total_count += recvcounts[i];
- if (total_count == 0) return MPI_ERR_COUNT;
+ if (total_count == 0)
+ return MPI_ERR_COUNT;
recvtype_extent=smpi_datatype_get_extent( recvtype);
recvtype_extent=smpi_datatype_get_extent( recvtype);
@@
-36,14
+43,15
@@
int smpi_coll_tuned_allgatherv_mpich_rdb (
smpi_datatype_extent(recvtype, &recvtype_true_lb, &recvtype_true_extent);
smpi_datatype_extent(recvtype, &recvtype_true_lb, &recvtype_true_extent);
- tmp_buf
= (void*)xbt_malloc(total_count*(max
(recvtype_true_extent,recvtype_extent)));
+ tmp_buf
_rl= (void*)smpi_get_tmp_sendbuffer(total_count*(MAX
(recvtype_true_extent,recvtype_extent)));
/* adjust for potential negative lower bound in datatype */
/* adjust for potential negative lower bound in datatype */
- tmp_buf = (void *)((char*)tmp_buf - recvtype_true_lb);
+ tmp_buf = (void *)((char*)tmp_buf
_rl
- recvtype_true_lb);
/* copy local data into right location in tmp_buf */
position = 0;
/* copy local data into right location in tmp_buf */
position = 0;
- for (i=0; i<rank; i++) position += recvcounts[i];
+ for (i=0; i<rank; i++)
+ position += recvcounts[i];
if (sendbuf != MPI_IN_PLACE)
{
smpi_datatype_copy(sendbuf, sendcount, sendtype,
if (sendbuf != MPI_IN_PLACE)
{
smpi_datatype_copy(sendbuf, sendcount, sendtype,
@@
-203,6
+211,6
@@
int smpi_coll_tuned_allgatherv_mpich_rdb (
position += recvcounts[j];
}
position += recvcounts[j];
}
-
free(tmp_buf
);
+
smpi_free_tmp_buffer(tmp_buf_rl
);
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}