Skip to content
Snippets Groups Projects
Commit b3f055c3 authored by Jan de Cuveland's avatar Jan de Cuveland Committed by Felix Weiglhofer
Browse files

Implement experimental timeslice copy/release mode for cbmreco

parent d449a383
No related branches found
No related tags found
1 merge request!1829Experimental timeslice copy/release mode for cbmreco
......@@ -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")
;
......
......@@ -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;
......
......@@ -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 +=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment