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,30 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
2727static int param_priority ;
2828static char * prov_include ;
2929static char * prov_exclude ;
30+ static int control_progress ;
31+ static int data_progress ;
32+
33+ /*
34+ * Enumerators
35+ */
36+
37+ enum {
38+ MTL_OFI_PROG_AUTO = 1 ,
39+ MTL_OFI_PROG_MANUAL ,
40+ MTL_OFI_PROG_UNKNOWN ,
41+ };
42+
43+ mca_base_var_enum_value_t control_prog_type [] = {
44+ {MTL_OFI_PROG_AUTO , "auto" },
45+ {MTL_OFI_PROG_MANUAL , "manual" },
46+ {0 , NULL }
47+ };
48+
49+ mca_base_var_enum_value_t data_prog_type [] = {
50+ {MTL_OFI_PROG_AUTO , "auto" },
51+ {MTL_OFI_PROG_MANUAL , "manual" },
52+ {0 , NULL }
53+ };
3054
3155mca_mtl_ofi_component_t mca_mtl_ofi_component = {
3256 {
@@ -56,6 +80,9 @@ mca_mtl_ofi_component_t mca_mtl_ofi_component = {
5680static int
5781ompi_mtl_ofi_component_register (void )
5882{
83+ int ret ;
84+ mca_base_var_enum_t * new_enum = NULL ;
85+
5986 param_priority = 25 ; /* for now give a lower priority than the psm mtl */
6087 mca_base_component_var_register (& mca_mtl_ofi_component .super .mtl_version ,
6188 "priority" , "Priority of the OFI MTL component" ,
@@ -82,6 +109,36 @@ ompi_mtl_ofi_component_register(void)
82109 MCA_BASE_VAR_SCOPE_READONLY ,
83110 & prov_exclude );
84111
112+ ret = mca_base_var_enum_create ("control_prog_type" , control_prog_type , & new_enum );
113+ if (OPAL_SUCCESS != ret ) {
114+ return ret ;
115+ }
116+
117+ control_progress = MTL_OFI_PROG_MANUAL ;
118+ mca_base_component_var_register (& mca_mtl_ofi_component .super .mtl_version ,
119+ "control_progress" ,
120+ "Specify control progress model (default: manual). Set to auto for auto progress." ,
121+ MCA_BASE_VAR_TYPE_INT , new_enum , 0 , 0 ,
122+ OPAL_INFO_LVL_3 ,
123+ MCA_BASE_VAR_SCOPE_READONLY ,
124+ & control_progress );
125+ OBJ_RELEASE (new_enum );
126+
127+ ret = mca_base_var_enum_create ("data_prog_type" , data_prog_type , & new_enum );
128+ if (OPAL_SUCCESS != ret ) {
129+ return ret ;
130+ }
131+
132+ data_progress = MTL_OFI_PROG_AUTO ;
133+ mca_base_component_var_register (& mca_mtl_ofi_component .super .mtl_version ,
134+ "data_progress" ,
135+ "Specify data progress model (default: auto). Set to manual for manual progress." ,
136+ MCA_BASE_VAR_TYPE_INT , new_enum , 0 , 0 ,
137+ OPAL_INFO_LVL_3 ,
138+ MCA_BASE_VAR_SCOPE_READONLY ,
139+ & data_progress );
140+ OBJ_RELEASE (new_enum );
141+
85142 return OMPI_SUCCESS ;
86143}
87144
@@ -239,7 +296,19 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
239296 hints -> rx_attr -> msg_order = FI_ORDER_SAS ;
240297
241298 hints -> domain_attr -> threading = FI_THREAD_UNSPEC ;
242- hints -> domain_attr -> control_progress = FI_PROGRESS_MANUAL ;
299+
300+ if (MTL_OFI_PROG_AUTO == control_progress ) {
301+ hints -> domain_attr -> control_progress = FI_PROGRESS_AUTO ;
302+ } else {
303+ hints -> domain_attr -> control_progress = FI_PROGRESS_MANUAL ;
304+ }
305+
306+ if (MTL_OFI_PROG_MANUAL == data_progress ) {
307+ hints -> domain_attr -> data_progress = FI_PROGRESS_MANUAL ;
308+ } else {
309+ hints -> domain_attr -> data_progress = FI_PROGRESS_AUTO ;
310+ }
311+
243312 hints -> domain_attr -> resource_mgmt = FI_RM_ENABLED ;
244313 hints -> domain_attr -> av_type = FI_AV_MAP ;
245314
@@ -353,9 +422,10 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
353422
354423 /**
355424 * The remote fi_addr will be stored in the ofi_endpoint struct.
356- * So, we use the AV in "map" mode.
357425 */
426+
358427 av_attr .type = FI_AV_MAP ;
428+
359429 ret = fi_av_open (ompi_mtl_ofi .domain , & av_attr , & ompi_mtl_ofi .av , NULL );
360430 if (ret ) {
361431 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
0 commit comments