Skip to content

Commit d1965d2

Browse files
authored
Merge pull request #10231 from awlauria/s11_v5.0.x
v5.0.x: SS11: initial ofi btl fixes
2 parents 4fd598b + 973702c commit d1965d2

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

opal/mca/btl/ofi/btl_ofi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2020 Amazon.com, Inc. or its affiliates.
1717
* All Rights reserved.
18+
* Copyright (c) 2022 Triad National Security, LLC. All rights
19+
* reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -124,6 +126,7 @@ struct mca_btl_ofi_module_t {
124126
bool initialized;
125127
bool use_virt_addr;
126128
bool is_scalable_ep;
129+
bool use_fi_mr_bind;
127130

128131
opal_atomic_int64_t outstanding_rdma;
129132
opal_atomic_int64_t outstanding_send;

opal/mca/btl/ofi/btl_ofi_component.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Copyright (c) 2018-2019 Intel, Inc. All rights reserved.
1616
*
1717
* Copyright (c) 2018-2021 Amazon.com, Inc. or its affiliates. All Rights reserved.
18-
* Copyright (c) 2020 Triad National Security, LLC. All rights
18+
* Copyright (c) 2020-2022 Triad National Security, LLC. All rights
1919
* reserved.
2020
* $COPYRIGHT$
2121
*
@@ -44,7 +44,7 @@
4444
#define MCA_BTL_OFI_ONE_SIDED_REQUIRED_CAPS (FI_RMA | FI_ATOMIC)
4545
#define MCA_BTL_OFI_TWO_SIDED_REQUIRED_CAPS (FI_MSG)
4646

47-
#define MCA_BTL_OFI_REQUESTED_MR_MODE (FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_VIRT_ADDR)
47+
#define MCA_BTL_OFI_REQUESTED_MR_MODE (FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_VIRT_ADDR | FI_MR_ENDPOINT)
4848

4949
static char *ofi_progress_mode;
5050
static bool disable_sep;
@@ -106,7 +106,7 @@ static int validate_info(struct fi_info *info, uint64_t required_caps, char **in
106106
mr_mode = info->domain_attr->mr_mode;
107107

108108
if (!(mr_mode == FI_MR_BASIC || mr_mode == FI_MR_SCALABLE
109-
|| (mr_mode & ~(FI_MR_VIRT_ADDR | FI_MR_ALLOCATED | FI_MR_PROV_KEY)) == 0)) {
109+
|| (mr_mode & ~(FI_MR_VIRT_ADDR | FI_MR_ALLOCATED | FI_MR_PROV_KEY | FI_MR_ENDPOINT)) == 0)) {
110110
BTL_VERBOSE(("unsupported MR mode"));
111111
return OPAL_ERROR;
112112
}
@@ -562,12 +562,17 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
562562
module->linux_device_name = linux_device_name;
563563
module->outstanding_rdma = 0;
564564
module->use_virt_addr = false;
565+
module->use_fi_mr_bind = false;
565566

566567
if (ofi_info->domain_attr->mr_mode == FI_MR_BASIC
567568
|| ofi_info->domain_attr->mr_mode & FI_MR_VIRT_ADDR) {
568569
module->use_virt_addr = true;
569570
}
570571

572+
if (ofi_info->domain_attr->mr_mode & FI_MR_ENDPOINT) {
573+
module->use_fi_mr_bind = true;
574+
}
575+
571576
/* create endpoint list */
572577
OBJ_CONSTRUCT(&module->endpoints, opal_list_t);
573578
OBJ_CONSTRUCT(&module->module_lock, opal_mutex_t);

opal/mca/btl/ofi/btl_ofi_module.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*
1717
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
1818
* Copyright (c) 2020 Google, LLC. All rights reserved.
19+
* Copyright (c) 2022 Triad National Security, LLC. All rights
20+
* reserved.
1921
* $COPYRIGHT$
2022
*
2123
* Additional copyrights may follow
@@ -239,6 +241,18 @@ int mca_btl_ofi_reg_mem(void *reg_data, void *base, size_t size,
239241
return OPAL_ERR_OUT_OF_RESOURCE;
240242
}
241243

244+
if (btl->use_fi_mr_bind) {
245+
BTL_VERBOSE(("binding mr to endpoint"));
246+
rc = fi_mr_bind(ur->ur_mr, &btl->ofi_endpoint->fid, 0ULL);
247+
if (FI_SUCCESS != rc) {
248+
return OPAL_ERR_OUT_OF_RESOURCE;
249+
}
250+
rc = fi_mr_enable(ur->ur_mr);
251+
if (FI_SUCCESS != rc) {
252+
return OPAL_ERR_OUT_OF_RESOURCE;
253+
}
254+
}
255+
242256
ur->handle.rkey = fi_mr_key(ur->ur_mr);
243257
ur->handle.desc = fi_mr_desc(ur->ur_mr);
244258

0 commit comments

Comments
 (0)