Skip to content

Commit

Permalink
Make sure we notify DPL about non-DPL message sending
Browse files Browse the repository at this point in the history
This is needed to avoid skipping CCDB callbacks on the last timeframe.
  • Loading branch information
ktf authored and davidrohr committed Oct 18, 2023
1 parent e60697e commit fba5f6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ void TFReaderSpec::run(o2f::ProcessingContext& ctx)
nparts += msgIt.second->Size() / 2;
device->Send(*msgIt.second.get(), msgIt.first);
}
// FIXME: this is to pretend we did send some messages via DPL.
// we should really migrate everything to use FairMQDeviceProxy,
// however this is a small enough hack for now.
ctx.services().get<o2f::MessageContext>().fakeDispatch();
tNow = std::chrono::time_point_cast<std::chrono::microseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
deltaSending = mTFCounter ? tNow - tLastTF : 0;
LOGP(info, "Sent TF {} of size {} with {} parts, {:.4f} s elapsed from previous TF.", mTFCounter, dataSize, nparts, double(deltaSending) * 1e-6);
Expand Down
1 change: 1 addition & 0 deletions Framework/Core/include/Framework/MessageContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ class MessageContext
o2::header::DataHeader* findMessageHeader(const Output& spec);
o2::header::Stack* findMessageHeaderStack(const Output& spec);
int countDeviceOutputs(bool excludeDPLOrigin = false);
void fakeDispatch() { mDidDispatch = true; }
o2::framework::DataProcessingHeader* findMessageDataProcessingHeader(const Output& spec);
std::pair<o2::header::DataHeader*, o2::framework::DataProcessingHeader*> findMessageHeaders(const Output& spec);

Expand Down

0 comments on commit fba5f6d

Please sign in to comment.