24void customize(std::vector<o2::framework::CompletionPolicy>& policies)
31void customize(std::vector<ConfigParamSpec>& workflowOptions)
35 std::vector<ConfigParamSpec> options{
36 {
"crus", VariantType::String, cruDefault.c_str(), {
"List of CRUs, comma separated ranges, e.g. 0-3,7,9-15"}},
37 {
"timeframes", VariantType::Int, 2000, {
"Number of TFs which will be aggregated per aggregation interval."}},
38 {
"firstTF", VariantType::Int, -1, {
"First time frame index. (if set to -1 the first TF will be automatically detected. Values < -1 are setting an offset for skipping the first TFs)"}},
39 {
"configKeyValues", VariantType::String,
"", {
"Semicolon separated key=value strings"}},
40 {
"lanes", VariantType::Int, 1, {
"Number of lanes of this device (CRUs are split per lane)"}},
41 {
"send-precise-timestamp", VariantType::Bool,
false, {
"Send precise timestamp information to the CMV aggregate workflow"}},
42 {
"n-TFs-buffer", VariantType::Int, 1, {
"Buffer which was defined in the TPCFLPCMVSpec."}},
43 {
"output-lanes", VariantType::Int, 1, {
"Number of parallel pipelines which will be used in the CMV aggregate device."}}};
44 std::swap(workflowOptions, options);
57 const auto tpcCRUs = o2::RangeTokenizer::tokenize<int>(config.
options().
get<std::string>(
"crus"));
58 const auto nCRUs = tpcCRUs.size();
59 auto timeframes =
static_cast<unsigned int>(config.
options().
get<
int>(
"timeframes"));
60 const auto outlanes =
static_cast<unsigned int>(config.
options().
get<
int>(
"output-lanes"));
61 const auto nLanes =
static_cast<unsigned int>(config.
options().
get<
int>(
"lanes"));
62 const auto firstTF =
static_cast<unsigned int>(config.
options().
get<
int>(
"firstTF"));
63 const bool sendPrecisetimeStamp = config.
options().
get<
bool>(
"send-precise-timestamp");
64 int nTFsBuffer = config.
options().
get<
int>(
"n-TFs-buffer");
65 if (nTFsBuffer <= 0) {
68 assert(timeframes >=
static_cast<unsigned int>(nTFsBuffer));
69 timeframes /=
static_cast<unsigned int>(nTFsBuffer);
70 LOGP(info,
"Using {} buffered CMV batches per interval with n-TFs-buffer={}", timeframes, nTFsBuffer);
72 const auto crusPerLane = nCRUs / nLanes + ((nCRUs % nLanes) != 0);
74 for (
int ilane = 0; ilane < nLanes; ++ilane) {
75 const auto first = tpcCRUs.begin() + ilane * crusPerLane;
76 if (
first >= tpcCRUs.end()) {
79 const auto last = std::min(tpcCRUs.end(),
first + crusPerLane);
80 const std::vector<uint32_t> rangeCRUs(
first, last);
81 workflow.emplace_back(getTPCDistributeCMVSpec(ilane, rangeCRUs, timeframes, outlanes, firstTF, sendPrecisetimeStamp, nTFsBuffer));
Helper function to tokenize sequences and ranges of integral numbers.
TPC distribution of grouped CMVs towards the CMV aggregation workflow.
static void writeINI(std::string const &filename, std::string const &keyOnly="")
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
Global TPC definitions and constants.
std::string to_string(gsl::span< T, Size > span)
static CompletionPolicy defineByName(std::string const &name, CompletionPolicy::CompletionOp op)
WorkflowSpec defineDataProcessing(ConfigContext const &config)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< o2::framework::CompletionPolicy > &policies)