QualityControl  1.5.1
O2 Data Quality Control Framework
Calculators.h
Go to the documentation of this file.
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
16 
17 #ifndef QUALITYCONTROL_CALCULATORS_H
18 #define QUALITYCONTROL_CALCULATORS_H
19 
20 #include <tuple>
21 #include <functional>
22 
24 {
25 
26 // average M/D/1 queue size, rho is server utilisation ( input rate / processing rate )
27 double averageMD1Queue(double rho);
28 
29 // average M/G/1 queue size
30 // rho is server utilisation ( input rate / processing rate )
31 // mean is the mean processing time
32 // stddev is the standard deviation of the processing time
33 double averageMG1Queue(double rho, double mean, double stddev);
34 
35 // number of merger layes, M0 is number of producers, R is max reduction factor
36 size_t numberOfMergerLayers(size_t M0, size_t R);
37 double mergersMemoryUsage(size_t R, size_t M0, size_t objSize, double T, std::function<double(double)> performance);
38 
39 double mergersCpuUsage(size_t R, size_t M0, double T, std::function<double(double)> performance);
40 
41 // returns the cost of CPU and RAM of the full merger topology
42 std::tuple<double, double> mergerCosts(double costCPU, double costRAM, size_t R, int parallelism, int mosSize,
43  double cycleDuration, std::function<double(double)> performance);
44 
45 // Returns the best Reduction factor (R) for given conditions and total cost of CPU and RAM.
46 // If there is a range of equally good reduction factors, it will return the highest.
47 std::tuple<size_t, double, double> cheapestMergers(double costCPU, double costRAM, int parallelism, int mosSize,
48  double cycleDuration, std::function<double(double)> performance);
49 
50 double qcTaskInputMemory(double utilisation, double avgInputMessage, double stddevInputMessage);
51 
52 double qcTaskCost(double costCPU, double costRAM, double qcTaskCPU, size_t qcTaskRAM, double parallelData, double avgInputMessage, double stddevInputMessage);
53 
54 } // namespace o2::quality_control::calculators
55 #endif //QUALITYCONTROL_CALCULATORS_H
Definition: Calculators.h:23