|
5 | 5 | * Copyright (c) 2014-2021 Cisco Systems, Inc. All rights reserved |
6 | 6 | * Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights |
7 | 7 | * reserved. |
8 | | - * Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. |
| 8 | + * Copyright (c) 2018-2025 Amazon.com, Inc. or its affiliates. All Rights reserved. |
9 | 9 | * Copyright (c) 2020-2023 Triad National Security, LLC. All rights |
10 | 10 | * reserved. |
11 | 11 | * $COPYRIGHT$ |
@@ -823,20 +823,17 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, |
823 | 823 | } |
824 | 824 | } else { |
825 | 825 | *accelerator_support = true; |
826 | | - ompi_mtl_ofi.hmem_needs_reg = true; |
827 | | - /* |
828 | | - * Workaround for the fact that the CXI provider actually doesn't need for accelerator memory to be registered |
829 | | - * for local buffers, but if one does do so using fi_mr_regattr, one actually needs to manage the |
830 | | - * requested_key field in the fi_mr_attr attr argument, and the OFI MTL doesn't track which requested_keys |
831 | | - * have already been registered. So just set a flag to disable local registration. Note the OFI BTL doesn't |
832 | | - * have a problem here since it uses fi_mr_regattr only within the context of an rcache, and manages the |
833 | | - * requested_key field in this way. |
834 | | - */ |
835 | | - if ((NULL != strstr(prov->fabric_attr->prov_name, "cxi")) || |
836 | | - (NULL != strstr(prov->fabric_attr->prov_name, "CXI")) ) { |
837 | | - ompi_mtl_ofi.hmem_needs_reg = false; |
838 | | - } |
839 | 826 |
|
| 827 | + /* Only explicitly register domain buffers if the provider requires it. |
| 828 | + For example, CXI does not require it but EFA does require it. */ |
| 829 | + if ((prov->domain_attr->mr_mode & FI_MR_HMEM) != 0) { |
| 830 | + ompi_mtl_ofi.hmem_needs_reg = true; |
| 831 | + opal_output_verbose(50, opal_common_ofi.output, |
| 832 | + "Support for device buffers enabled with explicit registration"); |
| 833 | + } else { |
| 834 | + opal_output_verbose(50, opal_common_ofi.output, |
| 835 | + "Support for device buffers enabled with implicit registration"); |
| 836 | + } |
840 | 837 | } |
841 | 838 | #else |
842 | 839 | opal_output_verbose(50, opal_common_ofi.output, |
|
0 commit comments