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

Add h5dump tests that require subfiling VFD #3879

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

hyoklee
Copy link
Member

@hyoklee hyoklee commented Dec 1, 2023

The test HDF5 file, test_subfiling_stripe_sizes.h5, in this PR is a subfiling VFD "stub" file.
It depends on the corresponding subfile test_subfiling_stripe_sizes.h5.subfile_1_of_1 and config file test_subfiling_stripe_sizes.h5.subfile.config.
h5dump can't dump the HDF5 file unless h5dump uses subfiling VFD.

These tests pass because VFD CTest defines HDF5_DRIVER in config/cmake/vfdTest.cmake:

set (ENV{HDF5_DRIVER} "${TEST_VFD}")

If you comment it out, these tests will fail.

I will create another PR that will make these tests pass even if HDF5_DRIVER is not set.

if (vfdtest STREQUAL "subfiling")
foreach (h5_tfile ${HDF5_SF_VFD_H5DUMP_FILES})
file(COPY "${PROJECT_SOURCE_DIR}/testfiles/${h5_tfile}" DESTINATION "${PROJECT_BINARY_DIR}/${vfdtest}")
execute_process(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this doing a process that could be done by a CMake command? We should not be using platform specific commands by choice. We should not assume that something is only ever going to be on one platform.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why use the inode in the first place - the files are unique without the number. I don't see the advantage of the complexity.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The inode is used by the Subfiling VFD to generate unique filenames, so the CMake code would need to be able to generate the names of the other resulting files when creating files with the Subfiling VFD during testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

But isn't that in the original name? Seems like there needs to be more documentation on this test, because it isn't obvious.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The problem is we can't add generated files here easily because the inode value for the file could change, meaning that when the Subfiling VFD tries to open test_subfiling_stripe_sizes.h5, it will also look for
test_subfiling_stripe_sizes.h5.subfile_XXXXXXXX_1_of_1 and test_subfiling_stripe_sizes.h5.subfile_XXXXXXXX.config, but we wouldn't have a way of predicting what the inode value for XXXXXXXX would be and so we have to grab the inode value. On the other hand, we probably don't necessarily need a generated file at all to test Subfiling with h5dump if we just create the file on the fly.

@glennsong09 glennsong09 added Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - Testing Code in test or testpar directories, GitHub workflows Type - Improvement Improvements that don't add a new feature or functionality labels Dec 4, 2023
@hyoklee hyoklee self-assigned this Dec 11, 2023
@brtnfld
Copy link
Contributor

brtnfld commented Dec 18, 2023

We need to have a test with more than one subfile. One subfile is just a regular HDF5.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Where were these test files taken from? I'd expect the configuration files to have aggregator_count, hdf5_file, subfile_dir fields and a list of the names of all the subfiles.

Copy link
Member Author

@hyoklee hyoklee Dec 23, 2023

Choose a reason for hiding this comment

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

I removed them manually because they did not affect the h5dump test result. Test files are based on subfiling test under testpar.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In general, it's probably best to keep the original config files intact so that future versions of the VFD don't have issues with the test files if it requires certain fields in the future for verification purposes. That said, I think this is fine for now.

@derobins derobins merged commit 0843a8c into HDFGroup:develop Feb 1, 2024
45 checks passed
lrknox pushed a commit to lrknox/hdf5 that referenced this pull request Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Testing Code in test or testpar directories, GitHub workflows Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - Improvement Improvements that don't add a new feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants