1
1
Этот коммит содержится в:
Yohann Burette 2015-03-06 14:38:19 -08:00
родитель cbd99d5f60
Коммит d48a8ab8f0

Просмотреть файл

@ -127,11 +127,8 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
bool enable_mpi_threads) bool enable_mpi_threads)
{ {
int ret, fi_version; int ret, fi_version;
struct fi_info hints = {0}; struct fi_info *hints;
struct fi_info *providers = NULL, *prov = NULL; struct fi_info *providers = NULL, *prov = NULL;
struct fi_domain_attr domain_attr = {0};
struct fi_fabric_attr fabric_attr = {0};
struct fi_ep_attr ep_attr = {0};
struct fi_cq_attr cq_attr = {0}; struct fi_cq_attr cq_attr = {0};
struct fi_av_attr av_attr = {0}; struct fi_av_attr av_attr = {0};
char ep_name[FI_NAME_MAX] = {0}; char ep_name[FI_NAME_MAX] = {0};
@ -149,28 +146,31 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
* We expect to register all memory up front for use with this * We expect to register all memory up front for use with this
* endpoint, so the MTL requires dynamic memory regions * endpoint, so the MTL requires dynamic memory regions
*/ */
hints.mode = FI_CONTEXT; hints = fi_allocinfo();
hints.caps = FI_TAGGED; /* Tag matching interface */ if (!hints) {
hints.caps |= FI_CANCEL; /* Support cancel */ opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
hints.caps |= FI_DYNAMIC_MR; /* Global dynamic mem region */ "%s:%d: Could not allocate fi_info\n",
__FILE__, __LINE__);
goto error;
}
hints->mode = FI_CONTEXT;
hints->ep_attr->type = FI_EP_RDM; /* Reliable datagram */
hints->caps = FI_TAGGED; /* Tag matching interface */
hints->caps |= FI_CANCEL; /* Support cancel */
hints->caps |= FI_DYNAMIC_MR; /* Global dynamic mem region */
/** /**
* Refine filter for additional capabilities * Refine filter for additional capabilities
* threading: Disable locking * threading: Disable locking
* control_progress: enable async progress * control_progress: enable async progress
* ep type: reliable datagram
*/ */
ep_attr.type = FI_EP_RDM; hints->domain_attr->threading = FI_THREAD_ENDPOINT;
domain_attr.threading = FI_THREAD_ENDPOINT; hints->domain_attr->control_progress = FI_PROGRESS_AUTO;
domain_attr.control_progress = FI_PROGRESS_AUTO;
if (NULL != ompi_mtl_ofi.provider_name) { if (NULL != ompi_mtl_ofi.provider_name) {
fabric_attr.prov_name = strdup(ompi_mtl_ofi.provider_name); hints->fabric_attr->prov_name = strdup(ompi_mtl_ofi.provider_name);
} else { } else {
fabric_attr.prov_name = NULL; hints->fabric_attr->prov_name = NULL;
} }
hints.ep_attr = &ep_attr;
hints.domain_attr = &domain_attr;
hints.fabric_attr = &fabric_attr;
/** /**
* FI_VERSION provides binary backward and forward compatibility support * FI_VERSION provides binary backward and forward compatibility support
@ -188,7 +188,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
NULL, /* Optional name or fabric to resolve */ NULL, /* Optional name or fabric to resolve */
NULL, /* Optional service name or port to request */ NULL, /* Optional service name or port to request */
0ULL, /* Optional flag */ 0ULL, /* Optional flag */
&hints, /* In: Hints to filter providers */ hints, /* In: Hints to filter providers */
&providers); /* Out: List of matching providers */ &providers); /* Out: List of matching providers */
if (0 != ret) { if (0 != ret) {
opal_output_verbose(1, ompi_mtl_base_framework.framework_output, opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
@ -340,6 +340,8 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
/** /**
* Free providers info since it's not needed anymore. * Free providers info since it's not needed anymore.
*/ */
fi_freeinfo(hints);
hints = NULL;
fi_freeinfo(providers); fi_freeinfo(providers);
providers = NULL; providers = NULL;
@ -389,6 +391,9 @@ error:
if (providers) { if (providers) {
(void) fi_freeinfo(providers); (void) fi_freeinfo(providers);
} }
if (hints) {
(void) fi_freeinfo(hints);
}
if (ompi_mtl_ofi.av) { if (ompi_mtl_ofi.av) {
(void) fi_close((fid_t)ompi_mtl_ofi.av); (void) fi_close((fid_t)ompi_mtl_ofi.av);
} }