Project
Loading...
Searching...
No Matches
MergerConfig.h
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.
11
12#ifndef ALICEO2_MERGERCONFIG_H
13#define ALICEO2_MERGERCONFIG_H
14
19
20#include <string>
21#include <vector>
22#include <variant>
24
25namespace o2::mergers
26{
27
28// This is a set of Mergers' options that user can choose from.
29
31 FullHistory, // Mergers expect objects with all data accumulated so far each time.
32 LastDifference // Mergers expect objects' differences (what has changed since the previous were sent).
33};
34
36 // Merged object should be an sum of differences received since the beginning
37 // or a sum of latest versions of objects received on each input.
39 // Merged object should be an sum of differences received after last publication.
40 // Merged object is reset after published. It won't produce meaningful results
41 // when InputObjectsTimespan::FullHistory is set.
43 // Generalisation of the two above. Resets all objects in Mergers after n cycles (0 - infinite).
44 // The above will be removed once we switch to NCycles in QC.
46};
47
49 // Publishes an object containing data points from the last cycle if it has one.
50 Yes,
51 No
52};
53
55 EachNSeconds, // Merged object is published each N seconds. This can evolve over time, thus we expect pairs specifying N:duration1, M:duration2...
56 EachNArrivals, // Merged object is published whenever we receive N new input objects.
57};
58
59enum class TopologySize {
60 NumberOfLayers, // User specifies the number of layers in topology.
61 ReductionFactor, // User specifies how many sources should be handled by one merger (by maximum).
62 MergersPerLayer // User specifies how many Mergers should be spawned in each layer.
63};
64
65enum class ParallelismType {
66 SplitInputs, // Splits the provided vector of InputSpecs evenly among Mergers.
67 RoundRobin // Mergers receive their input messages in round robin order. Useful when there is one InputSpec with a wildcard.
68};
69
70// fixme: this way of configuring mergers should be refactored, it does not make sense that we share `param`s across for different enum values.
71template <typename V, typename P = double>
74 P param = P();
75};
76
82{
83 public:
85 PublicationDecisionParameter(const std::vector<std::pair<size_t, size_t>>& decision) : decision(decision) {}
86
87 std::vector<std::pair<size_t /* cycle duration seconds */, size_t /* validity seconds */>> decision;
88};
89
90// todo rework configuration in a way that user cannot create an invalid configuration
91// \brief MergerAlgorithm configuration structure. Default configuration should work in most cases, out of the box.
103
104} // namespace o2::mergers
105
106#endif //ALICEO2_MERGERCONFIG_H
std::vector< std::pair< size_t, size_t > > decision
PublicationDecisionParameter(const std::vector< std::pair< size_t, size_t > > &decision)
GLenum GLfloat param
Definition glcorearb.h:271
ConfigEntry< PublicationDecision, PublicationDecisionParameter > publicationDecision
std::vector< o2::framework::DataProcessorLabel > labels
ConfigEntry< PublishMovingWindow > publishMovingWindow
ConfigEntry< TopologySize, std::variant< int, std::vector< size_t > > > topologySize
ConfigEntry< ParallelismType > parallelismType
ConfigEntry< InputObjectsTimespan > inputObjectTimespan
ConfigEntry< MergedObjectTimespan, int > mergedObjectTimespan