Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions 26 Framework/Core/src/SendingPolicy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Framework/DeviceSpec.h"
#include "Framework/DataRefUtils.h"
#include "Framework/DataProcessingHeader.h"
#include "Headers/DataHeaderHelpers.h"
#include "Framework/Logger.h"
#include "Headers/STFHeader.h"
#include "DeviceSpecHelpers.h"
Expand Down Expand Up @@ -48,6 +49,31 @@ std::vector<SendingPolicy> SendingPolicy::createDefaultPolicies()
} else if (state.droppedMessages < std::numeric_limits<decltype(state.droppedMessages)>::max()) {
state.droppedMessages++;
} }},
SendingPolicy{
.name = "profiling",
.matcher = [](DeviceSpec const&, ConfigContext const&) { return getenv("DPL_DEBUG_MESSAGE_SIZE"); },
.send = [](FairMQDeviceProxy& proxy, fair::mq::Parts& parts, ChannelIndex channelIndex, ServiceRegistryRef registry) {
auto *channel = proxy.getOutputChannel(channelIndex);
auto timeout = 1000;
int count = 0;
for (auto& part : parts) {
auto* dh = o2::header::get<o2::header::DataHeader*>(part->GetData());
if (dh == nullptr) {
// This is a payload.
continue;
}
LOGP(info, "Sent {}/{}/{} for a total of {} bytes", dh->dataOrigin, dh->dataDescription, dh->subSpecification, dh->payloadSize);
count+= dh->payloadSize;
}
LOGP(info, "Sent {} parts for a total of {} bytes", parts.Size(), count);
auto res = channel->Send(parts, timeout);
if (res == (size_t)fair::mq::TransferCode::timeout) {
LOGP(warning, "Timed out sending after {}s. Downstream backpressure detected on {}.", timeout/1000, channel->GetName());
channel->Send(parts);
LOGP(info, "Downstream backpressure on {} recovered.", channel->GetName());
} else if (res == (size_t) fair::mq::TransferCode::error) {
LOGP(fatal, "Error while sending on channel {}", channel->GetName());
} }},
SendingPolicy{
.name = "default",
.matcher = [](DeviceSpec const&, ConfigContext const&) { return true; },
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.