Skip to content

Commit 9afdb7b

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 34b70be commit 9afdb7b

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

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)