Skip to content

Commit 5ff6b81

Browse files
authored
Merge pull request open-mpi#1871 from hppritcha/topic/ofi_mtl_params
mtl/ofi: add some more mca parameters
2 parents 19a2dbb + 22c8743 commit 5ff6b81

File tree

1 file changed

+105
-3
lines changed

1 file changed

+105
-3
lines changed

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved
44
*
55
* Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved.
6-
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
6+
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
77
* reserved.
88
* $COPYRIGHT$
99
*
@@ -27,6 +27,43 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
2727
static int param_priority;
2828
static char *prov_include;
2929
static char *prov_exclude;
30+
static int control_progress;
31+
static int data_progress;
32+
static int av_type;
33+
34+
/*
35+
* Enumerators
36+
*/
37+
38+
enum {
39+
MTL_OFI_PROG_AUTO=1,
40+
MTL_OFI_PROG_MANUAL,
41+
MTL_OFI_PROG_UNKNOWN,
42+
};
43+
44+
mca_base_var_enum_value_t control_prog_type[] = {
45+
{MTL_OFI_PROG_AUTO, "auto"},
46+
{MTL_OFI_PROG_MANUAL, "manual"},
47+
{0, NULL}
48+
};
49+
50+
mca_base_var_enum_value_t data_prog_type[] = {
51+
{MTL_OFI_PROG_AUTO, "auto"},
52+
{MTL_OFI_PROG_MANUAL, "manual"},
53+
{0, NULL}
54+
};
55+
56+
enum {
57+
MTL_OFI_AV_MAP=1,
58+
MTL_OFI_AV_TABLE,
59+
MTL_OFI_AV_UNKNOWN,
60+
};
61+
62+
mca_base_var_enum_value_t av_table_type[] = {
63+
{MTL_OFI_AV_MAP, "map"},
64+
{MTL_OFI_AV_TABLE, "table"},
65+
{0, NULL}
66+
};
3067

3168
mca_mtl_ofi_component_t mca_mtl_ofi_component = {
3269
{
@@ -56,6 +93,9 @@ mca_mtl_ofi_component_t mca_mtl_ofi_component = {
5693
static int
5794
ompi_mtl_ofi_component_register(void)
5895
{
96+
int ret;
97+
mca_base_var_enum_t *new_enum = NULL;
98+
5999
param_priority = 25; /* for now give a lower priority than the psm mtl */
60100
mca_base_component_var_register(&mca_mtl_ofi_component.super.mtl_version,
61101
"priority", "Priority of the OFI MTL component",
@@ -82,6 +122,51 @@ ompi_mtl_ofi_component_register(void)
82122
MCA_BASE_VAR_SCOPE_READONLY,
83123
&prov_exclude);
84124

125+
ret = mca_base_var_enum_create ("control_prog_type", control_prog_type, &new_enum);
126+
if (OPAL_SUCCESS != ret) {
127+
return ret;
128+
}
129+
130+
control_progress = MTL_OFI_PROG_MANUAL;
131+
mca_base_component_var_register (&mca_mtl_ofi_component.super.mtl_version,
132+
"control_progress",
133+
"Specify control progress model (default: manual). Set to auto for auto progress.",
134+
MCA_BASE_VAR_TYPE_INT, new_enum, 0, 0,
135+
OPAL_INFO_LVL_3,
136+
MCA_BASE_VAR_SCOPE_READONLY,
137+
&control_progress);
138+
OBJ_RELEASE(new_enum);
139+
140+
ret = mca_base_var_enum_create ("data_prog_type", data_prog_type, &new_enum);
141+
if (OPAL_SUCCESS != ret) {
142+
return ret;
143+
}
144+
145+
data_progress = MTL_OFI_PROG_AUTO;
146+
mca_base_component_var_register(&mca_mtl_ofi_component.super.mtl_version,
147+
"data_progress",
148+
"Specify data progress model (default: auto). Set to manual for manual progress.",
149+
MCA_BASE_VAR_TYPE_INT, new_enum, 0, 0,
150+
OPAL_INFO_LVL_3,
151+
MCA_BASE_VAR_SCOPE_READONLY,
152+
&data_progress);
153+
OBJ_RELEASE(new_enum);
154+
155+
ret = mca_base_var_enum_create ("av_type", av_table_type, &new_enum);
156+
if (OPAL_SUCCESS != ret) {
157+
return ret;
158+
}
159+
160+
av_type = MTL_OFI_AV_MAP;
161+
mca_base_component_var_register (&mca_mtl_ofi_component.super.mtl_version,
162+
"av",
163+
"Specify AV type to use (default: map). Set to table for FI_AV_TABLE AV type.",
164+
MCA_BASE_VAR_TYPE_INT, new_enum, 0, 0,
165+
OPAL_INFO_LVL_3,
166+
MCA_BASE_VAR_SCOPE_READONLY,
167+
&av_type);
168+
OBJ_RELEASE(new_enum);
169+
85170
return OMPI_SUCCESS;
86171
}
87172

@@ -239,9 +324,26 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
239324
hints->rx_attr->msg_order = FI_ORDER_SAS;
240325

241326
hints->domain_attr->threading = FI_THREAD_UNSPEC;
242-
hints->domain_attr->control_progress = FI_PROGRESS_MANUAL;
327+
328+
if (MTL_OFI_PROG_AUTO == control_progress) {
329+
hints->domain_attr->control_progress = FI_PROGRESS_AUTO;
330+
} else {
331+
hints->domain_attr->control_progress = FI_PROGRESS_MANUAL;
332+
}
333+
334+
if (MTL_OFI_PROG_MANUAL == data_progress) {
335+
hints->domain_attr->data_progress = FI_PROGRESS_MANUAL;
336+
} else {
337+
hints->domain_attr->data_progress = FI_PROGRESS_AUTO;
338+
}
339+
340+
if (MTL_OFI_AV_TABLE == av_type) {
341+
hints->domain_attr->av_type = FI_AV_TABLE;
342+
} else {
343+
hints->domain_attr->av_type = FI_AV_MAP;
344+
}
345+
243346
hints->domain_attr->resource_mgmt = FI_RM_ENABLED;
244-
hints->domain_attr->av_type = FI_AV_MAP;
245347

246348
/**
247349
* FI_VERSION provides binary backward and forward compatibility support

0 commit comments

Comments
 (0)