{
MPI_Aint extent;
- int i, src, dst, rank, num_procs;
+ unsigned int i, src, dst;
int tag = COLL_TAG_ALLGATHER;
MPI_Status status;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
- rank = smpi_comm_rank(comm);
- num_procs = smpi_comm_size(comm);
+ unsigned int rank = smpi_comm_rank(comm);
+ unsigned int num_procs = smpi_comm_size(comm);
if((num_procs&(num_procs-1)))
THROWF(arg_error,0, "allgather pair algorithm can't be used with non power of two number of processes ! ");
MPI_Aint send_chunk, recv_chunk;
// local int variables
- int i, j, k, dst, rank, num_procs, send_offset, recv_offset, tree_root;
+ unsigned int i, j, k, dst, send_offset, recv_offset, tree_root;
int dst_tree_root, rank_tree_root, last_recv_count = 0, num_procs_completed;
int offset, tmp_mask;
int tag = COLL_TAG_ALLGATHER;
char *recv_ptr = (char *) rbuf;
// get size of the communicator, followed by rank
- num_procs = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+ unsigned int num_procs = smpi_comm_size(comm);
+ unsigned int rank = smpi_comm_rank(comm);
// get size of single element's type for send buffer and recv buffer
send_chunk = smpi_datatype_get_extent(send_type);
// local int variables
int i, dst, send_base_offset, recv_base_offset, send_chunk, recv_chunk,
send_offset, recv_offset;
- int rank, num_procs;
int tag = COLL_TAG_ALLGATHER;
int mask;
int curr_count;
// get size of the communicator, followed by rank
- num_procs = smpi_comm_size(comm);
+ unsigned int num_procs = smpi_comm_size(comm);
if((num_procs&(num_procs-1)))
THROWF(arg_error,0, "allgather rhv algorithm can't be used with non power of two number of processes ! ");
- rank = smpi_comm_rank(comm);
+ unsigned int rank = smpi_comm_rank(comm);
// get size of single element's type for send buffer and recv buffer
s_extent = smpi_datatype_get_extent(send_type);
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;
void *tmp_buf, *tmp_buf_rl;
- int mask, dst_tree_root, my_tree_root, position,
+ 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;
- 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];
- if (total_count == 0) return MPI_ERR_COUNT;
+ if (total_count == 0)
+ return MPI_ERR_COUNT;
recvtype_extent=smpi_datatype_get_extent( recvtype);
/* 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,
MPI_Datatype rdtype,
MPI_Comm comm)
{
- int rank, size;
- int sendto, recvfrom, distance, blockcount, i;
+ int sendto, recvfrom, blockcount, i;
+ unsigned int distance;
int *new_rcounts = NULL, *new_rdispls = NULL;
int *new_scounts = NULL, *new_sdispls = NULL;
ptrdiff_t slb, rlb, sext, rext;
char *tmpsend = NULL, *tmprecv = NULL;
MPI_Datatype new_rdtype = MPI_DATATYPE_NULL, new_sdtype = MPI_DATATYPE_NULL;
- size = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+ unsigned int size = smpi_comm_size(comm);
+ unsigned int rank = smpi_comm_rank(comm);
XBT_DEBUG(
"coll:tuned:allgather_ompi_bruck rank %d", rank);
{
MPI_Aint extent;
- int i, src, dst, rank, num_procs;
+ unsigned int i, src, dst;
int tag = COLL_TAG_ALLGATHERV;
MPI_Status status;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
- rank = smpi_comm_rank(comm);
- num_procs = smpi_comm_size(comm);
+ unsigned int rank = smpi_comm_rank(comm);
+ unsigned int num_procs = smpi_comm_size(comm);
if((num_procs&(num_procs-1)))
THROWF(arg_error,0, "allgatherv pair algorithm can't be used with non power of two number of processes ! ");
* 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 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;
void *tmp_buf, *tmp_buf_free;
/* 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);
*
*/
- #define COLL_TUNED_COMPUTED_SEGCOUNT(SEGSIZE, TYPELNG, SEGCOUNT) \
+#define COLL_TUNED_COMPUTED_SEGCOUNT(SEGSIZE, TYPELNG, SEGCOUNT) \
if( ((SEGSIZE) >= (TYPELNG)) && \
((SEGSIZE) < ((TYPELNG) * (SEGCOUNT))) ) { \
size_t residual; \
if (0 != SPLIT_INDEX) { \
EARLY_BLOCK_COUNT = EARLY_BLOCK_COUNT + 1; \
} \
-
- #include "colls_private.h"
+
+#include "colls_private.h"
int
smpi_coll_tuned_allreduce_ompi_ring_segmented(void *sbuf, void *rbuf, int count,
MPI_Datatype dtype,
{
int ret = MPI_SUCCESS;
int line;
- int rank, size, k, recv_from, send_to;
+ int k, recv_from, send_to;
int early_blockcount, late_blockcount, split_rank;
int segcount, max_segcount;
int num_phases, phase;
- int block_count, inbi;
+ int block_count;
+ unsigned int inbi;
size_t typelng;
char *tmpsend = NULL, *tmprecv = NULL;
char *inbuf[2] = {NULL, NULL};
ptrdiff_t block_offset, max_real_segsize;
MPI_Request reqs[2] = {NULL, NULL};
const size_t segsize = 1 << 20; /* 1 MB */
- size = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+ unsigned int size = smpi_comm_size(comm);
+ unsigned int rank = smpi_comm_rank(comm);
XBT_DEBUG("coll:tuned:allreduce_intra_ring_segmented rank %d, count %d", rank, count);
MPI_Datatype dtype, MPI_Op op,
MPI_Comm comm)
{
- int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
- int mask, dst, pof2, newrank, rem, newdst, i,
+ int tag = COLL_TAG_ALLREDUCE;
+ unsigned int mask, pof2;
+ int dst, newrank, rem, newdst, i,
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint extent;
MPI_Status status;
void *tmp_buf = NULL;
- nprocs = smpi_comm_size(comm);
- rank = smpi_comm_rank(comm);
+ unsigned int nprocs = smpi_comm_size(comm);
+ unsigned int rank = smpi_comm_rank(comm);
extent = smpi_datatype_get_extent(dtype);
tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
{
MPI_Status status;
MPI_Aint extent;
- int tag = COLL_TAG_ALLREDUCE, rank, nprocs, send_size, newcnt, share;
- int pof2 = 1, mask, send_idx, recv_idx, dst, send_cnt, recv_cnt;
+ int tag = COLL_TAG_ALLREDUCE, send_size, newcnt, share;
+ unsigned int pof2 = 1, mask;
+ int send_idx, recv_idx, dst, send_cnt, recv_cnt;
void *recv, *tmp_buf;
- rank = smpi_comm_rank(comm);
- nprocs = smpi_comm_size(comm);
+ unsigned int rank = smpi_comm_rank(comm);
+ unsigned int nprocs = smpi_comm_size(comm);
if((nprocs&(nprocs-1)))
THROWF(arg_error,0, "allreduce rab1 algorithm can't be used with non power of two number of processes ! ");