@@ -80,8 +80,9 @@ extern opal_thread_local int ompi_mtl_ofi_per_thread_ctx;
80
80
extern opal_thread_local struct fi_cq_tagged_entry ompi_mtl_ofi_wc [MTL_OFI_MAX_PROG_EVENT_COUNT ];
81
81
#endif
82
82
83
- #define MCA_MTL_OFI_CID_NOT_EXCHANGED 1
84
- #define MCA_MTL_OFI_CID_EXCHANGING 2
83
+ #define MCA_MTL_OFI_CID_NOT_EXCHANGED 2
84
+ #define MCA_MTL_OFI_CID_EXCHANGING 1
85
+ #define MCA_MTL_OFI_CID_EXCHANGED 0
85
86
86
87
typedef struct {
87
88
uint32_t c_index :30 ;
@@ -543,13 +544,13 @@ ompi_mtl_ofi_post_recv_excid_buffer_callback(struct fi_cq_tagged_entry *wc,
543
544
544
545
mtl_comm = comm -> c_mtl_comm ;
545
546
546
- if (mtl_comm -> c_index_vec [src ].c_index_state == 2
547
+ if (mtl_comm -> c_index_vec [src ].c_index_state == MCA_MTL_OFI_CID_NOT_EXCHANGED
547
548
&& buffer -> need_response ) {
548
549
mtl_comm -> c_index_vec [src ].c_index = buffer -> hdr_src_c_index ;
549
- mtl_comm -> c_index_vec [src ].c_index_state = 0 ;
550
+ mtl_comm -> c_index_vec [src ].c_index_state = MCA_MTL_OFI_CID_EXCHANGED ;
550
551
ret = ompi_mtl_ofi_send_excid (ofi_req -> mtl , comm , src , buffer -> ofi_cq_data , false);
551
552
} else {
552
- mtl_comm -> c_index_vec [src ].c_index_state = 0 ;
553
+ mtl_comm -> c_index_vec [src ].c_index_state = MCA_MTL_OFI_CID_EXCHANGED ;
553
554
mtl_comm -> c_index_vec [src ].c_index = buffer -> hdr_src_c_index ;
554
555
}
555
556
@@ -600,7 +601,7 @@ ompi_mtl_ofi_post_recv_excid_buffer(bool blocking, struct ompi_communicator_t *c
600
601
601
602
if (blocking ) {
602
603
assert (src != -1 );
603
- while (mtl_comm -> c_index_vec [src ].c_index_state > 0 ) {
604
+ while (mtl_comm -> c_index_vec [src ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) {
604
605
ompi_mtl_ofi_progress ();
605
606
}
606
607
}
@@ -694,7 +695,7 @@ ompi_mtl_ofi_send_excid(struct mca_mtl_base_module_t *mtl,
694
695
start -> hdr_src = comm -> c_my_rank ;
695
696
start -> hdr_src_c_index = comm -> c_index ;
696
697
start -> ofi_cq_data = ofi_cq_data ;
697
- if (mtl_comm -> c_index_vec [dest ].c_index_state > 0 ) {
698
+ if (mtl_comm -> c_index_vec [dest ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) {
698
699
start -> need_response = true;
699
700
} else {
700
701
start -> need_response = false;
@@ -791,13 +792,13 @@ ompi_mtl_ofi_send_generic(struct mca_mtl_base_module_t *mtl,
791
792
c_index_for_tag = comm -> c_index ;
792
793
} else {
793
794
mtl_comm = comm -> c_mtl_comm ;
794
- if (mtl_comm -> c_index_vec [dest ].c_index_state == 2 ) {
795
- mtl_comm -> c_index_vec [dest ].c_index_state = 1 ;
795
+ if (mtl_comm -> c_index_vec [dest ].c_index_state == MCA_MTL_OFI_CID_NOT_EXCHANGED ) {
796
+ mtl_comm -> c_index_vec [dest ].c_index_state = MCA_MTL_OFI_CID_EXCHANGING ;
796
797
ompi_ret = ompi_mtl_ofi_send_excid (mtl , comm , dest , ofi_cq_data , true);
797
798
}
798
799
799
- if (mtl_comm -> c_index_vec [dest ].c_index_state > 0 ) {
800
- while (mtl_comm -> c_index_vec [dest ].c_index_state > 0 ) {
800
+ if (mtl_comm -> c_index_vec [dest ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) {
801
+ while (mtl_comm -> c_index_vec [dest ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) {
801
802
ompi_ret = ompi_mtl_ofi_post_recv_excid_buffer (true, comm , dest );
802
803
}
803
804
}
@@ -971,12 +972,12 @@ ompi_mtl_ofi_isend_generic(struct mca_mtl_base_module_t *mtl,
971
972
c_index_for_tag = comm -> c_index ;
972
973
} else {
973
974
mtl_comm = comm -> c_mtl_comm ;
974
- if (mtl_comm -> c_index_vec [dest ].c_index_state == 2 ) {
975
- mtl_comm -> c_index_vec [dest ].c_index_state = 1 ;
975
+ if (mtl_comm -> c_index_vec [dest ].c_index_state == MCA_MTL_OFI_CID_NOT_EXCHANGED ) {
976
+ mtl_comm -> c_index_vec [dest ].c_index_state = MCA_MTL_OFI_CID_EXCHANGING ;
976
977
ompi_ret = ompi_mtl_ofi_send_excid (mtl , comm , dest , ofi_cq_data , true);
977
978
}
978
- if (mtl_comm -> c_index_vec [dest ].c_index_state > 0 ) {
979
- while (mtl_comm -> c_index_vec [dest ].c_index_state > 0 ) {
979
+ if (mtl_comm -> c_index_vec [dest ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) {
980
+ while (mtl_comm -> c_index_vec [dest ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) {
980
981
ompi_ret = ompi_mtl_ofi_post_recv_excid_buffer (true, comm , dest );
981
982
}
982
983
}
@@ -1235,13 +1236,13 @@ ompi_mtl_ofi_irecv_generic(struct mca_mtl_base_module_t *mtl,
1235
1236
1236
1237
if (!OMPI_COMM_IS_GLOBAL_INDEX (comm )) {
1237
1238
mtl_comm = comm -> c_mtl_comm ;
1238
- if ((src == MPI_ANY_SOURCE || mtl_comm -> c_index_vec [src ].c_index_state > 0 ) &&
1239
+ if ((src == MPI_ANY_SOURCE || mtl_comm -> c_index_vec [src ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) &&
1239
1240
!ompi_mtl_ofi .has_posted_initial_buffer ) {
1240
1241
ompi_mtl_ofi .has_posted_initial_buffer = true;
1241
1242
ompi_ret = ompi_mtl_ofi_post_recv_excid_buffer (false, comm , -1 );
1242
1243
}
1243
- if (src >= 0 && mtl_comm -> c_index_vec [src ].c_index_state == 2 ) {
1244
- mtl_comm -> c_index_vec [src ].c_index_state = 1 ;
1244
+ if (src >= 0 && mtl_comm -> c_index_vec [src ].c_index_state == MCA_MTL_OFI_CID_NOT_EXCHANGED ) {
1245
+ mtl_comm -> c_index_vec [src ].c_index_state = MCA_MTL_OFI_CID_EXCHANGING ;
1245
1246
ompi_ret = ompi_mtl_ofi_send_excid (mtl , comm , src , ofi_cq_data , false);
1246
1247
}
1247
1248
}
@@ -1506,13 +1507,13 @@ ompi_mtl_ofi_iprobe_generic(struct mca_mtl_base_module_t *mtl,
1506
1507
1507
1508
if (!OMPI_COMM_IS_GLOBAL_INDEX (comm )) {
1508
1509
mtl_comm = comm -> c_mtl_comm ;
1509
- if ((src == MPI_ANY_SOURCE || mtl_comm -> c_index_vec [src ].c_index_state > 0 ) &&
1510
+ if ((src == MPI_ANY_SOURCE || mtl_comm -> c_index_vec [src ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED ) &&
1510
1511
!ompi_mtl_ofi .has_posted_initial_buffer ) {
1511
1512
ompi_mtl_ofi .has_posted_initial_buffer = true;
1512
1513
ret = ompi_mtl_ofi_post_recv_excid_buffer (false, comm , -1 );
1513
1514
}
1514
- if (src >= 0 && mtl_comm -> c_index_vec [src ].c_index_state == 2 ) {
1515
- mtl_comm -> c_index_vec [src ].c_index_state = 1 ;
1515
+ if (src >= 0 && mtl_comm -> c_index_vec [src ].c_index_state == MCA_MTL_OFI_CID_NOT_EXCHANGED ) {
1516
+ mtl_comm -> c_index_vec [src ].c_index_state = MCA_MTL_OFI_CID_EXCHANGING ;
1516
1517
ret = ompi_mtl_ofi_send_excid (mtl , comm , src , ofi_cq_data , false);
1517
1518
}
1518
1519
}
@@ -1606,12 +1607,13 @@ ompi_mtl_ofi_improbe_generic(struct mca_mtl_base_module_t *mtl,
1606
1607
1607
1608
if (!OMPI_COMM_IS_GLOBAL_INDEX (comm )) {
1608
1609
mtl_comm = comm -> c_mtl_comm ;
1609
- if ((src == MPI_ANY_SOURCE || mtl_comm -> c_index_vec [src ].c_index_state > 0 ) && !ompi_mtl_ofi .has_posted_initial_buffer ) {
1610
+ if ((src == MPI_ANY_SOURCE || mtl_comm -> c_index_vec [src ].c_index_state > MCA_MTL_OFI_CID_EXCHANGED )
1611
+ && !ompi_mtl_ofi .has_posted_initial_buffer ) {
1610
1612
ompi_mtl_ofi .has_posted_initial_buffer = true;
1611
1613
ret = ompi_mtl_ofi_post_recv_excid_buffer (false, comm , -1 );
1612
1614
}
1613
- if (src >= 0 && mtl_comm -> c_index_vec [src ].c_index_state == 2 ) {
1614
- mtl_comm -> c_index_vec [src ].c_index_state = 1 ;
1615
+ if (src >= 0 && mtl_comm -> c_index_vec [src ].c_index_state == MCA_MTL_OFI_CID_NOT_EXCHANGED ) {
1616
+ mtl_comm -> c_index_vec [src ].c_index_state = MCA_MTL_OFI_CID_EXCHANGING ;
1615
1617
ret = ompi_mtl_ofi_send_excid (mtl , comm , src , ofi_cq_data , false);
1616
1618
}
1617
1619
}
0 commit comments