Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCS/CONFIG: Filter out not loaded config tables for unused vars message #8557

Merged
merged 4 commits into from
Oct 30, 2022

Conversation

shasson5
Copy link
Contributor

What

Filter out not loaded config tables for unused vars message

Why ?

Avoid displaying wrong env var suggestions

@shasson5 shasson5 requested a review from gleon99 September 22, 2022 15:12
@yosefe
Copy link
Contributor

yosefe commented Sep 25, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@@ -91,6 +91,7 @@ typedef struct ucs_config_global_list_entry {
ucs_config_field_t *table; /* array of configuration fields */
size_t size; /* size of config structure */
ucs_list_link_t list; /* entry in global list */
int loaded; /* entry was loaded by parser */
Copy link
Contributor

Choose a reason for hiding this comment

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

Align comment

Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT of making a flags member instead of dedicating a whole int to a single bit?
Then can be extended if need extra fields in the future

src/ucs/config/parser.h Show resolved Hide resolved
@shasson5 shasson5 requested a review from gleon99 September 29, 2022 17:35
/**
* Configuration table flags
*/
enum {
Copy link
Contributor

Choose a reason for hiding this comment

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

typedef, ..._flags_t


typedef struct ucs_config_global_list_entry {
const char *name; /* configuration table name */
const char *prefix; /* configuration prefix */
ucs_config_field_t *table; /* array of configuration fields */
size_t size; /* size of config structure */
ucs_list_link_t list; /* entry in global list */
int loaded; /* entry was loaded by parser */
uint8_t flags; /* config table flags */
Copy link
Contributor

Choose a reason for hiding this comment

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

Align /*

@shasson5 shasson5 requested a review from gleon99 October 13, 2022 06:52
* Configuration table flags
*/
typedef enum {
/**< Table was loaded by the system */
Copy link
Contributor

Choose a reason for hiding this comment

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

has been already loaded by the config parser

src/ucs/config/parser.c Outdated Show resolved Hide resolved
status = ucs_config_parser_fill_opts(&opts, car_opts_table,
UCS_DEFAULT_ENV_PREFIX, NULL, 0);

static ucs_config_global_list_entry_t config;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why static?

src/ucs/config/parser.h Show resolved Hide resolved
src/ucs/config/parser.h Show resolved Hide resolved
src/ucs/config/parser.h Outdated Show resolved Hide resolved
src/ucs/config/parser.h Outdated Show resolved Hide resolved
src/ucs/config/parser.h Show resolved Hide resolved
src/ucs/config/parser.h Outdated Show resolved Hide resolved
src/uct/base/uct_component.c Outdated Show resolved Hide resolved
src/uct/base/uct_component.h Outdated Show resolved Hide resolved
test/gtest/ucs/test_config.cc Outdated Show resolved Hide resolved
status = ucs_config_parser_fill_opts(&opts, car_opts_table,
UCS_DEFAULT_ENV_PREFIX, NULL, 0);

ucs_config_global_list_entry_t config;
Copy link
Contributor

Choose a reason for hiding this comment

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

rename "config" to "entry"

Copy link
Contributor

Choose a reason for hiding this comment

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

unresolved @shasson5

@shasson5 shasson5 requested review from yosefe and gleon99 October 18, 2022 11:31
yosefe
yosefe previously approved these changes Oct 24, 2022
@yosefe
Copy link
Contributor

yosefe commented Oct 25, 2022

@shasson5 pls squash

yosefe
yosefe previously approved these changes Oct 26, 2022
@yosefe yosefe enabled auto-merge October 26, 2022 11:29
@gleon99
Copy link
Contributor

gleon99 commented Oct 26, 2022

@shasson5
Copy link
Contributor Author

yes I think so, will try to reproduce it

@@ -40,12 +40,23 @@ def __init__(self, ucx_info, verbose):
self.ucx_info = ucx_info
if verbose:
logging.basicConfig(level=logging.DEBUG)

def ib_available(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

is_ib_available or has_ib

{'UCX_SOME_VAR' : [], 'UCX_MOFULE_D' : ['UCX_MODULE_DIR', 'UCX_MODULES'], 'UCX_SOME_VAR2' : [], 'UCX_LOF_LEVEL' : ['UCX_LOG_LEVEL']},
{'UCX_RC_VERBS_RX_MAX_BUF' : ['UCX_RC_VERBS_TX_MAX_BUFS', 'UCX_RC_VERBS_RX_MAX_BUFS', 'UCX_UD_VERBS_RX_MAX_BUFS']},
{'UCX_RLS' : ['UCX_TLS']}]
expected_list = [{'results' : {'UCX_LOF_LEVEL' : ['UCX_LOG_LEVEL']}, 'ib_required': False},
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT of the following refactoring (simplify).

  1. Rename expected_list to something like test_cases or fuzzy_matches (at least remove _list).
  2. Revert to the "old" structure of the dicts in the list
  3. Split to 2 lists, e.g test_cases, ib_test_cases.
  4. Then can have:
def run(self, test_case, needs_ib=False):
    ...
for test_case in test_cases:
    runner.run(test_case)

for test_case in ib_test_cases:
    runner.run(test_case, needs_ib=True)

def run(self, expected):
with Environment(expected.keys()):
if expected['ib_required'] and not self.ib_available():
# Skip test if IB transport is required but not available.
Copy link
Contributor

Choose a reason for hiding this comment

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

Excessive commenting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean it's not needed at all? or it should just be shorter?

@shasson5 shasson5 requested a review from gleon99 October 28, 2022 13:37
runner.run(expected)
ib_test_cases = [{'UCX_RC_VERBS_RX_MAX_BUF' : ['UCX_RC_VERBS_TX_MAX_BUFS', 'UCX_RC_VERBS_RX_MAX_BUFS', 'UCX_UD_VERBS_RX_MAX_BUFS']}]

for test_case in test_cases:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe smth like this

if self.has_ib()
    test_cases += ib_test_cases

and remove "needs_ib" param

@shasson5 shasson5 requested a review from yosefe October 30, 2022 09:18
@yosefe yosefe merged commit 38926ae into openucx:master Oct 30, 2022
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