Skip to content

Commit 7bd63e7

Browse files
committed
coll/libnbc: add Rabenseifner's algorithm for MPI_Ireduce
An implementation of R. Rabenseifner's algorithm for MPI_Ireduce. This algorithm is a combination of a reduce-scatter implemented with recursive vector halving and recursive distance doubling, followed either by a gather. Limitations: -- count >= 2^{\floor{\log_2 p}} -- commutative operations only -- intra-communicators only Signed-off-by: Mikhail Kurnosov <mkurnosov@gmail.com>
1 parent b0e6d1f commit 7bd63e7

File tree

3 files changed

+401
-9
lines changed

3 files changed

+401
-9
lines changed

ompi/mca/coll/libnbc/coll_libnbc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ BEGIN_C_DECLS
7171

7272
extern bool libnbc_ibcast_skip_dt_decision;
7373
extern int libnbc_iexscan_algorithm;
74+
extern int libnbc_ireduce_algorithm;
7475
extern int libnbc_iscan_algorithm;
7576

7677
struct ompi_coll_libnbc_component_t {

ompi/mca/coll/libnbc/coll_libnbc_component.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ static mca_base_var_enum_value_t iexscan_algorithms[] = {
5454
{0, NULL}
5555
};
5656

57+
int libnbc_ireduce_algorithm = 0; /* ireduce user forced algorithm */
58+
static mca_base_var_enum_value_t ireduce_algorithms[] = {
59+
{0, "ignore"},
60+
{1, "chain"},
61+
{2, "binomial"},
62+
{3, "rabenseifner"},
63+
{0, NULL}
64+
};
65+
5766
int libnbc_iscan_algorithm = 0; /* iscan user forced algorithm */
5867
static mca_base_var_enum_value_t iscan_algorithms[] = {
5968
{0, "ignore"},
@@ -185,6 +194,16 @@ libnbc_register(void)
185194
&libnbc_iexscan_algorithm);
186195
OBJ_RELEASE(new_enum);
187196

197+
libnbc_ireduce_algorithm = 0;
198+
(void) mca_base_var_enum_create("coll_libnbc_ireduce_algorithms", ireduce_algorithms, &new_enum);
199+
mca_base_component_var_register(&mca_coll_libnbc_component.super.collm_version,
200+
"ireduce_algorithm",
201+
"Which ireduce algorithm is used: 0 ignore, 1 chain, 2 binomial, 3 rabenseifner",
202+
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
203+
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_ALL,
204+
&libnbc_ireduce_algorithm);
205+
OBJ_RELEASE(new_enum);
206+
188207
libnbc_iscan_algorithm = 0;
189208
(void) mca_base_var_enum_create("coll_libnbc_iscan_algorithms", iscan_algorithms, &new_enum);
190209
mca_base_component_var_register(&mca_coll_libnbc_component.super.collm_version,

0 commit comments

Comments
 (0)