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

UTIL: cfg parser respect inherited vars #545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vspetrov
Copy link
Collaborator

What

Fixes config file parsing with respect to inherited variables

Why ?

When the variable in the config table is inherited from another parent table (e.g., TLS var in CLs is defined in parent ucc_cl_base_config), and user sets the top variable in the env it gets overwritten by the file configuration.
For example,
if there is cfg file with entry:
UCC_CL_BASIC_TLS=^sharp

and user runs app with: UCC_TLS=ucp , then the value of CL_BASIC_TLS would still be "^sharp", i.e. all except sharp - not what user expects (which is "ucp" only).

How ?

When applying value from cfg file database need to check if there is a parent variable setting in the environment and then skip it in that case.

@bureddy
Copy link
Collaborator

bureddy commented Jul 19, 2022

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCS_TLS

@vspetrov
Copy link
Collaborator Author

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCS_TLS

@bureddy i don't understand. could you plz elaborate?

@bureddy
Copy link
Collaborator

bureddy commented Jul 19, 2022

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCC_TLS

@bureddy i don't understand. could you plz elaborate?

I mean if the user sets UCC_TL but not UCC_CL_BASIC_TLS. does it alway inherit from UCC_TLS ?

@vspetrov
Copy link
Collaborator Author

if UCC_CL_BASIC_TLS is not inthe environment, then is it the same as UCC_TLS

@bureddy i don't understand. could you plz elaborate?

I mean if the user sets UCC_TL but not UCC_CL_BASIC_TLS. does it alway inherit from UCC_TLS ?

This was the behavior before file cfg, which broke it. UCC_TLS is the highest var in the hierarchy, all CLs vars inherit from it. W/o config file, we can set UCC_TLS=ucp and this will guarantee all CLs only have ucp.

Say, i want to disable TL/SHM. It is used in both CLs hier and basic. I could just set UCC_TLS=^shm. But currently due to bug in cfg file, it will not work.

@manjugv
Copy link
Contributor

manjugv commented Jul 20, 2022

@vspetrov Please add a FAQ entry to capture this example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants