Skip to content

Commit dfe203e

Browse files
committed
coll/libnbc: add recursive doubling algorithm for MPI_Iexscan
Implements recursive doubling algorithm for MPI_Iexscan. The algorithm preserves order of operations so it can be used both by commutative and non-commutative operations. The MCA parameter 'coll_libnbc_iexscan_algorithm' was added for dynamic algorithm selection. Signed-off-by: Mikhail Kurnosov <mkurnosov@gmail.com>
1 parent ddf7e43 commit dfe203e

File tree

3 files changed

+246
-90
lines changed

3 files changed

+246
-90
lines changed

ompi/mca/coll/libnbc/coll_libnbc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ BEGIN_C_DECLS
7070
#define NBC_NUM_COLL 17
7171

7272
extern bool libnbc_ibcast_skip_dt_decision;
73+
extern int libnbc_iexscan_algorithm;
7374

7475
struct ompi_coll_libnbc_component_t {
7576
mca_coll_base_component_2_0_0_t super;

ompi/mca/coll/libnbc/coll_libnbc_component.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ static int libnbc_priority = 10;
4646
static bool libnbc_in_progress = false; /* protect from recursive calls */
4747
bool libnbc_ibcast_skip_dt_decision = true;
4848

49+
int libnbc_iexscan_algorithm = 0; /* iexscan user forced algorithm */
50+
static mca_base_var_enum_value_t iexscan_algorithms[] = {
51+
{0, "ignore"},
52+
{1, "linear"},
53+
{2, "recursive_doubling"},
54+
{0, NULL}
55+
};
4956

5057
static int libnbc_open(void);
5158
static int libnbc_close(void);
@@ -128,6 +135,8 @@ libnbc_close(void)
128135
static int
129136
libnbc_register(void)
130137
{
138+
mca_base_var_enum_t *new_enum = NULL;
139+
131140
/* Use a low priority, but allow other components to be lower */
132141
libnbc_priority = 10;
133142
(void) mca_base_component_var_register(&mca_coll_libnbc_component.super.collm_version,
@@ -158,6 +167,16 @@ libnbc_register(void)
158167
MCA_BASE_VAR_SCOPE_READONLY,
159168
&libnbc_ibcast_skip_dt_decision);
160169

170+
libnbc_iexscan_algorithm = 0;
171+
(void) mca_base_var_enum_create("coll_libnbc_iexscan_algorithms", iexscan_algorithms, &new_enum);
172+
mca_base_component_var_register(&mca_coll_libnbc_component.super.collm_version,
173+
"iexscan_algorithm",
174+
"Which iexscan algorithm is used: 0 ignore, 1 linear, 2 recursive_doubling",
175+
MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
176+
OPAL_INFO_LVL_5, MCA_BASE_VAR_SCOPE_ALL,
177+
&libnbc_iexscan_algorithm);
178+
OBJ_RELEASE(new_enum);
179+
161180
return OMPI_SUCCESS;
162181
}
163182

0 commit comments

Comments
 (0)