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
6 changes: 3 additions & 3 deletions Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback()
monitoring.flushBuffer();

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

Expand Down Expand Up @@ -272,11 +272,11 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback()
ntf = 0;
tr = didir->getDataTree(dh, fcnt, ntf);
if (!tr) {
LOGP(FATAL, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf);
LOGP(fatal, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf);
throw std::runtime_error("Processing is stopped!");
}
} else {
LOGP(FATAL, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf);
LOGP(fatal, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf);
throw std::runtime_error("Processing is stopped!");
}
}
Expand Down
4 changes: 2 additions & 2 deletions Framework/Core/COOKBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ for (const auto& element : data) {

#### How do I report failure for a given Algorithm?

Whenever the driver process spots an error message, i.e. an error printed via `LOG(ERROR)` facility, when the driver process quits, it will exit with a exit code of 1. This includes any exception reported by the default exception handler.
Whenever the driver process spots an error message, i.e. an error printed via `LOG(error)` facility, when the driver process quits, it will exit with a exit code of 1. This includes any exception reported by the default exception handler.

This comes handy, for example in tests.

Expand Down Expand Up @@ -328,7 +328,7 @@ DataProcessorSpec{
AlgorithmSpec{[](InitContext &setup) {
return [](ProcessingContext &ctx) {
// Create a single output.
LOG(DEBUG) << "Invoked" << std::endl;
LOG(debug) << "Invoked" << std::endl;
};
}
// ...
Expand Down
6 changes: 3 additions & 3 deletions Framework/Core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ FairLogger.
#include "Framework/Logger.h"
...

LOG(INFO) << "some message"; // streamer based API
LOGF(INFO, "%s", "some message"); // printf based API
LOGP(INFO, "{}", "some message"); // python / fmt based API
LOG(info) << "some message"; // streamer based API
LOGF(info, "%s", "some message"); // printf based API
LOGP(info, "{}", "some message"); // python / fmt based API
O2INFO("{}", "some message); // same but with less typing.
```

Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/include/Framework/AnalysisTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args)

// no static way to check if the task defines any processing, we can only make sure it subscribes to at least something
if (inputs.empty() == true) {
LOG(WARN) << "Task " << name_str << " has no inputs";
LOG(warn) << "Task " << name_str << " has no inputs";
}

homogeneous_apply_refs([&outputs, &hash](auto& x) { return OutputManager<std::decay_t<decltype(x)>>::appendOutput(outputs, x, hash); }, *task.get());
Expand Down
8 changes: 4 additions & 4 deletions Framework/Core/include/Framework/HistogramRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,19 @@ void HistFiller::fillHistAny(std::shared_ptr<T> hist, const Ts&... positionAndWe
if (hist->GetNdimensions() == nArgsMinusOne) {
weight = tempArray[nArgsMinusOne];
} else if (hist->GetNdimensions() != nArgs) {
LOGF(FATAL, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName());
LOGF(fatal, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName());
}
hist->Fill(tempArray, weight);
} else {
LOGF(FATAL, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName());
LOGF(fatal, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName());
}
}

template <typename... Cs, typename R, typename T>
void HistFiller::fillHistAny(std::shared_ptr<R> hist, const T& table, const o2::framework::expressions::Filter& filter)
{
if constexpr (std::is_base_of_v<StepTHn, T>) {
LOGF(FATAL, "Table filling is not (yet?) supported for StepTHn.");
LOGF(fatal, "Table filling is not (yet?) supported for StepTHn.");
return;
}
auto filtered = o2::soa::Filtered<T>{{table.asArrowTable()}, o2::framework::expressions::createSelection(table.asArrowTable(), filter)};
Expand Down Expand Up @@ -386,7 +386,7 @@ HistPtr HistogramRegistry::insertClone(const HistName& histName, const std::shar
return mRegistryValue[imask(histName.idx + i)];
}
}
LOGF(FATAL, R"(Internal array of HistogramRegistry "%s" is full.)", mName);
LOGF(fatal, R"(Internal array of HistogramRegistry "%s" is full.)", mName);
return HistPtr();
}

Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/include/Framework/HistogramSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct AxisSpec {
name(name_)
{
if (binMin_ > binMax_) {
LOG(FATAL) << "Defined ill-defined axis";
LOG(fatal) << "Defined ill-defined axis";
}
}

Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/src/CommonDataProcessors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ DataProcessorSpec
if (it != tfNumbers.end()) {
tfNumber = (it->second / dod->getNumberTimeFramesToMerge()) * dod->getNumberTimeFramesToMerge();
} else {
LOGP(FATAL, "No time frame number found for output with start time {}", startTime);
LOGP(fatal, "No time frame number found for output with start time {}", startTime);
throw std::runtime_error("Processing is stopped!");
}

Expand Down
4 changes: 2 additions & 2 deletions Framework/Core/src/ComputingQuotaEvaluator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ bool ComputingQuotaEvaluator::selectOffer(int task, ComputingQuotaRequest const&

auto summarizeWhatHappended = [](bool enough, std::vector<int> const& result, ComputingQuotaOffer const& totalOffer, QuotaEvaluatorStats& stats) -> bool {
if (result.size() == 1 && result[0] == 0) {
// LOG(INFO) << "No particular resource was requested, so we schedule task anyways";
// LOG(info) << "No particular resource was requested, so we schedule task anyways";
return enough;
}
if (enough) {
LOGP(info, "{} offers were selected for a total of: cpu {}, memory {}, shared memory {}", result.size(), totalOffer.cpu, totalOffer.memory, totalOffer.sharedMemory);
LOGP(info, " The following offers were selected for computation: {} ", fmt::join(result, ","));
} else {
LOG(INFO) << "No offer was selected";
LOG(info) << "No offer was selected";
if (result.size()) {
LOGP(info, " The following offers were selected for computation but not enough: {} ", fmt::join(result, ","));
}
Expand Down
6 changes: 3 additions & 3 deletions Framework/Core/src/DPLWebSocket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void WSDPLHandler::endHeaders()
}
}
} else {
LOG(INFO) << "Connection not bound to a PID";
LOG(info) << "Connection not bound to a PID";
}
}

Expand Down Expand Up @@ -440,7 +440,7 @@ void WSDPLClient::header(std::string_view const& k, std::string_view const& v)
void WSDPLClient::dumpHeaders()
{
for (auto [k, v] : mHeaders) {
LOG(INFO) << k << ": " << v;
LOG(info) << k << ": " << v;
}
}

Expand All @@ -463,7 +463,7 @@ void WSDPLClient::endHeaders()
throw runtime_error_f(R"(Invalid accept received: "%s", expected "%s")", mHeaders["sec-websocket-accept"].c_str(), expectedAccept.c_str());
}

LOG(INFO) << "Correctly handshaken websocket connection.";
LOG(info) << "Correctly handshaken websocket connection.";
/// Create an appropriate reply
mHandshaken = true;
mHandshake();
Expand Down
4 changes: 2 additions & 2 deletions Framework/Core/src/DataOutputDirector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void DataOutputDirector::readString(std::string const& keepString)
auto it = std::unique(mtreeFilenames.begin(), mtreeFilenames.end());
if (it != mtreeFilenames.end()) {
printOut();
LOGP(FATAL, "Dublicate tree names in a file!");
LOGP(fatal, "Dublicate tree names in a file!");
}

// make unique/sorted list of filenameBases
Expand Down Expand Up @@ -503,7 +503,7 @@ void DataOutputDirector::setFilenameBase(std::string dfn)
auto it = std::unique(mtreeFilenames.begin(), mtreeFilenames.end());
if (it != mtreeFilenames.end()) {
printOut();
LOG(FATAL) << "Duplicate tree names in a file!";
LOG(fatal) << "Duplicate tree names in a file!";
}

// make unique/sorted list of filenameBases
Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/src/DataProcessingDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ void DataProcessingDevice::handleData(DataProcessorContext& context, InputChanne
switch (relayed) {
case DataRelayer::Backpressured:
if (info.normalOpsNotified == true && info.backpressureNotified == false) {
LOGP(WARN, "Backpressure on channel {}. Waiting.", info.channel->GetName());
LOGP(warn, "Backpressure on channel {}. Waiting.", info.channel->GetName());
info.backpressureNotified = true;
info.normalOpsNotified = false;
}
Expand Down
18 changes: 9 additions & 9 deletions Framework/Core/src/ExternalFairMQDeviceProxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void sendOnChannel(FairMQDevice& device, FairMQParts& messages, std::string cons
}
// FIXME: we need a better logic for avoiding message spam
if (timeout > 1 && timeout <= maxTimeout) {
LOG(WARNING) << "dispatching on channel " << channel << " was delayed by " << timeout << " ms";
LOG(warning) << "dispatching on channel " << channel << " was delayed by " << timeout << " ms";
}
// TODO: feeling this is a bit awkward, but the interface of FairMQParts does not provide a
// method to clear the content.
Expand All @@ -116,7 +116,7 @@ void sendOnChannel(FairMQDevice& device, FairMQParts& messages, OutputSpec const
// array of channels, the index is 0 in the call
auto channel = channelRetriever(spec, tslice);
if (channel.empty()) {
LOG(WARNING) << "can not find matching channel for " << DataSpecUtils::describe(spec) << " timeslice " << tslice;
LOG(warning) << "can not find matching channel for " << DataSpecUtils::describe(spec) << " timeslice " << tslice;
return;
}
sendOnChannel(device, messages, channel);
Expand All @@ -132,7 +132,7 @@ void sendOnChannel(FairMQDevice& device, o2::header::Stack&& headerStack, FairMQ
auto channelName = channelRetriever(spec, dph->startTime);
constexpr auto index = 0;
if (channelName.empty()) {
LOG(WARNING) << "can not find matching channel for " << DataSpecUtils::describe(spec);
LOG(warning) << "can not find matching channel for " << DataSpecUtils::describe(spec);
return;
}
for (auto& channelInfo : device.fChannels) {
Expand Down Expand Up @@ -209,7 +209,7 @@ InjectorFunction dplModelAdaptor(std::vector<OutputSpec> const& filterSpecs, boo
void warning() const
{
if (not descriptions.empty()) {
LOG(WARNING) << "Some input data are not matched by filter rules " << descriptions << "\n"
LOG(warning) << "Some input data are not matched by filter rules " << descriptions << "\n"
<< "DROPPING OF THESE MESSAGES HAS BEEN ENABLED BY CONFIGURATION";
}
}
Expand Down Expand Up @@ -248,16 +248,16 @@ InjectorFunction dplModelAdaptor(std::vector<OutputSpec> const& filterSpecs, boo
DataSpecUtils::match(spec, query)) {
auto channelName = channelRetriever(query, dph->startTime);
if (channelName.empty()) {
LOG(WARNING) << "can not find matching channel, not able to adopt " << DataSpecUtils::describe(query);
LOG(warning) << "can not find matching channel, not able to adopt " << DataSpecUtils::describe(query);
break;
}
// the checks for consistency of split payload parts are of informative nature
// forwarding happens independently
if (dh->splitPayloadParts > 1 && dh->splitPayloadParts != std::numeric_limits<decltype(dh->splitPayloadParts)>::max()) {
if (lastSplitPartIndex == -1 && dh->splitPayloadIndex != 0) {
LOG(WARNING) << "wrong split part index, expecting the first of " << dh->splitPayloadParts << " part(s)";
LOG(warning) << "wrong split part index, expecting the first of " << dh->splitPayloadParts << " part(s)";
} else if (dh->splitPayloadIndex != lastSplitPartIndex + 1) {
LOG(WARNING) << "unordered split parts, expecting part " << lastSplitPartIndex + 1 << ", got " << dh->splitPayloadIndex
LOG(warning) << "unordered split parts, expecting part " << lastSplitPartIndex + 1 << ", got " << dh->splitPayloadIndex
<< " of " << dh->splitPayloadParts;
} else if (channelNameForSplitParts.empty() == false && channelName != channelNameForSplitParts) {
LOG(error) << "inconsistent channel for split part " << dh->splitPayloadIndex
Expand All @@ -270,7 +270,7 @@ InjectorFunction dplModelAdaptor(std::vector<OutputSpec> const& filterSpecs, boo
channelNameForSplitParts = "";
}
} else if (lastSplitPartIndex != -1) {
LOG(WARNING) << "found incomplete or unordered split parts, expecting part " << lastSplitPartIndex + 1
LOG(warning) << "found incomplete or unordered split parts, expecting part " << lastSplitPartIndex + 1
<< " but got a new data block";
}
outputs[channelName].AddPart(std::move(parts.At(msgidx * 2)));
Expand Down Expand Up @@ -465,7 +465,7 @@ DataProcessorSpec specifyFairMQDeviceOutputProxy(char const* name,
// FairMQDevice calls the custom init before the channels have been configured
// so we do the check before starting in a dedicated callback
auto channelConfigurationChecker = [inputSpecs = std::move(inputSpecs), device, outputChannelName]() {
LOG(INFO) << "checking channel configuration";
LOG(info) << "checking channel configuration";
if (device->fChannels.count(outputChannelName) == 0) {
throw std::runtime_error("no corresponding output channel found for input '" + outputChannelName + "'");
}
Expand Down
4 changes: 2 additions & 2 deletions Framework/Core/src/FreePortFinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ void FreePortFinder::scan()
for (mPort = mInitialPort; mPort < mFinalPort; mPort += mStep) {
if (!testPort(mPort)) {
if (mVerbose) {
LOG(WARN) << "Port range [" << mPort << ", " << mPort + mStep
LOG(warn) << "Port range [" << mPort << ", " << mPort + mStep
<< "] already taken. Skipping";
}
continue;
}
if (mVerbose) {
LOG(INFO) << "Using port range [" << mPort << ", " << mPort + mStep << "]";
LOG(info) << "Using port range [" << mPort << ", " << mPort + mStep << "]";
}
break;
}
Expand Down
38 changes: 19 additions & 19 deletions Framework/Core/src/HistogramRegistry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ HistPtr HistogramRegistry::insert(const HistogramSpec& histSpec)
return mRegistryValue[imask(idx + i)];
}
}
LOGF(FATAL, R"(Internal array of HistogramRegistry "%s" is full.)", mName);
LOGF(fatal, R"(Internal array of HistogramRegistry "%s" is full.)", mName);
return HistPtr();
}

Expand All @@ -85,12 +85,12 @@ void HistogramRegistry::validateHistName(const std::string& name, const uint32_t
auto idx = it - mRegistryKey.begin();
std::string collidingName{};
std::visit([&](const auto& hist) { collidingName = hist->GetName(); }, mRegistryValue[idx]);
LOGF(FATAL, R"(Hash collision in HistogramRegistry "%s"! Please rename histogram "%s" or "%s".)", mName, name, collidingName);
LOGF(fatal, R"(Hash collision in HistogramRegistry "%s"! Please rename histogram "%s" or "%s".)", mName, name, collidingName);
}

// validate that name contains only allowed characters
if (!std::regex_match(name, std::regex("([a-zA-Z0-9])(([\\/_])?[a-zA-Z0-9])*"))) {
LOGF(FATAL, R"(Histogram name "%s" contains invalid characters.)", name);
LOGF(fatal, R"(Histogram name "%s" contains invalid characters.)", name);
}
}

Expand Down Expand Up @@ -125,7 +125,7 @@ void HistogramRegistry::addClone(const std::string& source, const std::string& t
}
// when cloning a single histogram the specified target_ must not be a group name
if (sourceName.size() == source.size() && target.back() == '/') {
LOGF(FATAL, "Cannot turn histogram into folder!");
LOGF(fatal, "Cannot turn histogram into folder!");
}
std::string targetName{target};
targetName += sourceName.substr(sourceName.find(source) + source.size());
Expand Down Expand Up @@ -205,7 +205,7 @@ void HistogramRegistry::print(bool showAxisDetails)
sizeInfo = fmt::format("{:.2f} kB", sizes[0] * 1024);
}
std::transform(totalSizes.begin(), totalSizes.end(), sizes.begin(), totalSizes.begin(), std::plus<double>());
LOGF(INFO, "Hist %03d: %-35s %-19s [%s]", nHistos, hist->GetName(), hist->IsA()->GetName(), sizeInfo);
LOGF(info, "Hist %03d: %-35s %-19s [%s]", nHistos, hist->GetName(), hist->IsA()->GetName(), sizeInfo);

if (showAxisDetails) {
int nDim = 0;
Expand All @@ -227,16 +227,16 @@ void HistogramRegistry::print(bool showAxisDetails)
axis = hist->GetZaxis();
}
}
LOGF(INFO, "- Axis %d: %-20s (%d bins)", d, axis->GetTitle(), axis->GetNbins());
LOGF(info, "- Axis %d: %-20s (%d bins)", d, axis->GetTitle(), axis->GetNbins());
}
}
}
};

std::string titleString{"======================== HistogramRegistry ========================"};
LOGF(INFO, "");
LOGF(INFO, "%s", titleString);
LOGF(INFO, "%s\"%s\"", std::string((int)(0.5 * titleString.size() - (1 + 0.5 * mName.size())), ' '), mName);
LOGF(info, "");
LOGF(info, "%s", titleString);
LOGF(info, "%s\"%s\"", std::string((int)(0.5 * titleString.size() - (1 + 0.5 * mName.size())), ' '), mName);
for (auto& curHistName : mRegisteredNames) {
std::visit(printHistInfo, mRegistryValue[getHistIndex(HistName{curHistName.data()})]);
}
Expand All @@ -251,13 +251,13 @@ void HistogramRegistry::print(bool showAxisDetails)
} else {
totalSizeInfo = fmt::format("{:.2f} MB", totalSizes[0]);
}
LOGF(INFO, "%s", std::string(titleString.size(), '='), titleString);
LOGF(INFO, "Total: %d histograms, ca. %s", nHistos, totalSizeInfo);
LOGF(info, "%s", std::string(titleString.size(), '='), titleString);
LOGF(info, "Total: %d histograms, ca. %s", nHistos, totalSizeInfo);
if (lookup) {
LOGF(INFO, "Due to index collisions, histograms were shifted by %d registry slots in total.", lookup);
LOGF(info, "Due to index collisions, histograms were shifted by %d registry slots in total.", lookup);
}
LOGF(INFO, "%s", std::string(titleString.size(), '='), titleString);
LOGF(INFO, "");
LOGF(info, "%s", std::string(titleString.size(), '='), titleString);
LOGF(info, "");
}

// create output structure will be propagated to file-sink
Expand Down Expand Up @@ -286,7 +286,7 @@ TList* HistogramRegistry::operator*()
rawPtr->SetName(name.data());
targetList->Add(rawPtr);
} else {
LOGF(FATAL, "Specified subfolder could not be created.");
LOGF(fatal, "Specified subfolder could not be created.");
}
}
}
Expand Down Expand Up @@ -359,25 +359,25 @@ std::deque<std::string> HistogramRegistry::splitPath(const std::string& pathAndN
void HistogramRegistry::registerName(const std::string& name)
{
if (name.empty() || name.back() == '/') {
LOGF(FATAL, "Invalid name for a histogram.");
LOGF(fatal, "Invalid name for a histogram.");
}
std::deque<std::string> path = splitPath(name);
std::string cumulativeName{};
int depth = path.size();
for (auto& step : path) {
if (step.empty()) {
LOGF(FATAL, R"(Found empty group name in path for histogram "%s".)", name);
LOGF(fatal, R"(Found empty group name in path for histogram "%s".)", name);
}
cumulativeName += step;
for (auto& curName : mRegisteredNames) {
// there is already a histogram where we want to put a folder or histogram
if (cumulativeName == curName) {
LOGF(FATAL, R"(Histogram name "%s" is not compatible with existing names.)", name);
LOGF(fatal, R"(Histogram name "%s" is not compatible with existing names.)", name);
}
// for the full new histogram name we need to check that none of the existing histograms already uses this as a group name
if (depth == 1) {
if (curName.rfind(cumulativeName, 0) == 0 && curName.size() > cumulativeName.size() && curName.at(cumulativeName.size()) == '/') {
LOGF(FATAL, R"(Histogram name "%s" is not compatible with existing names.)", name);
LOGF(fatal, R"(Histogram name "%s" is not compatible with existing names.)", name);
}
}
}
Expand Down
Loading