Project
Loading...
Searching...
No Matches
o2FairMQHeaderSizeTest.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.
11
17
25
26#include <chrono>
27#include <thread>
28#include <vector>
29#include <random>
30
31using namespace o2::framework;
32
33static std::random_device rd;
34static std::mt19937 gen(rd());
35
36std::string random_string(size_t length)
37{
38 static const char alphanum[] =
39 "0123456789"
40 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
41 "abcdefghijklmnopqrstuvwxyz";
42
43 std::uniform_int_distribution<> dis(0, sizeof(alphanum) - 2);
44
45 std::string randomString;
46 randomString.reserve(length);
47
48 for (int i = 0; i < length; ++i) {
49 randomString.push_back(alphanum[dis(gen)]);
50 }
51
52 return randomString;
53}
54
55std::string filename()
56{
57 std::stringstream ss;
58 ss << "messages_count_" << random_string(10) << ".data";
59 return std::move(ss).str();
60}
61
63{
64 return WorkflowSpec{
65 {"A",
66 Inputs{},
67 {OutputSpec{{"a"}, "TST", "A"}},
69 [numberOfMessages = 0, filename = filename()](ProcessingContext& ctx) mutable {
70 using namespace std::chrono;
71 ++numberOfMessages;
72 // LOG(info) << "Generating message #" << ++numberOfMessages;
73
74 {
75 auto file = std::ofstream(filename, std::ios_base::out | std::ios_base::trunc);
76 // file << duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count() << "," << numberOfMessages << "\n";
77 file << numberOfMessages;
78 }
79
80 auto& aData = ctx.outputs().make<int>(Output{"TST", "A", 0}, 1);
81 aData[0] = 1;
82 }}},
83 {"B",
84 {InputSpec{"x", "TST", "A"}},
85 Outputs{},
87 return [](ProcessingContext& ctx) {
88 while (true) {
89 std::this_thread::sleep_for(std::chrono::milliseconds{100});
90 }
91 // auto& data = ctx.inputs().get<int>("x");
92 // LOG(info) << "Reading message: " << data;
93 };
94 }}},
95 };
96}
default_random_engine gen(dev())
int32_t i
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
WorkflowSpec defineDataProcessing(ConfigContext const &specs)
This function hooks up the the workflow specifications into the DPL driver.
std::string random_string(size_t length)
std::string filename()
std::random_device rd