Skip to content
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
19 changes: 9 additions & 10 deletions Framework/AnalysisSupport/src/AODReaderHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct Buildable {
outputSchema = std::make_shared<arrow::Schema>([](std::vector<o2::soa::IndexRecord> const& recs) {
std::vector<std::shared_ptr<arrow::Field>> fields;
fields.reserve(recs.size());
std::ranges::transform(recs, std::back_inserter(fields), [](auto& r){ return r.field(); });
std::ranges::transform(recs, std::back_inserter(fields), [](auto& r) { return r.field(); });
return fields;
}(records))
->WithMetadata(std::make_shared<arrow::KeyValueMetadata>(std::vector{std::string{"label"}}, std::vector{std::string{binding}}));
Expand Down Expand Up @@ -88,10 +88,10 @@ AlgorithmSpec AODReaderHelpers::indexBuilderCallback(ConfigContext const& /*ctx*
auto const& requested = ic.services().get<DanglingEdgesContext>().requestedIDXs;
std::vector<Builder> builders;
builders.reserve(requested.size());
std::ranges::transform(requested, std::back_inserter(builders), [](auto const& i){ return Buildable{i}.createBuilder(); });
std::ranges::transform(requested, std::back_inserter(builders), [](auto const& i) { return Buildable{i}.createBuilder(); });
return [builders](ProcessingContext& pc) mutable {
auto outputs = pc.outputs();
std::ranges::for_each(builders, [&pc, &outputs](auto& builder){ outputs.adopt(Output{builder.origin, builder.description, builder.version}, builder.materialize(pc)); });
std::ranges::for_each(builders, [&pc, &outputs](auto& builder) { outputs.adopt(Output{builder.origin, builder.description, builder.version}, builder.materialize(pc)); });
};
}};
}
Expand Down Expand Up @@ -140,14 +140,13 @@ struct Spawnable {
views::filter_string_params_starts_with("input:") |
std::ranges::views::transform(
[](auto const& param) {
return DataSpecUtils::fromMetadataString(param.defaultValue.template get<std::string>());
}),
std::back_inserter(matchers), [](auto const& i){ return std::get<ConcreteDataMatcher>(i.matcher); });

return DataSpecUtils::fromMetadataString(param.defaultValue.template get<std::string>());
}),
std::back_inserter(matchers), [](auto const& i) { return std::get<ConcreteDataMatcher>(i.matcher); });

std::vector<std::shared_ptr<arrow::Field>> fields;
std::ranges::for_each(schemas,
[&fields](auto const& s){
[&fields](auto const& s) {
std::ranges::copy(s->fields(), std::back_inserter(fields));
});

Expand Down Expand Up @@ -192,10 +191,10 @@ AlgorithmSpec AODReaderHelpers::aodSpawnerCallback(ConfigContext const& /*ctx*/)
auto const& requested = ic.services().get<DanglingEdgesContext>().spawnerInputs;
std::vector<Spawner> spawners;
spawners.reserve(requested.size());
std::ranges::transform(requested, std::back_inserter(spawners), [](auto const& i){ return Spawnable{i}.createMaker(); });
std::ranges::transform(requested, std::back_inserter(spawners), [](auto const& i) { return Spawnable{i}.createMaker(); });
return [spawners](ProcessingContext& pc) mutable {
auto outputs = pc.outputs();
std::ranges::for_each(spawners, [&pc, &outputs](auto& spawner){ outputs.adopt(Output{spawner.origin, spawner.description, spawner.version}, spawner.materialize(pc)); });
std::ranges::for_each(spawners, [&pc, &outputs](auto& spawner) { outputs.adopt(Output{spawner.origin, spawner.description, spawner.version}, spawner.materialize(pc)); });
};
}};
}
Expand Down
13 changes: 7 additions & 6 deletions Framework/Core/src/ASoA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ SelectionVector sliceSelection(std::span<int64_t const> const& mSelectedRows, in
auto stop_iterator = std::lower_bound(start_iterator, mSelectedRows.end(), end);
SelectionVector slicedSelection{start_iterator, stop_iterator};
std::ranges::transform(slicedSelection.begin(), slicedSelection.end(), slicedSelection.begin(),
[&start](int64_t idx) {
return idx - static_cast<int64_t>(start);
});
[&start](int64_t idx) {
return idx - static_cast<int64_t>(start);
});
return slicedSelection;
}

Expand All @@ -74,7 +74,7 @@ std::shared_ptr<arrow::Table> ArrowHelpers::joinTables(std::vector<std::shared_p
std::vector<std::shared_ptr<arrow::Field>> fields;
std::vector<std::shared_ptr<arrow::ChunkedArray>> columns;
bool notEmpty = (tables[0]->num_rows() != 0);
std::ranges::for_each(tables, [&fields, &columns, notEmpty](auto const& t){
std::ranges::for_each(tables, [&fields, &columns, notEmpty](auto const& t) {
std::ranges::copy(t->fields(), std::back_inserter(fields));
if (notEmpty) {
std::ranges::copy(t->columns(), std::back_inserter(columns));
Expand All @@ -84,7 +84,8 @@ std::shared_ptr<arrow::Table> ArrowHelpers::joinTables(std::vector<std::shared_p
return arrow::Table::Make(schema, columns);
}

namespace {
namespace
{
template <typename T>
requires(std::same_as<T, std::string>)
auto makeString(T const& str)
Expand All @@ -108,7 +109,7 @@ void canNotJoin(std::vector<std::shared_ptr<arrow::Table>> const& tables, std::s
}
}
}
}
} // namespace

std::shared_ptr<arrow::Table> ArrowHelpers::joinTables(std::vector<std::shared_ptr<arrow::Table>>&& tables, std::span<const char* const> labels)
{
Expand Down
8 changes: 4 additions & 4 deletions Framework/Core/src/AnalysisHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ std::shared_ptr<arrow::Table> IndexBuilder::materialize(std::vector<framework::I

if (!exclusive || found) {
builders[0].fill(counter);
std::ranges::for_each(builders.begin() + 1, builders.end(), [&idx](auto& builder){ builder.fill(idx); });
std::ranges::for_each(builders.begin() + 1, builders.end(), [&idx](auto& builder) { builder.fill(idx); });
}
}

std::vector<std::shared_ptr<arrow::ChunkedArray>> arrays;
arrays.reserve(builders.size());
std::ranges::transform(builders, std::back_inserter(arrays), [](auto& builder){ return builder.result(); });
std::ranges::transform(builders, std::back_inserter(arrays), [](auto& builder) { return builder.result(); });

return arrow::Table::Make(schema, arrays);
}
Expand Down Expand Up @@ -130,7 +130,7 @@ std::shared_ptr<arrow::Table> spawnerHelper(std::shared_ptr<arrow::Table> const&
}

arrays.reserve(nColumns);
std::ranges::transform(chunks, std::back_inserter(arrays), [](auto&& chunk){ return std::make_shared<arrow::ChunkedArray>(chunk); });
std::ranges::transform(chunks, std::back_inserter(arrays), [](auto&& chunk) { return std::make_shared<arrow::ChunkedArray>(chunk); });

return arrow::Table::Make(newSchema, arrays);
}
Expand Down Expand Up @@ -175,7 +175,7 @@ std::vector<std::shared_ptr<arrow::Table>> extractSources(ProcessingContext& pc,
{
std::vector<std::shared_ptr<arrow::Table>> tables;
tables.reserve(matchers.size());
std::ranges::transform(matchers, std::back_inserter(tables), [&pc](auto const& matcher){ return pc.inputs().get<TableConsumer>(matcher)->asArrowTable(); });
std::ranges::transform(matchers, std::back_inserter(tables), [&pc](auto const& matcher) { return pc.inputs().get<TableConsumer>(matcher)->asArrowTable(); });
return tables;
}

Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/src/ArrowSupport.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ o2::framework::ServiceSpec ArrowSupport::arrowBackendSpec()
dh->dataOrigin.str, dh->dataDescription.str);
continue;
}
bool forwarded = std::ranges::any_of(ctx.services().get<DeviceSpec const>().forwards, [&dh](auto const& forward){ return DataSpecUtils::match(forward.matcher, *dh); });
bool forwarded = std::ranges::any_of(ctx.services().get<DeviceSpec const>().forwards, [&dh](auto const& forward) { return DataSpecUtils::match(forward.matcher, *dh); });
if (forwarded) {
O2_SIGNPOST_EVENT_EMIT(rate_limiting, sid, "offer",
"Message %{public}.4s/%{public}.16s is forwarded so we are not returning its memory.",
Expand Down
22 changes: 11 additions & 11 deletions Framework/Core/src/WorkflowHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -440,21 +440,21 @@ void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext
// Check if any of the provided outputs is a DISTSTF
// Check if any of the requested inputs is for a 0xccdb message
bool providesDISTSTF = std::ranges::any_of(workflow,
[&matcher](auto const& dp) {
return std::any_of(dp.outputs.begin(), dp.outputs.end(), [&matcher](auto const& output) {
return DataSpecUtils::match(matcher, output);
});
});
[&matcher](auto const& dp) {
return std::any_of(dp.outputs.begin(), dp.outputs.end(), [&matcher](auto const& output) {
return DataSpecUtils::match(matcher, output);
});
});

// If there is no CCDB requested, but we still ask for a FLP/DISTSUBTIMEFRAME/0xccdb
// we add to the first data processor which has no inputs (apart from
// enumerations / timers) the responsibility to provide the DISTSUBTIMEFRAME
bool requiresDISTSUBTIMEFRAME = std::ranges::any_of(workflow,
[&dstf](auto const& dp) {
return std::any_of(dp.inputs.begin(), dp.inputs.end(), [&dstf](auto const& input) {
return DataSpecUtils::match(input, dstf);
});
});
[&dstf](auto const& dp) {
return std::any_of(dp.inputs.begin(), dp.inputs.end(), [&dstf](auto const& input) {
return DataSpecUtils::match(input, dstf);
});
});

// We find the first device which has either just enumerations or
// just timers, and we will add the DISTSUBTIMEFRAME to it.
Expand Down Expand Up @@ -694,7 +694,7 @@ void WorkflowHelpers::adjustTopology(WorkflowSpec& workflow, ConfigContext const

if (distSTFCount > 0) {
for (auto& spec : workflow) {
if (std::ranges::any_of(spec.outputs, [](auto const& output){ return DataSpecUtils::match(output, ConcreteDataMatcher{"FLP", "DISTSUBTIMEFRAME", 0}); })) {
if (std::ranges::any_of(spec.outputs, [](auto const& output) { return DataSpecUtils::match(output, ConcreteDataMatcher{"FLP", "DISTSUBTIMEFRAME", 0}); })) {
for (unsigned int i = 1; i < distSTFCount; ++i) {
spec.outputs.emplace_back(OutputSpec{ConcreteDataMatcher{"FLP", "DISTSUBTIMEFRAME", i}, Lifetime::Timeframe});
}
Expand Down