Commit d187e94c authored by Spencer Sherwin's avatar Spencer Sherwin

Merge branch 'fix/hdf5-deadlock' into 'master'

Fix HDF5 deadlock

See merge request !786
parents 3e60e8c4 a11c68a6
......@@ -30,6 +30,7 @@ v4.4.1
- Fix Hdf5 output in FilterFieldConvert (!781)
- Fixed extreme memory consumption of Interpolator when interpolating from pts
to fld or between different meshes (!783)
- Fix deadlock with HDF5 input (!786)
**FieldConvert:**
- Fix issue with field ordering in the interppointdatatofld module (!754)
......
......@@ -864,6 +864,7 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
// Set properties for parallel file access (if we're in parallel)
H5::PListSharedPtr parallelProps = H5::PList::Default();
H5::PListSharedPtr readPL = H5::PList::Default();
H5::PListSharedPtr readPLInd = H5::PList::Default();
if (nRanks > 1)
{
......@@ -873,6 +874,8 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
// Use collective IO
readPL = H5::PList::DatasetXfer();
readPL->SetDxMpioCollective();
readPLInd = H5::PList::DatasetXfer();
readPLInd->SetDxMpioIndependent();
}
DataSourceSharedPtr dataSource = H5DataSource::create(
......@@ -1012,8 +1015,9 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
map<uint64_t, set<uint64_t> >::iterator gIt;
for (gIt = groupsToDecomps.begin(); gIt != groupsToDecomps.end(); ++gIt)
{
// Select region from dataset for this decomposition.
set<uint64_t>::iterator sIt;
// Select region from dataset for this decomposition.
for (sIt = gIt->second.begin(); sIt != gIt->second.end(); ++sIt)
{
std::stringstream fieldNameStream;
......@@ -1021,7 +1025,7 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
FieldDefinitionsSharedPtr fielddef =
MemoryManager<FieldDefinitions>::AllocateSharedPtr();
ImportFieldDef(readPL, root, decomps, *sIt, decompsToOffsets[*sIt],
ImportFieldDef(readPLInd, root, decomps, *sIt, decompsToOffsets[*sIt],
fieldNameStream.str(), fielddef);
fielddef->m_elementIDs = groupsToElmts[*sIt];
......@@ -1031,7 +1035,7 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
{
std::vector<NekDouble> decompFieldData;
ImportFieldData(
readPL, data_dset, data_fspace,
readPLInd, data_dset, data_fspace,
decompsToOffsets[*sIt].data, decomps, *sIt, fielddef,
decompFieldData);
fielddata.push_back(decompFieldData);
......@@ -1276,7 +1280,6 @@ void FieldIOHdf5::ImportFieldData(
data_fspace->SelectRange(data_i, nFieldVals);
data_dset->Read(fielddata, data_fspace, readPL);
int datasize = CheckFieldDefinition(fielddef);
ASSERTL0(
fielddata.size() == datasize * fielddef->m_fields.size(),
......
......@@ -76,6 +76,7 @@ namespace H5
0); \
}
class Error : public std::exception
{
};
......@@ -474,12 +475,9 @@ public:
DataTypeSharedPtr mem_t = DataTypeTraits<T>::GetType();
DataSpaceSharedPtr memspace = DataSpace::OneD(data.size());
H5Dwrite(m_Id,
mem_t->GetId(),
memspace->GetId(),
filespace->GetId(),
dxpl->GetId(),
&data[0]);
H5_CALL(H5Dwrite,
(m_Id, mem_t->GetId(), memspace->GetId(), filespace->GetId(),
dxpl->GetId(), &data[0]) );
}
template <class T> void Read(std::vector<T> &data)
{
......@@ -508,12 +506,8 @@ public:
data.resize(len);
DataSpaceSharedPtr memspace = DataSpace::OneD(len);
H5Dread(m_Id,
mem_t->GetId(),
memspace->GetId(),
filespace->GetId(),
dxpl->GetId(),
&data[0]);
H5_CALL(H5Dread, (m_Id, mem_t->GetId(), memspace->GetId(),
filespace->GetId(), dxpl->GetId(), &data[0]));
}
private:
......
......@@ -160,6 +160,7 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES )
ADD_NEKTAR_TEST_LENGTHY(Tet_channel_m8_petsc_sc_par)
ENDIF (NEKTAR_USE_PETSC)
IF (NEKTAR_USE_HDF5)
ADD_NEKTAR_TEST(TriQuadChannelHdf5)
ADD_NEKTAR_TEST(Tet_channel_m8_hdf)
ADD_NEKTAR_TEST(KovaFlow_3DH1D_P5_20modes_MVM_hdf5)
ENDIF (NEKTAR_USE_HDF5)
......
<?xml version="1.0" encoding="utf-8"?>
<test>
<description>Tri and Quad element channel Flow 2D reading hdf5 (3 proc) </description>
<executable>IncNavierStokesSolver</executable>
<parameters>TriQuadChannelHdf5.xml</parameters>
<processes>3</processes>
<files>
<file description="Session File">TriQuadChannelHdf5.xml</file>
<file description="Restart File">TriQuadChannelHdf5.rst</file>
</files>
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-12">6.53397e-14</value>
<value variable="v" tolerance="1e-12">2.89187e-15</value>
<value variable="p" tolerance="2.3e-10">2.26904e-10</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-12">5.31797e-14</value>
<value variable="v" tolerance="1e-12">4.82522e-15</value>
<value variable="p" tolerance="1.1e-10">1.00154e-10</value>
</metric>
</metrics>
</test>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment