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
*
@@ -50,10 +50,6 @@ BEGIN_C_DECLS
50
50
extern mca_mtl_ofi_module_t ompi_mtl_ofi ;
51
51
extern mca_base_framework_t ompi_mtl_base_framework ;
52
52
53
- extern int ompi_mtl_ofi_add_procs (struct mca_mtl_base_module_t * mtl ,
54
- size_t nprocs ,
55
- struct ompi_proc_t * * procs );
56
-
57
53
extern int ompi_mtl_ofi_del_procs (struct mca_mtl_base_module_t * mtl ,
58
54
size_t nprocs ,
59
55
struct ompi_proc_t * * procs );
@@ -235,7 +231,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
235
231
ompi_mtl_ofi_request_t * ack_req = NULL ; /* For synchronous send */
236
232
237
233
ompi_proc = ompi_comm_peer_lookup (comm , dest );
238
- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
234
+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
239
235
240
236
ompi_ret = ompi_mtl_datatype_pack (convertor , & start , & length , & free_after );
241
237
if (OMPI_SUCCESS != ompi_ret ) return ompi_ret ;
@@ -266,6 +262,7 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
266
262
opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
267
263
"%s:%d: fi_trecv failed: %s(%zd)" ,
268
264
__FILE__ , __LINE__ , fi_strerror (- ret ), ret );
265
+ free (ack_req );
269
266
return ompi_mtl_ofi_get_error (ret );
270
267
}
271
268
} else {
@@ -284,6 +281,10 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
284
281
opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
285
282
"%s:%d: fi_tinject failed: %s(%zd)" ,
286
283
__FILE__ , __LINE__ , fi_strerror (- ret ), ret );
284
+ if (ack_req ) {
285
+ fi_cancel ((fid_t )ompi_mtl_ofi .ep , & ack_req -> ctx );
286
+ free (ack_req );
287
+ }
287
288
return ompi_mtl_ofi_get_error (ret );
288
289
}
289
290
@@ -460,7 +461,7 @@ ompi_mtl_ofi_recv_callback(struct fi_cq_tagged_entry *wc,
460
461
if (ompi_mtl_ofi .any_addr == ofi_req -> remote_addr ) {
461
462
src = MTL_OFI_GET_SOURCE (wc -> tag );
462
463
ompi_proc = ompi_comm_peer_lookup (ofi_req -> comm , src );
463
- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
464
+ endpoint = ompi_mtl_ofi_get_endpoint ( ofi_req -> mtl , ompi_proc ) ;
464
465
ofi_req -> remote_addr = endpoint -> peer_fiaddr ;
465
466
}
466
467
MTL_OFI_RETRY_UNTIL_DONE (fi_tsend (ompi_mtl_ofi .ep ,
@@ -532,7 +533,7 @@ ompi_mtl_ofi_irecv(struct mca_mtl_base_module_t *mtl,
532
533
533
534
if (MPI_ANY_SOURCE != src ) {
534
535
ompi_proc = ompi_comm_peer_lookup (comm , src );
535
- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
536
+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
536
537
remote_addr = endpoint -> peer_fiaddr ;
537
538
} else {
538
539
remote_addr = ompi_mtl_ofi .any_addr ;
@@ -744,7 +745,7 @@ ompi_mtl_ofi_iprobe(struct mca_mtl_base_module_t *mtl,
744
745
*/
745
746
if (MPI_ANY_SOURCE != src ) {
746
747
ompi_proc = ompi_comm_peer_lookup ( comm , src );
747
- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
748
+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
748
749
remote_proc = endpoint -> peer_fiaddr ;
749
750
}
750
751
@@ -829,7 +830,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
829
830
*/
830
831
if (MPI_ANY_SOURCE != src ) {
831
832
ompi_proc = ompi_comm_peer_lookup ( comm , src );
832
- endpoint = ompi_proc -> proc_endpoints [ OMPI_PROC_ENDPOINT_TAG_MTL ] ;
833
+ endpoint = ompi_mtl_ofi_get_endpoint ( mtl , ompi_proc ) ;
833
834
remote_proc = endpoint -> peer_fiaddr ;
834
835
}
835
836
@@ -864,11 +865,13 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
864
865
* The search request completed but no matching message was found.
865
866
*/
866
867
* matched = 0 ;
868
+ free (ofi_req );
867
869
return OMPI_SUCCESS ;
868
870
} else if (OPAL_UNLIKELY (0 > ret )) {
869
871
opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
870
872
"%s:%d: fi_trecvmsg failed: %s(%zd)" ,
871
873
__FILE__ , __LINE__ , fi_strerror (- ret ), ret );
874
+ free (ofi_req );
872
875
return ompi_mtl_ofi_get_error (ret );
873
876
}
874
877
@@ -894,6 +897,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
894
897
895
898
} else {
896
899
(* message ) = MPI_MESSAGE_NULL ;
900
+ free (ofi_req );
897
901
}
898
902
899
903
return OMPI_SUCCESS ;
@@ -961,7 +965,6 @@ ompi_mtl_ofi_del_comm(struct mca_mtl_base_module_t *mtl,
961
965
return OMPI_SUCCESS ;
962
966
}
963
967
964
-
965
968
END_C_DECLS
966
969
967
970
#endif /* MTL_OFI_H_HAS_BEEN_INCLUDED */
0 commit comments