sst takes longer than needed buffer from bp3
Created by: germasch
@eisenhauer, I noticed that SstWriter uses m_Data.m_Buffer.size()
to get the size of the provided buffer. That actually returns the capacity of m_Data
, though, that is, it's potentially larger than the actual serialized data. It's not likely to have any actual consequences (I don't know if that size is even used at all. If the buffer were copied, it could potentially lead to copying more data than needed, but I don't thing it is ever copied in the first place.)
Potential fix:
diff --git a/source/adios2/engine/sst/SstWriter.cpp b/source/adios2/engine/sst/SstWriter.cpp
index b17f7f92..e0e971a2 100644
--- a/source/adios2/engine/sst/SstWriter.cpp
+++ b/source/adios2/engine/sst/SstWriter.cpp
@@ -161,7 +161,7 @@ void SstWriter::EndStep()
newblock->metadata.DataSize =
m_BP3Serializer->m_Metadata.m_Buffer.size();
newblock->metadata.block = m_BP3Serializer->m_Metadata.m_Buffer.data();
- newblock->data.DataSize = m_BP3Serializer->m_Data.m_Buffer.size();
+ newblock->data.DataSize = m_BP3Serializer->m_Data.m_Position;
newblock->data.block = m_BP3Serializer->m_Data.m_Buffer.data();
newblock->serializer = m_BP3Serializer;
TAU_STOP("Marshaling overhead");
That's from how BP3Writer does it:
void BP3Writer::WriteData(const bool isFinal, const int transportIndex)
{
size_t dataSize = m_BP3Serializer.m_Data.m_Position;
...