Repository navigation
HDF5 tables: files written field by field in HDF5 format (.h5) (#1560) - #1582
Open
carlocamilloni wants to merge 4 commits into
Open
carlocamilloni wants to merge 4 commits into
carlocamilloni wants to merge 4 commits into
Conversation
- tools/H5Table: writer and reader of tables in HDF5 files (libhdf5 C API, optional). Layout (version 1): root attribute plumed_format=plumed-table; groups block_0, block_1, ... (a new block when the fields change); one extendable chunked 1-D dataset per field (double, int64 or string; deflate when available), in the order of the attribute plumed_columns; constant fields as attributes listed in plumed_constants. Full precision, FMT ignored. The reader gives the lines of the equivalent text file (numbers with %.17g), so IFile reads .h5 files wherever it reads text files. - OFile: a file whose name ends with .h5 is written with the HDF5 writer on the writing process (fp is the null device); fields keep their typed value; printf on such a file is an error (free text); rewind is not supported. The trimming at the restart step is done at open. FileBase::closeBackend. - Restarts: trimming at the restart step (Checkpointing::trimAtRestart reads the table as text lines, keeps rows by block, removed rows go to bck.trimmed.N.name.h5), CHECKPOINT stores the rows of every block (h5rows) and truncates to them. METAD: no incomplete-line removal for .h5, WALKERS_N with .h5 hills is an error. - New cltool h5convert (text <-> HDF5). - configure: libhdf5 enabled by default (autodetected), hdf5.h located with pkg-config when needed (Debian/Ubuntu). - Regtests basic/rt-h5-tables, basic/rt-h5-mpi, opes/rt-h5-opes; docs in the Files page; CHANGES. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vwxtVYJZTnryBhjdtFbvH
…HDF5 tables Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vwxtVYJZTnryBhjdtFbvH
…F5 table) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vwxtVYJZTnryBhjdtFbvH
| #ifdef _WIN32 | ||
| fp=std::fopen("NUL","w"); | ||
| #else | ||
| fp=std::fopen("/dev/null","w"); |
- OFile: files rewritten at every write (rewind) can be HDF5 tables: the previous table is kept as bck.last.name, a new one is created at the next row. The writer is created at the first row (so that a file rewound before its first row is never trimmed, as with text files); before that the rows of the table are read from the file (checkpoint). Blank lines printed with printf (between the rows of a grid) are ignored; any other text is still an error. - So METAD grids (GRID_WFILE/GRID_RFILE), DUMPGRID and the OPES state (STATE_WFILE/STATE_RFILE) can be HDF5 tables, one row per grid point as in text; restarts from them keep the full precision. - New regtest opes/rt-h5-grids: grid, state and histogram tables equal to their text twins; restart from the HDF5 grid and state gives the biases of the uninterrupted run (except at the restart step, where the grid and state already contain the hill/kernel of that step, as with text files). - conda recipe: hdf5 in host (run export), -lhdf5, test of libhdf5. - Docs (Files page), CHANGES. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vwxtVYJZTnryBhjdtFbvH
| const std::size_t n=H5Tget_size(t); | ||
| std::string buf(n,'\0'); | ||
| err=H5Aread(a,t,buf.data()); | ||
| v.s=buf.c_str(); |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Claude-Session: https://claude.ai/code/session_016vwxtVYJZTnryBhjdtFbvH
Description
Target release
I would like my code to appear in release XXXXX
Type of contribution
Copyright
COPYRIGHTfile with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulenamein order to make sure the headers of the module are correct.Tests