-
Notifications
You must be signed in to change notification settings - Fork 220
moves the lib list to the driver buildnml with backward compatibility #4836
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2191950
moves the lib list to the driver buildnml with backward compatibility
jedwards4b 530471a
logic for libs not set
jedwards4b 7f62cd0
Merge branch 'master' into move_liblist_to_driver
jedwards4b 035e801
black reformat file
jedwards4b 29070d6
clean up
jedwards4b aab0766
add some documentation, remove duplicates in lib argument
jedwards4b 256f24c
Merge remote-tracking branch 'origin/fix_mixed_subgroup_resolve' into…
jedwards4b 99cc6a7
Updates documentation
jasonb5 022abc6
Reverts previous doc update
jasonb5 7f47f19
Merge branch 'master' into move_liblist_to_driver
jedwards4b 2ceb24e
Adds unit tests and fixes black formatting
jasonb5 8a78127
Fixes black formatting
jasonb5 48153cf
Adds warning to migrate to CASE_SUPPORT_LIBRARIES
jasonb5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -738,44 +738,48 @@ def _build_libraries( | |
| if not os.path.exists(shared_item): | ||
| os.makedirs(shared_item) | ||
|
|
||
| mpilib = case.get_value("MPILIB") | ||
| ufs_driver = os.environ.get("UFS_DRIVER") | ||
| libs = case.get_values("CASE_SUPPORT_LIBRARIES") | ||
| logger.info(f"libs from case_support_libraries {libs}") | ||
| build_script = {} | ||
| cpl_in_complist = False | ||
| for l in complist: | ||
| if "cpl" in l: | ||
| cpl_in_complist = True | ||
| if ufs_driver: | ||
| logger.info("UFS_DRIVER is set to {}".format(ufs_driver)) | ||
|
|
||
| # This is a bit hacky. The host model should define whatever | ||
| # shared libs it might need. | ||
| if ufs_driver and ufs_driver == "nems" and not cpl_in_complist: | ||
| libs = [] | ||
| elif case.get_value("MODEL") == "cesm": | ||
| libs = ["gptl", "pio", "csm_share"] | ||
| elif case.get_value("MODEL") == "e3sm": | ||
| libs = ["gptl", "mct", "spio", "csm_share"] | ||
| else: | ||
| libs = ["gptl", "mct", "pio", "csm_share"] | ||
| if libs is None or len(libs) < 1: | ||
| mpilib = case.get_value("MPILIB") | ||
| ufs_driver = os.environ.get("UFS_DRIVER") | ||
| if ufs_driver: | ||
| logger.info("UFS_DRIVER is set to {}".format(ufs_driver)) | ||
|
|
||
| # This is a bit hacky. The host model should define whatever | ||
| # shared libs it might need. | ||
| if ufs_driver and ufs_driver == "nems" and not cpl_in_complist: | ||
| libs = [] | ||
| elif case.get_value("MODEL") == "cesm": | ||
| libs = ["gptl", "pio", "csm_share"] | ||
| elif case.get_value("MODEL") == "e3sm": | ||
| libs = ["gptl", "mct", "spio", "csm_share"] | ||
| else: | ||
| libs = ["gptl", "mct", "pio", "csm_share"] | ||
|
|
||
| libs.append("FTorch") | ||
| libs.append("FTorch") | ||
|
|
||
| if mpilib == "mpi-serial": | ||
| libs.insert(0, mpilib) | ||
| if mpilib == "mpi-serial": | ||
| libs.insert(0, mpilib) | ||
|
|
||
| if uses_kokkos(case) and comp_interface != "nuopc": | ||
| libs.append("ekat") | ||
| if uses_kokkos(case) and comp_interface != "nuopc": | ||
| libs.append("ekat") | ||
|
|
||
| # Build shared code of CDEPS nuopc data models | ||
| build_script = {} | ||
| if comp_interface == "nuopc" and (not ufs_driver or ufs_driver != "nems"): | ||
| libs.append("CDEPS") | ||
| # Build shared code of CDEPS nuopc data models | ||
| build_script = {} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this line is pointless, no? It's already set before the if clause.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like a merge error, I'll clean it up - thanks. |
||
| if comp_interface == "nuopc" and (not ufs_driver or ufs_driver != "nems"): | ||
| libs.append("CDEPS") | ||
|
|
||
| ocn_model = case.get_value("COMP_OCN") | ||
| ocn_model = case.get_value("COMP_OCN") | ||
|
|
||
| atm_dycore = case.get_value("CAM_DYCORE") | ||
| if ocn_model == "mom" or (atm_dycore and atm_dycore == "fv3"): | ||
| libs.append("FMS") | ||
| atm_dycore = case.get_value("CAM_DYCORE") | ||
| if ocn_model == "mom" or (atm_dycore and atm_dycore == "fv3"): | ||
| libs.append("FMS") | ||
|
|
||
| files = Files(comp_interface=comp_interface) | ||
| for lib in libs: | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bartgol if I understood your suggestion from #4837 correctly, the
uses_kokkosfunction can be deprecated since the host model will define the shared libs in its config_component.xml?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, this code is only still here for backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was my idea. I don't want to inject knowledge about host model tpls into CIME. All CIME should care about is a list of libs names, and where to find their build scripts.