Skip to content

UCP/CORE/GTEST: Introduce the test to check an equality of CM and WIREUP configs#5793

Merged
yosefe merged 1 commit intoopenucx:masterfrom
dmitrygx:topic/ucp/cm_mlane_gtest
Oct 22, 2020
Merged

UCP/CORE/GTEST: Introduce the test to check an equality of CM and WIREUP configs#5793
yosefe merged 1 commit intoopenucx:masterfrom
dmitrygx:topic/ucp/cm_mlane_gtest

Conversation

@dmitrygx
Copy link
Member

What

Introduce the test to check an equality of CM and WIREUP configs.

Why ?

To test #5696.

How ?

The test does the following:

  1. Creates EP using CM, does send-recv, saves its config.
  2. Creates EP using WIREUP, does send-recv, saves its config.
  3. Compares configs.

}
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why added?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

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)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +1147 to +1151
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;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

answered

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 =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not change config key after it's already saved in the worker array

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines +181 to +183
if (status == UCS_OK) {
key->cm_idx = wireup_ep->cm_idx;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do it unconditionally in line 177

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}

cm_wireup_ep->cm_idx = next_cm_idx;
ucp_ep_config(ep)->key.cm_idx =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not change config key after it's already saved in the worker array

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@dmitrygx
Copy link
Member Author

/azp run

@dmitrygx
Copy link
Member Author

bot:pipe:retest

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).


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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can remove cm_idx field from wireup_ep altogether?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in another way:
saved CM index in EP extension

Comment on lines +363 to +364
ucp_ep_has_cm_lane(ep) ?
ucp_ep_config(ep)->key.cm_idx :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we always pass ucp_ep_config(ep)->key.cm_idx

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, returned back, since EP cfg_index could be NULL

@dmitrygx
Copy link
Member Author

bot:pipe:retest

@dmitrygx
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dmitrygx dmitrygx force-pushed the topic/ucp/cm_mlane_gtest branch from ea6436e to 48ba3ec Compare October 19, 2020 07:54
@dmitrygx
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dmitrygx
Copy link
Member Author

@yosefe your comments were fixed, could you check pls?

@dmitrygx
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yosefe yosefe merged commit 53ff49d into openucx:master Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants