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

Adds additional machine details to query_config #4759

Merged
merged 20 commits into from
Mar 18, 2025

Conversation

jasonb5
Copy link
Collaborator

@jasonb5 jasonb5 commented Feb 21, 2025

Adds --compiler argument to query_config. This argument should
be used when querying a specific machine e.g. --machines frontier.

When specified, modules and environment_variables that match the
compiler will be printed. Additional requirements e.g. DEBUG="TRUE"
will be printed above sections that require them. Additionally for
environment_variables there is an attempt to resolve any CIME specific
templates e.g. $ENV{HOME}.

Test suite:
Test baseline: n/a
Test namelist changes: n/a
Test status: n/a

Fixes #4743
User interface changes?:
Update gh-pages html (Y/N)?:

@jasonb5 jasonb5 marked this pull request as ready for review March 8, 2025 01:38
"features": {
"ghcr.io/devcontainers/features/git:1": {}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Why are these container changes part of this?

Copy link
Collaborator Author

@jasonb5 jasonb5 Mar 10, 2025

Choose a reason for hiding this comment

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

Ah yea I'll pull that out and make a separate PR. It's some additional dev stuff for anyone using vscode to simplify running/testing in a container locally. @jedwards4b @jgfouca Any issue if I add this in a different PR? It doesn't affect anything unless you're using vscode.

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually don't care if you keep it in this PR as long as we understand why it's there and you add it to the description.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably best to pull it out of this PR. I'll be making a more testing focused PR soon, it'll fit in better there and I can provide a full explanation.

@rljacob
Copy link
Member

rljacob commented Mar 10, 2025

I tried "./query_config --machines chrysalis --compiler intel" and it looks good!

"./query-config --machines" is a valid input. People might try "./query-config --machines --compiler intel" but I think we should restrict "--compiler" to specific machines. Current it gives a python error:

[jacob@chrlogin2 scripts]$ ./query_config --machines --compiler intel
Traceback (most recent call last):
  File "/gpfs/fs1/home/jacob/E3SM2/cime/scripts/./query_config", line 19, in <module>
    _main_func()
  File "/gpfs/fs1/home/jacob/E3SM2/cime/CIME/scripts/query_config.py", line 31, in _main_func
    kwargs = parse_command_line(description)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gpfs/fs1/home/jacob/E3SM2/cime/CIME/scripts/query_config.py", line 144, in parse_command_line
    raise Exception(
Exception: The --compiler argument must be used when specifying a machine with --machines <name>
Exit 1

Copy link
Contributor

@jgfouca jgfouca left a comment

Choose a reason for hiding this comment

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

Looks good! I think we just need to answer Rob's question and then we can merge.

@rljacob
Copy link
Member

rljacob commented Mar 13, 2025

@jasonb5 did you also see #4759 (comment) ?

@jasonb5
Copy link
Collaborator Author

jasonb5 commented Mar 15, 2025

@rljacob Just need to make sure I fully understand the change you'd like to see; there should be a error message rather than the exception when a user provides --compiler ... with --machines, where no specific machine is specified?

@rljacob
Copy link
Member

rljacob commented Mar 16, 2025

Yes there should be an error message in that case.

@jasonb5
Copy link
Collaborator Author

jasonb5 commented Mar 17, 2025

@rljacob Changed the behavior, now it will print the usage with this error message The --compiler argument must be used when specifying a machine with --machines <name>.

@jasonb5 jasonb5 merged commit 36cf5e4 into master Mar 18, 2025
7 checks passed
@jasonb5 jasonb5 deleted the adds-query_config-compiler-info branch March 18, 2025 00:51
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.

Add compiler output to query_config
4 participants