Skip to content

Commit 30831fb

Browse files
authored
Merge pull request #8186 from devreal/fix-tuned-dynamic
Fix some issues with dynamic algorithm selection in coll/tuned
2 parents d489030 + a15e5dc commit 30831fb

16 files changed

+78
-101
lines changed

ompi/mca/coll/tuned/coll_tuned_allgather_decision.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004-2017 The University of Tennessee and The University
2+
* Copyright (c) 2004-2020 The University of Tennessee and The University
33
* of Tennessee Research Foundation. All rights
44
* reserved.
55
* Copyright (c) 2015 Research Organization for Information Science
@@ -31,7 +31,7 @@ static int coll_tuned_allgather_tree_fanout;
3131
static int coll_tuned_allgather_chain_fanout;
3232

3333
/* valid values for coll_tuned_allgather_forced_algorithm */
34-
static mca_base_var_enum_value_t allgather_algorithms[] = {
34+
static const mca_base_var_enum_value_t allgather_algorithms[] = {
3535
{0, "ignore"},
3636
{1, "linear"},
3737
{2, "bruck"},
@@ -77,7 +77,8 @@ ompi_coll_tuned_allgather_intra_check_forced_init(coll_tuned_force_algorithm_mca
7777
mca_param_indices->algorithm_param_index =
7878
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
7979
"allgather_algorithm",
80-
"Which allallgather algorithm is used. Can be locked down to choice of: 0 ignore, 1 basic linear, 2 bruck, 3 recursive doubling, 4 ring, 5 neighbor exchange, 6: two proc only.",
80+
"Which allallgather algorithm is used. Can be locked down to choice of: 0 ignore, 1 basic linear, 2 bruck, 3 recursive doubling, 4 ring, 5 neighbor exchange, 6: two proc only. "
81+
"Only relevant if coll_tuned_use_dynamic_rules is true.",
8182
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
8283
OPAL_INFO_LVL_5,
8384
MCA_BASE_VAR_SCOPE_ALL,

ompi/mca/coll/tuned/coll_tuned_allgatherv_decision.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2004-2017 The University of Tennessee and The University
3+
* Copyright (c) 2004-2020 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
66
* Copyright (c) 2015 Research Organization for Information Science
@@ -31,7 +31,7 @@ static int coll_tuned_allgatherv_tree_fanout;
3131
static int coll_tuned_allgatherv_chain_fanout;
3232

3333
/* valid values for coll_tuned_allgatherv_forced_algorithm */
34-
static mca_base_var_enum_value_t allgatherv_algorithms[] = {
34+
static const mca_base_var_enum_value_t allgatherv_algorithms[] = {
3535
{0, "ignore"},
3636
{1, "default"},
3737
{2, "bruck"},
@@ -76,7 +76,8 @@ ompi_coll_tuned_allgatherv_intra_check_forced_init(coll_tuned_force_algorithm_mc
7676
mca_param_indices->algorithm_param_index =
7777
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
7878
"allgatherv_algorithm",
79-
"Which allallgatherv algorithm is used. Can be locked down to choice of: 0 ignore, 1 default (allgathervv + bcast), 2 bruck, 3 ring, 4 neighbor exchange, 5: two proc only.",
79+
"Which allallgatherv algorithm is used. Can be locked down to choice of: 0 ignore, 1 default (allgathervv + bcast), 2 bruck, 3 ring, 4 neighbor exchange, 5: two proc only. "
80+
"Only relevant if coll_tuned_use_dynamic_rules is true.",
8081
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
8182
OPAL_INFO_LVL_5,
8283
MCA_BASE_VAR_SCOPE_CONSTANT,

ompi/mca/coll/tuned/coll_tuned_allreduce_decision.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2004-2017 The University of Tennessee and The University
3+
* Copyright (c) 2004-2020 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
66
* Copyright (c) 2015-2018 Research Organization for Information Science
@@ -34,7 +34,7 @@ static int coll_tuned_allreduce_tree_fanout;
3434
static int coll_tuned_allreduce_chain_fanout;
3535

3636
/* valid values for coll_tuned_allreduce_forced_algorithm */
37-
static mca_base_var_enum_value_t allreduce_algorithms[] = {
37+
static const mca_base_var_enum_value_t allreduce_algorithms[] = {
3838
{0, "ignore"},
3939
{1, "basic_linear"},
4040
{2, "nonoverlapping"},
@@ -77,7 +77,8 @@ int ompi_coll_tuned_allreduce_intra_check_forced_init (coll_tuned_force_algorith
7777
mca_param_indices->algorithm_param_index =
7878
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
7979
"allreduce_algorithm",
80-
"Which allreduce algorithm is used. Can be locked down to any of: 0 ignore, 1 basic linear, 2 nonoverlapping (tuned reduce + tuned bcast), 3 recursive doubling, 4 ring, 5 segmented ring",
80+
"Which allreduce algorithm is used. Can be locked down to any of: 0 ignore, 1 basic linear, 2 nonoverlapping (tuned reduce + tuned bcast), 3 recursive doubling, 4 ring, 5 segmented ring. "
81+
"Only relevant if coll_tuned_use_dynamic_rules is true.",
8182
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
8283
OPAL_INFO_LVL_5,
8384
MCA_BASE_VAR_SCOPE_ALL,

ompi/mca/coll/tuned/coll_tuned_alltoall_decision.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2004-2017 The University of Tennessee and The University
3+
* Copyright (c) 2004-2020 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
66
* Copyright (c) 2015 Research Organization for Information Science
@@ -32,7 +32,7 @@ static int coll_tuned_alltoall_tree_fanout;
3232
static int coll_tuned_alltoall_chain_fanout;
3333

3434
/* valid values for coll_tuned_alltoall_forced_algorithm */
35-
static mca_base_var_enum_value_t alltoall_algorithms[] = {
35+
static const mca_base_var_enum_value_t alltoall_algorithms[] = {
3636
{0, "ignore"},
3737
{1, "linear"},
3838
{2, "pairwise"},
@@ -74,7 +74,8 @@ int ompi_coll_tuned_alltoall_intra_check_forced_init (coll_tuned_force_algorithm
7474
mca_param_indices->algorithm_param_index =
7575
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
7676
"alltoall_algorithm",
77-
"Which alltoall algorithm is used. Can be locked down to choice of: 0 ignore, 1 basic linear, 2 pairwise, 3: modified bruck, 4: linear with sync, 5:two proc only.",
77+
"Which alltoall algorithm is used. Can be locked down to choice of: 0 ignore, 1 basic linear, 2 pairwise, 3: modified bruck, 4: linear with sync, 5:two proc only. "
78+
"Only relevant if coll_tuned_use_dynamic_rules is true.",
7879
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
7980
OPAL_INFO_LVL_5,
8081
MCA_BASE_VAR_SCOPE_ALL,

ompi/mca/coll/tuned/coll_tuned_alltoallv_decision.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2004-2017 The University of Tennessee and The University
3+
* Copyright (c) 2004-2020 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
66
* Copyright (c) 2015 Research Organization for Information Science
@@ -29,7 +29,7 @@
2929
static int coll_tuned_alltoallv_forced_algorithm = 0;
3030

3131
/* valid values for coll_tuned_alltoallv_forced_algorithm */
32-
static mca_base_var_enum_value_t alltoallv_algorithms[] = {
32+
static const mca_base_var_enum_value_t alltoallv_algorithms[] = {
3333
{0, "ignore"},
3434
{1, "basic_linear"},
3535
{2, "pairwise"},
@@ -71,7 +71,8 @@ int ompi_coll_tuned_alltoallv_intra_check_forced_init(coll_tuned_force_algorithm
7171
"alltoallv_algorithm",
7272
"Which alltoallv algorithm is used. "
7373
"Can be locked down to choice of: 0 ignore, "
74-
"1 basic linear, 2 pairwise.",
74+
"1 basic linear, 2 pairwise. "
75+
"Only relevant if coll_tuned_use_dynamic_rules is true.",
7576
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
7677
OPAL_INFO_LVL_5,
7778
MCA_BASE_VAR_SCOPE_ALL,

ompi/mca/coll/tuned/coll_tuned_barrier_decision.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2004-2015 The University of Tennessee and The University
3+
* Copyright (c) 2004-2020 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
66
* $COPYRIGHT$
@@ -27,7 +27,7 @@
2727
static int coll_tuned_barrier_forced_algorithm = 0;
2828

2929
/* valid values for coll_tuned_barrier_forced_algorithm */
30-
static mca_base_var_enum_value_t barrier_algorithms[] = {
30+
static const mca_base_var_enum_value_t barrier_algorithms[] = {
3131
{0, "ignore"},
3232
{1, "linear"},
3333
{2, "double_ring"},
@@ -72,7 +72,8 @@ int ompi_coll_tuned_barrier_intra_check_forced_init (coll_tuned_force_algorithm_
7272
mca_param_indices->algorithm_param_index =
7373
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
7474
"barrier_algorithm",
75-
"Which barrier algorithm is used. Can be locked down to choice of: 0 ignore, 1 linear, 2 double ring, 3: recursive doubling 4: bruck, 5: two proc only, 6: tree",
75+
"Which barrier algorithm is used. Can be locked down to choice of: 0 ignore, 1 linear, 2 double ring, 3: recursive doubling 4: bruck, 5: two proc only, 6: tree. "
76+
"Only relevant if coll_tuned_use_dynamic_rules is true.",
7677
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
7778
OPAL_INFO_LVL_5,
7879
MCA_BASE_VAR_SCOPE_ALL,

ompi/mca/coll/tuned/coll_tuned_bcast_decision.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2004-2017 The University of Tennessee and The University
3+
* Copyright (c) 2004-2020 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
66
* Copyright (c) 2015 Research Organization for Information Science
@@ -34,7 +34,7 @@ static int coll_tuned_bcast_chain_fanout;
3434
static int coll_tuned_bcast_knomial_radix = 4;
3535

3636
/* valid values for coll_tuned_bcast_forced_algorithm */
37-
static mca_base_var_enum_value_t bcast_algorithms[] = {
37+
static const mca_base_var_enum_value_t bcast_algorithms[] = {
3838
{0, "ignore"},
3939
{1, "basic_linear"},
4040
{2, "chain"},
@@ -80,7 +80,8 @@ int ompi_coll_tuned_bcast_intra_check_forced_init (coll_tuned_force_algorithm_mc
8080
mca_param_indices->algorithm_param_index =
8181
mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
8282
"bcast_algorithm",
83-
"Which bcast algorithm is used. Can be locked down to choice of: 0 ignore, 1 basic linear, 2 chain, 3: pipeline, 4: split binary tree, 5: binary tree, 6: binomial tree, 7: knomial tree, 8: scatter_allgather, 9: scatter_allgather_ring.",
83+
"Which bcast algorithm is used. Can be locked down to choice of: 0 ignore, 1 basic linear, 2 chain, 3: pipeline, 4: split binary tree, 5: binary tree, 6: binomial tree, 7: knomial tree, 8: scatter_allgather, 9: scatter_allgather_ring. "
84+
"Only relevant if coll_tuned_use_dynamic_rules is true.",
8485
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
8586
OPAL_INFO_LVL_5,
8687
MCA_BASE_VAR_SCOPE_ALL,

ompi/mca/coll/tuned/coll_tuned_decision_dynamic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2015 The University of Tennessee and The University
5+
* Copyright (c) 2004-2020 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -97,7 +97,7 @@ ompi_coll_tuned_allreduce_intra_dec_dynamic (const void *sbuf, void *rbuf, int c
9797
*
9898
* Function: - seletects alltoall algorithm to use
9999
* Accepts: - same arguments as MPI_Alltoall()
100-
* Returns: - MPI_SUCCESS or error code (passed from the bcast implementation)
100+
* Returns: - MPI_SUCCESS or error code (passed from the alltoall implementation)
101101
*/
102102

103103
int ompi_coll_tuned_alltoall_intra_dec_dynamic(const void *sbuf, int scount,
@@ -238,7 +238,7 @@ int ompi_coll_tuned_barrier_intra_dec_dynamic(struct ompi_communicator_t *comm,
238238
/*
239239
* bcast_intra_dec
240240
*
241-
* Function: - seletects broadcast algorithm to use
241+
* Function: - selects broadcast algorithm to use
242242
* Accepts: - same arguments as MPI_Bcast()
243243
* Returns: - MPI_SUCCESS or error code (passed from the bcast implementation)
244244
*/

ompi/mca/coll/tuned/coll_tuned_decision_fixed.c

Lines changed: 12 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2015 The University of Tennessee and The University
6+
* Copyright (c) 2004-2020 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -92,30 +92,10 @@ ompi_coll_tuned_allreduce_intra_dec_fixed(const void *sbuf, void *rbuf, int coun
9292
} else {
9393
alg = 2;
9494
}
95-
} else if (communicator_size < 32) {
96-
alg = 3;
97-
} else if (communicator_size < 64) {
98-
if (total_dsize < 131072) {
99-
alg = 1;
100-
} else {
101-
alg = 3;
102-
}
10395
} else if (communicator_size < 128) {
104-
if (total_dsize < 128) {
105-
alg = 1;
106-
} else if (total_dsize < 512) {
107-
alg = 3;
108-
} else if (total_dsize < 8192) {
109-
alg = 1;
110-
} else {
111-
alg = 3;
112-
}
96+
alg = 3;
11397
} else if (communicator_size < 256) {
114-
if (total_dsize < 2048) {
115-
alg = 2;
116-
} else if (total_dsize < 16384) {
117-
alg = 1;
118-
} else if (total_dsize < 131072) {
98+
if (total_dsize < 131072) {
11999
alg = 2;
120100
} else if (total_dsize < 524288) {
121101
alg = 3;
@@ -183,23 +163,13 @@ ompi_coll_tuned_allreduce_intra_dec_fixed(const void *sbuf, void *rbuf, int coun
183163
alg = 6;
184164
}
185165
} else if (communicator_size < 128) {
186-
if (total_dsize < 128) {
187-
alg = 1;
188-
} else if (total_dsize < 512) {
189-
alg = 3;
190-
} else if (total_dsize < 8192) {
191-
alg = 1;
192-
} else if (total_dsize < 262144) {
166+
if (total_dsize < 262144) {
193167
alg = 3;
194168
} else {
195169
alg = 6;
196170
}
197171
} else if (communicator_size < 256) {
198-
if (total_dsize < 2048) {
199-
alg = 2;
200-
} else if (total_dsize < 16384) {
201-
alg = 1;
202-
} else if (total_dsize < 131072) {
172+
if (total_dsize < 131072) {
203173
alg = 2;
204174
} else if (total_dsize < 262144) {
205175
alg = 3;
@@ -567,9 +537,7 @@ int ompi_coll_tuned_bcast_intra_dec_fixed(void *buff, int count,
567537
* {9, "scatter_allgather_ring"},
568538
*/
569539
if (communicator_size < 4) {
570-
if (total_dsize < 2) {
571-
alg = 9;
572-
} else if (total_dsize < 32) {
540+
if (total_dsize < 32) {
573541
alg = 3;
574542
} else if (total_dsize < 256) {
575543
alg = 5;
@@ -591,9 +559,7 @@ int ompi_coll_tuned_bcast_intra_dec_fixed(void *buff, int count,
591559
alg = 5;
592560
}
593561
} else if (communicator_size < 8) {
594-
if (total_dsize < 2) {
595-
alg = 8;
596-
} else if (total_dsize < 64) {
562+
if (total_dsize < 64) {
597563
alg = 5;
598564
} else if (total_dsize < 128) {
599565
alg = 6;
@@ -639,8 +605,6 @@ int ompi_coll_tuned_bcast_intra_dec_fixed(void *buff, int count,
639605
} else if (communicator_size < 256) {
640606
if (total_dsize < 2) {
641607
alg = 6;
642-
} else if (total_dsize < 128) {
643-
alg = 8;
644608
} else if (total_dsize < 16384) {
645609
alg = 5;
646610
} else if (total_dsize < 32768) {
@@ -1164,19 +1128,15 @@ int ompi_coll_tuned_allgather_intra_dec_fixed(const void *sbuf, int scount,
11641128
alg = 4;
11651129
}
11661130
} else if (communicator_size < 128) {
1167-
if (total_dsize < 64) {
1168-
alg = 1;
1169-
} else if (total_dsize < 512) {
1131+
if (total_dsize < 512) {
11701132
alg = 3;
11711133
} else if (total_dsize < 65536) {
11721134
alg = 5;
11731135
} else {
11741136
alg = 4;
11751137
}
11761138
} else if (communicator_size < 256) {
1177-
if (total_dsize < 32) {
1178-
alg = 1;
1179-
} else if (total_dsize < 512) {
1139+
if (total_dsize < 512) {
11801140
alg = 3;
11811141
} else if (total_dsize < 131072) {
11821142
alg = 5;
@@ -1188,9 +1148,7 @@ int ompi_coll_tuned_allgather_intra_dec_fixed(const void *sbuf, int scount,
11881148
alg = 4;
11891149
}
11901150
} else if (communicator_size < 512) {
1191-
if (total_dsize < 16) {
1192-
alg = 1;
1193-
} else if (total_dsize < 32) {
1151+
if (total_dsize < 32) {
11941152
alg = 3;
11951153
} else if (total_dsize < 128) {
11961154
alg = 2;
@@ -1206,9 +1164,7 @@ int ompi_coll_tuned_allgather_intra_dec_fixed(const void *sbuf, int scount,
12061164
alg = 4;
12071165
}
12081166
} else if (communicator_size < 1024) {
1209-
if (total_dsize < 4) {
1210-
alg = 1;
1211-
} else if (total_dsize < 64) {
1167+
if (total_dsize < 64) {
12121168
alg = 3;
12131169
} else if (total_dsize < 256) {
12141170
alg = 2;
@@ -1218,9 +1174,7 @@ int ompi_coll_tuned_allgather_intra_dec_fixed(const void *sbuf, int scount,
12181174
alg = 5;
12191175
}
12201176
} else if (communicator_size < 2048) {
1221-
if (total_dsize < 2) {
1222-
alg = 1;
1223-
} else if (total_dsize < 4) {
1177+
if (total_dsize < 4) {
12241178
alg = 3;
12251179
} else if (total_dsize < 8) {
12261180
alg = 2;

0 commit comments

Comments
 (0)