|
4 | 4 | * reserved.
|
5 | 5 | * Copyright (c) 2019-2022 Triad National Security, LLC. All rights
|
6 | 6 | * reserved.
|
7 |
| - * Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. |
| 7 | + * Copyright (c) 2018-2023 Amazon.com, Inc. or its affiliates. All Rights reserved. |
8 | 8 | * reserved.
|
9 | 9 | * Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
|
10 | 10 | * Copyright (c) 2021 The University of Tennessee and The University
|
@@ -1165,6 +1165,46 @@ ompi_mtl_ofi_isend_generic(struct mca_mtl_base_module_t *mtl,
|
1165 | 1165 | return ompi_ret;
|
1166 | 1166 | }
|
1167 | 1167 |
|
| 1168 | + |
| 1169 | + /** Inject does not currently support device memory |
| 1170 | + * https://github.com/ofiwg/libfabric/issues/5861 |
| 1171 | + */ |
| 1172 | + if (!(convertor->flags & CONVERTOR_ACCELERATOR) |
| 1173 | + && (ompi_mtl_ofi.max_inject_size >= length)) { |
| 1174 | + if (ofi_cq_data) { |
| 1175 | + ret = fi_tinjectdata(ompi_mtl_ofi.ofi_ctxt[ctxt_id].tx_ep, |
| 1176 | + start, |
| 1177 | + length, |
| 1178 | + comm->c_my_rank, |
| 1179 | + sep_peer_fiaddr, |
| 1180 | + match_bits); |
| 1181 | + } else { |
| 1182 | + ret = fi_tinject(ompi_mtl_ofi.ofi_ctxt[ctxt_id].tx_ep, |
| 1183 | + start, |
| 1184 | + length, |
| 1185 | + sep_peer_fiaddr, |
| 1186 | + match_bits); |
| 1187 | + } |
| 1188 | + |
| 1189 | + if(OPAL_LIKELY(ret == 0)) { |
| 1190 | + ofi_req->event_callback(NULL, ofi_req); |
| 1191 | + return ofi_req->status.MPI_ERROR; |
| 1192 | + } else if(ret != -FI_EAGAIN) { |
| 1193 | + MTL_OFI_LOG_FI_ERR(ret, |
| 1194 | + ofi_cq_data ? "fi_tinjectdata failed" |
| 1195 | + : "fi_tinject failed"); |
| 1196 | + if (ack_req) { |
| 1197 | + fi_cancel((fid_t)ompi_mtl_ofi.ofi_ctxt[ctxt_id].tx_ep, &ack_req->ctx); |
| 1198 | + free(ack_req); |
| 1199 | + } |
| 1200 | + ofi_req->status.MPI_ERROR = ompi_mtl_ofi_get_error(ret); |
| 1201 | + ofi_req->event_callback(NULL, ofi_req); |
| 1202 | + return ofi_req->status.MPI_ERROR; |
| 1203 | + } |
| 1204 | + /* otherwise fall back to the standard fi_tsend path */ |
| 1205 | + } |
| 1206 | + |
| 1207 | + |
1168 | 1208 | if (ofi_cq_data) {
|
1169 | 1209 | MTL_OFI_RETRY_UNTIL_DONE(fi_tsenddata(ompi_mtl_ofi.ofi_ctxt[ctxt_id].tx_ep,
|
1170 | 1210 | start,
|
|
0 commit comments