Updating Source Location of Virtual Dataset

I am using VDS in my program to enable parallelization of an algorithm within Matlab using their supported low-level functions for HDF5. However, the issue arises when the data files need to be moved; the VDS no longer works in the new location because it still references the old location. Is there a way such that the VDS can automatically update its source location using the location of the VDS itself? If not, is it possible to remap the source without having to create a new VDS? It appears that once I set the VDS, I cannot make any changes. Edit: Is it possible to change the source folder of a VDS to a new location and how may I do that?

Alternatively, does HDF5 have support for converting a VDS into a permanent .h5 file or will I have to copy from the source data into a new .H5 file?

How about H5Pset_virtual_prefix? G.

Thank you for your help @gheber.
H5Pset_virtual_prefix seems to be a good option. I saw that H5Pset_efile_prefix() has support for relative path which I think could be the solution to my problem. Does H5Pset_virtual_prefix also have support for relative path because I did not find it in the document.

Could you also explain further how relative paths work and usage?

Say the VDS is stored at /myDataset and the source files are stored at /myDataset/sourceFiles
If I want to use the VDS’s location, I can do H5Pset_virtual_prefix(dapl_id,'${ORIGIN}/sourceFiles') right?
So, when I start mapping the datasets I would do H5Pset_virtual(dcpl_id,vspace_id,src_file_name,src_dset_name,src_space_id ) where the src_file_name = '/sourceFiles/data1.h5'

I’m with you: There are way too many H5P_set_this_or_that functions, and they are too hard to find. Sigh.

Does the discussion in H5Pset_virtual under Source File Resolutions help to answer your question?

Best, G.

Sorry I got dragged away to another project for the past few weeks. Thanks for your help because I just got the relative path working for my VDS today. I ended up not having to use H5Pset_virtual_prefix. During the mapping step with H5Pset_virtual , all that was needed is the relative path sourceFolder/data%i.h5.

Unrelated: I’m new to the forum and I was trying to mark one of your posts as the answer, but I can’t seem to find the functionality.

1 Like