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

Necessary revision to get VOL work HDF5 1.13 & BP4 #3279

Merged
merged 3 commits into from Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion source/h5vol/H5VolReadWrite.c
Expand Up @@ -143,7 +143,9 @@ void gInitADIOS2(hid_t acc_tpl)
MPI_Initialized(&flag);
if (!flag)
{
SHOW_ERROR_MSG("H5VL_ADIOS2: Error: MPI is not initialized");
RANK_ZERO_MSG("H5VL_ADIOS2 WARNING: MPI is not initialized, will use "
"Serial ADIOS\n");
m_ADIOS2 = adios2_init_serial();
}
else
{
Expand Down Expand Up @@ -879,6 +881,12 @@ herr_t gADIOS2ReadVar(H5VL_VarDef_t *varDef)

adios2_set_selection(varDef->m_Variable, varDef->m_DimCount, start,
count);

if (varDef->m_MemSpaceID > 0)
{
RANK_ZERO_MSG("\n## No memory space is supported. Expect limited "
"support when VOL supports BP5. \n");
}
}
adios2_get(varDef->m_Engine, varDef->m_Variable, varDef->m_Data,
adios2_mode_sync);
Expand Down
12 changes: 6 additions & 6 deletions source/h5vol/H5VolReadWrite.h
Expand Up @@ -51,13 +51,13 @@ static herr_t H5VL_adios2_datatype_close(void *dt, hid_t H5_ATTR_UNUSED dxpl_id,
// Define H5VOL functions
//
static const H5VL_class_t H5VL_adios2_def = {
H5VL_ADIOS2_VERSION,
H5VL_VERSION, /* Version # of connector, needed for v1.13 */
(H5VL_class_value_t)H5VL_ADIOS2_VALUE,
H5VL_ADIOS2_NAME, /* name */
0, /* Version # of connector */
H5VL_CAP_FLAG_NONE, /* Capability flags for connector */
H5VL_adios2_init, /* initialize */
H5VL_adios2_term, /* terminate */
H5VL_ADIOS2_NAME, /* name */
H5VL_ADIOS2_VERSION, /* version of this vol, not as important */
H5VL_CAP_FLAG_NONE, /* Capability flags for connector */
H5VL_adios2_init, /* initialize */
H5VL_adios2_term, /* terminate */
{
/* info_cls */
(size_t)0, /* info size */
Expand Down
22 changes: 15 additions & 7 deletions source/h5vol/H5Vol_dataset.c
Expand Up @@ -96,6 +96,7 @@ herr_t H5VL_adios2_dataset_read(void *dset, hid_t mem_type_id,

var->m_HyperSlabID = file_space_id;
var->m_MemSpaceID = mem_space_id;

var->m_Data = buf;
return gADIOS2ReadVar(var);
}
Expand All @@ -111,16 +112,14 @@ herr_t H5VL_adios2_dataset_get(void *dset, H5VL_dataset_get_args_t *args,
{
case H5VL_DATASET_GET_SPACE:
{
hid_t *ret_id = (hid_t *)args->args.get_space.space_id;
*ret_id = H5Scopy(varDef->m_ShapeID);
REQUIRE_SUCC_MSG((*ret_id >= 0), -1,
REQUIRE_SUCC_MSG((varDef->m_ShapeID >= 0), -1,
"H5VOL-ADIOS2: Unable to get space id.");
args->args.get_space.space_id = H5Scopy(varDef->m_ShapeID);
break;
}
case H5VL_DATASET_GET_TYPE:
{
hid_t *ret_id = (hid_t *)args->args.get_type.type_id;
*ret_id = H5Tcopy(varDef->m_TypeID);
args->args.get_type.type_id = H5Tcopy(varDef->m_TypeID);
break;
}
default:
Expand All @@ -141,8 +140,17 @@ herr_t H5VL_adios2_dataset_write(void *dset, hid_t mem_type_id,

// H5VL_VarDef_t *varDef = (H5VL_VarDef_t *)dset;
varDef->m_Data = (void *)buf;
varDef->m_MemSpaceID = mem_space_id;
varDef->m_HyperSlabID = file_space_id;

if (file_space_id > 0)
varDef->m_HyperSlabID = file_space_id;
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;

varDef->m_PropertyID = plist_id;

gADIOS2CreateVar(vol->m_FileIO, varDef);
Expand Down
3 changes: 3 additions & 0 deletions testing/h5vol/TestH5VolWriteReadBPFile.cpp
Expand Up @@ -462,9 +462,12 @@ void HDF5NativeReader::ReadVar(const std::string varName, void *dataArray,
"Unable to create a selection for dataset" + varName);
}

/*
hsize_t dimsm[1];
dimsm[0] = memspaceSize;
hid_t memspace = H5Screate_simple(1, dimsm, NULL);
*/
hid_t memspace = H5S_ALL;

hid_t ret = H5Dread(dataSetId, h5type, memspace, dataspace, H5P_DEFAULT,
dataArray);
Expand Down