From ae6f5714fc3abf7b087587c5187f2069a5d83872 Mon Sep 17 00:00:00 2001 From: Ruonan Wang <jason.ruonan.wang@gmail.com> Date: Sun, 16 Apr 2017 11:07:33 -0400 Subject: [PATCH] Removed while loop in helloDataManReader_nompi.cpp to prevent deadlock --- .../hello/datamanReader/helloDataManReader.cpp | 8 ++++---- .../datamanReader/helloDataManReader_nompi.cpp | 17 ++++++++--------- .../datamanWriter/helloDataManWriter_nompi.cpp | 8 ++++---- source/utilities/realtime/dataman/DataMan.cpp | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/examples/hello/datamanReader/helloDataManReader.cpp b/examples/hello/datamanReader/helloDataManReader.cpp index b3c8aa0cb..07a009915 100644 --- a/examples/hello/datamanReader/helloDataManReader.cpp +++ b/examples/hello/datamanReader/helloDataManReader.cpp @@ -51,11 +51,11 @@ int main(int argc, char *argv[]) // if not defined by user, we can change the default settings datamanSettings.SetEngine("DataManReader"); datamanSettings.SetParameters("peer-to-peer=yes"); - datamanSettings.AddTransport("Mdtm", "localIP=128.0.0.0.1", - "remoteIP=128.0.0.0.2", + datamanSettings.AddTransport("Mdtm", "localIP=127.0.0.1", + "remoteIP=127.0.0.1", "tolerances=1,2,3"); - // datamanSettings.AddTransport( "ZeroMQ", "localIP=128.0.0.0.1.1", - // "remoteIP=128.0.0.0.2.1", "tolerances=1,2,3" ); not yet supported + // datamanSettings.AddTransport( "ZeroMQ", "localIP=127.0.0.1", + // "remoteIP=127.0.0.1", "tolerances=1,2,3" ); not yet supported // , // will throw an exception } diff --git a/examples/hello/datamanReader/helloDataManReader_nompi.cpp b/examples/hello/datamanReader/helloDataManReader_nompi.cpp index 7e8c982bd..cb406b450 100644 --- a/examples/hello/datamanReader/helloDataManReader_nompi.cpp +++ b/examples/hello/datamanReader/helloDataManReader_nompi.cpp @@ -43,14 +43,12 @@ int main(int argc, char *argv[]) { // if not defined by user, we can change the default settings datamanSettings.SetEngine("DataManReader"); - datamanSettings.SetParameters( - "real_time=yes", "method_type=stream", "method=zmq", - "local_ip=127.0.0.1", "remote_ip=127.0.0.1", "local_port=12307", - "remote_port=12306"); - // datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", - // "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); - // datamanSettings.AddTransport( "ZeroMQ", "localIP=128.0.0.0.1.1", - // "remoteIP=128.0.0.0.2.1", "tolerances=1,2,3" ); not yet supported + datamanSettings.SetParameters("real_time=yes", "method_type=stream", + "method=dump"); + // datamanSettings.AddTransport( "Mdtm", "localIP=127.0.0.1", + // "remoteIP=127.0.0.1", "tolerances=1,2,3" ); + // datamanSettings.AddTransport( "ZeroMQ", "localIP=127.0.0.1", + // "remoteIP=127.0.0.1", "tolerances=1,2,3" ); not yet supported // , // will throw an exception } @@ -67,8 +65,9 @@ int main(int argc, char *argv[]) datamanReader->SetCallBack(getcb); - while (1) + for (int i = 0; i < 3; i++) { + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } adios::Variable<double> *ioMyDoubles = diff --git a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp index fa7158c37..aa2aed47a 100644 --- a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp +++ b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp @@ -52,10 +52,10 @@ int main(int argc, char *argv[]) "real_time=yes", "method_type=stream", "method=dump", "monitoring=yes", "local_ip=127.0.0.1", "remote_ip=127.0.0.1", "local_port=12306", "remote_port=12307"); - // datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", - // "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); - // datamanSettings.AddTransport( "ZeroMQ", "localIP=128.0.0.0.1.1", - // "remoteIP=128.0.0.0.2.1", "tolerances=1,2,3" ); not yet supported + // datamanSettings.AddTransport( "Mdtm", "localIP=127.0.0.1", + // "remoteIP=127.0.0.1", "tolerances=1,2,3" ); + // datamanSettings.AddTransport( "ZeroMQ", "localIP=127.0.0.1", + // "remoteIP=127.0.0.1", "tolerances=1,2,3" ); not yet supported // , // will throw an exception } diff --git a/source/utilities/realtime/dataman/DataMan.cpp b/source/utilities/realtime/dataman/DataMan.cpp index 430c8e363..eedda8a3a 100644 --- a/source/utilities/realtime/dataman/DataMan.cpp +++ b/source/utilities/realtime/dataman/DataMan.cpp @@ -38,7 +38,7 @@ void DataMan::add_file(std::string p_method) {} void DataMan::add_stream(json p_jmsg) { - std::string method = "zmq"; + std::string method; if (p_jmsg["method"] != nullptr) method = p_jmsg["method"]; -- GitLab