1
1
/*
2
- * Copyright (c) 2013-2015 Intel, Inc. All rights reserved
2
+ * Copyright (c) 2013-2016 Intel, Inc. All rights reserved
3
3
*
4
4
* $COPYRIGHT$
5
5
*
@@ -51,10 +51,6 @@ BEGIN_C_DECLS
51
51
extern mca_mtl_ofi_module_t ompi_mtl_ofi ;
52
52
extern mca_base_framework_t ompi_mtl_base_framework ;
53
53
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
-
58
54
extern int ompi_mtl_ofi_del_procs (struct mca_mtl_base_module_t * mtl ,
59
55
size_t nprocs ,
60
56
struct ompi_proc_t * * procs );
@@ -236,7 +232,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
236
232
ompi_mtl_ofi_request_t * ack_req = NULL ; /* For synchronous send */
237
233
238
234
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 ) ;
240
236
241
237
ompi_ret = ompi_mtl_datatype_pack (convertor , & start , & length , & free_after );
242
238
if (OMPI_SUCCESS != ompi_ret ) return ompi_ret ;
@@ -267,6 +263,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
267
263
opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
268
264
"%s:%d: fi_trecv failed: %s(%zd)" ,
269
265
__FILE__ , __LINE__ , fi_strerror (- ret ), ret );
266
+ free (ack_req );
270
267
return ompi_mtl_ofi_get_error (ret );
271
268
}
272
269
} else {
@@ -285,6 +282,10 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
285
282
opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
286
283
"%s:%d: fi_tinject failed: %s(%zd)" ,
287
284
__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
+ }
288
289
return ompi_mtl_ofi_get_error (ret );
289
290
}
290
291
@@ -461,7 +462,7 @@ ompi_mtl_ofi_recv_callback(struct fi_cq_tagged_entry *wc,
461
462
if (ompi_mtl_ofi .any_addr == ofi_req -> remote_addr ) {
462
463
src = MTL_OFI_GET_SOURCE (wc -> tag );
463
464
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 ) ;
465
466
ofi_req -> remote_addr = endpoint -> peer_fiaddr ;
466
467
}
467
468
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,
533
534
534
535
if (MPI_ANY_SOURCE != src ) {
535
536
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 ) ;
537
538
remote_addr = endpoint -> peer_fiaddr ;
538
539
} else {
539
540
remote_addr = ompi_mtl_ofi .any_addr ;
@@ -745,7 +746,7 @@ ompi_mtl_ofi_iprobe(struct mca_mtl_base_module_t *mtl,
745
746
*/
746
747
if (MPI_ANY_SOURCE != src ) {
747
748
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 ) ;
749
750
remote_proc = endpoint -> peer_fiaddr ;
750
751
}
751
752
@@ -830,7 +831,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
830
831
*/
831
832
if (MPI_ANY_SOURCE != src ) {
832
833
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 ) ;
834
835
remote_proc = endpoint -> peer_fiaddr ;
835
836
}
836
837
@@ -865,11 +866,13 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
865
866
* The search request completed but no matching message was found.
866
867
*/
867
868
* matched = 0 ;
869
+ free (ofi_req );
868
870
return OMPI_SUCCESS ;
869
871
} else if (OPAL_UNLIKELY (0 > ret )) {
870
872
opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
871
873
"%s:%d: fi_trecvmsg failed: %s(%zd)" ,
872
874
__FILE__ , __LINE__ , fi_strerror (- ret ), ret );
875
+ free (ofi_req );
873
876
return ompi_mtl_ofi_get_error (ret );
874
877
}
875
878
@@ -895,6 +898,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
895
898
896
899
} else {
897
900
(* message ) = MPI_MESSAGE_NULL ;
901
+ free (ofi_req );
898
902
}
899
903
900
904
return OMPI_SUCCESS ;
@@ -962,7 +966,6 @@ ompi_mtl_ofi_del_comm(struct mca_mtl_base_module_t *mtl,
962
966
return OMPI_SUCCESS ;
963
967
}
964
968
965
-
966
969
END_C_DECLS
967
970
968
971
#endif /* MTL_OFI_H_HAS_BEEN_INCLUDED */
0 commit comments