Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions ompi/mca/mtl/ofi/mtl_ofi_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,17 +982,6 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
goto error;
}

/**
* Unfortunately the attempt to implement FI_MR_SCALABLE in the GNI provider
* doesn't work, at least not well. Since we're asking for the 1.5 libfabric
* API now, we have to tell GNI we want to use Mr. Basic. Using FI_MR_BASIC
* rather than FI_MR_VIRT_ADDR | FI_MR_ALLOCATED | FI_MR_PROV_KEY to stay
* compatible with older libfabrics.
*/
if (!strncmp(prov->fabric_attr->prov_name,"gni",3)) {
prov->domain_attr->mr_mode = FI_MR_BASIC;
}

/**
* Create the access domain, which is the physical or virtual network or
* hardware port/collection of ports. Returns a domain object that can be
Expand Down
4 changes: 2 additions & 2 deletions opal/mca/btl/ofi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ be explicit.
Supported MR mode bits (will work with or without):

* enum:
* `FI_MR_BASIC`
* `FI_MR_SCALABLE`
* `FI_MR_BASIC` (deprecated since libfabric 1.5)
* `FI_MR_SCALABLE` (deprecated since libfabric 1.5)
* mode bits:
* `FI_MR_VIRT_ADDR`
* `FI_MR_ALLOCATED`
Expand Down
14 changes: 12 additions & 2 deletions opal/mca/btl/ofi/btl_ofi_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@

#define MCA_BTL_OFI_REQUESTED_MR_MODE (FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_VIRT_ADDR | FI_MR_ENDPOINT)

/**
* FI_MR_BASIC (1<<0) and FI_MR_SCALABLE (1<<1) are deprecated
* since Libfabric 1.5 and the symbols will get removed in
* future Libfabric 2.x versions. Use the internal mode bits
* for backward compatibilities without breaking compilation
* with newer libfabric.
Comment on lines +50 to +54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that a newer libfabric won't be reusing those old values? Otherwise FI_MR_SUPER_NEW_FANCY_MODE with value (1<<0) might be misinterpreted as FI_MR_BASIC in some future compile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would hope ofi wg would not make that mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there won't be newer libfabric to use these bits, it's forbidden in the development

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I think in this case we will merge this PR. Thanks for cleaning our code a bit @shijin-aws

*/
#define MCA_BTL_OFI_MR_BASIC (1 << 0)
#define MCA_BTL_OFI_MR_SCALABLE (1 << 1)

static char *ofi_progress_mode;
static bool disable_sep;
static int mca_btl_ofi_init_device(struct fi_info *info);
Expand Down Expand Up @@ -105,7 +115,7 @@ static int validate_info(struct fi_info *info, uint64_t required_caps, char **in

mr_mode = info->domain_attr->mr_mode;

if (!(mr_mode == FI_MR_BASIC || mr_mode == FI_MR_SCALABLE
if (!(mr_mode == MCA_BTL_OFI_MR_BASIC || mr_mode == MCA_BTL_OFI_MR_SCALABLE
#if defined(FI_MR_HMEM)
|| (mr_mode & ~(FI_MR_VIRT_ADDR | FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_ENDPOINT | FI_MR_HMEM)) == 0)) {
#else
Expand Down Expand Up @@ -655,7 +665,7 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
}
#endif

if (ofi_info->domain_attr->mr_mode == FI_MR_BASIC
if (ofi_info->domain_attr->mr_mode == MCA_BTL_OFI_MR_BASIC
|| ofi_info->domain_attr->mr_mode & FI_MR_VIRT_ADDR) {
module->use_virt_addr = true;
}
Expand Down