11/*
2- * Copyright (c) 2013-2015 Intel, Inc. All rights reserved
2+ * Copyright (c) 2013-2016 Intel, Inc. All rights reserved
33 *
44 * $COPYRIGHT$
55 *
@@ -51,10 +51,6 @@ BEGIN_C_DECLS
5151extern mca_mtl_ofi_module_t ompi_mtl_ofi ;
5252extern mca_base_framework_t ompi_mtl_base_framework ;
5353
54- extern int ompi_mtl_ofi_add_procs (struct mca_mtl_base_module_t * mtl ,
55- size_t nprocs ,
56- struct ompi_proc_t * * procs );
57-
5854extern int ompi_mtl_ofi_del_procs (struct mca_mtl_base_module_t * mtl ,
5955 size_t nprocs ,
6056 struct ompi_proc_t * * procs );
@@ -236,7 +232,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
236232 ompi_mtl_ofi_request_t * ack_req = NULL ; /* For synchronous send */
237233
238234 ompi_proc = ompi_comm_peer_lookup (comm , dest );
239- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
235+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
240236
241237 ompi_ret = ompi_mtl_datatype_pack (convertor , & start , & length , & free_after );
242238 if (OMPI_SUCCESS != ompi_ret ) return ompi_ret ;
@@ -267,6 +263,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
267263 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
268264 "%s:%d: fi_trecv failed: %s(%zd)" ,
269265 __FILE__ , __LINE__ , fi_strerror (- ret ), ret );
266+ free (ack_req );
270267 return ompi_mtl_ofi_get_error (ret );
271268 }
272269 } else {
@@ -285,6 +282,10 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
285282 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
286283 "%s:%d: fi_tinject failed: %s(%zd)" ,
287284 __FILE__ , __LINE__ , fi_strerror (- ret ), ret );
285+ if (ack_req ) {
286+ fi_cancel ((fid_t )ompi_mtl_ofi .ep , & ack_req -> ctx );
287+ free (ack_req );
288+ }
288289 return ompi_mtl_ofi_get_error (ret );
289290 }
290291
@@ -461,7 +462,7 @@ ompi_mtl_ofi_recv_callback(struct fi_cq_tagged_entry *wc,
461462 if (ompi_mtl_ofi .any_addr == ofi_req -> remote_addr ) {
462463 src = MTL_OFI_GET_SOURCE (wc -> tag );
463464 ompi_proc = ompi_comm_peer_lookup (ofi_req -> comm , src );
464- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
465+ endpoint = ompi_mtl_ofi_get_endpoint ( ofi_req -> mtl , ompi_proc ) ;
465466 ofi_req -> remote_addr = endpoint -> peer_fiaddr ;
466467 }
467468 MTL_OFI_RETRY_UNTIL_DONE (fi_tsend (ompi_mtl_ofi .ep ,
@@ -533,7 +534,7 @@ ompi_mtl_ofi_irecv(struct mca_mtl_base_module_t *mtl,
533534
534535 if (MPI_ANY_SOURCE != src ) {
535536 ompi_proc = ompi_comm_peer_lookup (comm , src );
536- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
537+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
537538 remote_addr = endpoint -> peer_fiaddr ;
538539 } else {
539540 remote_addr = ompi_mtl_ofi .any_addr ;
@@ -745,7 +746,7 @@ ompi_mtl_ofi_iprobe(struct mca_mtl_base_module_t *mtl,
745746 */
746747 if (MPI_ANY_SOURCE != src ) {
747748 ompi_proc = ompi_comm_peer_lookup ( comm , src );
748- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
749+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
749750 remote_proc = endpoint -> peer_fiaddr ;
750751 }
751752
@@ -830,7 +831,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
830831 */
831832 if (MPI_ANY_SOURCE != src ) {
832833 ompi_proc = ompi_comm_peer_lookup ( comm , src );
833- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
834+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
834835 remote_proc = endpoint -> peer_fiaddr ;
835836 }
836837
@@ -865,11 +866,13 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
865866 * The search request completed but no matching message was found.
866867 */
867868 * matched = 0 ;
869+ free (ofi_req );
868870 return OMPI_SUCCESS ;
869871 } else if (OPAL_UNLIKELY (0 > ret )) {
870872 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
871873 "%s:%d: fi_trecvmsg failed: %s(%zd)" ,
872874 __FILE__ , __LINE__ , fi_strerror (- ret ), ret );
875+ free (ofi_req );
873876 return ompi_mtl_ofi_get_error (ret );
874877 }
875878
@@ -895,6 +898,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
895898
896899 } else {
897900 (* message ) = MPI_MESSAGE_NULL ;
901+ free (ofi_req );
898902 }
899903
900904 return OMPI_SUCCESS ;
@@ -962,7 +966,6 @@ ompi_mtl_ofi_del_comm(struct mca_mtl_base_module_t *mtl,
962966 return OMPI_SUCCESS ;
963967}
964968
965-
966969END_C_DECLS
967970
968971#endif /* MTL_OFI_H_HAS_BEEN_INCLUDED */
0 commit comments