Don't use to-be-deprecated names

This commit is contained in:
Alexey Rybalchenko
2022-01-14 00:48:34 +01:00
committed by Dennis Klein
parent f15f669853
commit bfd08bb33f
90 changed files with 411 additions and 391 deletions

View File

@@ -44,7 +44,7 @@ class BenchmarkSampler : public Device
void Run() override
{
// store the channel reference to avoid traversing the map on every loop iteration
FairMQChannel& dataOutChannel = GetChannel(fOutChannelName, 0);
Channel& dataOutChannel = GetChannel(fOutChannelName, 0);
LOG(info) << "Starting the benchmark with message size of " << fMsgSize << " and " << fMaxIterations << " iterations.";
auto tStart = std::chrono::high_resolution_clock::now();
@@ -53,7 +53,7 @@ class BenchmarkSampler : public Device
while (!NewStatePending()) {
if (fMultipart) {
FairMQParts parts;
Parts parts;
for (size_t i = 0; i < fNumParts; ++i) {
parts.AddPart(dataOutChannel.NewMessage(fMsgSize, fair::mq::Alignment{fMsgAlignment}));
@@ -71,7 +71,7 @@ class BenchmarkSampler : public Device
++fNumIterations;
}
} else {
FairMQMessagePtr msg(dataOutChannel.NewMessage(fMsgSize, fair::mq::Alignment{fMsgAlignment}));
MessagePtr msg(dataOutChannel.NewMessage(fMsgSize, fair::mq::Alignment{fMsgAlignment}));
if (fMemSet) {
std::memset(msg->GetData(), 0, msg->GetSize());
}

View File

@@ -9,7 +9,7 @@
#ifndef FAIR_MQ_MERGER_H
#define FAIR_MQ_MERGER_H
#include <FairMQPoller.h>
#include <fairmq/Poller.h>
#include <fairmq/Device.h>
#include <fairlogger/Logger.h>
@@ -45,13 +45,13 @@ class Merger : public Device
{
int numInputs = GetNumSubChannels(fInChannelName);
std::vector<FairMQChannel*> chans;
std::vector<Channel*> chans;
for (auto& chan : fChannels.at(fInChannelName)) {
chans.push_back(&chan);
}
FairMQPollerPtr poller(NewPoller(chans));
PollerPtr poller(NewPoller(chans));
if (fMultipart) {
while (!NewStatePending()) {
@@ -61,7 +61,7 @@ class Merger : public Device
for (int i = 0; i < numInputs; ++i) {
// Check if the channel has data ready to be received.
if (poller->CheckInput(i)) {
FairMQParts payload;
Parts payload;
if (Receive(payload, fInChannelName, i) >= 0) {
if (Send(payload, fOutChannelName) < 0) {
@@ -83,7 +83,7 @@ class Merger : public Device
for (int i = 0; i < numInputs; ++i) {
// Check if the channel has data ready to be received.
if (poller->CheckInput(i)) {
FairMQMessagePtr payload(fTransportFactory->CreateMessage());
MessagePtr payload(fTransportFactory->CreateMessage());
if (Receive(payload, fInChannelName, i) >= 0) {
if (Send(payload, fOutChannelName) < 0) {

View File

@@ -40,11 +40,11 @@ class Multiplier : public Device
}
bool HandleSingleData(std::unique_ptr<FairMQMessage>& payload, int)
bool HandleSingleData(std::unique_ptr<Message>& payload, int)
{
for (unsigned int i = 0; i < fOutChannelNames.size() - 1; ++i) { // all except last channel
for (unsigned int j = 0; j < GetNumSubChannels(fOutChannelNames.at(i)); ++j) { // all subChannels in a channel
FairMQMessagePtr msgCopy(fTransportFactory->CreateMessage());
MessagePtr msgCopy(fTransportFactory->CreateMessage());
msgCopy->Copy(*payload);
Send(msgCopy, fOutChannelNames.at(i), j);
@@ -54,7 +54,7 @@ class Multiplier : public Device
unsigned int lastChannelSize = GetNumSubChannels(fOutChannelNames.back());
for (unsigned int i = 0; i < lastChannelSize - 1; ++i) { // iterate over all except last subChannels of the last channel
FairMQMessagePtr msgCopy(fTransportFactory->CreateMessage());
MessagePtr msgCopy(fTransportFactory->CreateMessage());
msgCopy->Copy(*payload);
Send(msgCopy, fOutChannelNames.back(), i);
@@ -65,14 +65,14 @@ class Multiplier : public Device
return true;
}
bool HandleMultipartData(FairMQParts& payload, int)
bool HandleMultipartData(Parts& payload, int)
{
for (unsigned int i = 0; i < fOutChannelNames.size() - 1; ++i) { // all except last channel
for (unsigned int j = 0; j < GetNumSubChannels(fOutChannelNames.at(i)); ++j) { // all subChannels in a channel
FairMQParts parts;
Parts parts;
for (int k = 0; k < payload.Size(); ++k) {
FairMQMessagePtr msgCopy(fTransportFactory->CreateMessage());
MessagePtr msgCopy(fTransportFactory->CreateMessage());
msgCopy->Copy(payload.AtRef(k));
parts.AddPart(std::move(msgCopy));
}
@@ -84,10 +84,10 @@ class Multiplier : public Device
unsigned int lastChannelSize = GetNumSubChannels(fOutChannelNames.back());
for (unsigned int i = 0; i < lastChannelSize - 1; ++i) { // iterate over all except last subChannels of the last channel
FairMQParts parts;
Parts parts;
for (int k = 0; k < payload.Size(); ++k) {
FairMQMessagePtr msgCopy(fTransportFactory->CreateMessage());
MessagePtr msgCopy(fTransportFactory->CreateMessage());
msgCopy->Copy(payload.AtRef(k));
parts.AddPart(std::move(msgCopy));
}

View File

@@ -34,7 +34,7 @@ class Proxy : public Device
{
if (fMultipart) {
while (!NewStatePending()) {
FairMQParts payload;
Parts payload;
if (Receive(payload, fInChannelName) >= 0) {
if (Send(payload, fOutChannelName) < 0) {
LOG(debug) << "Transfer interrupted";
@@ -47,7 +47,7 @@ class Proxy : public Device
}
} else {
while (!NewStatePending()) {
FairMQMessagePtr payload(fTransportFactory->CreateMessage());
MessagePtr payload(fTransportFactory->CreateMessage());
if (Receive(payload, fInChannelName) >= 0) {
if (Send(payload, fOutChannelName) < 0) {
LOG(debug) << "Transfer interrupted";

View File

@@ -9,7 +9,6 @@
#ifndef FAIR_MQ_SINK_H
#define FAIR_MQ_SINK_H
#include <FairMQPoller.h>
#include <fairmq/Device.h>
#include <fairmq/tools/Strings.h>
@@ -48,7 +47,7 @@ class Sink : public Device
void Run() override
{
// store the channel reference to avoid traversing the map on every loop iteration
FairMQChannel& dataInChannel = GetChannel(fInChannelName, 0);
Channel& dataInChannel = GetChannel(fInChannelName, 0);
LOG(info) << "Starting sink and expecting to receive " << fMaxIterations << " messages.";
auto tStart = std::chrono::high_resolution_clock::now();
@@ -70,7 +69,7 @@ class Sink : public Device
while (!NewStatePending()) {
if (fMultipart) {
FairMQParts parts;
Parts parts;
if (dataInChannel.Receive(parts) < 0) {
continue;
}
@@ -80,7 +79,7 @@ class Sink : public Device
}
}
} else {
FairMQMessagePtr msg(dataInChannel.NewMessage());
MessagePtr msg(dataInChannel.NewMessage());
if (dataInChannel.Receive(msg) < 0) {
continue;
}

View File

@@ -34,9 +34,9 @@ class Splitter : public Device
fDirection = 0;
if (fMultipart) {
OnData(fInChannelName, &Splitter::HandleData<FairMQParts>);
OnData(fInChannelName, &Splitter::HandleData<Parts>);
} else {
OnData(fInChannelName, &Splitter::HandleData<FairMQMessagePtr>);
OnData(fInChannelName, &Splitter::HandleData<MessagePtr>);
}
}