Skip to content
Open
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
6 changes: 3 additions & 3 deletions Framework/src/PostProcessingRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void PostProcessingRunner::doInitialize(const Trigger& trigger)
{
ILOG(Info, Support) << "Initializing the user task due to trigger '" << trigger << "'" << ENDM;

mTask->initialize(trigger, mServices);
mTask->initialize(trigger, framework::ServiceRegistryRef{ mServices, framework::ServiceRegistry::globalDeviceSalt() });
updateValidity(trigger);
mTaskState = TaskState::Running;

Expand All @@ -296,7 +296,7 @@ void PostProcessingRunner::doInitialize(const Trigger& trigger)
void PostProcessingRunner::doUpdate(const Trigger& trigger)
{
ILOG(Info, Support) << "Updating the user task due to trigger '" << trigger << "'" << ENDM;
mTask->update(trigger, mServices);
mTask->update(trigger, framework::ServiceRegistryRef{ mServices, framework::ServiceRegistry::globalDeviceSalt() });
updateValidity(trigger);

if (mActivity.mValidity.isValid()) {
Expand All @@ -314,7 +314,7 @@ void PostProcessingRunner::doFinalize(const Trigger& trigger)
return;
}
ILOG(Info, Support) << "Finalizing the user task due to trigger '" << trigger << "'" << ENDM;
mTask->finalize(trigger, mServices);
mTask->finalize(trigger, framework::ServiceRegistryRef{ mServices, framework::ServiceRegistry::globalDeviceSalt() });
updateValidity(trigger);

if (mActivity.mValidity.isValid()) {
Expand Down
4 changes: 2 additions & 2 deletions Framework/src/runPostProcessing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int main(int argc, const char* argv[])
runner.runOverTimestamps(vm["timestamps"].as<std::vector<uint64_t>>());
} else {
// running the PP task with an event loop
runner.start({ registry });
runner.start(o2::framework::ServiceRegistryRef{ registry, ServiceRegistry::globalDeviceSalt() });

Timer timer;
timer.reset(periodUs);
Expand All @@ -96,7 +96,7 @@ int main(int argc, const char* argv[])
usleep(1000000.0 * timer.getRemainingTime());
}
}
runner.stop({ registry });
runner.stop(o2::framework::ServiceRegistryRef{ registry, ServiceRegistry::globalDeviceSalt() });
return 0;
} catch (const bpo::error& ex) {
ILOG(Error, Ops) << "Exception caught: " << ex.what() << ENDM;
Expand Down
4 changes: 2 additions & 2 deletions Framework/src/runPostProcessingOCC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class PostProcessingOCCStateMachine : public RuntimeControlledObject
bool success = true;
try {
o2::framework::ServiceRegistry registry;
mRunner->start(registry);
mRunner->start(o2::framework::ServiceRegistryRef{ registry, o2::framework::ServiceRegistry::globalDeviceSalt() });
} catch (const std::exception& ex) {
ILOG(Error, Support) << "Exception caught: " << ex.what() << ENDM;
success = false;
Expand All @@ -119,7 +119,7 @@ class PostProcessingOCCStateMachine : public RuntimeControlledObject
bool success = true;
try {
o2::framework::ServiceRegistry registry;
mRunner->stop(registry);
mRunner->stop(o2::framework::ServiceRegistryRef{ registry, o2::framework::ServiceRegistry::globalDeviceSalt() });
} catch (const std::exception& ex) {
ILOG(Error, Support) << "Exception caught: " << ex.what() << ENDM;
success = false;
Expand Down
2 changes: 1 addition & 1 deletion Framework/test/testAggregatorRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TEST_CASE("test_aggregator_runner")
std::unique_ptr<ConfigParamStore> store = make_unique<ConfigParamStore>(std::move(options), std::move(retr));
ConfigParamRegistry cfReg(std::move(store));
ServiceRegistry sReg;
InitContext initContext{ cfReg, sReg };
InitContext initContext{ cfReg, ServiceRegistryRef{ sReg, ServiceRegistry::globalDeviceSalt() } };
aggregatorRunner.init(initContext);

CHECK(aggregatorRunner.getDeviceName() == "qc-aggregator");
Expand Down
6 changes: 3 additions & 3 deletions Framework/test/testPostProcessingInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ TEST_CASE("PostProcessingInterface_test_factory")

o2::framework::ServiceRegistry services;

task.initialize({ TriggerType::No }, services);
task.initialize({ TriggerType::No }, o2::framework::ServiceRegistryRef{ services, o2::framework::ServiceRegistry::globalDeviceSalt() });
CHECK(task.test == 2);
task.update({ TriggerType::No }, services);
task.update({ TriggerType::No }, o2::framework::ServiceRegistryRef{ services, o2::framework::ServiceRegistry::globalDeviceSalt() });
CHECK(task.test == 3);
task.finalize({ TriggerType::No }, services);
task.finalize({ TriggerType::No }, o2::framework::ServiceRegistryRef{ services, o2::framework::ServiceRegistry::globalDeviceSalt() });
CHECK(task.test == 4);
}
2 changes: 1 addition & 1 deletion Framework/test/testTaskInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ TEST_CASE("test_invoke_all_TaskRunnerConfig_methods")

auto options = createDummyRegistry();
ServiceRegistry services;
InitContext ctx(options, services);
InitContext ctx(options, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() });
testTask.initialize(ctx);
CHECK(testTask.test == 1);

Expand Down
2 changes: 1 addition & 1 deletion Framework/test/testTaskRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ TEST_CASE("test_task_runner")
std::unique_ptr<ConfigParamStore> store = make_unique<ConfigParamStore>(std::move(options), std::move(retr));
ConfigParamRegistry cfReg(std::move(store));
ServiceRegistry sReg;
InitContext initContext{ cfReg, sReg };
InitContext initContext{ cfReg, ServiceRegistryRef{ sReg, ServiceRegistry::globalDeviceSalt() } };
qcTask.init(initContext);
}

Expand Down
14 changes: 7 additions & 7 deletions Framework/test/testTrendingTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ TEST_CASE("test_trending_task", "[ccdb]")
}

// test initialize()
REQUIRE_NOTHROW(task.initialize({ TriggerType::UserOrControl, true, { 0, "NONE", "", "", "qc" }, 1 }, services));
REQUIRE_NOTHROW(task.initialize({ TriggerType::UserOrControl, true, { 0, "NONE", "", "", "qc" }, 1 }, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() }));
REQUIRE(objectManager->getNumberPublishedObjects() == 1);
auto treeMO = objectManager->getMonitorObject(trendingTaskName);
REQUIRE(treeMO != nullptr);
Expand All @@ -219,9 +219,9 @@ TEST_CASE("test_trending_task", "[ccdb]")
REQUIRE(tree->GetEntries() == 0);

// test update()
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 2, 100000 } }, 100000 - 1 }, services);
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 2, 100000 } }, 100000 - 1 }, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() });
objectManager->stopPublishing(PublicationPolicy::Once);
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 100000, 200000 } }, 200000 - 1 }, services);
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 100000, 200000 } }, 200000 - 1 }, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() });
REQUIRE(objectManager->getNumberPublishedObjects() == 1);
REQUIRE(tree->GetEntries() == 0);
}
Expand Down Expand Up @@ -277,7 +277,7 @@ TEST_CASE("test_trending_task", "[ccdb]")
REQUIRE_NOTHROW(task.configure(config));

// test initialize()
REQUIRE_NOTHROW(task.initialize({ TriggerType::UserOrControl, true, { 0, "NONE", "", "", "qc" }, 1 }, services));
REQUIRE_NOTHROW(task.initialize({ TriggerType::UserOrControl, true, { 0, "NONE", "", "", "qc" }, 1 }, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() }));
REQUIRE(objectManager->getNumberPublishedObjects() == 1);
auto treeMO = objectManager->getMonitorObject(trendingTaskName);
REQUIRE(treeMO != nullptr);
Expand All @@ -286,9 +286,9 @@ TEST_CASE("test_trending_task", "[ccdb]")
REQUIRE(tree->GetEntries() == 0);

// test update()
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 2, 100000 } }, 100000 - 1 }, services);
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 2, 100000 } }, 100000 - 1 }, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() });
objectManager->stopPublishing(PublicationPolicy::Once);
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 100000, 200000 } }, 200000 - 1 }, services);
task.update({ TriggerType::NewObject, false, { 0, "NONE", "", "", "qc", { 100000, 200000 } }, 200000 - 1 }, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() });
REQUIRE(objectManager->getNumberPublishedObjects() == 3);
REQUIRE(tree->GetEntries() == 2);
auto varexp = "testHistoTrending.mean:testHistoTrending.entries:" + checkName + ".level";
Expand Down Expand Up @@ -319,7 +319,7 @@ TEST_CASE("test_trending_task", "[ccdb]")
objectManager->stopPublishing(PublicationPolicy::Once);

// test finalize()
REQUIRE_NOTHROW(task.finalize({ TriggerType::UserOrControl, true }, services));
REQUIRE_NOTHROW(task.finalize({ TriggerType::UserOrControl, true }, ServiceRegistryRef{ services, ServiceRegistry::globalDeviceSalt() }));
REQUIRE(objectManager->getNumberPublishedObjects() == 3);
REQUIRE(tree->GetEntries() == 2);
objectManager->stopPublishing(PublicationPolicy::Once);
Expand Down
Loading