Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions Framework/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ target_include_directories(${targetName} PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE

o2_target_root_dictionary(Framework
HEADERS include/Framework/StepTHn.h
include/Framework/CompactTHnSparse.h
LINKDEF src/StepTHnLinkDef.h)

# o2::test::* support classes for unit tests, kept out of production libO2Framework.
Expand All @@ -210,6 +211,7 @@ add_executable(o2-test-framework-core
test/test_ConfigurationOptionsRetriever.cxx
test/test_ChannelSpecHelpers.cxx
test/test_CheckTypes.cxx
test/test_CompactTHnSparse.cxx
test/test_CompletionPolicy.cxx
test/test_ComputingResourceHelpers.cxx
test/test_ComputingQuotaEvaluator.cxx
Expand Down
10 changes: 10 additions & 0 deletions Framework/Core/include/Framework/AnalysisManagers.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ bool postRunOutput(EndOfStreamContext& context, T& hr)
{
auto& deviceSpec = context.services().get<o2::framework::DeviceSpec const>();
auto sendHistos = [deviceSpec, &context](HistogramRegistry const& self, TNamed* obj) mutable {
// Compact sparse histograms are sent as the equivalent THnSparse, so the output files and
// whatever reads or merges them are unchanged. One at a time, each compact histogram
// freed before its THnSparse is serialised, to keep the memory peak low.
if (auto* compact = dynamic_cast<CompactTHnSparse*>(obj)) {
std::unique_ptr<THnSparse> sparse{compact->toTHnSparse()};
compact->Reset();
TNamed* named = sparse.get();
context.outputs().snapshot(self.ref(deviceSpec.inputTimesliceId, deviceSpec.maxInputTimeslices), *named);
return;
}
context.outputs().snapshot(self.ref(deviceSpec.inputTimesliceId, deviceSpec.maxInputTimeslices), *obj);
};
hr.apply(sendHistos);
Expand Down
Loading