@@ -736,6 +736,7 @@ ompi_mtl_ofi_send_excid(struct mca_mtl_base_module_t *mtl,
736736 /**
737737 * Create a send request, start it and wait until it completes.
738738 */
739+ ofi_req -> type = OMPI_MTL_OFI_SEND ;
739740 ofi_req -> event_callback = ompi_mtl_ofi_send_excid_callback ;
740741 ofi_req -> error_callback = ompi_mtl_ofi_send_error_callback ;
741742 ofi_req -> buffer = start ;
@@ -1060,6 +1061,7 @@ ompi_mtl_ofi_isend_generic(struct mca_mtl_base_module_t *mtl,
10601061 ompi_ret = ompi_mtl_datatype_pack (convertor , & start , & length , & free_after );
10611062 if (OPAL_UNLIKELY (OMPI_SUCCESS != ompi_ret )) return ompi_ret ;
10621063
1064+ ofi_req -> type = OMPI_MTL_OFI_SEND ;
10631065 ofi_req -> buffer = (free_after ) ? start : NULL ;
10641066 ofi_req -> length = length ;
10651067 ofi_req -> status .MPI_ERROR = OMPI_SUCCESS ;
@@ -1774,9 +1776,8 @@ ompi_mtl_ofi_cancel(struct mca_mtl_base_module_t *mtl,
17741776 int ret , ctxt_id = 0 ;
17751777 ompi_mtl_ofi_request_t * ofi_req = (ompi_mtl_ofi_request_t * ) mtl_request ;
17761778
1777- ctxt_id = ompi_mtl_ofi_map_comm_to_ctxt (ofi_req -> comm -> c_index );
1778-
17791779 switch (ofi_req -> type ) {
1780+ case OMPI_MTL_OFI_PROBE :
17801781 case OMPI_MTL_OFI_SEND :
17811782 /**
17821783 * Cannot cancel sends yet
@@ -1792,6 +1793,8 @@ ompi_mtl_ofi_cancel(struct mca_mtl_base_module_t *mtl,
17921793 ompi_mtl_ofi_progress ();
17931794
17941795 if (!ofi_req -> req_started ) {
1796+ ctxt_id = ompi_mtl_ofi_map_comm_to_ctxt (ofi_req -> comm -> c_index );
1797+
17951798 ret = fi_cancel ((fid_t )ompi_mtl_ofi .ofi_ctxt [ctxt_id ].rx_ep ,
17961799 & ofi_req -> ctx );
17971800 if (0 == ret ) {
0 commit comments