diff --git a/ompi/mca/coll/tuned/coll_tuned_allgather.c b/ompi/mca/coll/tuned/coll_tuned_allgather.c index 1893fce99d..d7d0209c78 100644 --- a/ompi/mca/coll/tuned/coll_tuned_allgather.c +++ b/ompi/mca/coll/tuned/coll_tuned_allgather.c @@ -751,14 +751,14 @@ ompi_coll_tuned_allgather_intra_basic_linear(void *sbuf, int scount, int ompi_coll_tuned_allgather_intra_check_forced_init(coll_tuned_force_algorithm_mca_param_indices_t *mca_param_indices) { - int rc, max_alg = 6, requested_alg; + int max_alg = 6, requested_alg; ompi_coll_tuned_forced_max_algorithms[ALLGATHER] = max_alg; - rc = mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, - "allgather_algorithm_count", - "Number of allgather algorithms available", - false, true, max_alg, NULL); + mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, + "allgather_algorithm_count", + "Number of allgather algorithms available", + false, true, max_alg, NULL); mca_param_indices->algorithm_param_index = mca_base_param_reg_int(&mca_coll_tuned_component.super.collm_version, diff --git a/ompi/mca/coll/tuned/coll_tuned_allgatherv.c b/ompi/mca/coll/tuned/coll_tuned_allgatherv.c index ca5407b95c..e112283d01 100644 --- a/ompi/mca/coll/tuned/coll_tuned_allgatherv.c +++ b/ompi/mca/coll/tuned/coll_tuned_allgatherv.c @@ -96,7 +96,8 @@ int ompi_coll_tuned_allgatherv_intra_bruck(void *sbuf, int scount, int line = -1, err = 0; int rank, size; int sendto, recvfrom, distance, blockcount, i; - int *new_rcounts, *new_rdispls, *new_scounts, *new_sdispls; + 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; struct ompi_datatype_t *new_rdtype, *new_sdtype; @@ -199,6 +200,11 @@ int ompi_coll_tuned_allgatherv_intra_bruck(void *sbuf, int scount, return OMPI_SUCCESS; err_hndl: + if( NULL != new_rcounts ) free(new_rcounts); + if( NULL != new_rdispls ) free(new_rdispls); + if( NULL != new_scounts ) free(new_scounts); + if( NULL != new_sdispls ) free(new_sdispls); + OPAL_OUTPUT((ompi_coll_tuned_stream, "%s:%4d\tError occurred %d, rank %2d", __FILE__, line, err, rank)); return err; @@ -681,14 +687,14 @@ ompi_coll_tuned_allgatherv_intra_basic_default(void *sbuf, int scount, int ompi_coll_tuned_allgatherv_intra_check_forced_init(coll_tuned_force_algorithm_mca_param_indices_t *mca_param_indices) { - int rc, max_alg = 5, requested_alg; + int max_alg = 5, requested_alg; ompi_coll_tuned_forced_max_algorithms[ALLGATHERV] = max_alg; - rc = mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, - "allgatherv_algorithm_count", - "Number of allgather algorithms available", - false, true, max_alg, NULL); + mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, + "allgatherv_algorithm_count", + "Number of allgather algorithms available", + false, true, max_alg, NULL); mca_param_indices->algorithm_param_index = mca_base_param_reg_int(&mca_coll_tuned_component.super.collm_version, diff --git a/ompi/mca/coll/tuned/coll_tuned_allreduce.c b/ompi/mca/coll/tuned/coll_tuned_allreduce.c index 43342654ad..d8958723fb 100644 --- a/ompi/mca/coll/tuned/coll_tuned_allreduce.c +++ b/ompi/mca/coll/tuned/coll_tuned_allreduce.c @@ -926,14 +926,14 @@ ompi_coll_tuned_allreduce_intra_basic_linear(void *sbuf, void *rbuf, int count, int ompi_coll_tuned_allreduce_intra_check_forced_init (coll_tuned_force_algorithm_mca_param_indices_t *mca_param_indices) { - int rc, max_alg = 5, requested_alg; + int max_alg = 5, requested_alg; ompi_coll_tuned_forced_max_algorithms[ALLREDUCE] = max_alg; - rc = mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, - "allreduce_algorithm_count", - "Number of allreduce algorithms available", - false, true, max_alg, NULL); + mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, + "allreduce_algorithm_count", + "Number of allreduce algorithms available", + false, true, max_alg, NULL); mca_param_indices->algorithm_param_index = mca_base_param_reg_int( &mca_coll_tuned_component.super.collm_version, diff --git a/ompi/mca/coll/tuned/coll_tuned_alltoall.c b/ompi/mca/coll/tuned/coll_tuned_alltoall.c index 8eef126751..d5c9af7e8d 100644 --- a/ompi/mca/coll/tuned/coll_tuned_alltoall.c +++ b/ompi/mca/coll/tuned/coll_tuned_alltoall.c @@ -606,14 +606,14 @@ int ompi_coll_tuned_alltoall_intra_basic_linear(void *sbuf, int scount, int ompi_coll_tuned_alltoall_intra_check_forced_init (coll_tuned_force_algorithm_mca_param_indices_t *mca_param_indices) { - int rc, max_alg = 5, requested_alg, max_requests; + int max_alg = 5, requested_alg, max_requests; ompi_coll_tuned_forced_max_algorithms[ALLTOALL] = max_alg; - rc = mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, - "alltoall_algorithm_count", - "Number of alltoall algorithms available", - false, true, max_alg, NULL); + mca_base_param_reg_int (&mca_coll_tuned_component.super.collm_version, + "alltoall_algorithm_count", + "Number of alltoall algorithms available", + false, true, max_alg, NULL); mca_param_indices->algorithm_param_index = mca_base_param_reg_int(&mca_coll_tuned_component.super.collm_version, diff --git a/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c b/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c index c500ee0549..487320a034 100644 --- a/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c +++ b/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c @@ -96,14 +96,13 @@ int ompi_coll_tuned_alltoall_intra_dec_fixed(void *sbuf, int scount, struct ompi_communicator_t *comm, struct mca_coll_base_module_1_1_0_t *module) { - int communicator_size, rank; + int communicator_size; size_t dsize, block_dsize; #if 0 size_t total_dsize; #endif communicator_size = ompi_comm_size(comm); - rank = ompi_comm_rank(comm); /* special case */ if (communicator_size==2) { @@ -142,7 +141,7 @@ int ompi_coll_tuned_alltoall_intra_dec_fixed(void *sbuf, int scount, total_dsize = dsize * scount * communicator_size; /* needed for decision */ OPAL_OUTPUT((ompi_coll_tuned_stream, "ompi_coll_tuned_alltoall_intra_dec_fixed rank %d com_size %d msg_length %ld", - rank, communicator_size, total_dsize)); + ompi_comm_rank(comm), communicator_size, total_dsize)); if (communicator_size >= 12 && total_dsize <= 768) { return ompi_coll_tuned_alltoall_intra_bruck (sbuf, scount, sdtype, rbuf, rcount, rdtype, comm, module); @@ -216,12 +215,11 @@ int ompi_coll_tuned_bcast_intra_dec_fixed(void *buff, int count, const double a_p128 = 1.6134e-6; /* [1 / byte] */ const double b_p128 = 2.1102; - int communicator_size, rank; + int communicator_size; int segsize = 0; size_t message_size, dsize; communicator_size = ompi_comm_size(comm); - rank = ompi_comm_rank(comm); /* else we need data size for decision function */ ompi_ddt_type_size(datatype, &dsize); @@ -229,7 +227,7 @@ int ompi_coll_tuned_bcast_intra_dec_fixed(void *buff, int count, OPAL_OUTPUT((ompi_coll_tuned_stream, "ompi_coll_tuned_bcast_intra_dec_fixed" " root %d rank %d com_size %d msg_length %lu", - root, rank, communicator_size, (unsigned long)message_size)); + root, ompi_comm_rank(comm), communicator_size, (unsigned long)message_size)); /* Handle messages of small and intermediate size, and single-element broadcasts */ @@ -327,7 +325,7 @@ int ompi_coll_tuned_reduce_intra_dec_fixed( void *sendbuf, void *recvbuf, struct ompi_communicator_t* comm, struct mca_coll_base_module_1_1_0_t *module) { - int communicator_size, rank, segsize = 0; + int communicator_size, segsize = 0; size_t message_size, dsize; const double a1 = 0.6016 / 1024.0; /* [1/B] */ const double b1 = 1.3496; @@ -341,7 +339,6 @@ int ompi_coll_tuned_reduce_intra_dec_fixed( void *sendbuf, void *recvbuf, const int max_requests = 0; /* no limit on # of outstanding requests */ communicator_size = ompi_comm_size(comm); - rank = ompi_comm_rank(comm); /* need data size for decision function */ ompi_ddt_type_size(datatype, &dsize); @@ -361,7 +358,7 @@ int ompi_coll_tuned_reduce_intra_dec_fixed( void *sendbuf, void *recvbuf, OPAL_OUTPUT((ompi_coll_tuned_stream, "ompi_coll_tuned_reduce_intra_dec_fixed" "root %d rank %d com_size %d msg_length %lu", - root, rank, communicator_size, (unsigned long)message_size)); + root, ompi_comm_rank(comm), communicator_size, (unsigned long)message_size)); if ((communicator_size < 8) && (message_size < 512)){ /* Linear_0K */ @@ -495,13 +492,12 @@ int ompi_coll_tuned_allgather_intra_dec_fixed(void *sbuf, int scount, void* rbuf, int rcount, struct ompi_datatype_t *rdtype, struct ompi_communicator_t *comm, - struct mca_coll_base_module_1_1_0_t *module) + struct mca_coll_base_module_1_1_0_t *module) { - int communicator_size, rank, pow2_size; + int communicator_size, pow2_size; size_t dsize, total_dsize; communicator_size = ompi_comm_size(comm); - rank = ompi_comm_rank(comm); /* Special case for 2 processes */ if (communicator_size == 2) { @@ -516,7 +512,7 @@ int ompi_coll_tuned_allgather_intra_dec_fixed(void *sbuf, int scount, OPAL_OUTPUT((ompi_coll_tuned_stream, "ompi_coll_tuned_allgather_intra_dec_fixed" " rank %d com_size %d msg_length %lu", - rank, communicator_size, (unsigned long)total_dsize)); + ompi_comm_rank(comm), communicator_size, (unsigned long)total_dsize)); for (pow2_size = 1; pow2_size <= communicator_size; pow2_size <<=1); pow2_size >>=1; @@ -594,11 +590,10 @@ int ompi_coll_tuned_allgatherv_intra_dec_fixed(void *sbuf, int scount, struct mca_coll_base_module_1_1_0_t *module) { int i; - int communicator_size, rank, pow2_size; + int communicator_size, pow2_size; size_t dsize, total_dsize; communicator_size = ompi_comm_size(comm); - rank = ompi_comm_rank(comm); /* Special case for 2 processes */ if (communicator_size == 2) { @@ -617,7 +612,7 @@ int ompi_coll_tuned_allgatherv_intra_dec_fixed(void *sbuf, int scount, OPAL_OUTPUT((ompi_coll_tuned_stream, "ompi_coll_tuned_allgatherv_intra_dec_fixed" " rank %d com_size %d msg_length %lu", - rank, communicator_size, (unsigned long)total_dsize)); + ompi_comm_rank(comm), communicator_size, (unsigned long)total_dsize)); for (pow2_size = 1; pow2_size <= communicator_size; pow2_size <<=1); pow2_size >>=1; diff --git a/ompi/mca/coll/tuned/coll_tuned_module.c b/ompi/mca/coll/tuned/coll_tuned_module.c index bdf164e957..2d61c5a267 100644 --- a/ompi/mca/coll/tuned/coll_tuned_module.c +++ b/ompi/mca/coll/tuned/coll_tuned_module.c @@ -150,7 +150,7 @@ static int tuned_module_enable(struct mca_coll_base_module_1_1_0_t *module, struct ompi_communicator_t *comm) { - int size, rank; + int size; mca_coll_tuned_module_t *tuned_module = (mca_coll_tuned_module_t *) module; mca_coll_tuned_comm_t *data = NULL; /* fanout parameters */ @@ -228,7 +228,6 @@ tuned_module_enable(struct mca_coll_base_module_1_1_0_t *module, /* (B) so we can get our very own customised ompi_coll_com_rule_t ptr */ /* which only has rules in it for our com size */ - rank = ompi_comm_rank(comm); /* find rank as only MCW:0 opens any tuned conf files */ /* actually if they are below a threadhold, they all open it */ /* have to build a collective in here.. but just for MCW.. */ /* but we have to make sure we have the same rules everywhere :( */