Skip to content

Commit

Permalink
Merge pull request #2621 from JasonRuonanWang/dataman
Browse files Browse the repository at this point in the history
DataMan: rename double buffer to threading
  • Loading branch information
JasonRuonanWang authored Feb 15, 2021
2 parents 1bd3d82 + 4d21443 commit 3455b66
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docs/user_guide/source/engines/dataman.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The DataMan engine takes the following parameters:
A number >1 will cause the writer to wait for more readers, and a value of 0 will allow the writer to proceed without any readers present.
This value is interpreted by DataMan Writer engines only.

5. ``DoubleBuffer``: Default **true** for reader, **false** for writer. Whether to use double buffer for caching send and receive operations.
Enabling double buffer will cause extra overhead for managing threads and buffer queues, but will improve the continuity of data steps for the reader, for the pub/sub mode.
5. ``Threading``: Default **true** for reader, **false** for writer. Whether to use threads for send and receive operations.
Enabling threading will cause extra overhead for managing threads and buffer queues, but will improve the continuity of data steps for readers, and help overlap data transfers with computations for writers.
Advice for generic uses cases is to keep the default values, true for reader and false for writer.

6. ``TransportMode``: Default **fast**. The fast mode is optimized for latency-critical applications.
Expand All @@ -40,7 +40,7 @@ The DataMan engine takes the following parameters:
Port integer **50001**, 22000, 33000
Timeout integer **5**, 10, 30
RendezvousReaderCount integer **1**, 0, 3
DoubleBuffer bool **true** for reader, **false** for writer
Threading bool **true** for reader, **false** for writer
TransportMode string **fast**, reliable
=============================== ================== ================================================

Expand Down
8 changes: 4 additions & 4 deletions source/adios2/engine/dataman/DataManReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DataManReader::DataManReader(IO &io, const std::string &name,
helper::GetParameter(m_IO.m_Parameters, "Port", m_Port);
helper::GetParameter(m_IO.m_Parameters, "Timeout", m_Timeout);
helper::GetParameter(m_IO.m_Parameters, "Verbose", m_Verbosity);
helper::GetParameter(m_IO.m_Parameters, "DoubleBuffer", m_DoubleBuffer);
helper::GetParameter(m_IO.m_Parameters, "Threading", m_Threading);
helper::GetParameter(m_IO.m_Parameters, "TransportMode", m_TransportMode);
helper::GetParameter(m_IO.m_Parameters, "Monitor", m_MonitorActive);

Expand Down Expand Up @@ -74,7 +74,7 @@ DataManReader::DataManReader(IO &io, const std::string &name,
m_Monitor.SetClockError(roundLatency,
*reinterpret_cast<uint64_t *>(reply->data()));
m_Monitor.AddTransport(m_TransportMode);
if (m_DoubleBuffer)
if (m_Threading)
{
m_Monitor.SetReaderThreading();
}
Expand Down Expand Up @@ -259,7 +259,7 @@ void DataManReader::RequestThread()
{
}
}
m_Serializer.PutPack(buffer, m_DoubleBuffer);
m_Serializer.PutPack(buffer, m_Threading);
if (m_MonitorActive)
{
size_t combiningSteps = m_Serializer.GetCombiningSteps();
Expand Down Expand Up @@ -300,7 +300,7 @@ void DataManReader::SubscribeThread()
{
}
}
m_Serializer.PutPack(buffer, m_DoubleBuffer);
m_Serializer.PutPack(buffer, m_Threading);
if (m_MonitorActive)
{
size_t combiningSteps = m_Serializer.GetCombiningSteps();
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/engine/dataman/DataManReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DataManReader : public Engine
int m_Port = 50001;
int m_Timeout = 5;
int m_Verbosity = 0;
bool m_DoubleBuffer = true;
bool m_Threading = true;
size_t m_ReceiverBufferSize = 128 * 1024 * 1024;
std::string m_TransportMode = "fast";
bool m_MonitorActive = false;
Expand Down
10 changes: 5 additions & 5 deletions source/adios2/engine/dataman/DataManWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DataManWriter::DataManWriter(IO &io, const std::string &name,
helper::GetParameter(m_IO.m_Parameters, "Verbose", m_Verbosity);
helper::GetParameter(m_IO.m_Parameters, "RendezvousReaderCount",
m_RendezvousReaderCount);
helper::GetParameter(m_IO.m_Parameters, "DoubleBuffer", m_DoubleBuffer);
helper::GetParameter(m_IO.m_Parameters, "Threading", m_Threading);
helper::GetParameter(m_IO.m_Parameters, "TransportMode", m_TransportMode);
helper::GetParameter(m_IO.m_Parameters, "Monitor", m_MonitorActive);
helper::GetParameter(m_IO.m_Parameters, "CombiningSteps", m_CombiningSteps);
Expand Down Expand Up @@ -83,7 +83,7 @@ DataManWriter::DataManWriter(IO &io, const std::string &name,
ReplyThread();
}

if (m_DoubleBuffer && m_TransportMode == "fast")
if (m_Threading && m_TransportMode == "fast")
{
m_PublishThreadActive = true;
m_PublishThread = std::thread(&DataManWriter::PublishThread, this);
Expand Down Expand Up @@ -147,7 +147,7 @@ void DataManWriter::EndStep()
m_SerializerBufferSize = buffer->size();
}

if (m_DoubleBuffer || m_TransportMode == "reliable")
if (m_Threading || m_TransportMode == "reliable")
{
PushBufferQueue(buffer);
}
Expand Down Expand Up @@ -195,7 +195,7 @@ void DataManWriter::DoClose(const int transportIndex)
m_SerializerBufferSize = buffer->size();
}

if (m_DoubleBuffer || m_TransportMode == "reliable")
if (m_Threading || m_TransportMode == "reliable")
{
PushBufferQueue(buffer);
}
Expand All @@ -211,7 +211,7 @@ void DataManWriter::DoClose(const int transportIndex)
auto cvp = std::make_shared<std::vector<char>>(s.size());
std::memcpy(cvp->data(), s.c_str(), s.size());

if (m_DoubleBuffer || m_TransportMode == "reliable")
if (m_Threading || m_TransportMode == "reliable")
{
PushBufferQueue(cvp);
}
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/engine/dataman/DataManWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DataManWriter : public Engine
int m_RendezvousReaderCount = 1;
int m_Timeout = 5;
int m_Verbosity = 0;
bool m_DoubleBuffer = false;
bool m_Threading = false;
std::string m_TransportMode = "fast";
bool m_MonitorActive = false;
int m_CombiningSteps = 1;
Expand Down

0 comments on commit 3455b66

Please sign in to comment.