Skip to content

Commit 995bd30

Browse files
committed
btl/ofi: Use internal macros for FI_MR_BASIC and FI_MR_SCALABLE
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. Signed-off-by: Shi Jin <[email protected]> (cherry picked from commit 281c6cd)
1 parent 37e1204 commit 995bd30

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

opal/mca/btl/ofi/btl_ofi_component.c

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

4848
#define MCA_BTL_OFI_REQUESTED_MR_MODE (FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_VIRT_ADDR)
4949

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

108118
mr_mode = info->domain_attr->mr_mode;
109119

110-
if (!(mr_mode == FI_MR_BASIC || mr_mode == FI_MR_SCALABLE ||
120+
if (!(mr_mode == MCA_BTL_OFI_MR_BASIC || mr_mode == MCA_BTL_OFI_MR_SCALABLE ||
111121
(mr_mode & ~(FI_MR_VIRT_ADDR | FI_MR_ALLOCATED | FI_MR_PROV_KEY)) == 0)) {
112122
BTL_VERBOSE(("unsupported MR mode"));
113123
return OPAL_ERROR;
@@ -609,7 +619,7 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
609619
module->outstanding_rdma = 0;
610620
module->use_virt_addr = false;
611621

612-
if (ofi_info->domain_attr->mr_mode == FI_MR_BASIC ||
622+
if (ofi_info->domain_attr->mr_mode == MCA_BTL_OFI_MR_BASIC ||
613623
ofi_info->domain_attr->mr_mode & FI_MR_VIRT_ADDR) {
614624
module->use_virt_addr = true;
615625
}

0 commit comments

Comments
 (0)