Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 5 Framework/Core/include/Framework/DriverInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ struct DriverInfo {
DeviceMetricsInfo metrics;
/// Skip shared memory cleanup if set
bool noSHMCleanup;
/// Default value for the --driver-client-backend. Notice that if we start from
/// the driver, the default backend will be the websocket one. On the other hand,
/// if the device is started standalone, the default becomes the old stdout:// so
/// that it works as it used to in AliECS.
std::string defaultDriverClient = "invalid";
};

struct DriverInfoHelper {
Expand Down
4 changes: 2 additions & 2 deletions 4 Framework/Core/src/DeviceSpecHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ void DeviceSpecHelpers::prepareArguments(bool defaultQuiet, bool defaultStopped,
// has option --session been specified on the command line?
bool haveSessionArg = false;
using FilterFunctionT = std::function<void(decltype(argc), decltype(argv), decltype(od))>;
bool useDefaultWS = false;
bool useDefaultWS = true;

// the filter function will forward command line arguments based on the option
// definition passed to it. All options of the program option definition will be forwarded
Expand Down Expand Up @@ -1110,7 +1110,7 @@ void DeviceSpecHelpers::prepareArguments(bool defaultQuiet, bool defaultStopped,
}

haveSessionArg = haveSessionArg || varmap.count("session") != 0;
useDefaultWS = useDefaultWS || (varmap.count("driver-client-backend") != 0) && varmap["driver-client-backend"].as<std::string>() == "ws://";
useDefaultWS = useDefaultWS && ((varmap.count("driver-client-backend") == 0) || varmap["driver-client-backend"].as<std::string>() == "ws://");

for (const auto varit : varmap) {
// find the option belonging to key, add if the option has been parsed
Expand Down
21 changes: 14 additions & 7 deletions 21 Framework/Core/src/runDataProcessing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,10 @@ void doDefaultWorkflowTerminationHook()
//LOG(INFO) << "Process " << getpid() << " is exiting.";
}

int doChild(int argc, char** argv, ServiceRegistry& serviceRegistry, const o2::framework::DeviceSpec& spec, TerminationPolicy errorPolicy,
int doChild(int argc, char** argv, ServiceRegistry& serviceRegistry,
const o2::framework::DeviceSpec& spec,
TerminationPolicy errorPolicy,
std::string const& defaultDriverClient,
uv_loop_t* loop)
{
fair::Logger::SetConsoleColor(false);
Expand All @@ -946,13 +949,13 @@ int doChild(int argc, char** argv, ServiceRegistry& serviceRegistry, const o2::f

// Populate options from the command line. Notice that only the options
// declared in the workflow definition are allowed.
runner.AddHook<fair::mq::hooks::SetCustomCmdLineOptions>([&spec](fair::mq::DeviceRunner& r) {
runner.AddHook<fair::mq::hooks::SetCustomCmdLineOptions>([&spec, defaultDriverClient](fair::mq::DeviceRunner& r) {
boost::program_options::options_description optsDesc;
ConfigParamsHelper::populateBoostProgramOptions(optsDesc, spec.options, gHiddenDeviceOptions);
optsDesc.add_options()("monitoring-backend", bpo::value<std::string>()->default_value("default"), "monitoring backend info") //
("driver-client-backend", bpo::value<std::string>()->default_value("stdout://"), "backend for device -> driver communicataon: stdout://: use stdout, ws://: use websockets") //
("infologger-severity", bpo::value<std::string>()->default_value(""), "minimum FairLogger severity to send to InfoLogger") //
("configuration,cfg", bpo::value<std::string>()->default_value("command-line"), "configuration backend") //
optsDesc.add_options()("monitoring-backend", bpo::value<std::string>()->default_value("default"), "monitoring backend info") //
("driver-client-backend", bpo::value<std::string>()->default_value(defaultDriverClient), "backend for device -> driver communicataon: stdout://: use stdout, ws://: use websockets") //
("infologger-severity", bpo::value<std::string>()->default_value(""), "minimum FairLogger severity to send to InfoLogger") //
("configuration,cfg", bpo::value<std::string>()->default_value("command-line"), "configuration backend") //
("infologger-mode", bpo::value<std::string>()->default_value(""), "INFOLOGGER_MODE override");
r.fConfig.AddToCmdLineOptions(optsDesc, true);
});
Expand Down Expand Up @@ -1363,7 +1366,9 @@ int runStateMachine(DataProcessorSpecs const& workflow,
if (spec.id == frameworkId) {
return doChild(driverInfo.argc, driverInfo.argv,
serviceRegistry, spec,
driverInfo.errorPolicy, loop);
driverInfo.errorPolicy,
driverInfo.defaultDriverClient,
loop);
}
}
{
Expand Down Expand Up @@ -2226,8 +2231,10 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
if (varmap.count("id")) {
frameworkId = varmap["id"].as<std::string>();
driverInfo.uniqueWorkflowId = fmt::format("{}", getppid());
driverInfo.defaultDriverClient = "stdout://";
} else {
driverInfo.uniqueWorkflowId = fmt::format("{}", getpid());
driverInfo.defaultDriverClient = "ws://";
}
return runStateMachine(physicalWorkflow,
currentWorkflow,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.