X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d20f024dba9ff1e9c8822237caaf963b9e913889..77bbf3027c4240a2e833209a3a3f186589da8577:/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp?ds=sidebyside diff --git a/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp b/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp index 3c3adc17a6..7a14eb4d38 100644 --- a/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp +++ b/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp @@ -36,6 +36,8 @@ */ #include "../colls_private.hpp" +#include + #define MV2_INTRA_SHMEM_REDUCE_MSG 2048 #define mv2_g_shmem_coll_max_msg_size (1 << 17) @@ -117,15 +119,14 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf, datatype->extent(&true_lb, &true_extent); extent =datatype->get_extent(); - stride = count * MAX(extent, true_extent); + stride = count * std::max(extent, 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 (local_rank == 0 ) { - tmp_buf=(void *)smpi_get_tmp_sendbuffer( count * - (MAX(extent, true_extent))); + tmp_buf = (void*)smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent)); tmp_buf = (void *) ((char *) tmp_buf - true_lb); } @@ -150,7 +151,7 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf, out_buf = NULL; } - if (count * (MAX(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE) { + if (count * (std::max(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE) { mpi_errno = MPIR_Reduce_shmem_MV2(in_buf, out_buf, count, datatype, op, 0, shmem_comm); } else { mpi_errno = MPIR_Reduce_intra_knomial_wrapper_MV2(in_buf, out_buf, count, datatype, op, 0, shmem_comm); @@ -189,8 +190,7 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf, } leader_comm_size = leader_comm->size(); leader_comm_rank = leader_comm->rank(); - tmp_buf=(void *)smpi_get_tmp_sendbuffer(count * - (MAX(extent, true_extent))); + tmp_buf = (void*)smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent)); tmp_buf = (void *) ((char *) tmp_buf - true_lb); } if (sendbuf != MPI_IN_PLACE) { @@ -214,7 +214,7 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf, *this step*/ if (MV2_Reduce_intra_function == & MPIR_Reduce_shmem_MV2) { - if (is_commutative == 1 && (count * (MAX(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE)) { + if (is_commutative == 1 && (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,