From 4a3f2afcbe125e7a736bec83a33b68c3aede8918 Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Thu, 5 Nov 2020 18:25:59 +0100 Subject: [PATCH] coll/tuned: Mark global static algorithm as const Signed-off-by: Joseph Schuchart (cherry picked from commit 7261255b8df40979e334cb9d09d68b20b34bfb17) --- ompi/mca/coll/tuned/coll_tuned_allgather_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_allgatherv_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_allreduce_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_alltoall_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_alltoallv_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_barrier_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_bcast_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_exscan_decision.c | 5 ++++- ompi/mca/coll/tuned/coll_tuned_gather_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_reduce_decision.c | 4 ++-- .../coll/tuned/coll_tuned_reduce_scatter_block_decision.c | 7 +++++-- ompi/mca/coll/tuned/coll_tuned_reduce_scatter_decision.c | 4 ++-- ompi/mca/coll/tuned/coll_tuned_scan_decision.c | 5 ++++- ompi/mca/coll/tuned/coll_tuned_scatter_decision.c | 4 ++-- 14 files changed, 35 insertions(+), 26 deletions(-) diff --git a/ompi/mca/coll/tuned/coll_tuned_allgather_decision.c b/ompi/mca/coll/tuned/coll_tuned_allgather_decision.c index b7332fa0e7..74ba5201ca 100644 --- a/ompi/mca/coll/tuned/coll_tuned_allgather_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_allgather_decision.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -31,7 +31,7 @@ static int coll_tuned_allgather_tree_fanout; static int coll_tuned_allgather_chain_fanout; /* valid values for coll_tuned_allgather_forced_algorithm */ -static mca_base_var_enum_value_t allgather_algorithms[] = { +static const mca_base_var_enum_value_t allgather_algorithms[] = { {0, "ignore"}, {1, "linear"}, {2, "bruck"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_allgatherv_decision.c b/ompi/mca/coll/tuned/coll_tuned_allgatherv_decision.c index e0c5385f05..e2828786ae 100644 --- a/ompi/mca/coll/tuned/coll_tuned_allgatherv_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_allgatherv_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -31,7 +31,7 @@ static int coll_tuned_allgatherv_tree_fanout; static int coll_tuned_allgatherv_chain_fanout; /* valid values for coll_tuned_allgatherv_forced_algorithm */ -static mca_base_var_enum_value_t allgatherv_algorithms[] = { +static const mca_base_var_enum_value_t allgatherv_algorithms[] = { {0, "ignore"}, {1, "default"}, {2, "bruck"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_allreduce_decision.c b/ompi/mca/coll/tuned/coll_tuned_allreduce_decision.c index 75b640ffc1..eabe6f1737 100644 --- a/ompi/mca/coll/tuned/coll_tuned_allreduce_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_allreduce_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015-2018 Research Organization for Information Science @@ -34,7 +34,7 @@ static int coll_tuned_allreduce_tree_fanout; static int coll_tuned_allreduce_chain_fanout; /* valid values for coll_tuned_allreduce_forced_algorithm */ -static mca_base_var_enum_value_t allreduce_algorithms[] = { +static const mca_base_var_enum_value_t allreduce_algorithms[] = { {0, "ignore"}, {1, "basic_linear"}, {2, "nonoverlapping"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_alltoall_decision.c b/ompi/mca/coll/tuned/coll_tuned_alltoall_decision.c index 5a878d61f1..487f9da4fd 100644 --- a/ompi/mca/coll/tuned/coll_tuned_alltoall_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_alltoall_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -32,7 +32,7 @@ static int coll_tuned_alltoall_tree_fanout; static int coll_tuned_alltoall_chain_fanout; /* valid values for coll_tuned_alltoall_forced_algorithm */ -static mca_base_var_enum_value_t alltoall_algorithms[] = { +static const mca_base_var_enum_value_t alltoall_algorithms[] = { {0, "ignore"}, {1, "linear"}, {2, "pairwise"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_alltoallv_decision.c b/ompi/mca/coll/tuned/coll_tuned_alltoallv_decision.c index 2996745e67..c5d72095c9 100644 --- a/ompi/mca/coll/tuned/coll_tuned_alltoallv_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_alltoallv_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -29,7 +29,7 @@ static int coll_tuned_alltoallv_forced_algorithm = 0; /* valid values for coll_tuned_alltoallv_forced_algorithm */ -static mca_base_var_enum_value_t alltoallv_algorithms[] = { +static const mca_base_var_enum_value_t alltoallv_algorithms[] = { {0, "ignore"}, {1, "basic_linear"}, {2, "pairwise"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_barrier_decision.c b/ompi/mca/coll/tuned/coll_tuned_barrier_decision.c index c13960c8ff..dca24ad27d 100644 --- a/ompi/mca/coll/tuned/coll_tuned_barrier_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_barrier_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2015 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * $COPYRIGHT$ @@ -27,7 +27,7 @@ static int coll_tuned_barrier_forced_algorithm = 0; /* valid values for coll_tuned_barrier_forced_algorithm */ -static mca_base_var_enum_value_t barrier_algorithms[] = { +static const mca_base_var_enum_value_t barrier_algorithms[] = { {0, "ignore"}, {1, "linear"}, {2, "double_ring"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c b/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c index d33ed7e9a9..b949b3ab74 100644 --- a/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_bcast_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -34,7 +34,7 @@ static int coll_tuned_bcast_chain_fanout; static int coll_tuned_bcast_knomial_radix = 4; /* valid values for coll_tuned_bcast_forced_algorithm */ -static mca_base_var_enum_value_t bcast_algorithms[] = { +static const mca_base_var_enum_value_t bcast_algorithms[] = { {0, "ignore"}, {1, "basic_linear"}, {2, "chain"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_exscan_decision.c b/ompi/mca/coll/tuned/coll_tuned_exscan_decision.c index 7ade8cbb89..42668d2e18 100644 --- a/ompi/mca/coll/tuned/coll_tuned_exscan_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_exscan_decision.c @@ -2,6 +2,9 @@ /* * Copyright (c) 2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,7 +29,7 @@ static int coll_tuned_exscan_forced_algorithm = 0; /* valid values for coll_tuned_exscan_forced_algorithm */ -static mca_base_var_enum_value_t exscan_algorithms[] = { +static const mca_base_var_enum_value_t exscan_algorithms[] = { {0, "ignore"}, {1, "linear"}, {2, "recursive_doubling"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_gather_decision.c b/ompi/mca/coll/tuned/coll_tuned_gather_decision.c index a87fe57277..1b09687234 100644 --- a/ompi/mca/coll/tuned/coll_tuned_gather_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_gather_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015-2017 Research Organization for Information Science @@ -32,7 +32,7 @@ static int coll_tuned_gather_tree_fanout; static int coll_tuned_gather_chain_fanout; /* valid values for coll_tuned_gather_forced_algorithm */ -static mca_base_var_enum_value_t gather_algorithms[] = { +static const mca_base_var_enum_value_t gather_algorithms[] = { {0, "ignore"}, {1, "basic_linear"}, {2, "binomial"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_reduce_decision.c b/ompi/mca/coll/tuned/coll_tuned_reduce_decision.c index 87f3a4a6bb..40e500d1c0 100644 --- a/ompi/mca/coll/tuned/coll_tuned_reduce_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_reduce_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015-2018 Research Organization for Information Science @@ -33,7 +33,7 @@ static int coll_tuned_reduce_tree_fanout; static int coll_tuned_reduce_chain_fanout; /* valid values for coll_tuned_reduce_forced_algorithm */ -static mca_base_var_enum_value_t reduce_algorithms[] = { +static const mca_base_var_enum_value_t reduce_algorithms[] = { {0, "ignore"}, {1, "linear"}, {2, "chain"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_block_decision.c b/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_block_decision.c index 0023a02e56..40144b68af 100644 --- a/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_block_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_block_decision.c @@ -4,6 +4,9 @@ * and Information Sciences. All rights reserved. * Copyright (c) 2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,7 +34,7 @@ static int coll_tuned_reduce_scatter_block_segment_size = 0; static int coll_tuned_reduce_scatter_block_tree_fanout; /* valid values for coll_tuned_reduce_scatter_blokc_forced_algorithm */ -static mca_base_var_enum_value_t reduce_scatter_block_algorithms[] = { +static const mca_base_var_enum_value_t reduce_scatter_block_algorithms[] = { {0, "ignore"}, {1, "basic_linear"}, {2, "recursive_doubling"}, @@ -131,7 +134,7 @@ int ompi_coll_tuned_reduce_scatter_block_intra_do_this(const void *sbuf, void *r dtype, op, comm, module); case (3): return ompi_coll_base_reduce_scatter_block_intra_recursivehalving(sbuf, rbuf, rcount, dtype, op, comm, module); - case (4): return ompi_coll_base_reduce_scatter_block_intra_butterfly(sbuf, rbuf, rcount, dtype, op, comm, + case (4): return ompi_coll_base_reduce_scatter_block_intra_butterfly(sbuf, rbuf, rcount, dtype, op, comm, module); } /* switch */ OPAL_OUTPUT((ompi_coll_tuned_stream, "coll:tuned:reduce_scatter_block_intra_do_this attempt to select algorithm %d when only 0-%d is valid?", diff --git a/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_decision.c b/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_decision.c index e9a8e9b95c..b4c1b43486 100644 --- a/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_reduce_scatter_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -33,7 +33,7 @@ static int coll_tuned_reduce_scatter_tree_fanout; static int coll_tuned_reduce_scatter_chain_fanout; /* valid values for coll_tuned_reduce_scatter_forced_algorithm */ -static mca_base_var_enum_value_t reduce_scatter_algorithms[] = { +static const mca_base_var_enum_value_t reduce_scatter_algorithms[] = { {0, "ignore"}, {1, "non-overlapping"}, {2, "recursive_halving"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_scan_decision.c b/ompi/mca/coll/tuned/coll_tuned_scan_decision.c index cc5392930b..f35872023f 100644 --- a/ompi/mca/coll/tuned/coll_tuned_scan_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_scan_decision.c @@ -2,6 +2,9 @@ /* * Copyright (c) 2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2020 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,7 +29,7 @@ static int coll_tuned_scan_forced_algorithm = 0; /* valid values for coll_tuned_scan_forced_algorithm */ -static mca_base_var_enum_value_t scan_algorithms[] = { +static const mca_base_var_enum_value_t scan_algorithms[] = { {0, "ignore"}, {1, "linear"}, {2, "recursive_doubling"}, diff --git a/ompi/mca/coll/tuned/coll_tuned_scatter_decision.c b/ompi/mca/coll/tuned/coll_tuned_scatter_decision.c index f56a68d5e6..75a8d64d20 100644 --- a/ompi/mca/coll/tuned/coll_tuned_scatter_decision.c +++ b/ompi/mca/coll/tuned/coll_tuned_scatter_decision.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2020 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science @@ -33,7 +33,7 @@ static int coll_tuned_scatter_tree_fanout; static int coll_tuned_scatter_chain_fanout; /* valid values for coll_tuned_scatter_forced_algorithm */ -static mca_base_var_enum_value_t scatter_algorithms[] = { +static const mca_base_var_enum_value_t scatter_algorithms[] = { {0, "ignore"}, {1, "basic_linear"}, {2, "binomial"},