8 #include "../results/Results.h"
9 #include "../settings/Settings.h"
62 for (
const auto& j: jobs) {
64 if (!res && j.first->canHandle(j.second)) {
65 BENCHMAX_LOG_WARN(
"benchmax",
"Missing result for " << j.first->name() <<
" on " << j.second);
66 BENCHMAX_LOG_WARN(
"benchmax",
"Chances are that something went wrong, please check this!");
102 result.additional.emplace(
"peak_memory_kbytes", std::to_string(
result.peak_memory_kbytes));
111 void run(
const Jobs& jobs,
bool wait_for_termination) {
114 if (!wait_for_termination) {
118 for (
const auto& tool: jobs.
tools()) {
121 for (
const auto& [tool, file]: jobs.
randomized()) {
#define BENCHMAX_LOG_WARN(channel, msg)
Log warnings.
#define BENCHMAX_LOG_INFO(channel, msg)
Log informational messages.
Base class for all backends.
void madeProgress(std::size_t files=1)
Can be called to give information about the current progress, if available.
void addResult(const Tool *tool, const fs::path &file, BenchmarkResult &&result)
Add a result.
void write_results(const Jobs &jobs) const
std::atomic< std::size_t > mLastPercent
Percentage of finished jobs when madeProgress() was last called.
void run(const Jobs &jobs, bool wait_for_termination)
Run the list of tools against the list of benchmarks.
virtual void finalize()
Hook to allow for asynchronous backends to wait for jobs to terminate.
void sanitize_results(const Jobs &jobs) const
std::atomic< std::size_t > mFinishedJobs
Number of jobs that are finished.
void process_results(const Jobs &jobs, bool check_finished)
virtual void execute(const Tool *, const fs::path &)
Execute a single pair of tool and benchmark.
virtual bool collect_results(const Jobs &, bool)
std::size_t mExpectedJobs
Number of jobs that should be run.
Results mResults
Results of already completed jobs.
virtual void startTool(const Tool *)
Hook for every tool at the beginning.
Writes results to a csv file.
Represents a set of jobs, constructed as the cartesian product of a set of tools and a set of benchma...
auto size() const
Returns the overall number of jobs.
const auto & tools() const
Returns the set of tools.
auto randomized() const
Returns all jobs in a pseudo-randomized order.
Stores results for for whole benchmax run.
void store(Database &db)
Store all results to some database.
std::optional< std::reference_wrapper< const BenchmarkResult > > get(const Tool *tool, const fs::path &file) const
void addResult(const Tool *tool, const fs::path &file, BenchmarkResult &&results)
Add a new result.
Writes results to a xml file.
const auto & settings_benchmarks()
Return the benchmark settings.
Results for a single benchmark run.