Unverified Commit f1cedf39 authored by Bolea Sanchez, Vicente Adolfo's avatar Bolea Sanchez, Vicente Adolfo Committed by GitHub
Browse files

Merge pull request #3619 from vicentebolea/backports-bp5-bugfix

Backports bp5 bugfix
parents 80a8b4d5 eff1b1bb
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -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");

    /*
@@ -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
+0 −4
Original line number Diff line number Diff line
@@ -42,10 +42,6 @@ public:

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