diff --git a/src/ucp/core/ucp_ep.c b/src/ucp/core/ucp_ep.c index 1a0c09bd808..5253ddedd3e 100644 --- a/src/ucp/core/ucp_ep.c +++ b/src/ucp/core/ucp_ep.c @@ -575,13 +575,13 @@ void ucp_ep_flush_state_reset(ucp_ep_h ep) flush_state->cmpl_sn = 0; flush_state->mem_in_progress = 0; ucs_hlist_head_init(&flush_state->reqs); - ucp_ep_update_flags(ep, UCP_EP_FLAG_FLUSH_STATE_VALID, 0); + ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_FLUSH_STATE_VALID, 0); } void ucp_ep_flush_state_invalidate(ucp_ep_h ep) { ucs_assert(ucs_hlist_is_empty(&ucp_ep_flush_state(ep)->reqs)); - ucp_ep_update_flags(ep, 0, UCP_EP_FLAG_FLUSH_STATE_VALID); + ucp_ep_update_debug_flags(ep, 0, UCP_EP_FLAG_FLUSH_STATE_VALID); } /* Since release function resets EP ID to @ref UCS_PTR_MAP_KEY_INVALID and PTR diff --git a/src/ucp/core/ucp_ep.h b/src/ucp/core/ucp_ep.h index 50e1f69eb2d..bb5ead463ff 100644 --- a/src/ucp/core/ucp_ep.h +++ b/src/ucp/core/ucp_ep.h @@ -115,6 +115,7 @@ enum { UCP_EP_FLAG_USER_DATA_PARAM = UCS_BIT(15),/* EP's user_data was passed via @ref ucp_ep_params_t::user_data */ +#if ENABLE_DEBUG_DATA || UCS_ENABLE_ASSERT /* DEBUG bits */ UCP_EP_FLAG_CONNECT_REQ_SENT = UCS_BIT(16),/* DEBUG: Connection request was sent */ UCP_EP_FLAG_CONNECT_REP_SENT = UCS_BIT(17),/* DEBUG: Connection reply was sent */ @@ -129,6 +130,7 @@ enum { UCP_EP_FLAG_DISCONNECT_CB_CALLED = UCS_BIT(25),/* DEBUG: Got disconnect notification */ UCP_EP_FLAG_CONNECT_WAIT_PRE_REQ = UCS_BIT(26) /* DEBUG: Connection pre-request needs to be received from a peer */ +#endif }; diff --git a/src/ucp/core/ucp_ep.inl b/src/ucp/core/ucp_ep.inl index bd39522f65c..933bd9cf772 100644 --- a/src/ucp/core/ucp_ep.inl +++ b/src/ucp/core/ucp_ep.inl @@ -178,6 +178,16 @@ static UCS_F_ALWAYS_INLINE void ucp_ep_update_flags( ep->flags = (ep->flags | ep_flags_add) & ~ep_flags_remove; } +#if ENABLE_DEBUG_DATA || UCS_ENABLE_ASSERT +#define ucp_ep_update_debug_flags(_ep, _flags_add, _flags_remove) \ + ucp_ep_update_flags(_ep, _flags_add, _flags_remove) +#else +#define ucp_ep_update_debug_flags(_ep, _flags_add, _flags_remove) \ + do { \ + (void)(_ep); \ + } while (0) +#endif + static UCS_F_ALWAYS_INLINE ucs_ptr_map_key_t ucp_ep_remote_id(ucp_ep_h ep) { #if UCS_ENABLE_ASSERT diff --git a/src/ucp/wireup/wireup.c b/src/ucp/wireup/wireup.c index 4a45dcea5bd..079322af503 100644 --- a/src/ucp/wireup/wireup.c +++ b/src/ucp/wireup/wireup.c @@ -193,17 +193,17 @@ ucs_status_t ucp_wireup_msg_progress(uct_pending_req_t *self) switch (req->send.wireup.type) { case UCP_WIREUP_MSG_PRE_REQUEST: - ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_PRE_REQ_SENT, 0); + ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_PRE_REQ_SENT, 0); break; case UCP_WIREUP_MSG_REQUEST: - ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_REQ_SENT, 0); + ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_REQ_SENT, 0); break; case UCP_WIREUP_MSG_REPLY: case UCP_WIREUP_MSG_REPLY_RECONFIG: - ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_REP_SENT, 0); + ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_REP_SENT, 0); break; case UCP_WIREUP_MSG_ACK: - ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_ACK_SENT, 0); + ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_ACK_SENT, 0); break; } @@ -696,7 +696,7 @@ ucp_wireup_process_request(ucp_worker_h worker, ucp_ep_h ep, if ((ep->flags & UCP_EP_FLAG_CONNECT_REQ_QUEUED) && (remote_uuid > worker->uuid)) { ucs_trace("ep %p: ignoring simultaneous connect request", ep); - ucp_ep_update_flags(ep, UCP_EP_FLAG_CONNECT_REQ_IGNORED, 0); + ucp_ep_update_debug_flags(ep, UCP_EP_FLAG_CONNECT_REQ_IGNORED, 0); return; } } diff --git a/src/ucp/wireup/wireup_cm.c b/src/ucp/wireup/wireup_cm.c index 01819a4dadb..2cf94743df9 100644 --- a/src/ucp/wireup/wireup_cm.c +++ b/src/ucp/wireup/wireup_cm.c @@ -724,7 +724,7 @@ static unsigned ucp_cm_client_connect_progress(void *arg) } if (context->config.ext.cm_use_all_devices) { - ucp_ep->flags |= UCP_EP_FLAG_CONNECT_WAIT_PRE_REQ; + ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_CONNECT_WAIT_PRE_REQ, 0); ucp_wireup_update_flags(ucp_ep, UCP_WIREUP_EP_FLAG_REMOTE_CONNECTED); } else { ucp_wireup_remote_connected(ucp_ep); @@ -778,7 +778,7 @@ static void ucp_cm_client_connect_cb(uct_ep_h uct_cm_ep, void *arg, UCT_CM_EP_CLIENT_CONNECT_ARGS_FIELD_STATUS))); remote_data = connect_args->remote_data; status = connect_args->status; - ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_CLIENT_CONNECT_CB, 0); + ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_CLIENT_CONNECT_CB, 0); ucs_debug("ep %p flags 0x%x cfg_index %d: client connected status %s", ucp_ep, ucp_ep->flags, ucp_ep->cfg_index, @@ -949,7 +949,7 @@ static void ucp_cm_disconnect_cb(uct_ep_h uct_cm_ep, void *arg) ucp_worker_h worker = ucp_ep->worker; uct_ep_h uct_ep; - ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_DISCONNECT_CB_CALLED, 0); + ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_DISCONNECT_CB_CALLED, 0); ucs_trace("ep %p flags 0x%x: remote disconnect callback invoked", ucp_ep, ucp_ep->flags); @@ -1393,7 +1393,7 @@ static void ucp_cm_server_conn_notify_cb( UCT_CM_EP_SERVER_CONN_NOTIFY_ARGS_FIELD_STATUS); status = notify_args->status; - ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_SERVER_NOTIFY_CB, 0); + ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_SERVER_NOTIFY_CB, 0); ucs_trace("ep %p flags 0x%x: notify callback invoked, status %s", ucp_ep, ucp_ep->flags, ucs_status_string(status)); @@ -1529,8 +1529,8 @@ void ucp_ep_cm_disconnect_cm_lane(ucp_ep_h ucp_ep) ucs_assert(!(ucp_ep->flags & UCP_EP_FLAG_FAILED)); ucs_assert(ucp_ep_is_cm_local_connected(ucp_ep)); - ucp_ep_update_flags(ucp_ep, UCP_EP_FLAG_DISCONNECTED_CM_LANE, - UCP_EP_FLAG_LOCAL_CONNECTED); + ucp_ep_update_flags(ucp_ep, 0, UCP_EP_FLAG_LOCAL_CONNECTED); + ucp_ep_update_debug_flags(ucp_ep, UCP_EP_FLAG_DISCONNECTED_CM_LANE, 0); /* Remove the client's connect_progress or the server's connect notify * callbacks from the callbackq to make sure it won't be invoked after diff --git a/test/gtest/ucp/test_ucp_sockaddr.cc b/test/gtest/ucp/test_ucp_sockaddr.cc index 6bdef6e9fb6..434d17b0cab 100644 --- a/test/gtest/ucp/test_ucp_sockaddr.cc +++ b/test/gtest/ucp/test_ucp_sockaddr.cc @@ -1508,6 +1508,7 @@ UCS_TEST_SKIP_COND_P(test_max_lanes, lanes_reconf, !cm_use_all_devices()) UCP_INSTANTIATE_TEST_CASE_TLS(test_max_lanes, rc, "rc") UCP_INSTANTIATE_TEST_CASE_TLS(test_max_lanes, dc, "dc") +#if ENABLE_DEBUG_DATA || UCS_ENABLE_ASSERT class test_ucp_sockaddr_wireup_fail : public test_ucp_sockaddr_wireup { protected: typedef enum { @@ -1803,6 +1804,7 @@ UCS_TEST_P(test_ucp_sockaddr_wireup_fail_try_next_cm, } UCP_INSTANTIATE_ALL_TEST_CASE(test_ucp_sockaddr_wireup_fail_try_next_cm) +#endif class test_ucp_sockaddr_different_tl_rsc : public test_ucp_sockaddr