mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
FairMQ: Implement blocking ofi::Socket Send/Receive with FI_MSG
Completion events are not yet working.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
8f5b888314
commit
144aa912d7
@@ -34,19 +34,23 @@ class PairLeft : public FairMQDevice
|
||||
|
||||
// Simple empty message ping pong
|
||||
auto msg1{NewMessageFor("data", 0)};
|
||||
auto msg2{NewMessageFor("data", 0)};
|
||||
auto msg3{NewMessageFor("data", 0)};
|
||||
if (Send(msg1, "data") >= 0) counter++;
|
||||
auto msg2{NewMessageFor("data", 0)};
|
||||
if (Receive(msg2, "data") >= 0) counter++;
|
||||
if (Send(msg2, "data") >= 0) counter++;
|
||||
if (Receive(msg3, "data") >= 0) counter++;
|
||||
auto msg3{NewMessageFor("data", 0)};
|
||||
if (Send(msg3, "data") >= 0) counter++;
|
||||
auto msg4{NewMessageFor("data", 0)};
|
||||
if (Receive(msg4, "data") >= 0) counter++;
|
||||
if (counter == 4) LOG(info) << "Simple empty message ping pong successfull";
|
||||
|
||||
// Simple message with short text data
|
||||
auto msg4{NewSimpleMessageFor("data", 0, "testdata1234")};
|
||||
if (Send(msg4, "data") >= 0) counter++;
|
||||
auto msg5{NewSimpleMessageFor("data", 0, "testdata1234")};
|
||||
LOG(info) << "Will send msg5";
|
||||
if (Send(msg5, "data") >= 0) counter++;
|
||||
LOG(info) << "Sent msg5";
|
||||
if (counter == 5) LOG(info) << "Simple message with short text data successfull";
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
assert(counter == 5);
|
||||
};
|
||||
};
|
||||
|
@@ -36,19 +36,21 @@ class PairRight : public FairMQDevice
|
||||
// Simple empty message ping pong
|
||||
auto msg1{NewMessageFor("data", 0)};
|
||||
if (Receive(msg1, "data") >= 0) counter++;
|
||||
if (Send(msg1, "data") >= 0) counter++;
|
||||
auto msg2{NewMessageFor("data", 0)};
|
||||
if (Receive(msg2, "data") >= 0) counter++;
|
||||
if (Send(msg2, "data") >= 0) counter++;
|
||||
auto msg3{NewMessageFor("data", 0)};
|
||||
if (Receive(msg3, "data") >= 0) counter++;
|
||||
auto msg4{NewMessageFor("data", 0)};
|
||||
if (Send(msg4, "data") >= 0) counter++;
|
||||
if (counter == 4) LOG(info) << "Simple empty message ping pong successfull";
|
||||
|
||||
// Simple message with short text data
|
||||
auto msg3{NewMessageFor("data", 0)};
|
||||
auto ret = Receive(msg3, "data");
|
||||
auto msg5{NewMessageFor("data", 0)};
|
||||
auto ret = Receive(msg5, "data");
|
||||
if (ret > 0) {
|
||||
auto content = std::string{static_cast<char*>(msg3->GetData()), msg3->GetSize()};
|
||||
LOG(info) << ret << ", " << msg3->GetSize() << ", '" << content << "'";
|
||||
if (msg3->GetSize() == ret && content == "testdata1234") counter++;
|
||||
auto content = std::string{static_cast<char*>(msg5->GetData()), msg5->GetSize()};
|
||||
LOG(info) << ret << ", " << msg5->GetSize() << ", '" << content << "'";
|
||||
if (msg5->GetSize() == ret && content == "testdata1234") counter++;
|
||||
}
|
||||
if (counter == 5) LOG(info) << "Simple message with short text data successfull";
|
||||
|
||||
|
Reference in New Issue
Block a user