diff --git a/algo/base/Options.cxx b/algo/base/Options.cxx index 25285bceef5306bec982a75c564e38a1bce4a2d9..448a074e7db2fe1645966038323ee722b3f5ad54 100644 --- a/algo/base/Options.cxx +++ b/algo/base/Options.cxx @@ -99,6 +99,8 @@ Options::Options(int argc, char** argv) "Write profiling times to yaml file (only when '-t' is set)") ("dump-archive", po::bool_switch(&fDumpArchive)->default_value(false), "Dump archive content to stdout and exit. Provide archive with '-i'. (This is a hack to quick check archive content until we have proper tooling.)") + ("release-mode,R",po::value<bool>(&fReleaseMode)->implicit_value(true), + "Copy and release each timeslice immediately after receiving it") ("help,h", "produce help message") ; diff --git a/algo/base/Options.h b/algo/base/Options.h index 61b6516675e6da0570d68c0081521d210215f6d5..2d580a9e2825309ec1c09787aaa4d3417092b168 100644 --- a/algo/base/Options.h +++ b/algo/base/Options.h @@ -46,6 +46,7 @@ namespace cbm::algo const std::string& ChildId() const { return fChildId; } uint64_t RunId() const { return fRunId; } bool DumpArchive() const { return fDumpArchive; } + bool ReleaseMode() const { return fReleaseMode; } const std::vector<Step>& Steps() const { return fRecoSteps; } @@ -71,6 +72,7 @@ namespace cbm::algo std::string fHistogramUri; int32_t fHistogramHwm; bool fDumpArchive = false; + bool fReleaseMode = false; ProfilingLevel fProfilingLevel = ProfilingNone; std::string fTimingsFile; int fNumTimeslices = -1; diff --git a/reco/app/cbmreco/main.cxx b/reco/app/cbmreco/main.cxx index 524141472e77720ce4cfa40d2e613644c2a31ab3..d5283904f458e3ebe5e79d3f26ab8763949557ff 100644 --- a/reco/app/cbmreco/main.cxx +++ b/reco/app/cbmreco/main.cxx @@ -14,6 +14,7 @@ #include "gpu/DeviceImage.h" #include "util/MemoryLogger.h" +#include <StorableTimeslice.hpp> #include <TimesliceAutoSource.hpp> #include <log.hpp> @@ -190,12 +191,20 @@ int main(int argc, char** argv) L_(debug) << "Starting to fetch timeslices from source..."; auto startFetchTS = std::chrono::high_resolution_clock::now(); - while (auto ts = source.get()) { + while (auto timeslice = source.get()) { if (tsIdx < opts.SkipTimeslices()) { tsIdx++; continue; } + std::unique_ptr<fles::Timeslice> ts; + if (opts.ReleaseMode()) { + ts = std::make_unique<fles::StorableTimeslice>(*timeslice); + timeslice.reset(); + } else { + ts = std::move(timeslice); + } + auto endFetchTS = std::chrono::high_resolution_clock::now(); auto durationFetchTS = endFetchTS - startFetchTS; extraMonitor.timeIdle +=