|
57 | 57 | #include <fairmq/Parts.h> |
58 | 58 | #include <fairmq/Socket.h> |
59 | 59 | #include <fairmq/ProgOptions.h> |
| 60 | +#if __has_include(<fairmq/shmem/Message.h>) |
| 61 | +#include <fairmq/shmem/Message.h> |
| 62 | +#endif |
60 | 63 | #include <Configuration/ConfigurationInterface.h> |
61 | 64 | #include <Configuration/ConfigurationFactory.h> |
62 | 65 | #include <Monitoring/Monitoring.h> |
@@ -1214,12 +1217,14 @@ void DataProcessingDevice::fillContext(DataProcessorContext& context, DeviceCont |
1214 | 1217 | if (forwarded.matcher.lifetime != Lifetime::Condition) { |
1215 | 1218 | onlyConditions = false; |
1216 | 1219 | } |
| 1220 | +#if !__has_include(<fairmq/shmem/Message.h>) |
1217 | 1221 | if (strncmp(DataSpecUtils::asConcreteOrigin(forwarded.matcher).str, "AOD", 3) == 0) { |
1218 | 1222 | context.canForwardEarly = false; |
1219 | 1223 | overriddenEarlyForward = true; |
1220 | 1224 | LOG(detail) << "Cannot forward early because of AOD input: " << DataSpecUtils::describe(forwarded.matcher); |
1221 | 1225 | break; |
1222 | 1226 | } |
| 1227 | +#endif |
1223 | 1228 | if (DataSpecUtils::partialMatch(forwarded.matcher, o2::header::DataDescription{"RAWDATA"}) && mProcessingPolicies.earlyForward == EarlyForwardPolicy::NORAW) { |
1224 | 1229 | context.canForwardEarly = false; |
1225 | 1230 | overriddenEarlyForward = true; |
@@ -2230,7 +2235,15 @@ bool DataProcessingDevice::tryDispatchComputation(ServiceRegistryRef ref, std::v |
2230 | 2235 | auto nofPartsGetter = [¤tSetOfInputs](size_t i) -> size_t { |
2231 | 2236 | return currentSetOfInputs[i].getNumberOfPairs(); |
2232 | 2237 | }; |
2233 | | - return InputSpan{getter, nofPartsGetter, currentSetOfInputs.size()}; |
| 2238 | +#if __has_include(<fairmq/shmem/Message.h>) |
| 2239 | + auto refCountGetter = [¤tSetOfInputs](size_t idx) -> int { |
| 2240 | + auto& header = static_cast<const fair::mq::shmem::Message&>(*currentSetOfInputs[idx].header(0)); |
| 2241 | + return header.GetRefCount(); |
| 2242 | + }; |
| 2243 | +#else |
| 2244 | + std::function<int(size_t)> refCountGetter = nullptr; |
| 2245 | +#endif |
| 2246 | + return InputSpan{getter, nofPartsGetter, refCountGetter, currentSetOfInputs.size()}; |
2234 | 2247 | }; |
2235 | 2248 |
|
2236 | 2249 | auto markInputsAsDone = [ref](TimesliceSlot slot) -> void { |
|
0 commit comments