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

Hdf5 vol support will require latest hdf5 1.14 #3516

Merged
merged 5 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ add_subdirectory(utils)

# HDF5 VOL requires 1.13+
if(ADIOS2_HAVE_HDF5)
if(HDF5_VERSION VERSION_LESS 1.13)
if(HDF5_VERSION VERSION_LESS 1.14)
vicentebolea marked this conversation as resolved.
Show resolved Hide resolved
set(ADIOS2_HAVE_HDF5_VOL OFF CACHE INTERNAL "")
message(STATUS "[ADIOS2 WARNING] To enable ADIOS VOL for HDF5, please use the version 1.14+ ")
else()
set(ADIOS2_HAVE_HDF5_VOL ON CACHE INTERNAL "")
endif()
else()
set(ADIOS2_HAVE_HDF5_VOL OFF CACHE INTERNAL "")
endif()

if(ADIOS2_HAVE_HDF5_VOL)
add_subdirectory(h5vol)
endif()
70 changes: 45 additions & 25 deletions source/h5vol/H5Vol_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,30 @@ void *H5VL_adios2_dataset_open(void *obj, const H5VL_loc_params_t *loc_params,
return result;
}

herr_t H5VL_adios2_dataset_read(void *dset, hid_t mem_type_id,
hid_t mem_space_id, hid_t file_space_id,
hid_t plist_id, void *buf, void **req)
herr_t H5VL_adios2_dataset_read(size_t count, void *dset_array[],
hid_t mem_type_id_array[],
hid_t mem_space_id_array[],
hid_t file_space_id_array[], hid_t dxpl_id,
void *buf_array[],
void **req) // last parameter is not unused
// void *dset, hid_t mem_type_id,
// hid_t mem_space_id, hid_t file_space_id,
// hid_t plist_id, void *buf, void **req)
guj marked this conversation as resolved.
Show resolved Hide resolved
{
REQUIRE_NOT_NULL_ERR(dset, -1);
H5VL_ObjDef_t *vol = (H5VL_ObjDef_t *)dset;
for (size_t i = 0; i < count; i++)
{
REQUIRE_NOT_NULL_ERR(dset_array[i], -1);
H5VL_ObjDef_t *vol = (H5VL_ObjDef_t *)(dset_array[i]);

H5VL_VarDef_t *var = (H5VL_VarDef_t *)(vol->m_ObjPtr);
H5VL_VarDef_t *var = (H5VL_VarDef_t *)(vol->m_ObjPtr);

var->m_HyperSlabID = file_space_id;
var->m_MemSpaceID = mem_space_id;
var->m_HyperSlabID = file_space_id_array[i];
var->m_MemSpaceID = mem_space_id_array[i];

var->m_Data = buf;
return gADIOS2ReadVar(var);
var->m_Data = buf_array[i];
gADIOS2ReadVar(var);
guj marked this conversation as resolved.
Show resolved Hide resolved
}
return 0;
}

herr_t H5VL_adios2_dataset_get(void *dset, H5VL_dataset_get_args_t *args,
Expand Down Expand Up @@ -130,30 +140,40 @@ herr_t H5VL_adios2_dataset_get(void *dset, H5VL_dataset_get_args_t *args,
return 0;
}

herr_t H5VL_adios2_dataset_write(size_t count, void *dset_array[],
hid_t mem_type_id_array[],
hid_t mem_space_id_array[],
hid_t file_space_id_array[], hid_t dxpl_id,
const void *buf_array[], void **req)
/*
herr_t H5VL_adios2_dataset_write(void *dset, hid_t mem_type_id,
hid_t mem_space_id, hid_t file_space_id,
hid_t plist_id, const void *buf, void **req)
guj marked this conversation as resolved.
Show resolved Hide resolved
*/
{
REQUIRE_NOT_NULL_ERR(dset, -1);
H5VL_ObjDef_t *vol = (H5VL_ObjDef_t *)dset;
H5VL_VarDef_t *varDef = (H5VL_VarDef_t *)(vol->m_ObjPtr);
for (size_t i = 0; i < count; i++)
{
REQUIRE_NOT_NULL_ERR(dset_array[0], -1);
H5VL_ObjDef_t *vol = (H5VL_ObjDef_t *)(dset_array[0]);
H5VL_VarDef_t *varDef = (H5VL_VarDef_t *)(vol->m_ObjPtr);

// H5VL_VarDef_t *varDef = (H5VL_VarDef_t *)dset;
varDef->m_Data = (void *)buf;
// H5VL_VarDef_t *varDef = (H5VL_VarDef_t *)dset;
guj marked this conversation as resolved.
Show resolved Hide resolved
varDef->m_Data = (void *)(buf_array[i]);

if (file_space_id > 0)
varDef->m_HyperSlabID = file_space_id;
else
varDef->m_HyperSlabID = varDef->m_ShapeID;
if (file_space_id_array[i] > 0)
varDef->m_HyperSlabID = file_space_id_array[i];
else
varDef->m_HyperSlabID = varDef->m_ShapeID;

if (mem_space_id > 0)
varDef->m_MemSpaceID = mem_space_id;
else
varDef->m_MemSpaceID = varDef->m_ShapeID;
if (mem_space_id_array[i] > 0)
varDef->m_MemSpaceID = mem_space_id_array[i];
else
varDef->m_MemSpaceID = varDef->m_ShapeID;

varDef->m_PropertyID = plist_id;
varDef->m_PropertyID = dxpl_id; // plist_id;

gADIOS2CreateVar(vol->m_FileIO, varDef);
gADIOS2CreateVar(vol->m_FileIO, varDef);
}
return 0;
}

Expand Down
17 changes: 10 additions & 7 deletions source/h5vol/H5Vol_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,20 @@ extern void *H5VL_adios2_dataset_open(void *obj,
const char *name, hid_t dapl_id,
hid_t dxpl_id, void **req);

extern herr_t H5VL_adios2_dataset_read(void *dset, hid_t mem_type_id,
hid_t mem_space_id, hid_t file_space_id,
hid_t plist_id, void *buf, void **req);
extern herr_t H5VL_adios2_dataset_read(size_t count, void *dset[],
hid_t mem_type_id[],
hid_t mem_space_id[],
hid_t file_space_id[], hid_t dxpl_id,
void *buf[], void **req);

extern herr_t H5VL_adios2_dataset_get(void *dset, H5VL_dataset_get_args_t *args,
hid_t dxpl_id, void **req);

extern herr_t H5VL_adios2_dataset_write(void *dset, hid_t mem_type_id,
hid_t mem_space_id, hid_t file_space_id,
hid_t plist_id, const void *buf,
void **req);
extern herr_t H5VL_adios2_dataset_write(size_t count, void *dset[],
hid_t mem_type_id[],
hid_t mem_space_id[],
hid_t file_space_id[], hid_t dxpl_id,
const void *buf[], void **req);

extern herr_t H5VL_adios2_dataset_close(void *dset, hid_t dxpl_id, void **req);

Expand Down