Skip to content

Commit f2e3af4

Browse files
authored
Merge pull request #13269 from shijin-aws/ofi_build_warnings_v5.0.x
v5.0.x: Fix OFI build warnings
2 parents 84891ba + 8e317c9 commit f2e3af4

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

ompi/mca/mtl/ofi/mtl_ofi_component.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -982,17 +982,6 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads,
982982
goto error;
983983
}
984984

985-
/**
986-
* Unfortunately the attempt to implement FI_MR_SCALABLE in the GNI provider
987-
* doesn't work, at least not well. Since we're asking for the 1.5 libfabric
988-
* API now, we have to tell GNI we want to use Mr. Basic. Using FI_MR_BASIC
989-
* rather than FI_MR_VIRT_ADDR | FI_MR_ALLOCATED | FI_MR_PROV_KEY to stay
990-
* compatible with older libfabrics.
991-
*/
992-
if (!strncmp(prov->fabric_attr->prov_name,"gni",3)) {
993-
prov->domain_attr->mr_mode = FI_MR_BASIC;
994-
}
995-
996985
/**
997986
* Create the access domain, which is the physical or virtual network or
998987
* hardware port/collection of ports. Returns a domain object that can be

opal/mca/btl/ofi/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ be explicit.
4848
Supported MR mode bits (will work with or without):
4949

5050
* enum:
51-
* `FI_MR_BASIC`
52-
* `FI_MR_SCALABLE`
51+
* `FI_MR_BASIC` (deprecated since libfabric 1.5)
52+
* `FI_MR_SCALABLE` (deprecated since libfabric 1.5)
5353
* mode bits:
5454
* `FI_MR_VIRT_ADDR`
5555
* `FI_MR_ALLOCATED`

opal/mca/btl/ofi/btl_ofi_component.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@
4646

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

49+
/**
50+
* FI_MR_BASIC (1<<0) and FI_MR_SCALABLE (1<<1) are deprecated
51+
* since Libfabric 1.5 and the symbols will get removed in
52+
* future Libfabric 2.x versions. Use the internal mode bits
53+
* for backward compatibilities without breaking compilation
54+
* with newer libfabric.
55+
*/
56+
#define MCA_BTL_OFI_MR_BASIC (1 << 0)
57+
#define MCA_BTL_OFI_MR_SCALABLE (1 << 1)
58+
4959
static char *ofi_progress_mode;
5060
static bool disable_sep;
5161
static int mca_btl_ofi_init_device(struct fi_info *info);
@@ -105,7 +115,7 @@ static int validate_info(struct fi_info *info, uint64_t required_caps, char **in
105115

106116
mr_mode = info->domain_attr->mr_mode;
107117

108-
if (!(mr_mode == FI_MR_BASIC || mr_mode == FI_MR_SCALABLE
118+
if (!(mr_mode == MCA_BTL_OFI_MR_BASIC || mr_mode == MCA_BTL_OFI_MR_SCALABLE
109119
#if defined(FI_MR_HMEM)
110120
|| (mr_mode & ~(FI_MR_VIRT_ADDR | FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_ENDPOINT | FI_MR_HMEM)) == 0)) {
111121
#else
@@ -655,7 +665,7 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
655665
}
656666
#endif
657667

658-
if (ofi_info->domain_attr->mr_mode == FI_MR_BASIC
668+
if (ofi_info->domain_attr->mr_mode == MCA_BTL_OFI_MR_BASIC
659669
|| ofi_info->domain_attr->mr_mode & FI_MR_VIRT_ADDR) {
660670
module->use_virt_addr = true;
661671
}

0 commit comments

Comments
 (0)