* Function: is_2dmesh
- * Return: int
+ * Return: bool
* Inputs:
num: the number of processors in a communicator
****************************************************************************/
#ifndef TWOD
#define TWOD
-static int is_2dmesh(int num, int *i, int *j)
+static bool is_2dmesh(int num, int* i, int* j)
{
int x, max = num / 2;
x = sqrt(double(num));
*j = x;
}
- return 1;
+ return true;
}
x++;
}
- return 0;
+ return false;
}
#endif
/*****************************************************************************
*****************************************************************************/
/*****************************************************************************
- * Function: is_2dmesh
- * return: int
+ * Function: is_3dmesh
+ * return: bool
* num: the number of processors in a communicator
* i: x dimension
* j: y dimension
****************************************************************************/
#ifndef THREED
#define THREED
-static int is_3dmesh(int num, int *i, int *j, int *k)
+static bool is_3dmesh(int num, int* i, int* j, int* k)
{
int x, max = num / 3;
x = cbrt(num);
if ((num % (x * x)) == 0) {
*i = *j = x;
*k = num / (x * x);
- return 1;
+ return true;
}
x++;
}
- return 0;
+ return false;
}
#endif
/*****************************************************************************
int mpi_errno = MPI_SUCCESS;
int newrank = 0;
int mask, pof2, i, send_idx, recv_idx, last_idx, send_cnt;
- int dst, is_commutative, rem, newdst, recv_cnt;
+ int dst, rem, newdst, recv_cnt;
MPI_Aint true_lb, true_extent, extent;
if (count == 0) {
int comm_size = comm->size();
int rank = comm->rank();
- is_commutative = (op==MPI_OP_NULL || op->is_commutative());
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
/* need to allocate temporary buffer to store incoming data */
datatype->extent(&true_lb, &true_extent);
num_procs = comm->size();
send_chunk = send_type->get_extent();
recv_chunk = recv_type->get_extent();
- int pof2 = ((num_procs != 0) && ((num_procs & (~num_procs + 1)) == num_procs));
+ bool pof2 = ((num_procs != 0) && ((num_procs & (~num_procs + 1)) == num_procs));
for (i = 0; i < num_procs; i++) {
- if (pof2 == 1) {
+ if (pof2) {
/* use exclusive-or algorithm */
src = dst = rank ^ i;
} else {
{
int mpi_errno = MPI_SUCCESS;
int comm_size;
- int two_level_bcast = 1;
+ bool two_level_bcast = true;
size_t nbytes = 0;
- int is_homogeneous, is_contig;
+ bool is_homogeneous, is_contig;
MPI_Aint type_size;
unsigned char* tmp_buf = nullptr;
MPI_Comm shmem_comm;
// rank = comm->rank();
/*
if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN)*/
- is_contig = 1;
+ is_contig = true;
/* else {
MPID_Datatype_get_ptr(datatype, dtp);
is_contig = dtp->is_contig;
}
*/
- is_homogeneous = 1;
+ is_homogeneous = true;
#ifdef MPID_HAS_HETERO
if (comm_ptr->is_hetero)
- is_homogeneous = 0;
+ is_homogeneous = false;
#endif
/* MPI_Type_size() might not give the accurate size of the packed
nbytes = (size_t) (count) * (type_size);
if (comm_size <= mv2_bcast_two_level_system_size) {
if (nbytes > mv2_bcast_short_msg && nbytes < mv2_bcast_large_msg) {
- two_level_bcast = 1;
+ two_level_bcast = true;
} else {
- two_level_bcast = 0;
+ two_level_bcast = false;
}
}
- if (two_level_bcast == 1
+ if (two_level_bcast
#if defined(_MCST_SUPPORT_)
|| comm_ptr->ch.is_mcast_ok
#endif
int relative_rank, mask;
int mpi_errno = MPI_SUCCESS;
int scatter_size, curr_size, recv_size = 0;
- int j, k, i, tmp_mask, is_contig, is_homogeneous;
+ int j, k, i, tmp_mask;
+ bool is_contig, is_homogeneous;
MPI_Aint type_size = 0, nbytes = 0;
int relative_dst, dst_tree_root, my_tree_root, send_offset;
int recv_offset, tree_root, nprocs_completed, offset;
if (comm_size == 1) goto fn_exit;
//if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN)
- if(datatype->flags() & DT_FLAG_CONTIGUOUS)
- is_contig = 1;
- else {
- is_contig = 0;
- }
+ is_contig = ((datatype->flags() & DT_FLAG_CONTIGUOUS) != 0);
- is_homogeneous = 1;
+ is_homogeneous = true;
/* MPI_Type_size() might not give the accurate size of the packed
* datatype for heterogeneous systems (because of padding, encoding,
extern MV2_Gather_function_ptr MV2_Gather_inter_leader_function;
extern MV2_Gather_function_ptr MV2_Gather_intra_node_function;
-#define TEMP_BUF_HAS_NO_DATA (0)
-#define TEMP_BUF_HAS_DATA (1)
-
+#define TEMP_BUF_HAS_NO_DATA (false)
+#define TEMP_BUF_HAS_DATA (true)
namespace simgrid{
namespace smpi{
* intra node gather function
* errflag - (out) to record errors
*/
-static int MPIR_pt_pt_intra_gather( const void *sendbuf, int sendcnt, MPI_Datatype sendtype,
- void *recvbuf, int recvcnt, MPI_Datatype recvtype,
- int root, int rank,
- void *tmp_buf, int nbytes,
- int is_data_avail,
- MPI_Comm comm,
- MV2_Gather_function_ptr intra_node_fn_ptr)
+static int MPIR_pt_pt_intra_gather(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
+ MPI_Datatype recvtype, int root, int rank, void* tmp_buf, int nbytes,
+ bool is_data_avail, MPI_Comm comm, MV2_Gather_function_ptr intra_node_fn_ptr)
{
int mpi_errno = MPI_SUCCESS;
MPI_Aint recvtype_extent = 0; /* Datatype extent */
extent = datatype->get_extent();
unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
- int is_commutative = (op==MPI_OP_NULL || op->is_commutative());
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
mask = 1;
int lroot;
MPI_Comm comm)
{
int mpi_errno = MPI_SUCCESS;
- int rank, is_commutative;
+ int rank;
int src, k;
MPI_Request send_request;
int index=0;
datatype->extent(&true_lb, &true_extent);
extent = datatype->get_extent();
- is_commutative = (op==MPI_OP_NULL || op->is_commutative());
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
if (rank != root) {
recvbuf = (void*)smpi_get_tmp_recvbuffer(count * std::max(extent, true_extent));
const unsigned char* in_buf = nullptr;
unsigned char *out_buf = nullptr, *tmp_buf = nullptr;
MPI_Aint true_lb, true_extent, extent;
- int is_commutative = 0, stride = 0;
+ int stride = 0;
int intra_node_root=0;
//if not set (use of the algo directly, without mvapich2 selector)
leader_of_root = comm->group()->rank(leaders_map[root]);
leader_root = leader_comm->group()->rank(leaders_map[root]);
- is_commutative= (op==MPI_OP_NULL || op->is_commutative());
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
datatype->extent(&true_lb,
&true_extent);
if (local_size == total_size) {
/* First handle the case where there is only one node */
- if (stride <= MV2_INTRA_SHMEM_REDUCE_MSG &&
- is_commutative == 1) {
+ if (stride <= MV2_INTRA_SHMEM_REDUCE_MSG && is_commutative) {
if (local_rank == 0 ) {
tmp_buf = smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
tmp_buf = tmp_buf - true_lb;
*this step*/
if (MV2_Reduce_intra_function == & MPIR_Reduce_shmem_MV2)
{
- if (is_commutative == 1 && (count * (std::max(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE)) {
+ if (is_commutative && (count * (std::max(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE)) {
mpi_errno = MV2_Reduce_intra_function(in_buf, out_buf, count, datatype, op, intra_node_root, shmem_comm);
} else {
mpi_errno = MPIR_Reduce_intra_knomial_wrapper_MV2(in_buf, out_buf, count,
REDUCE_LIMITS
namespace simgrid{
namespace smpi{
-static int MPI_I_anyReduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, int is_all)
+static int MPI_I_anyReduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op,
+ int root, MPI_Comm comm, bool is_all)
{
char *scr1buf, *scr2buf, *scr3buf, *xxx, *sendbuf, *recvbuf;
int myrank, size, x_base, x_size, computed, idx;
int reduce__rab(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
{
- return( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, root, comm, 0) );
+ return MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, root, comm, false);
}
int allreduce__rab(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
- return( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, -1, comm, 1) );
+ return MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, -1, comm, true);
}
}
}
unsigned char* tmp_recvbuf;
int mpi_errno = MPI_SUCCESS;
int total_count, dst, src;
- int is_commutative;
comm_size = comm->size();
rank = comm->rank();
extent =datatype->get_extent();
datatype->extent(&true_lb, &true_extent);
- if (op->is_commutative()) {
- is_commutative = 1;
- }
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
int* disps = new int[comm_size];
int mask, dst_tree_root, my_tree_root, j, k;
int received;
MPI_Datatype sendtype, recvtype;
- int nprocs_completed, tmp_mask, tree_root, is_commutative=0;
+ int nprocs_completed, tmp_mask, tree_root;
comm_size = comm->size();
rank = comm->rank();
extent =datatype->get_extent();
datatype->extent(&true_lb, &true_extent);
- if ((op==MPI_OP_NULL) || op->is_commutative()) {
- is_commutative = 1;
- }
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
int* disps = new int[comm_size];
if( (op==MPI_OP_NULL || op->is_commutative()) && total_message_size > 524288) {
return reduce_scatter__mpich_pair(sbuf, rbuf, rcounts, dtype, op, comm);
} else if ((op != MPI_OP_NULL && not op->is_commutative())) {
- int is_block_regular = 1;
+ bool is_block_regular = true;
for (i = 0; i < (comm_size - 1); ++i) {
if (rcounts[i] != rcounts[i + 1]) {
- is_block_regular = 0;
+ is_block_regular = false;
break;
}
}
int mpi_errno = MPI_SUCCESS;
long nbytes = 0, comm_size, recvtype_size;
int range = 0;
- int partial_sub_ok = 0;
+ bool partial_sub_ok = false;
int conf_index = 0;
int range_threshold = 0;
- int is_two_level = 0;
MPI_Comm shmem_comm;
//MPI_Comm *shmem_commptr=NULL;
/* Get the size of the communicator */
do {
if (local_size == mv2_allgather_table_ppn_conf[i]) {
conf_index = i;
- partial_sub_ok = 1;
+ partial_sub_ok = true;
break;
}
i++;
} while(i < mv2_allgather_num_ppn_conf);
}
conf_check_end:
- if (partial_sub_ok != 1) {
+ if (not partial_sub_ok) {
conf_index = 0;
}
mv2_allgather_thresholds_table[conf_index][range].inter_leader[range_threshold].
MV2_pt_Allgatherction;
- is_two_level = mv2_allgather_thresholds_table[conf_index][range].two_level[range_threshold];
+ bool is_two_level = mv2_allgather_thresholds_table[conf_index][range].two_level[range_threshold];
/* intracommunicator */
- if(is_two_level ==1){
- if(partial_sub_ok ==1){
+ if (is_two_level) {
+ if (partial_sub_ok) {
if (comm->is_blocked()){
mpi_errno = MPIR_2lvl_Allgather_MV2(sendbuf, sendcount, sendtype,
recvbuf, recvcount, recvtype,
MPI_Aint sendtype_size = 0;
long nbytes = 0;
- int is_commutative = 0;
MPI_Aint true_lb, true_extent;
sendtype_size=datatype->size();
nbytes = count * sendtype_size;
datatype->extent(&true_lb, &true_extent);
- is_commutative = op->is_commutative();
+ bool is_commutative = op->is_commutative();
{
int range = 0, range_threshold = 0, range_threshold_intra = 0;
- int is_two_level = 0;
+ bool is_two_level = false;
/* Search for the corresponding system size inside the tuning table */
while ((range < (mv2_size_allreduce_tuning_table - 1)) &&
}
/* Search for corresponding inter-leader function */
/* skip mcast pointers if mcast is not available */
- if(mv2_allreduce_thresholds_table[range].mcast_enabled != 1){
+ if (not mv2_allreduce_thresholds_table[range].mcast_enabled) {
while ((range_threshold < (mv2_allreduce_thresholds_table[range].size_inter_table - 1))
&& ((mv2_allreduce_thresholds_table[range].
inter_leader[range_threshold].MV2_pt_Allreducection
&& (mv2_allreduce_thresholds_table[range].inter_leader[range_threshold].max != -1)) {
range_threshold++;
}
- if(mv2_allreduce_thresholds_table[range].is_two_level_allreduce[range_threshold] == 1){
- is_two_level = 1;
+ if (mv2_allreduce_thresholds_table[range].is_two_level_allreduce[range_threshold]) {
+ is_two_level = true;
}
/* Search for corresponding intra-node function */
while ((range_threshold_intra <
{
MV2_Allreducection = &MPIR_Allreduce_pt2pt_rd_MV2;
}
- if(is_two_level != 1) {
+ if (not is_two_level) {
MV2_Allreducection = &MPIR_Allreduce_pt2pt_rd_MV2;
}
}
- if(is_two_level == 1){
- // check if shm is ready, if not use other algorithm first
- if (is_commutative) {
+ if (is_two_level) {
+ // check if shm is ready, if not use other algorithm first
+ if (is_commutative) {
if(comm->get_leaders_comm()==MPI_COMM_NULL){
comm->init_smp();
}
mpi_errno = MPIR_Allreduce_two_level_MV2(sendbuf, recvbuf, count,
datatype, op, comm);
- } else {
+ } else {
mpi_errno = MPIR_Allreduce_pt2pt_rd_MV2(sendbuf, recvbuf, count,
datatype, op, comm);
- }
+ }
} else {
mpi_errno = MV2_Allreducection(sendbuf, recvbuf, count,
datatype, op, comm);
{
int mpi_errno = MPI_SUCCESS;
int comm_size/*, rank*/;
- int two_level_bcast = 1;
+ bool two_level_bcast = true;
long nbytes = 0;
int range = 0;
int range_threshold = 0;
int range_threshold_intra = 0;
- // int is_homogeneous, is_contig;
MPI_Aint type_size;
//, position;
// unsigned char *tmp_buf = NULL;
comm_size = comm->size();
//rank = comm->rank();
- //is_contig=1;
+ // bool is_contig = true;
/* if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN)*/
-/* is_contig = 1;*/
+/* is_contig = true;*/
/* else {*/
/* MPID_Datatype_get_ptr(datatype, dtp);*/
/* is_contig = dtp->is_contig;*/
/* }*/
- // is_homogeneous = 1;
+ // bool is_homogeneous = true;
/* MPI_Type_size() might not give the accurate size of the packed
* datatype for heterogeneous systems (because of padding, encoding,
#else
mv2_bcast_thresholds_table[range].is_two_level_bcast[range_threshold];
#endif
- if (two_level_bcast == 1) {
+ if (two_level_bcast) {
// if (not is_contig || not is_homogeneous) {
// tmp_buf = smpi_get_tmp_sendbuffer(nbytes);
int range = 0;
int range_threshold = 0;
int range_intra_threshold = 0;
- int is_commutative, pof2;
+ int pof2;
int comm_size = 0;
long nbytes = 0;
int sendtype_size;
- int is_two_level = 0;
+ bool is_two_level = false;
comm_size = comm->size();
sendtype_size=datatype->size();
if (count == 0)
return MPI_SUCCESS;
- is_commutative = (op==MPI_OP_NULL || op->is_commutative());
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
/* find nearest power-of-two less than or equal to comm_size */
for( pof2 = 1; pof2 <= comm_size; pof2 <<= 1 );
{
mv2_reduce_inter_knomial_factor = mv2_reduce_thresholds_table[range].inter_k_degree;
}
- if(mv2_reduce_thresholds_table[range].is_two_level_reduce[range_threshold] == 1){
- is_two_level = 1;
+ if (mv2_reduce_thresholds_table[range].is_two_level_reduce[range_threshold]) {
+ is_two_level = true;
}
/* We call Reduce function */
- if(is_two_level == 1)
- {
- if (is_commutative == 1) {
+ if (is_two_level) {
+ if (is_commutative) {
if(comm->get_leaders_comm()==MPI_COMM_NULL){
comm->init_smp();
}
mpi_errno = MPIR_Reduce_two_level_helper_MV2(sendbuf, recvbuf, count,
datatype, op, root, comm);
- } else {
+ } else {
mpi_errno = MPIR_Reduce_binomial_MV2(sendbuf, recvbuf, count,
datatype, op, root, comm);
- }
+ }
} else if(MV2_Reduce_function == &MPIR_Reduce_inter_knomial_wrapper_MV2 ){
- if(is_commutative ==1)
+ if (is_commutative)
{
mpi_errno = MV2_Reduce_function(sendbuf, recvbuf, count,
datatype, op, root, comm);
int mpi_errno = MPI_SUCCESS;
int i = 0, comm_size = comm->size(), total_count = 0, type_size =
0, nbytes = 0;
- int is_commutative = 0;
int* disps = new int[comm_size];
if(mv2_red_scat_thresholds_table==NULL)
init_mv2_reduce_scatter_tables_stampede();
- is_commutative=(op==MPI_OP_NULL || op->is_commutative());
+ bool is_commutative = (op == MPI_OP_NULL || op->is_commutative());
for (i = 0; i < comm_size; i++) {
disps[i] = total_count;
total_count += recvcnts[i];
recvcnts, datatype,
op, comm);
} else {
- int is_block_regular = 1;
+ bool is_block_regular = true;
for (i = 0; i < (comm_size - 1); ++i) {
if (recvcnts[i] != recvcnts[i+1]) {
- is_block_regular = 0;
+ is_block_regular = false;
break;
}
}
int mpi_errno = MPI_SUCCESS;
// int mpi_errno_ret = MPI_SUCCESS;
int rank, nbytes, comm_size;
- int partial_sub_ok = 0;
+ bool partial_sub_ok = false;
int conf_index = 0;
MPI_Comm shmem_comm;
// MPID_Comm *shmem_commptr=NULL;
do {
if (local_size == mv2_scatter_table_ppn_conf[i]) {
conf_index = i;
- partial_sub_ok = 1;
+ partial_sub_ok = true;
break;
}
i++;
}
}
- if (partial_sub_ok != 1) {
+ if (not partial_sub_ok) {
conf_index = 0;
}
struct mv2_allgather_tuning_table {
int numproc;
- int two_level[MV2_MAX_NB_THRESHOLDS];
+ bool two_level[MV2_MAX_NB_THRESHOLDS];
int size_inter_table;
mv2_allgather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
};
mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_1ppn[] = {
{
2,
- {0},
+ {false},
1,
{
{0, -1, &MPIR_Allgather_Ring_MV2},
},
{
4,
- {0, 0},
+ {false, false},
2,
{
{0, 262144, &MPIR_Allgather_RD_MV2}, {262144, -1, &MPIR_Allgather_Ring_MV2},
},
{
8,
- {0, 0},
+ {false, false},
2,
{
{0, 131072, &MPIR_Allgather_RD_MV2}, {131072, -1, &MPIR_Allgather_Ring_MV2},
},
{
16,
- {0, 0},
+ {false, false},
2,
{
{0, 131072, &MPIR_Allgather_RD_MV2}, {131072, -1, &MPIR_Allgather_Ring_MV2},
},
{
32,
- {0, 0},
+ {false, false},
2,
{
{0, 65536, &MPIR_Allgather_RD_MV2}, {65536, -1, &MPIR_Allgather_Ring_MV2},
},
{
64,
- {0, 0},
+ {false, false},
2,
{
{0, 32768, &MPIR_Allgather_RD_MV2}, {32768, -1, &MPIR_Allgather_Ring_MV2},
mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_2ppn[] = {
{
4,
- {0, 0},
+ {false, false},
2,
{
{0, 524288, &MPIR_Allgather_RD_MV2}, {524288, -1, &MPIR_Allgather_Ring_MV2},
},
{
8,
- {0, 1, 0},
+ {false, true, false},
2,
{
{0, 32768, &MPIR_Allgather_RD_MV2},
},
{
16,
- {0, 1, 0},
+ {false, true, false},
2,
{
{0, 16384, &MPIR_Allgather_RD_MV2},
},
{
32,
- {1, 1, 0},
+ {true, true, false},
2,
{
{0, 65536, &MPIR_Allgather_RD_MV2},
},
{
64,
- {1, 1, 0},
+ {true, true, false},
2,
{
{0, 32768, &MPIR_Allgather_RD_MV2},
},
{
128,
- {1, 1, 0},
+ {true, true, false},
2,
{
{0, 65536, &MPIR_Allgather_RD_MV2},
mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_16ppn[] = {
{
16,
- {0, 0},
+ {false, false},
2,
{
{0, 1024, &MPIR_Allgather_RD_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
},
{
32,
- {0, 0},
+ {false, false},
2,
{
{0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
},
{
64,
- {0, 0},
+ {false, false},
2,
{
{0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
},
{
128,
- {0, 0},
+ {false, false},
2,
{
{0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
},
{
256,
- {0, 0},
+ {false, false},
2,
{
{0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
},
{
512,
- {0, 0},
+ {false, false},
2,
{
{0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
struct mv2_allreduce_tuning_table {
int numproc;
- int mcast_enabled;
- int is_two_level_allreduce[MV2_MAX_NB_THRESHOLDS];
+ bool mcast_enabled;
+ bool is_two_level_allreduce[MV2_MAX_NB_THRESHOLDS];
int size_inter_table;
mv2_allreduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
int size_intra_table;
mv2_allreduce_tuning_table mv2_tmp_allreduce_thresholds_table[] = {
{
16,
- 0,
- {1, 0},
+ false,
+ {true, false},
2,
{
{0, 1024, &MPIR_Allreduce_pt2pt_rd_MV2}, {1024, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
},
{
32,
- 0,
- {1, 1, 0},
+ false,
+ {true, true, false},
3,
{
{0, 1024, &MPIR_Allreduce_pt2pt_rd_MV2},
},
{
64,
- 0,
- {1, 1, 0},
+ false,
+ {true, true, false},
3,
{
{0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
},
{
128,
- 0,
- {1, 1, 0},
+ false,
+ {true, true, false},
3,
{
{0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
},
{
256,
- 0,
- {1, 1, 0},
+ false,
+ {true, true, false},
3,
{
{0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
},
{
512,
- 0,
- {1, 1, 0},
+ false,
+ {true, true, false},
3,
{
{0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
},
{
1024,
- 0,
- {1, 1, 1, 0},
+ false,
+ {true, true, true, false},
4,
{
{0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
},
{
2048,
- 0,
- {1, 1, 1, 0},
+ false,
+ {true, true, true, false},
4,
{
{0, 64, &MPIR_Allreduce_pt2pt_rd_MV2},
int bcast_segment_size;
int intra_node_knomial_factor;
int inter_node_knomial_factor;
- int is_two_level_bcast[MV2_MAX_NB_THRESHOLDS];
+ bool is_two_level_bcast[MV2_MAX_NB_THRESHOLDS];
int size_inter_table;
mv2_bcast_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
int size_intra_table;
8192,
4,
4,
- {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+ {true, true, true, true, true, true, true, true, true, true, true},
11,
{{0, 8, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
{8, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
8192,
4,
4,
- {1, 1, 1, 1, 1, 1, 1, 1},
+ {true, true, true, true, true, true, true, true},
8,
{{0, 128, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
{128, 256, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
8192,
4,
4,
- {1, 1, 1, 1, 1, 1, 1, 1, 1},
+ {true, true, true, true, true, true, true, true, true},
9,
{{0, 2, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
{2, 4, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
8192,
4,
4,
- {1, 1, 1, 0},
+ {true, true, true, false},
4,
{{0, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
{8192, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
8192,
4,
4,
- {1, 1, 1, 1, 1},
+ {true, true, true, true, true},
5,
{{0, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
{16384, 131072, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
8192,
4,
4,
- {1, 1, 1, 1, 1},
+ {true, true, true, true, true},
5,
{{0, 4096, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
{4096, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
8192,
4,
4,
- {1, 1, 1, 1, 1},
+ {true, true, true, true, true},
5,
{{0, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
{8192, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
8192,
4,
4,
- {1, 1, 1, 1, 1, 1, 1},
+ {true, true, true, true, true, true, true},
7,
{{0, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
{16, 32, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
int numproc;
int inter_k_degree;
int intra_k_degree;
- int is_two_level_reduce[MV2_MAX_NB_THRESHOLDS];
+ bool is_two_level_reduce[MV2_MAX_NB_THRESHOLDS];
int size_inter_table;
mv2_reduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
int size_intra_table;
16,
4,
4,
- {1, 0, 0},
+ {true, false, false},
3,
{
{0, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
32,
4,
4,
- {1, 1, 1, 1, 0, 0, 0},
+ {true, true, true, true, false, false, false},
7,
{
{0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
64,
4,
4,
- {1, 1, 1, 1, 0},
+ {true, true, true, true, false},
5,
{
{0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
128,
4,
4,
- {1, 0, 1, 0, 1, 0},
+ {true, false, true, false, true, false},
6,
{
{0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
256,
4,
4,
- {1, 1, 1, 0, 1, 1, 0},
+ {true, true, true, false, true, true, false},
7,
{
{0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
512,
4,
4,
- {1, 0, 1, 1, 1, 0},
+ {true, false, true, true, true, false},
6,
{
{0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
1024,
4,
4,
- {1, 0, 1, 1, 1},
+ {true, false, true, true, true},
5,
{
{0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
2048,
4,
4,
- {1, 0, 1, 1, 1, 1},
+ {true, false, true, true, true, true},
6,
{
{0, 2048, &MPIR_Reduce_inter_knomial_wrapper_MV2},
/* * the use the recursive doubling algorithm, otherwise*/
/* * bruck is the one we want.*/
{
- int has_one = 0;
+ bool has_one = false;
for( ; communicator_size > 0; communicator_size >>= 1 ) {
if( communicator_size & 0x1 ) {
if( has_one )
return barrier__ompi_bruck(comm);
- has_one = 1;
+ has_one = true;
}
}
}