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

Emancipation from serialbox via HDF5 for C-style variants #62

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

MichaelSt98
Copy link
Contributor

Draft/POC implementation HDF5 input and reference reading for C-style variants to not rely on serialbox for those variants.

Before I am tempted to over-engineer this I thought I'd make a Draft PR to allow for some comments/feedback and to allow a discussion about a potential restructuring/refactoring of the C-style variants.

Tested on

  • AC with Intel and NVHPC
  • LUMI via cray toolchain

Obviously more testing necessary before thinking about merging this.

Some hacks in the CMakeLists.txt due to problems with HDF5 on AC.

Copy link
Collaborator

@reuterbal reuterbal left a comment

Choose a reason for hiding this comment

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

This looks pleasantly straightforward. Sorry for taking so long to look at this.

I've pointed out how to change the CMake integration, which should resolve your problems. Otherwise (I haven't flagged this in code), there are a few leftover commented code snippets which should probably be removed.

$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cloudsc>
PUBLIC_LIBS
Serialbox::Serialbox_C
$<${HAVE_OMP}:OpenMP::OpenMP_C>
$<${HAVE_HDF5}:hdf5>
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should use here the target exported via FindHDF5:

Suggested change
$<${HAVE_HDF5}:hdf5>
$<${HAVE_HDF5}:hdf5::hdf5>

This will automatically inject include paths, link flags & co, so you can drop all of the PRIVATE_INCLUDES part and link_directories fuff.

@reuterbal
Copy link
Collaborator

Additional remark: Since this will allow to always build the C variant, the verify_targets.sh script should be updated to always include the C variant in the expected_targets, i.e., remove the conditional on the io flag here:

targets=(dwarf-P-cloudMicrophysics-IFSScheme dwarf-cloudsc-fortran)
if [[ "$io_library_flag" == "--with-serialbox" ]]
then
targets+=(dwarf-cloudsc-c)
fi

@MichaelSt98 MichaelSt98 marked this pull request as ready for review February 9, 2024 15:47
@MichaelSt98
Copy link
Contributor Author

@reuterbal Thanks for pointing out how to change the CMake integration!
Should we rewrite/refactor Serialbox/HDF5 for this variant or wait for the overall ("C" variant) refactoring?

@reuterbal
Copy link
Collaborator

I'd say we can leave this until the overall refactoring to avoid doing the same work twice. Do you want to apply the same changes to the C-based kernel language variants, too, or will this be separate PRs?

@MichaelSt98
Copy link
Contributor Author

I'll make it a separate PR.

Copy link
Collaborator

@mlange05 mlange05 left a comment

Choose a reason for hiding this comment

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

Yes! Very nice, and looking good. GTG :shipit: 🥳

@reuterbal reuterbal merged commit 4bbe68e into develop Feb 9, 2024
18 checks passed
@reuterbal reuterbal deleted the nams_hdf5_c branch February 9, 2024 21:41
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