Project
Loading...
Searching...
No Matches
o2NullSink.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
15#include "Framework/Logger.h"
18
19#include <chrono>
20#include <thread>
21#include <vector>
22
25using namespace o2::framework;
26
27void customize(std::vector<ConfigParamSpec>& options)
28{
29 options.push_back(o2::framework::ConfigParamSpec{"name", VariantType::String, "null", {"name for the dataprocessor"}});
30 options.push_back(o2::framework::ConfigParamSpec{"dataspec", VariantType::String, "", {"inputs for the dataprocessor"}});
31};
32
34
35// This is a simple consumer / producer workflow where both are
36// stateful, i.e. they have context which comes from their initialization.
38{
39 WorkflowSpec workflow;
40 // This is an example of how we can parallelize by subSpec.
41 // templatedProducer will be instanciated 32 times and the lambda function
42 // passed to the parallel statement will be applied to each one of the
43 // instances in order to modify it. Parallel will also make sure the name of
44 // the instance is amended from "some-producer" to "some-producer-<index>".
45 auto name = context.options().get<std::string>("name");
46 auto inputsDesc = context.options().get<std::string>("dataspec");
47 auto inputs = DataDescriptorQueryBuilder::parse(inputsDesc.c_str());
48
49 workflow.push_back(DataProcessorSpec{
50 name,
51 inputs,
52 {},
53 AlgorithmSpec{[](ProcessingContext& ctx) {}}});
54
55 return workflow;
56}
ConfigParamRegistry & options() const
GLuint const GLchar * name
Definition glcorearb.h:781
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
WorkflowSpec defineDataProcessing(ConfigContext const &context)
This function hooks up the the workflow specifications into the DPL driver.
void customize(std::vector< ConfigParamSpec > &options)
static std::vector< InputSpec > parse(const char *s="")