@@ -63,6 +63,7 @@ int mca_btl_ofi_afop(struct mca_btl_base_module_t *btl, struct mca_btl_base_endp
6363 mca_btl_ofi_rdma_completion_t * comp = NULL ;
6464 mca_btl_ofi_context_t * ofi_context ;
6565
66+ MCA_BTL_OFI_NUM_RDMA_INC (ofi_btl );
6667 ofi_context = get_ofi_context (ofi_btl );
6768
6869 if (flags & MCA_BTL_ATOMIC_FLAG_32BIT ) {
@@ -87,16 +88,16 @@ int mca_btl_ofi_afop(struct mca_btl_base_module_t *btl, struct mca_btl_base_endp
8788 fi_datatype , fi_op , & comp -> comp_ctx );
8889
8990 if (rc == - FI_EAGAIN ) {
91+ MCA_BTL_OFI_NUM_RDMA_DEC (ofi_btl );
9092 opal_free_list_return (comp -> base .my_list , (opal_free_list_item_t * ) comp );
9193 return OPAL_ERR_OUT_OF_RESOURCE ;
9294 } else if (rc < 0 ) {
95+ MCA_BTL_OFI_NUM_RDMA_DEC (ofi_btl );
9396 opal_free_list_return (comp -> base .my_list , (opal_free_list_item_t * ) comp );
9497 BTL_ERROR (("fi_fetch_atomic failed with rc=%d (%s)" , rc , fi_strerror (- rc )));
9598 MCA_BTL_OFI_ABORT ();
9699 }
97100
98- MCA_BTL_OFI_NUM_RDMA_INC (ofi_btl );
99-
100101 return OPAL_SUCCESS ;
101102}
102103
@@ -114,6 +115,7 @@ int mca_btl_ofi_aop(struct mca_btl_base_module_t *btl, mca_btl_base_endpoint_t *
114115 mca_btl_ofi_rdma_completion_t * comp = NULL ;
115116 mca_btl_ofi_context_t * ofi_context ;
116117
118+ MCA_BTL_OFI_NUM_RDMA_INC (ofi_btl );
117119 ofi_context = get_ofi_context (ofi_btl );
118120
119121 if (flags & MCA_BTL_ATOMIC_FLAG_32BIT ) {
@@ -136,16 +138,16 @@ int mca_btl_ofi_aop(struct mca_btl_base_module_t *btl, mca_btl_base_endpoint_t *
136138 fi_datatype , fi_op , & comp -> comp_ctx );
137139
138140 if (rc == - FI_EAGAIN ) {
141+ MCA_BTL_OFI_NUM_RDMA_DEC (ofi_btl );
139142 opal_free_list_return (comp -> base .my_list , (opal_free_list_item_t * ) comp );
140143 return OPAL_ERR_OUT_OF_RESOURCE ;
141144 } else if (rc < 0 ) {
145+ MCA_BTL_OFI_NUM_RDMA_DEC (ofi_btl );
142146 opal_free_list_return (comp -> base .my_list , (opal_free_list_item_t * ) comp );
143147 BTL_ERROR (("fi_atomic failed with rc=%d (%s)" , rc , fi_strerror (- rc )));
144148 MCA_BTL_OFI_ABORT ();
145149 }
146150
147- MCA_BTL_OFI_NUM_RDMA_INC (ofi_btl );
148-
149151 return OPAL_SUCCESS ;
150152}
151153
@@ -165,6 +167,7 @@ int mca_btl_ofi_acswap(struct mca_btl_base_module_t *btl, struct mca_btl_base_en
165167 mca_btl_ofi_endpoint_t * btl_endpoint = (mca_btl_ofi_endpoint_t * ) endpoint ;
166168 mca_btl_ofi_context_t * ofi_context ;
167169
170+ MCA_BTL_OFI_NUM_RDMA_INC (ofi_btl );
168171 ofi_context = get_ofi_context (ofi_btl );
169172
170173 if (flags & MCA_BTL_ATOMIC_FLAG_32BIT ) {
@@ -188,15 +191,15 @@ int mca_btl_ofi_acswap(struct mca_btl_base_module_t *btl, struct mca_btl_base_en
188191 fi_datatype , FI_CSWAP , & comp -> comp_ctx );
189192
190193 if (rc == - FI_EAGAIN ) {
194+ MCA_BTL_OFI_NUM_RDMA_DEC (ofi_btl );
191195 opal_free_list_return (comp -> base .my_list , (opal_free_list_item_t * ) comp );
192196 return OPAL_ERR_OUT_OF_RESOURCE ;
193197 } else if (rc < 0 ) {
198+ MCA_BTL_OFI_NUM_RDMA_DEC (ofi_btl );
194199 opal_free_list_return (comp -> base .my_list , (opal_free_list_item_t * ) comp );
195200 BTL_ERROR (("fi_compare_atomic failed with rc=%d (%s)" , rc , fi_strerror (- rc )));
196201 MCA_BTL_OFI_ABORT ();
197202 }
198203
199- MCA_BTL_OFI_NUM_RDMA_INC (ofi_btl );
200-
201204 return OPAL_SUCCESS ;
202205}
0 commit comments