Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frank/scheduler fixes #435

Merged
merged 3 commits into from
Oct 4, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ static_assert(std::is_default_constructible_v<Device::Stream<float, SOAPY_SDR_RX

template<>
struct fmt::formatter<SoapySDRRange> {
constexpr auto parse(format_parse_context& ctx) const noexcept { return ctx.begin(); }
constexpr auto parse(fmt::format_parse_context& ctx) const noexcept { return ctx.begin(); }

template<typename FormatContext>
auto format(const gr::blocks::soapy::Range& range, FormatContext& ctx) const noexcept {
Expand Down
2 changes: 1 addition & 1 deletion core/include/gnuradio-4.0/BlockModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ struct fmt::formatter<gr::Edge> {
}

template<typename FormatContext>
auto format(const gr::Edge& e, FormatContext& ctx) {
auto format(const gr::Edge& e, FormatContext& ctx) const {
const auto& name = [this](const gr::BlockModel* block) { return (formatSpecifier == 'l') ? block->uniqueName() : block->name(); };

const auto portIndex = [](const gr::PortDefinition& port) {
Expand Down
5 changes: 4 additions & 1 deletion core/include/gnuradio-4.0/Scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class SchedulerBase : public Block<Derived> {
std::abort();
}
}
waitDone();
}

[[nodiscard]] bool isProcessing() const
Expand Down Expand Up @@ -245,7 +246,9 @@ class SchedulerBase : public Block<Derived> {
for (std::size_t runnerID = 0UZ; runnerID < _jobLists->size(); runnerID++) {
_pool->execute([this, runnerID]() { static_cast<Derived*>(this)->poolWorker(runnerID, _jobLists); });
}
_nRunningJobs.wait(0UZ, std::memory_order_acquire); // waits until at least one pool worker started
if (!_jobLists->empty()) {
_nRunningJobs.wait(0UZ, std::memory_order_acquire); // waits until at least one pool worker started
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/include/gnuradio-4.0/Sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct fmt::formatter<gr::Sequence> {
}

template<typename FormatContext>
auto format(gr::Sequence const& value, FormatContext& ctx) {
auto format(gr::Sequence const& value, FormatContext& ctx) const {
return fmt::format_to(ctx.out(), "{}", value.value());
}
};
Expand Down
2 changes: 1 addition & 1 deletion core/include/gnuradio-4.0/annotated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ struct fmt::formatter<gr::Annotated<T, description, Arguments...>> {
}

template<typename FormatContext>
constexpr auto format(const gr::Annotated<T, description, Arguments...>& annotated, FormatContext& ctx) {
constexpr auto format(const gr::Annotated<T, description, Arguments...>& annotated, FormatContext& ctx) const {
// TODO: add switch for printing only brief and/or meta-information
return value_formatter.format(annotated.value, ctx);
}
Expand Down
2 changes: 1 addition & 1 deletion core/include/gnuradio-4.0/thread/thread_affinity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ struct fmt::formatter<gr::thread_pool::thread::Policy> {
}

template<typename FormatContext>
auto format(Policy policy, FormatContext& ctx) {
auto format(Policy policy, FormatContext& ctx) const {
std::string policy_name;
switch (policy) {
case Policy::UNKNOWN: policy_name = "UNKNOWN"; break;
Expand Down
10 changes: 5 additions & 5 deletions meta/include/gnuradio-4.0/meta/formatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct fmt::formatter<std::complex<T>> {
// simplified formatter for UncertainValue
template<gr::arithmetic_or_complex_like T>
struct fmt::formatter<gr::UncertainValue<T>> {
constexpr auto parse(format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(fmt::format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }

template<typename FormatContext>
constexpr auto format(const gr::UncertainValue<T>& value, FormatContext& ctx) const noexcept {
Expand Down Expand Up @@ -126,7 +126,7 @@ constexpr std::string join(const Container& container, const Separator& separato

template<>
struct fmt::formatter<pmtv::map_t::value_type> {
constexpr auto parse(format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(fmt::format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }

template<typename FormatContext>
auto format(const pmtv::map_t::value_type& kv, FormatContext& ctx) const noexcept {
Expand All @@ -136,7 +136,7 @@ struct fmt::formatter<pmtv::map_t::value_type> {

template<pmtv::IsPmt T>
struct fmt::formatter<T> { // alternate pmtv formatter optimised for compile-time not runtime
constexpr auto parse(format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(fmt::format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }

template<typename FormatContext>
auto format(const T& value, FormatContext& ctx) const noexcept {
Expand Down Expand Up @@ -180,7 +180,7 @@ struct fmt::formatter<T> { // alternate pmtv formatter optimised for compile-tim

template<>
struct fmt::formatter<pmtv::map_t> {
constexpr auto parse(format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }
constexpr auto parse(fmt::format_parse_context& ctx) const noexcept -> decltype(ctx.begin()) { return ctx.begin(); }

template<typename FormatContext>
constexpr auto format(const pmtv::map_t& value, FormatContext& ctx) const noexcept {
Expand All @@ -194,7 +194,7 @@ template<>
struct fmt::formatter<std::vector<bool>> {
char presentation = 'c';

constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) {
constexpr auto parse(fmt::format_parse_context& ctx) -> decltype(ctx.begin()) {
auto it = ctx.begin(), end = ctx.end();
if (it != end && (*it == 's' || *it == 'c')) {
presentation = *it++;
Expand Down
Loading