Skip to content
Snippets Groups Projects
Commit 4cdd0934 authored by Jason Wang's avatar Jason Wang Committed by William F Godoy
Browse files

fixed JSON exception for helloDataManWriter (#6)

and clang-format issues
parent 0724681f
No related branches found
No related tags found
1 merge request!124Refactor
......@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
adios::IO &dataManIO = adios.DeclareIO("WANIO");
dataManIO.SetEngine("DataManWriter");
dataManIO.SetParameters("peer-to-peer=yes", "real_time=yes",
"compress=no", "method=cache");
"compress=no", "method=dump");
// Define variable and local size
auto bpFloats =
......
......@@ -72,11 +72,23 @@ void DataMan::add_stream(json a_jmsg)
a_jmsg["num_channels"] = num_channels;
}
int local_port = 12306, remote_port = 12307;
if (a_jmsg["local_port"].is_number())
{
local_port = a_jmsg["local_port"].get<int>();
}
if (a_jmsg["remote_port"].is_number())
{
local_port = a_jmsg["remote_port"].get<int>();
}
for (int i = 0; i < num_channels; i++)
{
a_jmsg["channel_id"] = i;
a_jmsg["local_port"] = a_jmsg["local_port"].get<int>() + 2;
a_jmsg["remote_port"] = a_jmsg["remote_port"].get<int>() + 2;
a_jmsg["local_port"] = local_port + 2;
a_jmsg["remote_port"] = remote_port + 2;
auto man = get_man(method);
if (man)
{
......
......@@ -19,6 +19,7 @@
int MdtmMan::init(json a_jmsg)
{
std::cout << " 1 MdtmMan::init " << m_channel_id << std::endl;
StreamMan::init(a_jmsg);
if (a_jmsg["pipe_prefix"].is_string())
......@@ -68,16 +69,22 @@ int MdtmMan::init(json a_jmsg)
// Make pipes
mkdir(m_pipepath.c_str(), 0755);
std::cout << "making " << m_full_pipename << std::endl;
mkfifo(m_full_pipename.c_str(), 0666);
std::cout << "made " << m_full_pipename << std::endl;
if (m_stream_mode == "sender")
{
std::cout << "opening " << m_full_pipename << std::endl;
m_pipe_handler = open(m_full_pipename.c_str(), O_WRONLY);
std::cout << "opened " << m_full_pipename << std::endl;
}
if (m_stream_mode == "receiver")
{
m_pipe_handler = open(m_full_pipename.c_str(), O_RDONLY | O_NONBLOCK);
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment