Skip to content

Commit

Permalink
Merge pull request ornladios#3619 from vicentebolea/backports-bp5-bugfix
Browse files Browse the repository at this point in the history
Backports bp5 bugfix
  • Loading branch information
vicentebolea committed May 29, 2023
2 parents 80a8b4d + eff1b1b commit f1cedf3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 15 additions & 3 deletions source/adios2/engine/bp5/BP5Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,14 @@ void BP5Writer::EndStep()
m_Profiler.Start("AWD");
// TSInfo destructor would delete the DataBuffer so we need to save it
// for async IO and let the writer free it up when not needed anymore
adios2::format::BufferV *databuf = TSInfo.DataBuffer;
TSInfo.DataBuffer = NULL;
m_AsyncWriteLock.lock();
m_flagRush = false;
m_AsyncWriteLock.unlock();
WriteData(databuf);

// WriteData will free TSInfo.DataBuffer
WriteData(TSInfo.DataBuffer);
TSInfo.DataBuffer = NULL;

m_Profiler.Stop("AWD");

/*
Expand Down Expand Up @@ -688,6 +690,16 @@ void BP5Writer::EndStep()
m_EndStepEnd = Now();
/* Seconds ts2 = Now() - m_EngineStart;
std::cout << "END STEP ended at: " << ts2.count() << std::endl;*/

if (TSInfo.AttributeEncodeBuffer)
{
delete TSInfo.AttributeEncodeBuffer;
}

if (TSInfo.MetaEncodeBuffer)
{
delete TSInfo.MetaEncodeBuffer;
}
}

// PRIVATE
Expand Down
4 changes: 0 additions & 4 deletions source/adios2/toolkit/format/bp5/BP5Serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ class BP5Serializer : virtual public BP5Base

~TimestepInfo()
{
delete MetaEncodeBuffer;
if (AttributeEncodeBuffer)
delete AttributeEncodeBuffer;
delete DataBuffer;
}
};

Expand Down

0 comments on commit f1cedf3

Please sign in to comment.