#7527 HDF Summary Reader : Add first working prototype

HDF5 must be compiled with special options to support multithreading. Disable file object multithreading for HDF5. Some vector types are not supported, as the support in opm-common reader is not complete (region, region_to_region, ...).
This commit is contained in:
Magne Sjaastad
2021-04-08 15:53:38 +02:00
parent d082ce7eb1
commit dd97e7741a
22 changed files with 990 additions and 147 deletions

View File

@@ -356,24 +356,7 @@ std::string RifHdf5Reader::getStringAttribute( H5::H5File file, std::string grou
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RifHdf5Reader::getSubGroupNames( H5::H5File file, std::string baseGroupName ) const
{
H5::Group baseGroup = file.openGroup( baseGroupName.c_str() );
std::vector<std::string> subGroupNames;
hsize_t groupSize = baseGroup.getNumObjs();
for ( hsize_t i = 0; i < groupSize; i++ )
{
std::string nodeName( 1024, '\0' );
ssize_t slen = baseGroup.getObjnameByIdx( i, &nodeName[0], 1023 );
nodeName.resize( slen + 1 );
subGroupNames.push_back( nodeName );
}
return subGroupNames;
return RifHdf5ReaderTools::getSubGroupNames( &file, baseGroupName );
}
//--------------------------------------------------------------------------------------------------
@@ -412,3 +395,33 @@ void RifHdf5Reader::getElementResultValues( H5::H5File file, std::string groupNa
( *resultValues ).resize( dims[0] );
dataset.read( resultValues->data(), H5::PredType::NATIVE_DOUBLE );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RifHdf5ReaderTools::getSubGroupNames( H5::H5File* file, const std::string& baseGroupName )
{
if ( file )
{
H5::Group baseGroup = file->openGroup( baseGroupName.c_str() );
std::vector<std::string> subGroupNames;
hsize_t groupSize = baseGroup.getNumObjs();
for ( hsize_t i = 0; i < groupSize; i++ )
{
std::string nodeName( 1024, '\0' );
ssize_t slen = baseGroup.getObjnameByIdx( i, &nodeName[0], 1023 );
nodeName.resize( slen + 1 );
subGroupNames.push_back( nodeName );
}
return subGroupNames;
}
return {};
}