Skip to content

Update mom5 SPR for new CMake build system #238

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 6 commits into from
May 23, 2025
Merged

Update mom5 SPR for new CMake build system #238

merged 6 commits into from
May 23, 2025

Conversation

dougiesquire
Copy link
Contributor

@dougiesquire dougiesquire commented May 8, 2025

This PR updates the mom5 SPR for the new CMake build system.

Currently I have completely dropped support for the access-esm1.5 version. We need to discuss how we want to handle this version since it is built from a different branch and is not built with CMake. UPDATE: no longer true. This SPR now supports two build systems:

Makefile build supporting:

  • access-esm1.5
  • access-om2
  • legacy-access-om2-bgc

CMake build supporting:

  • mom_solo
  • mom_sis
  • access-om2
  • legacy-access-om2-bgc
  • access-esm1.6

Build will default to CMake where possible

@dougiesquire dougiesquire self-assigned this May 8, 2025
Dropped support for access-esm1.5
@dougiesquire
Copy link
Contributor Author

@harshula, what would you like to do about the access-esm1.5 version? Should I create a separate SPR for it?

@harshula
Copy link
Collaborator

@dougiesquire
Copy link
Contributor Author

dougiesquire commented May 12, 2025

@harshula
Copy link
Collaborator

Hi @dougiesquire , Thanks for implementing the class Mom5(CMakePackage, MakefilePackage) approach. Please keep support for access-om2, access-om2-bgc and access-esm1.5 in the MakefilePackage section because we released them with the mkmf build system. I would also keep access-esm1.6 support in the MakefilePackage section for easy comparison runs, if we need to do any debugging. However, your call on access-esm1.6.

@dougiesquire
Copy link
Contributor Author

dougiesquire commented May 13, 2025

Testing

Uses:

Summary of results:

Model Prerelease deployment PR Configuration test PR Historical reproducibility? Expected outcome?
ACCESS-OM2 ACCESS-NRI/ACCESS-OM2#106

dev-1deg_jra55_ryf

dougiesquire/1deg_jra55_ryf_wombatlite

✅ see here

❌ see here

✅ see here

ACCESS-OM2-BGC (legacy) ACCESS-NRI/ACCESS-OM2-BGC#24 dev-1deg_jra55_ryf_bgc ✅ see here
ACCESS-ESM1.6 ACCESS-NRI/ACCESS-ESM1.6#86 dev-preindustrial+concentrations ❌ see here ✅ see here
ACCESS-ESM1.5 ACCESS-NRI/ACCESS-ESM1.5#37 dev-preindustrial+concentrations ✅ see here

Also:

$ spack install mom5@51f67bf4a554d62f7b1ce99caf2f39dc1ef6b7b3=mom_solo

and

$ spack install mom5@51f67bf4a554d62f7b1ce99caf2f39dc1ef6b7b3=mom_sis

both build successfully.

@dougiesquire
Copy link
Contributor Author

dougiesquire commented May 13, 2025

Please keep support for access-om2, access-om2-bgc and access-esm1.5 in the MakefilePackage section because we released them with the mkmf build system. I would also keep access-esm1.6 support in the MakefilePackage section for easy comparison runs, if we need to do any debugging.

@harshula really? Can we not just use an earlier tag of spack-packages if we ever need to do this in the future (though I don't see why we'd need mkmf again for these types given the CMake system gives the same answers - see above)? I thought the whole point in me doing all this work was to remove the burden of having to support mkmf?

@dougiesquire dougiesquire marked this pull request as ready for review May 13, 2025 01:45
@harshula
Copy link
Collaborator

Hi @dougiesquire , As stated during the meeting, the point of adding CMake support to MOM5 was for long-term ACCESS-ESM1.6 support. We can't rely on using an older version of spack-packages because we may need to make changes to SPRs. e.g. When Spack v1.0 releases, we anticipate having to make Spack related changes to our SPRs.

@dougiesquire
Copy link
Contributor Author

Why do we need mkmf support when I can reproduce the released models with the CMake build system?

@harshula
Copy link
Collaborator

Hi @dougiesquire , Can you reproduce the binaries?

@dougiesquire
Copy link
Contributor Author

dougiesquire commented May 13, 2025

Hi @dougiesquire , Can you reproduce the binaries?

I'm guessing no because they were released with ~deterministic. But neither could the mkmf build, right? Or have I misunderstood the question?

@harshula
Copy link
Collaborator

Hi @dougiesquire , +deterministic removes attributes like timestamps to make it easier to compare binaries. However, that doesn't mean the binaries are identical. IIRC, for MOM5, I don't think I was able to get the COSIMA and ACCESS-NRI binaries to be identical.

If you don't have time to revert back the support for Makefile builds of released models, just rename your MOM5 SPR (e.g. Mom5Cmake) and continue work. We can then integrate your CMake changes back to the MOM5 SPR without breaking the existing Makefile support.

@dougiesquire
Copy link
Contributor Author

There are a number of nuances to what you're asking. Can we chat about this?

@harshula
Copy link
Collaborator

Summary: We should have a workable build_system() call with the appropriate conditional() calls.

@dougiesquire
Copy link
Contributor Author

dougiesquire commented May 13, 2025

Notes from chat:

  • Makefile build will support:
    • access-esm1.5
    • access-om2
    • legacy-access-om2-bgc
  • CMake build will support:
    • mom_solo
    • mom_sis
    • access-om2
    • legacy-access-om2-bgc
    • access-esm1.6
  • Build will default to CMake where possible
  • The old implementation of external gtracer/fms support will be dropped from Makefile builds (this was never released)

@dougiesquire
Copy link
Contributor Author

dougiesquire commented May 14, 2025

Testing

Uses:

CMake build system:

Model Prerelease deployment PR Configuration test PR Historical reproducibility? Expected outcome?
ACCESS-OM2 ACCESS-NRI/ACCESS-OM2#106

dev-1deg_jra55_ryf

dougiesquire/1deg_jra55_ryf_wombatlite

✅ see here

❌ see here

✅ see here

ACCESS-OM2-BGC (legacy) ACCESS-NRI/ACCESS-OM2-BGC#24 dev-1deg_jra55_ryf_bgc ✅ see here
ACCESS-ESM1.6 ACCESS-NRI/ACCESS-ESM1.6#86 dev-preindustrial+concentrations ❌ see here ✅ see here

Makefile build system:

Model Prerelease deployment PR Configuration test PR Historical reproducibility? Expected outcome?
ACCESS-OM2 ACCESS-NRI/ACCESS-OM2#106 dev-1deg_jra55_ryf ✅ see here
ACCESS-OM2-BGC (legacy) ACCESS-NRI/ACCESS-OM2-BGC#24 dev-1deg_jra55_ryf_bgc ✅ see here
ACCESS-ESM1.5 ACCESS-NRI/ACCESS-ESM1.5#37 dev-preindustrial+concentrations ✅ see here

Also:

$ spack install [email protected]=mom_solo

and

$ spack install [email protected]=mom_sis

both build successfully with CMake.

@dougiesquire
Copy link
Contributor Author

This is ready for review @harshula

@dougiesquire dougiesquire requested a review from harshula May 14, 2025 03:10
@harshula
Copy link
Collaborator

Hi @dougiesquire , The changes are progressing well! Can you please put back the comments related to the setup() function and revert back to __builds variable name for the data structure because we want to use this SPR as a template that can be copied by others. Also, put back the copyright comment and undo unnecessary whitespace changes that make the diff even larger. In general, when making such a significant and important functional change, please don't make unnecessary changes.

@dougiesquire
Copy link
Contributor Author

dougiesquire commented May 14, 2025

Can you please put back the comments related to the setup() function and revert back to __builds variable name for the data structure because we want to use this SPR as a template that can be copied by others

I changed the name to __types because this used to be a nested dictionary with values describing the builds, but it's now a single-level dictionary with values containing the types. But sure.

undo unnecessary whitespace changes that make the diff even larger.

Apologies, this must have been my editor

@dougiesquire
Copy link
Contributor Author

Done in 1517db9

@access-hive-bot
Copy link

This pull request has been mentioned on ACCESS Hive Community Forum. There might be relevant details there:

https://forum.access-hive.org.au/t/coordinating-development-threads-for-next-phase-of-control-run/4523/1

Copy link
Collaborator

@harshula harshula 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! Are you intentionally removing restart_repro variant for CMake builds?

Co-authored-by: Harshula Jayasuriya <[email protected]>
@dougiesquire
Copy link
Contributor Author

Are you intentionally removing restart_repro variant for CMake builds?

Yes that's intentional. The CMake build always builds with the REPRO flags. It's mentioned here but should have also mentioned in this PR sorry.

@dougiesquire dougiesquire requested a review from harshula May 22, 2025 03:53
@dougiesquire
Copy link
Contributor Author

@harshula once you're happy I'll do one final set of tests with the most recent version before merging

Co-authored-by: Harshula Jayasuriya <[email protected]>
Copy link
Collaborator

@harshula harshula 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 making these changes! Please remember to squash merge.

@dougiesquire
Copy link
Contributor Author

Testing

Uses:

CMake build system:

Model Prerelease deployment PR Configuration test PR Historical reproducibility? Expected outcome?
ACCESS-OM2 ACCESS-NRI/ACCESS-OM2#106

dev-1deg_jra55_ryf

dougiesquire/1deg_jra55_ryf_wombatlite

✅ see here

❌ see here

✅ see here

ACCESS-OM2-BGC (legacy) ACCESS-NRI/ACCESS-OM2-BGC#24 dev-1deg_jra55_ryf_bgc ✅ see here
ACCESS-ESM1.6 ACCESS-NRI/ACCESS-ESM1.6#86 dev-preindustrial+concentrations ❌ see here ✅ see here

Makefile build system:

Model Prerelease deployment PR Configuration test PR Historical reproducibility? Expected outcome?
ACCESS-OM2 ACCESS-NRI/ACCESS-OM2#106 dev-1deg_jra55_ryf ✅ see here
ACCESS-OM2-BGC (legacy) ACCESS-NRI/ACCESS-OM2-BGC#24 dev-1deg_jra55_ryf_bgc ✅ see here
ACCESS-ESM1.5 ACCESS-NRI/ACCESS-ESM1.5#37 dev-preindustrial+concentrations ✅ see here

Also:

$ spack install [email protected]==mom_solo

and

$ spack install [email protected]==mom_sis

both build successfully with CMake.

@dougiesquire dougiesquire merged commit ad5e555 into main May 23, 2025
1 check passed
@dougiesquire dougiesquire deleted the mom5-cmake branch May 23, 2025 07:15
@harshula
Copy link
Collaborator

harshula commented May 23, 2025

Hi @dougiesquire , You should have cleaned up the commit message.

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