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

Replace deprecated H5part with H5hut #458

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Replace deprecated H5part with H5hut #458

wants to merge 12 commits into from

Conversation

biddisco
Copy link
Collaborator

H5part was discontinued many years ago, but the code was copied into the source tree of sphexa and although it works fine when built as an external as part of the project, it ought to be replaced with the newer H5hut library that contains all the functions of H5part, but with additional block data support.
This PR removes H5part, and adds H5hut instead, but not built as part of the source tree. H5hut must be installed on the system using (for example)

spack install h5hut@2:
spack install h5hut@master

Some small changes to the API for access to numparticles and particle data/attributes are reflected in the PR and the access to type safe attributes has been rewritten slightly.

Note - this PR relies on H5hut merge request https://gitlab.psi.ch/H5hut/src/-/merge_requests/7 and should not be merged before the int8 changes have been accepted into H5hut.

Note - users of sphexa will need to change their build environment to add H5hut, so this is a breaking change and all users will need to be notified of the change to their workflow and an sphexe uenv provided for alps systems at CSCS.

@biddisco biddisco added the enhancement New feature or request label Oct 31, 2024
@biddisco biddisco marked this pull request as ready for review October 31, 2024 12:39
@biddisco
Copy link
Collaborator Author

int8 PR has been merged into H5hut master.

@jfavre
Copy link
Collaborator

jfavre commented Oct 31, 2024 via email

@sekelle
Copy link
Collaborator

sekelle commented Nov 2, 2024

I believe the meta-data convention in h5hut is still the same, i.e the resulting HDF5 output files will have the same structure as what we've been writing with H5Part.

openPMD seems very interesting. It's also a thin layer over HDF5, enforcing a certain data layout and some common sense attributes. The option to use ADIOS or JSON instead is nice.

@biddisco
Copy link
Collaborator Author

biddisco commented Nov 5, 2024

Ah, it is collective. Independent performs better, can you change it?

Pushed a commit with an option to switch between independent and collective, with independent as default.
(NB. rebased branch onto latest master)

@biddisco
Copy link
Collaborator Author

biddisco commented Nov 5, 2024

Nice effort, but I wonder if any discussion has taken place about the merits of h5hut which AFAIK, is not astro-, or fluid-specific, compared to, for example Gagdet, or some much more recent and physics oriented format such as openPMD for particle physics. H5part had such poor support for meta data convention...I hope h5hut does. And btw, who will support an h5hut ParaView reader? N.B. Gadget and openPMD already have ParaView readers.

As sebastien mentioned, this does not change the IO at all, only upgrades the lib version used. The h5part support in sphexa was using an old version of the code that I have upgraded to h5hut - exact same binary hdf5 file contets, no change to readers.

Adding support for something more widely used like gadget or openPMD would be a very good idea - they most likely have more tools available for processing them. I'm sure when someone needs extra functioanlity from sphexa files, they can/will ask for it ;)

@biddisco biddisco force-pushed the h5hut branch 10 times, most recently from 77e13e4 to e661222 Compare November 5, 2024 15:19
h5part was copied as a snapshot into sphexa but was out of date and this
upgrades the h5part wrapper code to use h5hut instead.

H5Hut supports the same particle datasets as h5part, but also adds
support for volumentric fields and has a slightly more consistent use of
hdf5 datatypes throughout

This patch requires the use of (to be released) h5hut version 2.0.0
or the master branch from git

Note:
NumParticles/Steps etc have changed from unsigned to signed variables
@jfavre
Copy link
Collaborator

jfavre commented Mar 17, 2025

in a recent past, I ran into what seems to be a problem with ParaView v5.13 (earlier versions not tested), when running in parallel, over multiple timesteps, particles gradually disappear. @ChristopherBignamini and I have seen that last week, but because of time pressure, I have not had time to document it.
I feel that before doing the upgrade to h5hut, we should build a test that demonstrates proper parallel, time-dependent. When that test passes, we can upgrade and test again.

@jgphpc jgphpc requested review from jgphpc and removed request for jgphpc March 18, 2025 12:15
@jfavre
Copy link
Collaborator

jfavre commented Mar 20, 2025

I have created a Python script to generate an example H5part and have created a ParaView issue to say that the H5part reader in ParaView does not work in parallel.
https://gitlab.kitware.com/paraview/paraview/-/issues/22918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants