From 9afdb7bb97f1081cf802f47b6cddbb40b9166bd8 Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Tue, 20 May 2025 03:59:40 +0000 Subject: [PATCH 1/2] 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 (cherry picked from commit 281c6cda55d0a67cf45887c88980a23fe42e15e2) --- opal/mca/btl/ofi/README.md | 4 ++-- opal/mca/btl/ofi/btl_ofi_component.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/opal/mca/btl/ofi/README.md b/opal/mca/btl/ofi/README.md index d9240526c9a..f03425ba36b 100644 --- a/opal/mca/btl/ofi/README.md +++ b/opal/mca/btl/ofi/README.md @@ -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` diff --git a/opal/mca/btl/ofi/btl_ofi_component.c b/opal/mca/btl/ofi/btl_ofi_component.c index 3c3ff6da4e1..955a8f129d6 100644 --- a/opal/mca/btl/ofi/btl_ofi_component.c +++ b/opal/mca/btl/ofi/btl_ofi_component.c @@ -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. + */ +#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); @@ -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 @@ -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; } From 8e317c92978edc928681fbe5cd2fbd49ced3688e Mon Sep 17 00:00:00 2001 From: Shi Jin Date: Tue, 20 May 2025 04:01:42 +0000 Subject: [PATCH 2/2] mtl/ofi: Remove special patch for gni provider There should not be any Cray XC systems in production now - which is where the GNI provider nominally functioned. Meanwhile FI_MR_BASIC is deprecated since Libfabric 1.5 and will be droppped in future Libfabric 2.x versions. Remove this special handler for gni provider due to unnecessity and build warnings. Signed-off-by: Shi Jin (cherry picked from commit 1c67d904e87b14d9abd75de2c2708f1a644371d7) --- ompi/mca/mtl/ofi/mtl_ofi_component.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index c794a8c8357..5bcd4fe477b 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -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