Skip to content

Commit 6747c25

Browse files
committed
DPL: drop support for FairMQ versions without shallow copy
1 parent 1cd002b commit 6747c25

File tree

5 files changed

+1
-34
lines changed

5 files changed

+1
-34
lines changed

Framework/Core/include/Framework/CompletionPolicyHelpers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ struct CompletionPolicyHelpers {
4444
/// When any of the parts of the record have been received, consume them.
4545
static CompletionPolicy consumeWhenAny(const char* name, CompletionPolicy::Matcher matcher);
4646

47-
#if __has_include(<fairmq/shmem/Message.h>)
4847
/// When any of the parts which has arrived has a refcount of 1.
4948
static CompletionPolicy consumeWhenAnyZeroCount(const char* name, CompletionPolicy::Matcher matcher);
50-
#endif
49+
5150
/// Default matcher applies for all devices
5251
static CompletionPolicy consumeWhenAny(CompletionPolicy::Matcher matcher = [](auto const&) -> bool { return true; })
5352
{

Framework/Core/src/CompletionPolicy.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ std::vector<CompletionPolicy>
2626
{
2727
return {
2828
CompletionPolicyHelpers::consumeWhenAllOrdered("internal-dpl-aod-writer"),
29-
#if __has_include(<fairmq/shmem/Message.h>)
3029
CompletionPolicyHelpers::consumeWhenAnyZeroCount("internal-dpl-injected-dummy-sink", [](DeviceSpec const& s) { return s.name.find("internal-dpl-injected-dummy-sink") != std::string::npos; }),
31-
#else
32-
CompletionPolicyHelpers::consumeWhenAny("internal-dpl-injected-dummy-sink", [](DeviceSpec const& s) { return s.name.find("internal-dpl-injected-dummy-sink") != std::string::npos; }),
33-
#endif
3430
CompletionPolicyHelpers::consumeWhenAll()};
3531
}
3632

Framework/Core/src/CompletionPolicyHelpers.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
#include "Framework/TimingInfo.h"
2020
#include "DecongestionService.h"
2121
#include "Framework/Signpost.h"
22-
#if __has_include(<fairmq/shmem/Message.h>)
2322
#include <fairmq/shmem/Message.h>
24-
#endif
2523

2624
#include <cassert>
2725
#include <regex>
@@ -252,7 +250,6 @@ CompletionPolicy CompletionPolicyHelpers::consumeExistingWhenAny(const char* nam
252250
}};
253251
}
254252

255-
#if __has_include(<fairmq/shmem/Message.h>)
256253
CompletionPolicy CompletionPolicyHelpers::consumeWhenAnyZeroCount(const char* name, CompletionPolicy::Matcher matcher)
257254
{
258255
auto callback = [](InputSpan const& inputs, std::vector<InputSpec> const&, ServiceRegistryRef& ref) -> CompletionPolicy::CompletionOp {
@@ -265,7 +262,6 @@ CompletionPolicy CompletionPolicyHelpers::consumeWhenAnyZeroCount(const char* na
265262
};
266263
return CompletionPolicy{name, matcher, callback, false};
267264
}
268-
#endif
269265

270266
CompletionPolicy CompletionPolicyHelpers::consumeWhenAny(const char* name, CompletionPolicy::Matcher matcher)
271267
{

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@
5959
#include <fairmq/Parts.h>
6060
#include <fairmq/Socket.h>
6161
#include <fairmq/ProgOptions.h>
62-
#if __has_include(<fairmq/shmem/Message.h>)
6362
#include <fairmq/shmem/Message.h>
64-
#endif
6563
#include <Configuration/ConfigurationInterface.h>
6664
#include <Configuration/ConfigurationFactory.h>
6765
#include <Monitoring/Monitoring.h>
@@ -1046,14 +1044,6 @@ void DataProcessingDevice::fillContext(DataProcessorContext& context, DeviceCont
10461044
if (forwarded.matcher.lifetime != Lifetime::Condition) {
10471045
onlyConditions = false;
10481046
}
1049-
#if !__has_include(<fairmq/shmem/Message.h>)
1050-
if (strncmp(DataSpecUtils::asConcreteOrigin(forwarded.matcher).str, "AOD", 3) == 0) {
1051-
context.canForwardEarly = false;
1052-
overriddenEarlyForward = true;
1053-
LOG(detail) << "Cannot forward early because of AOD input: " << DataSpecUtils::describe(forwarded.matcher);
1054-
break;
1055-
}
1056-
#endif
10571047
if (DataSpecUtils::partialMatch(forwarded.matcher, o2::header::DataDescription{"RAWDATA"}) && deviceContext.processingPolicies.earlyForward == EarlyForwardPolicy::NORAW) {
10581048
context.canForwardEarly = false;
10591049
overriddenEarlyForward = true;
@@ -2058,14 +2048,10 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v
20582048
auto nofPartsGetter = [&currentSetOfInputs](size_t i) -> size_t {
20592049
return currentSetOfInputs[i].getNumberOfPairs();
20602050
};
2061-
#if __has_include(<fairmq/shmem/Message.h>)
20622051
auto refCountGetter = [&currentSetOfInputs](size_t idx) -> int {
20632052
auto& header = static_cast<const fair::mq::shmem::Message&>(*currentSetOfInputs[idx].header(0));
20642053
return header.GetRefCount();
20652054
};
2066-
#else
2067-
std::function<int(size_t)> refCountGetter = nullptr;
2068-
#endif
20692055
return InputSpan{getter, nofPartsGetter, refCountGetter, currentSetOfInputs.size()};
20702056
};
20712057

Framework/Core/src/DataRelayer.cxx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@
4747
#include <fairlogger/Logger.h>
4848
#include <fairmq/Channel.h>
4949
#include <functional>
50-
#if __has_include(<fairmq/shmem/Message.h>)
5150
#include <fairmq/shmem/Message.h>
52-
#endif
5351
#include <fmt/format.h>
5452
#include <fmt/ostream.h>
5553
#include <span>
@@ -215,14 +213,10 @@ DataRelayer::ActivityStats DataRelayer::processDanglingInputs(std::vector<Expira
215213
auto nPartsGetter = [&partial](size_t idx) {
216214
return partial[idx].size();
217215
};
218-
#if __has_include(<fairmq/shmem/Message.h>)
219216
auto refCountGetter = [&partial](size_t idx) -> int {
220217
auto& header = static_cast<const fair::mq::shmem::Message&>(*partial[idx].header(0));
221218
return header.GetRefCount();
222219
};
223-
#else
224-
std::function<int(size_t)> refCountGetter = nullptr;
225-
#endif
226220
InputSpan span{getter, nPartsGetter, refCountGetter, static_cast<size_t>(partial.size())};
227221
// Setup the input span
228222

@@ -781,14 +775,10 @@ void DataRelayer::getReadyToProcess(std::vector<DataRelayer::RecordAction>& comp
781775
auto nPartsGetter = [&partial](size_t idx) {
782776
return partial[idx].size();
783777
};
784-
#if __has_include(<fairmq/shmem/Message.h>)
785778
auto refCountGetter = [&partial](size_t idx) -> int {
786779
auto& header = static_cast<const fair::mq::shmem::Message&>(*partial[idx].header(0));
787780
return header.GetRefCount();
788781
};
789-
#else
790-
std::function<int(size_t)> refCountGetter = nullptr;
791-
#endif
792782
InputSpan span{getter, nPartsGetter, refCountGetter, static_cast<size_t>(partial.size())};
793783
CompletionPolicy::CompletionOp action = mCompletionPolicy.callbackFull(span, mInputs, mContext);
794784

0 commit comments

Comments
 (0)