Skip to content

SimuInterface::group_exist_HDF5 hack #15

Description

@yigu8115

The following function is a hack. It opens and closes the input file every time it is called.
This is because the rest of the code uses HDF5 C++ API, but HDF5 C API is needed here.
This may cause excessive overhead.

Solutions:
(1) Use HDF5 C API for the rest of the code (lots of work!) or
(2) Wait for better HDF5 C++ API error handling.

bool SimuInterface::group_exist_HDF5(const string & filename, const string & name){
hid_t file_id = H5Fopen( filename.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT );
//hbool_t check_object_valid = true;
bool r = H5LTpath_valid(file_id, name.c_str(), true);
H5Fclose(file_id);
return r;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions