UCP/CORE/GTEST: Introduce the test to check an equality of CM and WIREUP configs#5793
Conversation
test/gtest/ucp/test_ucp_sockaddr.cc
Outdated
| } | ||
| } | ||
|
|
||
|
|
test/gtest/ucp/test_ucp_sockaddr.cc
Outdated
| EXPECT_TRUE(((lane1 == UCP_NULL_LANE) && (lane2 == UCP_NULL_LANE)) || | ||
| ucp_ep_config_lane_is_peer_equal(key1, lane1, key2, lane2)); | ||
| ((lane1 != UCP_NULL_LANE) && (lane2 != UCP_NULL_LANE) && | ||
| ucp_ep_config_lane_is_peer_equal(key1, lane1, key2, lane2))); |
src/ucp/wireup/wireup.c
Outdated
| cm_wireup_ep = ucp_ep_get_cm_wireup_ep(ep); | ||
| if ((cm_wireup_ep != NULL) && (key.cm_idx == UCP_NULL_RESOURCE)) { | ||
| key.cm_idx = cm_wireup_ep->cm_idx; | ||
| } | ||
|
|
There was a problem hiding this comment.
i think it should be in ucp_ep_init_create_wireup, not here
for the new config we already copy the key by ucp_wireup_check_config_intersect
There was a problem hiding this comment.
CM WIREUP EP is not created yet in ucp_ep_init_create_wireup()
fixed, by initilaizing CM_IDX in key when initilaizing CM_IDX in CM WIREUP EP
| sender().connect(&receiver(), get_ep_params()); | ||
| ucp_ep_params_t params = get_ep_params(); | ||
| params.field_mask |= UCP_EP_PARAM_FIELD_USER_DATA; | ||
| params.user_data = &receiver(); |
src/ucp/wireup/wireup_cm.c
Outdated
| wireup_ep->ep_init_flags = ucp_ep_init_flags(ucp_ep->worker, params); | ||
| wireup_ep->cm_idx = 0; | ||
| wireup_ep->ep_init_flags = ucp_ep_init_flags(ucp_ep->worker, params); | ||
| ucp_ep_config(ucp_ep)->key.cm_idx = |
There was a problem hiding this comment.
we should not change config key after it's already saved in the worker array
src/ucp/wireup/wireup_cm.c
Outdated
| if (status == UCS_OK) { | ||
| key->cm_idx = wireup_ep->cm_idx; | ||
| } |
There was a problem hiding this comment.
can do it unconditionally in line 177
src/ucp/wireup/wireup_cm.c
Outdated
| } | ||
|
|
||
| cm_wireup_ep->cm_idx = next_cm_idx; | ||
| ucp_ep_config(ep)->key.cm_idx = |
There was a problem hiding this comment.
we should not change config key after it's already saved in the worker array
|
/azp run |
|
bot:pipe:retest |
|
Azure Pipelines successfully started running 1 pipeline(s). |
src/ucp/wireup/wireup_cm.c
Outdated
|
|
||
| wireup_ep->ep_init_flags = ucp_ep_init_flags(ucp_ep->worker, params); | ||
| wireup_ep->cm_idx = 0; | ||
| wireup_ep->cm_idx = ucp_ep_config(ucp_ep)->key.cm_idx; |
There was a problem hiding this comment.
maybe we can remove cm_idx field from wireup_ep altogether?
There was a problem hiding this comment.
unfortunately, can't remove it
we will be unable to determine whether we need to use next CM index in ucp_cm_client_priv_pack_cb() or not when initilaizing an initial config (ucp_cm_ep_client_initial_config_get()). I tried to understand checking previous config (if EP has prev config - then it is fallback, otherwise - not), but an EP config walys exist in ucp_cm_client_priv_pack_cb()
There was a problem hiding this comment.
we should be able to take cm_idx from current ep config key: when ucp_worker_create_ep() is called from ucp_ep_create_to_sock_addr it should set the cm_idx to 0
There was a problem hiding this comment.
Yes, but if we do fallback, ucp_cm_client_priv_pack_cb() could be called several times for each CM until CM connection is successful.
So, we don't have the way to determine whether it was called after initial config get (CM idx has to be 0) or from fallback (CM idx has to be ++).
Whatd do you think about not initializing CM index to 0 when initializing config for the first time? Initialize it or increment it only in ucp_cm_client_priv_pack_cb()?
There was a problem hiding this comment.
done in another way:
saved CM index in EP extension
src/ucp/wireup/wireup.c
Outdated
| ucp_ep_has_cm_lane(ep) ? | ||
| ucp_ep_config(ep)->key.cm_idx : |
There was a problem hiding this comment.
can't we always pass ucp_ep_config(ep)->key.cm_idx
There was a problem hiding this comment.
unfortunately, returned back, since EP cfg_index could be NULL
|
bot:pipe:retest |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ea6436e to
48ba3ec
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@yosefe your comments were fixed, could you check pls? |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
What
Introduce the test to check an equality of CM and WIREUP configs.
Why ?
To test #5696.
How ?
The test does the following: