3838#include "mtl_ofi_endpoint.h"
3939#include "mtl_ofi_compat.h"
4040
41- #define FI_RETRY_UNTIL_DONE (FUNC ) \
42- do { \
43- do { \
44- ret = FUNC; \
41+ #define MTL_OFI_RETRY_UNTIL_DONE (FUNC ) \
42+ do { \
43+ do { \
44+ ret = FUNC; \
4545 if(OPAL_LIKELY(0 == ret)) {break;} \
46- } while(-FI_EAGAIN == ret); \
46+ } while(-FI_EAGAIN == ret); \
4747 } while(0);
4848
4949BEGIN_C_DECLS
@@ -254,14 +254,14 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
254254 ofi_req -> completion_count = 2 ;
255255 MTL_OFI_SET_SEND_BITS (match_bits , comm -> c_contextid ,
256256 comm -> c_my_rank , tag , MTL_OFI_SYNC_SEND );
257- FI_RETRY_UNTIL_DONE (fi_trecv (ompi_mtl_ofi .ep ,
258- NULL ,
259- 0 ,
260- NULL ,
261- endpoint -> peer_fiaddr ,
262- match_bits | MTL_OFI_SYNC_SEND_ACK ,
263- 0 , /* Exact match, no ignore bits */
264- (void * ) & ack_req -> ctx ));
257+ MTL_OFI_RETRY_UNTIL_DONE (fi_trecv (ompi_mtl_ofi .ep ,
258+ NULL ,
259+ 0 ,
260+ NULL ,
261+ endpoint -> peer_fiaddr ,
262+ match_bits | MTL_OFI_SYNC_SEND_ACK ,
263+ 0 , /* Exact match, no ignore bits */
264+ (void * ) & ack_req -> ctx ));
265265 if (OPAL_UNLIKELY (0 > ret )) {
266266 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
267267 "%s:%d: fi_trecv failed: %s(%zd)" ,
@@ -275,11 +275,11 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
275275 }
276276
277277 if (ompi_mtl_ofi .max_inject_size >= length ) {
278- FI_RETRY_UNTIL_DONE (fi_tinject (ompi_mtl_ofi .ep ,
279- start ,
280- length ,
281- endpoint -> peer_fiaddr ,
282- match_bits ));
278+ MTL_OFI_RETRY_UNTIL_DONE (fi_tinject (ompi_mtl_ofi .ep ,
279+ start ,
280+ length ,
281+ endpoint -> peer_fiaddr ,
282+ match_bits ));
283283 if (OPAL_UNLIKELY (0 > ret )) {
284284 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
285285 "%s:%d: fi_tinject failed: %s(%zd)" ,
@@ -289,13 +289,13 @@ ompi_mtl_ofi_send_start(struct mca_mtl_base_module_t *mtl,
289289
290290 ofi_req -> event_callback (NULL ,ofi_req );
291291 } else {
292- FI_RETRY_UNTIL_DONE (fi_tsend (ompi_mtl_ofi .ep ,
293- start ,
294- length ,
295- NULL ,
296- endpoint -> peer_fiaddr ,
297- match_bits ,
298- (void * ) & ofi_req -> ctx ));
292+ MTL_OFI_RETRY_UNTIL_DONE (fi_tsend (ompi_mtl_ofi .ep ,
293+ start ,
294+ length ,
295+ NULL ,
296+ endpoint -> peer_fiaddr ,
297+ match_bits ,
298+ (void * ) & ofi_req -> ctx ));
299299 if (OPAL_UNLIKELY (0 > ret )) {
300300 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
301301 "%s:%d: fi_tsend failed: %s(%zd)" ,
@@ -463,13 +463,13 @@ ompi_mtl_ofi_recv_callback(struct fi_cq_tagged_entry *wc,
463463 endpoint = ompi_proc -> proc_endpoints [OMPI_PROC_ENDPOINT_TAG_MTL ];
464464 ofi_req -> remote_addr = endpoint -> peer_fiaddr ;
465465 }
466- FI_RETRY_UNTIL_DONE (fi_tsend (ompi_mtl_ofi .ep ,
467- NULL ,
468- 0 ,
469- NULL ,
470- ofi_req -> remote_addr ,
471- wc -> tag | MTL_OFI_SYNC_SEND_ACK ,
472- (void * ) & ofi_req -> ctx ));
466+ MTL_OFI_RETRY_UNTIL_DONE (fi_tsend (ompi_mtl_ofi .ep ,
467+ NULL ,
468+ 0 ,
469+ NULL ,
470+ ofi_req -> remote_addr ,
471+ wc -> tag | MTL_OFI_SYNC_SEND_ACK ,
472+ (void * ) & ofi_req -> ctx ));
473473 if (OPAL_UNLIKELY (0 > ret )) {
474474 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
475475 "%s:%d: fi_tsend failed: %s(%zd)" ,
@@ -560,14 +560,14 @@ ompi_mtl_ofi_irecv(struct mca_mtl_base_module_t *mtl,
560560 ofi_req -> remote_addr = remote_addr ;
561561 ofi_req -> match_bits = match_bits ;
562562
563- FI_RETRY_UNTIL_DONE (fi_trecv (ompi_mtl_ofi .ep ,
564- start ,
565- length ,
566- NULL ,
567- remote_addr ,
568- match_bits ,
569- mask_bits ,
570- (void * )& ofi_req -> ctx ));
563+ MTL_OFI_RETRY_UNTIL_DONE (fi_trecv (ompi_mtl_ofi .ep ,
564+ start ,
565+ length ,
566+ NULL ,
567+ remote_addr ,
568+ match_bits ,
569+ mask_bits ,
570+ (void * )& ofi_req -> ctx ));
571571 if (OPAL_UNLIKELY (0 > ret )) {
572572 if (NULL != ofi_req -> buffer ) {
573573 free (ofi_req -> buffer );
@@ -680,7 +680,7 @@ ompi_mtl_ofi_imrecv(struct mca_mtl_base_module_t *mtl,
680680 msg .context = (void * )& ofi_req -> ctx ;
681681 msg .data = 0 ;
682682
683- FI_RETRY_UNTIL_DONE (fi_trecvmsg (ompi_mtl_ofi .ep , & msg , msgflags ));
683+ MTL_OFI_RETRY_UNTIL_DONE (fi_trecvmsg (ompi_mtl_ofi .ep , & msg , msgflags ));
684684 if (OPAL_UNLIKELY (0 > ret )) {
685685 opal_output_verbose (1 , ompi_mtl_base_framework .framework_output ,
686686 "%s:%d: unexpected return code from fi_trecvmsg: %s(%zd)" ,
@@ -773,7 +773,7 @@ ompi_mtl_ofi_iprobe(struct mca_mtl_base_module_t *mtl,
773773 ofi_req .completion_count = 1 ;
774774 ofi_req .match_state = 0 ;
775775
776- FI_RETRY_UNTIL_DONE (fi_trecvmsg (ompi_mtl_ofi .ep , & msg , msgflags ));
776+ MTL_OFI_RETRY_UNTIL_DONE (fi_trecvmsg (ompi_mtl_ofi .ep , & msg , msgflags ));
777777 if (- FI_ENOMSG == ret ) {
778778 /**
779779 * The search request completed but no matching message was found.
@@ -858,7 +858,7 @@ ompi_mtl_ofi_improbe(struct mca_mtl_base_module_t *mtl,
858858 ofi_req -> completion_count = 1 ;
859859 ofi_req -> match_state = 0 ;
860860
861- FI_RETRY_UNTIL_DONE (fi_trecvmsg (ompi_mtl_ofi .ep , & msg , msgflags ));
861+ MTL_OFI_RETRY_UNTIL_DONE (fi_trecvmsg (ompi_mtl_ofi .ep , & msg , msgflags ));
862862 if (- FI_ENOMSG == ret ) {
863863 /**
864864 * The search request completed but no matching message was found.
0 commit comments