Skip to content

Commit

Permalink
simple setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák committed Feb 19, 2024
1 parent 144a9aa commit eb6324e
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions Framework/Core/src/DeviceSpecHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,7 @@ boost::program_options::options_description DeviceSpecHelpers::getForwardedDevic
("shm-allocation", bpo::value<std::string>()->default_value("rbtree_best_fit"), "shm allocation method") //
("shm-no-cleanup", bpo::value<std::string>()->default_value("false"), "no shm cleanup") //
("shmid", bpo::value<std::string>(), "shmid") //
("shm-metadata-msg-size", bpo::value<std::string>(), "TODO add description!!!!") //
("environment", bpo::value<std::string>(), "comma separated list of environment variables to set for the device") //
("stacktrace-on-signal", bpo::value<std::string>()->default_value("simple"), //
"dump stacktrace on specified signal(s) (any of `all`, `segv`, `bus`, `ill`, `abrt`, `fpe`, `sys`.)" //
Expand Down
5 changes: 5 additions & 0 deletions Framework/TestWorkflows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ o2_add_dpl_workflow(test-ccdb-fetcher
PUBLIC_LINK_LIBRARIES O2::DataFormatsTOF O2::Framework
COMPONENT_NAME TestWorkflows)

o2_add_dpl_workflow(fairmq-header-size-test
SOURCES src/o2FairMQHeaderSizeTest.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
COMPONENT_NAME TestWorkflows)

add_executable(o2-test-deadlock src/o2DeadlockReproducer.cxx)
target_link_libraries(o2-test-deadlock PUBLIC FairMQ::FairMQ)
add_test(NAME o2-test-deadlock COMMAND o2-test-deadlock --channel-config "name=data,type=sub,method=bind,address=ipc://127.0.0.1,rateLogging=0" --id foo --transport zeromq --control static)
59 changes: 59 additions & 0 deletions Framework/TestWorkflows/src/o2FairMQHeaderSizeTest.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "Framework/ConfigParamSpec.h"
#include "Framework/ControlService.h"
#include "Framework/CallbackService.h"
#include "Framework/EndOfStreamContext.h"
#include "Framework/DeviceSpec.h"
#include "Framework/ControlService.h"
#include "Framework/runDataProcessing.h"

#include <chrono>
#include <thread>
#include <vector>

using namespace o2::framework;
// This is how you can define your processing in a declarative way

WorkflowSpec defineDataProcessing(ConfigContext const& specs)
{
for (auto& cfg : specs.options().specs()) {
LOG(info) << cfg.name;
}

if (specs.options().hasOption("shm-metadata-msg-size")) {
LOG(info) << "\n\n\n\n has option\n\n\n\n ";
}
return WorkflowSpec{
{"A",
Inputs{},
{OutputSpec{{"a"}, "TST", "A"}},
AlgorithmSpec{
[numberOfMessages = 0](ProcessingContext& ctx) mutable {
std::ofstream file{""};
srand(getpid());
LOG(info) << "Generating message #" << ++numberOfMessages;
auto& aData = ctx.outputs().make<int>(Output{"TST", "A", 0}, 1);
aData[0] = 1;
}}},
{"B",
{InputSpec{"x", "TST", "A"}},
Outputs{},
AlgorithmSpec{[](InitContext& ic) {
return [](ProcessingContext& ctx) {
std::this_thread::sleep_for(std::chrono::minutes{5});
// auto& data = ctx.inputs().get<int>("x");
// LOG(info) << "Reading message: " << data;
};
}}},
};
}

0 comments on commit eb6324e

Please sign in to comment.