Skip to content

Commit

Permalink
Somewhat fix Attribute loading
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Nov 24, 2020
1 parent 4c5fe8c commit 58b0d87
Showing 1 changed file with 37 additions and 17 deletions.
54 changes: 37 additions & 17 deletions src/IO/ADIOS/ADIOS2IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ ADIOS2IOHandlerImpl::closeFile(
auto it = m_fileData.find( fileIterator->second );
if ( it != m_fileData.end( ) )
{
/*
* Do not perform Puts and Gets manually, engine will do that
* upon being closed.
*/
it->second->flush(
/* performDatasetPutGets = */ false,
/* writeAttributes = */ true );
Expand Down Expand Up @@ -1806,19 +1810,19 @@ namespace detail
{
ba->run( *this );
}
if( writeAttributes )
{
for( auto & pair : m_attributeWrites )
{
pair.second.run( *this );
}
}
if( performDatasetPutGets )
{
for( auto & ba : m_buffer )
{
ba->run( *this );
}
if( writeAttributes )
{
for( auto & pair : m_attributeWrites )
{
pair.second.run( *this );
}
}
// Flush() does not necessarily perform
// deferred actions....
switch ( m_mode )
Expand All @@ -1838,16 +1842,16 @@ namespace detail
break;
}
m_buffer.clear();
}
m_buffer.clear();
for( BufferedAttributeRead & task : m_attributeReads )
{
task.run( *this );
}
m_attributeReads.clear();
if( writeAttributes )
{
m_attributeWrites.clear();

for( BufferedAttributeRead & task : m_attributeReads )
{
task.run( *this );
}
m_attributeReads.clear();
if( writeAttributes )
{
m_attributeWrites.clear();
}
}
}

Expand Down Expand Up @@ -1878,10 +1882,22 @@ namespace detail
{
getEngine().BeginStep();
}
/*
* Do not perform Puts and Gets manually,
* engine will do that upon EndStep.
*/
flush(
/* performDatasetPutGets = */ false,
/* writeAttributes = */ true );
getEngine().EndStep();
m_buffer.clear();
/*
* Flush a second time to read attributes, now that they've been
* preloaded.
*/
flush(
/* performDatasetPutGets = */ true,
/* writeAttributes = */ false );
streamStatus = StreamStatus::OutsideOfStep;
return AdvanceStatus::OK;
}
Expand All @@ -1895,6 +1911,10 @@ namespace detail
// return status is stored in m_lastStepStatus
if( streamStatus != StreamStatus::DuringStep )
{
/*
* Do not perform Puts and Gets,
* Engine is outside of a step anyway.
*/
flush(
/* performDatasetPutGets = */ false,
/* writeAttributes = */ false );
Expand Down

0 comments on commit 58b0d87

Please sign in to comment.