24void customize(std::vector<ConfigParamSpec>& workflowOptions)
27 const int defaultlanes = std::max(1u, std::thread::hardware_concurrency() / 2);
29 std::vector<ConfigParamSpec> options{
30 {
"configFile", VariantType::String,
"", {
"configuration file for configurable parameters"}},
31 {
"lanes", VariantType::Int, defaultlanes, {
"Number of parallel processing lanes (crus are split per device)"}},
32 {
"time-lanes", VariantType::Int, 1, {
"Number of parallel processing lanes (timeframes are split per device)"}},
33 {
"crus", VariantType::String, cruDefault.c_str(), {
"List of CRUs, comma separated ranges, e.g. 0-3,7,9-15"}},
34 {
"n-TFs-buffer", VariantType::Int, 1, {
"Buffer n-TFs before sending output"}},
35 {
"configKeyValues", VariantType::String,
"", {
"Semicolon separated key=value strings"}}};
37 std::swap(workflowOptions, options);
46 const auto tpcCRUs = o2::RangeTokenizer::tokenize<int>(config.
options().
get<std::string>(
"crus"));
47 const auto nCRUs = tpcCRUs.size();
48 const auto nLanes = std::min(
static_cast<unsigned long>(config.
options().
get<
int>(
"lanes")), nCRUs);
49 const auto time_lanes =
static_cast<unsigned int>(config.
options().
get<
int>(
"time-lanes"));
50 const auto crusPerLane = nCRUs / nLanes + ((nCRUs % nLanes) != 0);
51 const int nTFsBuffer = config.
options().
get<
int>(
"n-TFs-buffer");
61 for (
int ilane = 0; ilane < nLanes; ++ilane) {
62 const auto first = tpcCRUs.begin() + ilane * crusPerLane;
63 if (
first >= tpcCRUs.end()) {
66 const auto last = std::min(tpcCRUs.end(),
first + crusPerLane);
67 const std::vector<uint32_t> rangeCRUs(
first, last);
Helper function to tokenize sequences and ranges of integral numbers.
TPC device for processing CMVs on FLPs.
static void writeINI(std::string const &filename, std::string const &keyOnly="")
static void updateFromFile(std::string const &, std::string const ¶msList="", bool unchangedOnly=false)
static void updateFromString(std::string const &)
ConfigParamRegistry & options() const
T get(const char *key) const
Defining ITS Vertex explicitly as messageable.
std::vector< DataProcessorSpec > WorkflowSpec
DataProcessorSpec timePipeline(DataProcessorSpec original, size_t count)
Global TPC definitions and constants.
DataProcessorSpec getTPCFLPCMVSpec(const int ilane, const std::vector< uint32_t > &crus, const int nTFsBuffer=1)
std::string to_string(gsl::span< T, Size > span)
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< ConfigParamSpec > &workflowOptions)