Skip to content

Commit

Permalink
Get fmt 11.1.1 to compile (#13855)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf authored Jan 12, 2025
1 parent a6d96bc commit 0c08b77
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions DataFormats/Headers/include/Headers/DataHeaderHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct fmt::formatter<T, std::enable_if_t<o2::header::is_descriptor<T>::value, c
}

template <typename FormatContext>
auto format(const T& p, FormatContext& ctx)
auto format(const T& p, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "{}", p.template as<std::string>());
}
Expand Down Expand Up @@ -67,7 +67,7 @@ struct fmt::formatter<o2::header::DataHeader> {
}

template <typename FormatContext>
auto format(const o2::header::DataHeader& h, FormatContext& ctx)
auto format(const o2::header::DataHeader& h, FormatContext& ctx) const
{
if (presentation == 's') {
auto res = fmt::format("Data header version {}, flags: {}\n", h.headerVersion, h.flags) +
Expand Down
3 changes: 2 additions & 1 deletion EventVisualisation/Workflow/src/O2DPLDisplay.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc)
}
}

LOGP(info, "Tracks: {}", fmt::join(sourceStats, ", "));
// FIXME: find out why this does not work with 11.1.1
// LOGP(info, "Tracks: {}", fmt::join(sourceStats, ", "));
}

void O2DPLDisplaySpec::endOfStream(EndOfStreamContext& ec)
Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/include/Framework/Formatters.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct fmt::formatter<o2::framework::Lifetime> : fmt::formatter<std::string_view
char presentation = 's';

template <typename FormatContext>
auto format(o2::framework::Lifetime const& h, FormatContext& ctx)
auto format(o2::framework::Lifetime const& h, FormatContext& ctx) const
{
std::string_view s = "unknown";
switch (h) {
Expand Down
11 changes: 6 additions & 5 deletions Framework/Core/src/ComputingQuotaEvaluator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#define LOGLEVEL debug


namespace o2::framework
{

Expand Down Expand Up @@ -90,7 +91,7 @@ bool ComputingQuotaEvaluator::selectOffer(int task, ComputingQuotaRequest const&
}
if (enough) {
LOGP(LOGLEVEL, "{} offers were selected for a total of: cpu {}, memory {}, shared memory {}", result.size(), totalOffer.cpu, totalOffer.memory, totalOffer.sharedMemory);
LOGP(LOGLEVEL, " The following offers were selected for computation: {} ", fmt::join(result, ","));
//LOG(LOGLEVEL) << " The following offers were selected for computation: {} " << fmt::join(result, ", ");
dpStats.updateStats({static_cast<short>(ProcessingStatsId::RESOURCES_SATISFACTORY), DataProcessingStats::Op::Add, 1});
} else {
dpStats.updateStats({static_cast<short>(ProcessingStatsId::RESOURCES_MISSING), DataProcessingStats::Op::Add, 1});
Expand All @@ -99,16 +100,16 @@ bool ComputingQuotaEvaluator::selectOffer(int task, ComputingQuotaRequest const&
}
}
if (stats.invalidOffers.size()) {
LOGP(LOGLEVEL, " The following offers were invalid: {}", fmt::join(stats.invalidOffers, ", "));
// LOGP(LOGLEVEL, " The following offers were invalid: {}", fmt::join(stats.invalidOffers, ", "));
}
if (stats.otherUser.size()) {
LOGP(LOGLEVEL, " The following offers were owned by other users: {}", fmt::join(stats.otherUser, ", "));
// LOGP(LOGLEVEL, " The following offers were owned by other users: {}", fmt::join(stats.otherUser, ", "));
}
if (stats.expired.size()) {
LOGP(LOGLEVEL, " The following offers are expired: {}", fmt::join(stats.expired, ", "));
// LOGP(LOGLEVEL, " The following offers are expired: {}", fmt::join(stats.expired, ", "));
}
if (stats.unexpiring.size() > 1) {
LOGP(LOGLEVEL, " The following offers will never expire: {}", fmt::join(stats.unexpiring, ", "));
// LOGP(LOGLEVEL, " The following offers will never expire: {}", fmt::join(stats.unexpiring, ", "));
}

return enough;
Expand Down

0 comments on commit 0c08b77

Please sign in to comment.