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

Reformat config machines #4542

Merged
merged 13 commits into from
Dec 15, 2023
Merged

Conversation

jedwards4b
Copy link
Contributor

Reformats config machines so that the primary file contains only the regex field for machine name matching. The
details for each machine are then read from files in machines/machinename/config_machines.xml
This is v3 of config_machines.xml, this change is backward compatible with v2.

Test suite: scripts_regression_tests.py
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes

User interface changes?:

Update gh-pages html (Y/N)?:

@jedwards4b jedwards4b requested a review from jasonb5 December 11, 2023 17:37
@jedwards4b jedwards4b self-assigned this Dec 11, 2023
Copy link
Collaborator

@jasonb5 jasonb5 left a comment

Choose a reason for hiding this comment

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

The config_machines_version3.xsd schema file is missing, otherwise this looks good.

@jedwards4b
Copy link
Contributor Author

Added the config_machines_version3.xsd and the code to pass both schemas in and check the one based on the file version.

Copy link
Member

@billsacks billsacks left a comment

Choose a reason for hiding this comment

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

Awesome. I like the new format of storing machine information! I have just one inline request for a bit more documentation on a function you changed. Some other comments / possible requests:

  • There are a few changes in here unrelated to the main changes here (cprnc and some test stuff). Would it make sense to separate these into their own PR? I don't feel strongly about this.
  • Does this lead to changes in the recommended (or possibly required) way that people store stuff in their personal .cime directory? If so, is there somewhere where this should be documented?

CIME/XML/generic_xml.py Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Are these changes intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes were due to a merge to master.

Copy link
Member

Choose a reason for hiding this comment

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

Weird - usually a merge to master won't show up in PR diffs like this. Is the situation different for submodules like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree this is a little strange and will make sure that the merge works correctly.

Copy link
Member

Choose a reason for hiding this comment

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

Great, thanks!

@rljacob
Copy link
Member

rljacob commented Dec 13, 2023

This is welcome since config_machines.xml can become a giant file. Does the code in the per-machine files look just like the XML blocks in the current combined file?

@jedwards4b
Copy link
Contributor Author

@rljacob I made it backward compatible so no changes are required in e3sm. Yes the
format of individual files is nearly the same as the current block - the only difference is that the NODENAME_REGEX has been moved out of the block to the top level file.
Here is a link to the reformated cesm machines files.

Copy link
Member

@billsacks billsacks left a comment

Choose a reason for hiding this comment

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

Thanks for the latest change!

@rljacob
Copy link
Member

rljacob commented Dec 13, 2023

Is there a way to do one subdir with a uniquely named file per machine instead of a uniquely named subdir for each machine?

@jedwards4b
Copy link
Contributor Author

What is your argument for that change? I considered it, but plan to treat config_batch.xml in the same way - so there will be a config_batch.xml file in each machine subdir.

@rljacob
Copy link
Member

rljacob commented Dec 14, 2023

If there's going to be more then one file in each subdir, then it makes more sense. Does the subdir name have to match the string you pass to --machine ?

@jedwards4b
Copy link
Contributor Author

Yes, currently the subdirectory name is expected to match the string in MACH=

@jedwards4b
Copy link
Contributor Author

The cprnc submodule does seem to be out of sync with master, my attempts to fix the issue have failed - @jgfouca can you have a look? There should not be any changes in cprnc due to this PR.

@jgfouca
Copy link
Contributor

jgfouca commented Dec 15, 2023

@jedwards4b , I just merged #4545 , which should put us on the latest cprnc main commit. You should rebase or upstream this branch, take the cprnc commit that's on master, and the conflict will resolve.

@jedwards4b jedwards4b force-pushed the reformat_config_machines branch from a5b829b to d32b0d5 Compare December 15, 2023 17:06
@jedwards4b
Copy link
Contributor Author

@jgfouca I just did a rebase again - it still doesn't seem to have worked.

@jgfouca
Copy link
Contributor

jgfouca commented Dec 15, 2023

It looks like the conflict is gone?

@jgfouca
Copy link
Contributor

jgfouca commented Dec 15, 2023

Oh, I see this PR is still trying to change the submodule. Try this:
git checkout origin/master $path_to_cprnc ; git add $path_to_cprnc; git commit. This assumes origin is the main repo, not your fork.

@jedwards4b
Copy link
Contributor Author

Still no help:
git checkout origin/master CIME/non_py/cprnc ; git add CIME/non_py/cprnc; git commit
Updated 0 paths from b6c797123
Check Xml............................................(no files to check)Skipped
Fix End of Files.....................................(no files to check)Skipped
Trim Trailing Whitespace.............................(no files to check)Skipped
black................................................(no files to check)Skipped
pylint...............................................(no files to check)Skipped
On branch reformat_config_machines
Your branch is up to date with 'mydev/reformat_config_machines'.

Untracked files:
(use "git add ..." to include in what will be committed)
#DiagsCase.py#
#testcase.py#
CIME/#test_status.py#
CIME/.#test_status.py
CIME/ParamGen/requirements.txt
CIME/case/#check_input_data.py#
DiagsCase.py
ccs_config/
scripts/create_newcase.py.log
scripts/create_test.log
scripts/create_test.out
scripts/create_test2.out
scripts/test.out
testcase.py

nothing added to commit but untracked files present (use "git add" to track)
derecho5: ~/sandboxes/cime
:) git push mydev
Everything up-to-date

@jgfouca
Copy link
Contributor

jgfouca commented Dec 15, 2023

@jedwards4b , can you push this branch to the main repo? I'd like to check it out and modify it.

@jedwards4b
Copy link
Contributor Author

I could but I shouldn't have to, you can clone or add my fork with
git remote add

@jgfouca
Copy link
Contributor

jgfouca commented Dec 15, 2023

I checked out your branch and somehow your cprnc submodule is still set to an older commit. This should fix it:

git fetch $esmci_remote
git cherry-pick $esmci_remote/jgfouca/jime_branch
git submodule update
git push

@jedwards4b
Copy link
Contributor Author

That did it - thank you!

@jedwards4b jedwards4b merged commit 102d408 into ESMCI:master Dec 15, 2023
7 checks passed
@jedwards4b jedwards4b deleted the reformat_config_machines branch December 15, 2023 18:07
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.

5 participants