Skip to content

Commit

Permalink
DPL Analysis: drop aod-file-private
Browse files Browse the repository at this point in the history
This was a hack introduced to pass a workflow option to an AlgorithmSpec created
by a plugin. Not needed anymore now that we properly pass the ConfigContext to plugins
as well.
  • Loading branch information
ktf committed Nov 8, 2024
1 parent e2a70de commit 8684458
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
21 changes: 10 additions & 11 deletions Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,16 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const
if (ctx.options().isSet("aod-parent-access-level")) {
parentAccessLevel = ctx.options().get<int>("aod-parent-access-level");
}
auto callback = AlgorithmSpec{adaptStateful([parentFileReplacement, parentAccessLevel](ConfigParamRegistry const& options,
DeviceSpec const& spec,
Monitoring& monitoring,
DataProcessingStats& stats) {
if (ctx.options().isSet("aod-file")) {
LOGP(fatal, "No input file defined!");
throw std::runtime_error("Processing is stopped!");
}
auto filename = ctx.options().get<std::string>("aod-file");

auto callback = AlgorithmSpec{adaptStateful([parentFileReplacement, parentAccessLevel, filename](ConfigParamRegistry const& options,
DeviceSpec const& spec,
Monitoring& monitoring,
DataProcessingStats& stats) {
// FIXME: not actually needed, since data processing stats can specify that we should
// send the initial value.
stats.updateStats({static_cast<short>(ProcessingStatsId::ARROW_BYTES_CREATED), DataProcessingStats::Op::Set, 0});
Expand All @@ -143,13 +149,6 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const
stats.updateStats({static_cast<short>(ProcessingStatsId::ARROW_MESSAGES_DESTROYED), DataProcessingStats::Op::Set, 0});
stats.updateStats({static_cast<short>(ProcessingStatsId::ARROW_BYTES_EXPIRED), DataProcessingStats::Op::Set, 0});

if (!options.isSet("aod-file-private")) {
LOGP(fatal, "No input file defined!");
throw std::runtime_error("Processing is stopped!");
}

auto filename = options.get<std::string>("aod-file-private");

auto maxRate = options.get<float>("aod-max-io-rate");

// create a DataInputDirector
Expand Down
3 changes: 1 addition & 2 deletions Framework/Core/src/WorkflowHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext
static_cast<DataAllocator::SubSpecificationType>(compile_time_hash("internal-dpl-aod-reader")),
aodLifetime}},
.algorithm = AlgorithmSpec::dummyAlgorithm(),
.options = {ConfigParamSpec{"aod-file-private", VariantType::String, ctx.options().get<std::string>("aod-file"), {"AOD file"}},
ConfigParamSpec{"aod-max-io-rate", VariantType::Float, 0.f, {"Maximum I/O rate in MB/s"}},
.options = {ConfigParamSpec{"aod-max-io-rate", VariantType::Float, 0.f, {"Maximum I/O rate in MB/s"}},
ConfigParamSpec{"aod-reader-json", VariantType::String, {"json configuration file"}},
ConfigParamSpec{"time-limit", VariantType::Int64, 0ll, {"Maximum run time limit in seconds"}},
ConfigParamSpec{"orbit-offset-enumeration", VariantType::Int64, 0ll, {"initial value for the orbit"}},
Expand Down

0 comments on commit 8684458

Please sign in to comment.