Skip to content

Commit 88140bd

Browse files
committed
DPL: reflow formatting
1 parent 22a8261 commit 88140bd

File tree

4 files changed

+43
-42
lines changed

4 files changed

+43
-42
lines changed

Framework/Core/include/Framework/ServiceRegistryRef.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ class ServiceRegistryRef
6464
mRegistry.preSendingMessagesCallbacks(mRegistry, parts, channelindex);
6565
}
6666

67-
void registerService(ServiceTypeHash typeHash, void* service, ServiceKind kind, char const* name = nullptr) const {
67+
void registerService(ServiceTypeHash typeHash, void* service, ServiceKind kind, char const* name = nullptr) const
68+
{
6869
mRegistry.registerService(typeHash, service, kind, mSalt, name);
6970
}
7071

7172
/// Register a service given an handle, notice how
72-
/// the service will be created in the current salt,
73-
/// so that from a dataprocessor you cannot create a service
74-
/// globally, or in a stream you cannot create services for
73+
/// the service will be created in the current salt,
74+
/// so that from a dataprocessor you cannot create a service
75+
/// globally, or in a stream you cannot create services for
7576
/// a dataprocessor.
7677
void registerService(ServiceHandle handle)
7778
{

Framework/Core/src/DataProcessingDevice.cxx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void on_communication_requested(uv_async_t* s)
112112
state->loopReason |= DeviceState::METRICS_MUST_FLUSH;
113113
}
114114

115-
DeviceSpec const&getRunningDevice(RunningDeviceRef const& running, ServiceRegistryRef const& services)
115+
DeviceSpec const& getRunningDevice(RunningDeviceRef const& running, ServiceRegistryRef const& services)
116116
{
117117
return services.get<o2::framework::RunningWorkflowInfo const>().devices[running.index];
118118
}
@@ -146,7 +146,7 @@ DataProcessingDevice::DataProcessingDevice(RunningDeviceRef running, ServiceRegi
146146

147147
ServiceRegistryRef ref{mServiceRegistry};
148148
mAwakeHandle = (uv_async_t*)malloc(sizeof(uv_async_t));
149-
auto &state = ref.get<DeviceState>();
149+
auto& state = ref.get<DeviceState>();
150150
assert(state.loop);
151151
int res = uv_async_init(state.loop, mAwakeHandle, on_communication_requested);
152152
mAwakeHandle->data = &state;
@@ -345,7 +345,7 @@ void DataProcessingDevice::Init()
345345
InitContext initContext{*mConfigRegistry, mServiceRegistry};
346346
context.statefulProcess = context.init(initContext);
347347
}
348-
auto& state= ref.get<DeviceState>();
348+
auto& state = ref.get<DeviceState>();
349349
state.inputChannelInfos.resize(spec.inputChannels.size());
350350
/// Internal channels which will never create an actual message
351351
/// should be considered as in "Pull" mode, since we do not
@@ -375,9 +375,9 @@ void on_signal_callback(uv_signal_t* handle, int signum)
375375
LOG(debug) << "Signal " << signum << " received.";
376376
auto* registry = (ServiceRegistry*)handle->data;
377377
ServiceRegistryRef ref{*registry};
378-
auto &state = ref.get<DeviceState>();
379-
auto &quotaEvaluator = ref.get<ComputingQuotaEvaluator>();
380-
auto &stats = ref.get<DataProcessingStats>();
378+
auto& state = ref.get<DeviceState>();
379+
auto& quotaEvaluator = ref.get<ComputingQuotaEvaluator>();
380+
auto& stats = ref.get<DataProcessingStats>();
381381
state.loopReason |= DeviceState::SIGNAL_ARRIVED;
382382
size_t ri = 0;
383383
while (ri != quotaEvaluator.mOffers.size()) {
@@ -894,7 +894,7 @@ void DataProcessingDevice::fillContext(DataProcessorContext& context, DeviceCont
894894
/// FIXME: move erro handling to a service?
895895
if (context.error != nullptr) {
896896
context.errorHandling = [&errorCallback = context.error,
897-
&serviceRegistry = mServiceRegistry](RuntimeErrorRef e, InputRecord& record) {
897+
&serviceRegistry = mServiceRegistry](RuntimeErrorRef e, InputRecord& record) {
898898
ZoneScopedN("Error handling");
899899
/// FIXME: we should pass the salt in, so that the message
900900
/// can access information which were stored in the stream.
@@ -908,7 +908,7 @@ void DataProcessingDevice::fillContext(DataProcessorContext& context, DeviceCont
908908
};
909909
} else {
910910
context.errorHandling = [&errorPolicy = mProcessingPolicies.error,
911-
&serviceRegistry = mServiceRegistry](RuntimeErrorRef e, InputRecord& record) {
911+
&serviceRegistry = mServiceRegistry](RuntimeErrorRef e, InputRecord& record) {
912912
ZoneScopedN("Error handling");
913913
auto& err = error_from_ref(e);
914914
/// FIXME: we should pass the salt in, so that the message
@@ -980,7 +980,7 @@ void DataProcessingDevice::Reset()
980980
void DataProcessingDevice::Run()
981981
{
982982
ServiceRegistryRef ref{mServiceRegistry};
983-
auto &state = ref.get<DeviceState>();
983+
auto& state = ref.get<DeviceState>();
984984
state.loopReason = DeviceState::LoopReason::FIRST_LOOP;
985985
while (state.transitionHandling != TransitionHandlingState::Expired) {
986986
if (state.nextFairMQState.empty() == false) {
@@ -1070,7 +1070,7 @@ void DataProcessingDevice::Run()
10701070
VariableContextHelpers::getTimeslice(variables);
10711071
forwardInputs(registry, slot, dropped, oldestOutputInfo, false, true);
10721072
};
1073-
auto &relayer = ref.get<DataRelayer>();
1073+
auto& relayer = ref.get<DataRelayer>();
10741074
relayer.prunePending(onDrop);
10751075
auto& queue = ref.get<AsyncQueue>();
10761076
auto oldestPossibleTimeslice = relayer.getOldestPossibleOutput();
@@ -1134,7 +1134,7 @@ void DataProcessingDevice::Run()
11341134

11351135
static std::function<void(ComputingQuotaOffer const&, ComputingQuotaStats const& stats)> reportExpiredOffer = [&registry = mServiceRegistry](ComputingQuotaOffer const& offer, ComputingQuotaStats const& stats) {
11361136
ServiceRegistryRef ref{registry};
1137-
auto &monitoring = ref.get<Monitoring>();
1137+
auto& monitoring = ref.get<Monitoring>();
11381138
monitoring.send(Metric{(uint64_t)stats.totalExpiredOffers, "resource-offer-expired"}.addTag(Key::Subsystem, Value::DPL));
11391139
monitoring.send(Metric{(uint64_t)stats.totalExpiredBytes, "arrow-bytes-expired"}.addTag(Key::Subsystem, Value::DPL));
11401140
monitoring.flushBuffer();
@@ -1325,14 +1325,14 @@ void DataProcessingDevice::doRun(DataProcessorContext& context)
13251325
{
13261326
auto switchState = [&registry = context.registry](StreamingState newState) {
13271327
ServiceRegistryRef ref{*registry};
1328-
auto &state = ref.get<DeviceState>();
1328+
auto& state = ref.get<DeviceState>();
13291329
LOG(detail) << "New state " << (int)newState << " old state " << (int)state.streaming;
13301330
state.streaming = newState;
13311331
ref.get<ControlService>().notifyStreamingState(state.streaming);
13321332
};
13331333
ServiceRegistryRef ref{*context.registry};
1334-
auto &state = ref.get<DeviceState>();
1335-
auto &spec = ref.get<DeviceSpec const>();
1334+
auto& state = ref.get<DeviceState>();
1335+
auto& spec = ref.get<DeviceSpec const>();
13361336

13371337
if (state.streaming == StreamingState::Idle) {
13381338
*context.wasActive = false;
@@ -1376,7 +1376,7 @@ void DataProcessingDevice::doRun(DataProcessorContext& context)
13761376
/// Besides flushing the queues we must make sure we do not have only
13771377
/// timers as they do not need to be further processed.
13781378
bool hasOnlyGenerated = (spec.inputChannels.size() == 1) && (spec.inputs[0].matcher.lifetime == Lifetime::Timer || spec.inputs[0].matcher.lifetime == Lifetime::Enumeration);
1379-
auto &relayer = ref.get<DataRelayer>();
1379+
auto& relayer = ref.get<DataRelayer>();
13801380
while (DataProcessingDevice::tryDispatchComputation(context, context.completed) && hasOnlyGenerated == false) {
13811381
relayer.processDanglingInputs(context.expirationHandlers, *context.registry, false);
13821382
}
@@ -1549,7 +1549,7 @@ void DataProcessingDevice::handleData(DataProcessorContext& context, InputChanne
15491549

15501550
auto handleValidMessages = [&info, &context = context, &reportError](std::vector<InputInfo> const& inputInfos) {
15511551
auto ref = ServiceRegistryRef{*context.registry};
1552-
auto &relayer = ref.get<DataRelayer>();
1552+
auto& relayer = ref.get<DataRelayer>();
15531553
static WaitBackpressurePolicy policy;
15541554
auto& parts = info.parts;
15551555
// We relay execution to make sure we have a complete set of parts
@@ -1773,8 +1773,8 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
17731773
auto getReadyActions = [&completed,
17741774
&registry = context.registry]() -> std::vector<DataRelayer::RecordAction> {
17751775
ServiceRegistryRef ref{*registry};
1776-
auto &stats = ref.get<DataProcessingStats>();
1777-
auto &relayer = ref.get<DataRelayer>();
1776+
auto& stats = ref.get<DataProcessingStats>();
1777+
auto& relayer = ref.get<DataRelayer>();
17781778
stats.pendingInputs = (int)relayer.getParallelTimeslices() - completed.size();
17791779
stats.incomplete = completed.empty() ? 1 : 0;
17801780
return completed;
@@ -1827,8 +1827,8 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
18271827
// it.
18281828
auto prepareAllocatorForCurrentTimeSlice = [&registry = context.registry](TimesliceSlot i) -> void {
18291829
ServiceRegistryRef ref{*registry};
1830-
auto &relayer = ref.get<DataRelayer>();
1831-
auto &timingInfo = ref.get<TimingInfo>();
1830+
auto& relayer = ref.get<DataRelayer>();
1831+
auto& timingInfo = ref.get<TimingInfo>();
18321832
ZoneScopedN("DataProcessingDevice::prepareForCurrentTimeslice");
18331833
auto timeslice = relayer.getTimesliceForSlot(i);
18341834
timingInfo.timeslice = timeslice.value;
@@ -1886,8 +1886,8 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
18861886

18871887
auto switchState = [&registry = context.registry](StreamingState newState) {
18881888
ServiceRegistryRef ref{*registry};
1889-
auto &control = ref.get<ControlService>();
1890-
auto &state = ref.get<DeviceState>();
1889+
auto& control = ref.get<ControlService>();
1890+
auto& state = ref.get<DeviceState>();
18911891
state.streaming = newState;
18921892
control.notifyStreamingState(state.streaming);
18931893
};
@@ -1899,7 +1899,7 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
18991899

19001900
auto postUpdateStats = [registry = context.registry](DataRelayer::RecordAction const& action, InputRecord const& record, uint64_t tStart) {
19011901
ServiceRegistryRef ref{*registry};
1902-
auto & stats = ref.get<DataProcessingStats>();
1902+
auto& stats = ref.get<DataProcessingStats>();
19031903
std::atomic_thread_fence(std::memory_order_release);
19041904
for (size_t ai = 0; ai != record.size(); ai++) {
19051905
auto cacheId = action.slot.index * record.size() + ai;
@@ -1917,7 +1917,7 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
19171917

19181918
auto preUpdateStats = [&registry = context.registry](DataRelayer::RecordAction const& action, InputRecord const& record, uint64_t) {
19191919
ServiceRegistryRef ref{*registry};
1920-
auto &stats = ref.get<DataProcessingStats>();
1920+
auto& stats = ref.get<DataProcessingStats>();
19211921
std::atomic_thread_fence(std::memory_order_release);
19221922
for (size_t ai = 0; ai != record.size(); ai++) {
19231923
auto cacheId = action.slot.index * record.size() + ai;
@@ -1931,8 +1931,8 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
19311931
// This is the main dispatching loop
19321932
LOGP(debug, "Processing actions:");
19331933
ServiceRegistryRef ref{*context.registry};
1934-
auto &state = ref.get<DeviceState>();
1935-
auto &spec = ref.get<DeviceSpec const>();
1934+
auto& state = ref.get<DeviceState>();
1935+
auto& spec = ref.get<DeviceSpec const>();
19361936

19371937
for (auto action : getReadyActions()) {
19381938
LOGP(debug, " Begin action");
@@ -1954,7 +1954,7 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
19541954
bool shouldConsume = action.op == CompletionPolicy::CompletionOp::Consume ||
19551955
action.op == CompletionPolicy::CompletionOp::Discard;
19561956
InputSpan span = getInputSpan(action.slot, shouldConsume);
1957-
auto &spec = ref.get<DeviceSpec const>();
1957+
auto& spec = ref.get<DeviceSpec const>();
19581958
InputRecord record{spec.inputs,
19591959
span,
19601960
*context.registry};
@@ -1994,8 +1994,8 @@ bool DataProcessingDevice::tryDispatchComputation(DataProcessorContext& context,
19941994

19951995
auto runNoCatch = [&context, &processContext](DataRelayer::RecordAction& action) {
19961996
ServiceRegistryRef ref{*context.registry};
1997-
auto &state = ref.get<DeviceState>();
1998-
auto &spec = ref.get<DeviceSpec const>();
1997+
auto& state = ref.get<DeviceState>();
1998+
auto& spec = ref.get<DeviceSpec const>();
19991999
if (state.quitRequested == false) {
20002000
{
20012001
ZoneScopedN("service post processing");

Framework/Core/test/test_Services.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ namespace o2::framework
9797
static ServiceRegistry::Salt salt_0 = ServiceRegistry::Salt{ServiceRegistry::Context{0,0}};
9898
static ServiceRegistry::Salt salt_1 = ServiceRegistry::Salt{ServiceRegistry::Context{1,0}};
9999
static ServiceRegistry::Salt salt_2 = ServiceRegistry::Salt{ServiceRegistry::Context{2,0}};
100-
static ServiceRegistry::Salt salt_3 = ServiceRegistry::Salt{ServiceRegistry::Context{3,0}};
101-
static ServiceRegistry::Salt salt_1_1 = ServiceRegistry::Salt{ServiceRegistry::Context{1,1}};
100+
static ServiceRegistry::Salt salt_3 = ServiceRegistry::Salt{ServiceRegistry::Context{3, 0}};
101+
static ServiceRegistry::Salt salt_1_1 = ServiceRegistry::Salt{ServiceRegistry::Context{1, 1}};
102102
}
103103

104104
BOOST_AUTO_TEST_CASE(TestSerialServices)
@@ -162,9 +162,9 @@ BOOST_AUTO_TEST_CASE(TestStreamServices)
162162
DummyService t1{1};
163163
DummyService t2{2};
164164
/// We register it pretending to be on thread 0
165-
registry.registerService({TypeIdHelpers::uniqueId<DummyService>()}, &t0, ServiceKind::Stream, ServiceRegistry::Salt{ServiceRegistry::Context{1,0}});
166-
registry.registerService({TypeIdHelpers::uniqueId<DummyService>()}, &t1, ServiceKind::Stream, ServiceRegistry::Salt{ServiceRegistry::Context{2,0}});
167-
registry.registerService({TypeIdHelpers::uniqueId<DummyService>()}, &t2, ServiceKind::Stream, ServiceRegistry::Salt{ServiceRegistry::Context{3,0}});
165+
registry.registerService({TypeIdHelpers::uniqueId<DummyService>()}, &t0, ServiceKind::Stream, ServiceRegistry::Salt{ServiceRegistry::Context{1, 0}});
166+
registry.registerService({TypeIdHelpers::uniqueId<DummyService>()}, &t1, ServiceKind::Stream, ServiceRegistry::Salt{ServiceRegistry::Context{2, 0}});
167+
registry.registerService({TypeIdHelpers::uniqueId<DummyService>()}, &t2, ServiceKind::Stream, ServiceRegistry::Salt{ServiceRegistry::Context{3, 0}});
168168

169169
auto tt0 = reinterpret_cast<DummyService*>(registry.get({TypeIdHelpers::uniqueId<DummyService>()}, salt_1, ServiceKind::Stream));
170170
auto tt1 = reinterpret_cast<DummyService*>(registry.get({TypeIdHelpers::uniqueId<DummyService>()}, salt_2, ServiceKind::Stream));

Framework/RootAnalysisHelpers/test/test_RDataFrameSupport.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ BOOST_AUTO_TEST_CASE(TestCombinedDS)
309309
auto left = [](int lx, int) { return lx; };
310310
auto right = [](int, int rx) { return rx; };
311311

312-
BOOST_CHECK_EQUAL(*finalDF.Define("s1", sum, { "left_x", "left_y" }).Sum("s1"), 448);
313-
BOOST_CHECK_EQUAL(*finalDF.Define("s4", sum, { "right_x", "left_x" }).Sum("s4"), 448);
314-
BOOST_CHECK_EQUAL(*finalDF.Define("s2", left, { "left_x", "left_y" }).Sum("s2"), 224);
315-
BOOST_CHECK_EQUAL(*finalDF.Define("s3", right, { "right_x", "left_x" }).Sum("s3"), 224);
312+
BOOST_CHECK_EQUAL(*finalDF.Define("s1", sum, {"left_x", "left_y"}).Sum("s1"), 448);
313+
BOOST_CHECK_EQUAL(*finalDF.Define("s4", sum, {"right_x", "left_x"}).Sum("s4"), 448);
314+
BOOST_CHECK_EQUAL(*finalDF.Define("s2", left, {"left_x", "left_y"}).Sum("s2"), 224);
315+
BOOST_CHECK_EQUAL(*finalDF.Define("s3", right, {"right_x", "left_x"}).Sum("s3"), 224);
316316
BOOST_CHECK_EQUAL(*indexedDF.Define("s4", sum, {"right_x", "left_x"}).Sum("s4"), 56);
317317
BOOST_CHECK_EQUAL(*unionDF.Define("s5", sum, {"right_x", "left_x"}).Sum("s5"), 56);
318318
BOOST_CHECK_EQUAL(*blockDF.Define("s5", sum, {"right_x", "left_x"}).Sum("s5"), 168);

0 commit comments

Comments
 (0)