@@ -76,31 +76,6 @@ int ompi_mtl_ofi_progress_no_inline(void);
7676extern  opal_thread_local  int  ompi_mtl_ofi_per_thread_ctx ;
7777#endif 
7878
79- #define  MCA_MTL_OFI_CID_NOT_EXCHANGED  2
80- #define  MCA_MTL_OFI_CID_EXCHANGING     1 
81- #define  MCA_MTL_OFI_CID_EXCHANGED      0
82- 
83- typedef  struct  {
84-     uint32_t  c_index ;
85- } c_index_vec_t ;
86- 
87- typedef  struct  mca_mtl_comm_t  {
88-     opal_object_t  super ;
89-     c_index_vec_t  * c_index_vec ;
90- } mca_mtl_comm_t ;
91- 
92- OBJ_CLASS_DECLARATION (mca_mtl_comm_t );
93- 
94- struct  mca_mtl_ofi_cid_hdr_t  {
95-     ompi_comm_extended_cid_t  hdr_cid ;
96-     int16_t                   hdr_src_c_index ;
97-     int32_t                   hdr_src ;
98-     bool                      need_response ;
99-     bool                      ofi_cq_data ;
100- };
101- 
102- typedef  struct  mca_mtl_ofi_cid_hdr_t  mca_mtl_ofi_cid_hdr_t ;
103- 
10479/* Set OFI context for operations which generate completion events */ 
10580__opal_attribute_always_inline__  static  inline  void 
10681set_thread_context (int  ctxt )
@@ -572,7 +547,8 @@ ompi_mtl_ofi_send_generic(struct mca_mtl_base_module_t *mtl,
572547{
573548    ssize_t  ret  =  OMPI_SUCCESS ;
574549    ompi_mtl_ofi_request_t  ofi_req ;
575-     int  ompi_ret , ctxt_id  =  0 , c_index_for_tag ;
550+     int  ompi_ret , ctxt_id  =  0 ;
551+     uint32_t  c_index_for_tag ;
576552    void  * start ;
577553    bool  free_after ;
578554    size_t  length ;
@@ -582,25 +558,10 @@ ompi_mtl_ofi_send_generic(struct mca_mtl_base_module_t *mtl,
582558    ompi_mtl_ofi_request_t  * ack_req  =  NULL ; /* For synchronous send */ 
583559    fi_addr_t  src_addr  =  0 ;
584560    fi_addr_t  sep_peer_fiaddr  =  0 ;
585-     mca_mtl_comm_t  * mtl_comm ;
586-     uint32_t  remote_cid ;
587561
588-     if  (OPAL_LIKELY (OMPI_COMM_IS_GLOBAL_INDEX (comm ))) {
589-         c_index_for_tag  =  comm -> c_index ;
590-     } else  {
591-         mtl_comm  =  comm -> c_mtl_comm ;
592-         /* 
593-          * if we do not have the local cid for the target receiver, 
594-          * retrieve via the PMIx modex 
595-          */ 
596-         if  (mtl_comm -> c_index_vec [dest ].c_index  ==  0 ) {
597-             ompi_ret  =  ompi_comm_get_remote_cid (comm , dest , & remote_cid );
598-             if  (OPAL_UNLIKELY (OMPI_SUCCESS  !=  ompi_ret )) {
599-                 return  ompi_ret ;
600-             }
601-             mtl_comm -> c_index_vec [dest ].c_index  =  remote_cid ;
602-         }
603-         c_index_for_tag  =  mtl_comm -> c_index_vec [dest ].c_index ;
562+     ompi_ret  =  ompi_comm_get_remote_cid (comm , dest , & c_index_for_tag );
563+     if  (OPAL_UNLIKELY (OMPI_SUCCESS  !=  ompi_ret )) {
564+         return  ompi_ret ;
604565    }
605566
606567    ompi_mtl_ofi_set_mr_null (& ofi_req );
@@ -828,7 +789,8 @@ ompi_mtl_ofi_isend_generic(struct mca_mtl_base_module_t *mtl,
828789{
829790    ssize_t  ret  =  OMPI_SUCCESS ;
830791    ompi_mtl_ofi_request_t  * ofi_req  =  (ompi_mtl_ofi_request_t  * ) mtl_request ;
831-     int  ompi_ret , ctxt_id  =  0 , c_index_for_tag ;
792+     int  ompi_ret , ctxt_id  =  0 ;
793+     uint32_t  c_index_for_tag ;
832794    void  * start ;
833795    size_t  length ;
834796    bool  free_after ;
@@ -837,28 +799,10 @@ ompi_mtl_ofi_isend_generic(struct mca_mtl_base_module_t *mtl,
837799    mca_mtl_ofi_endpoint_t  * endpoint  =  NULL ;
838800    ompi_mtl_ofi_request_t  * ack_req  =  NULL ; /* For synchronous send */ 
839801    fi_addr_t  sep_peer_fiaddr  =  0 ;
840-     mca_mtl_comm_t  * mtl_comm ;
841-     uint32_t  remote_cid ;
842802
843803    ompi_mtl_ofi_set_mr_null (ofi_req );
844804
845-     if  (OMPI_COMM_IS_GLOBAL_INDEX (comm )) {
846-         c_index_for_tag  =  comm -> c_index ;
847-     } else  {
848-         mtl_comm  =  comm -> c_mtl_comm ;
849-         /* 
850-          * if we do not have the local cid for the target receiver, 
851-          * retrive via the PMIx modex  
852-          */ 
853-         if  (mtl_comm -> c_index_vec [dest ].c_index  ==  0 ) {    
854-             ompi_ret  =  ompi_comm_get_remote_cid (comm , dest , & remote_cid );
855-             if  (OPAL_UNLIKELY (OMPI_SUCCESS  !=  ompi_ret )) {
856-                 return  ompi_ret ;
857-             }   
858-             mtl_comm -> c_index_vec [dest ].c_index  =  remote_cid ;
859-         }
860-         c_index_for_tag  =  mtl_comm -> c_index_vec [dest ].c_index ;
861-     }
805+     ompi_ret  =  ompi_comm_get_remote_cid (comm , dest , & c_index_for_tag );
862806
863807    if  (ompi_mtl_ofi .total_ctxts_used  >  0 ) {
864808        ctxt_id  =  comm -> c_contextid .cid_sub .u64  % ompi_mtl_ofi .total_ctxts_used ;
0 commit comments