SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
benchmax::Backend Class Reference

Base class for all backends. More...

#include <Backend.h>

Inheritance diagram for benchmax::Backend:
Collaboration diagram for benchmax::Backend:

Public Member Functions

bool suspendable () const
 
void process_results (const Jobs &jobs, bool check_finished)
 
void addResult (const Tool *tool, const fs::path &file, BenchmarkResult &&result)
 Add a result. More...
 
void run (const Jobs &jobs, bool wait_for_termination)
 Run the list of tools against the list of benchmarks. More...
 

Protected Member Functions

 Backend ()
 
virtual void startTool (const Tool *)
 Hook for every tool at the beginning. More...
 
virtual void finalize ()
 Hook to allow for asynchronous backends to wait for jobs to terminate. More...
 
virtual void execute (const Tool *, const fs::path &)
 Execute a single pair of tool and benchmark. More...
 
void madeProgress (std::size_t files=1)
 Can be called to give information about the current progress, if available. More...
 
virtual bool collect_results (const Jobs &, bool)
 
void sanitize_results (const Jobs &jobs) const
 
void write_results (const Jobs &jobs) const
 

Protected Attributes

std::size_t mExpectedJobs
 Number of jobs that should be run. More...
 
std::atomic< std::size_t > mFinishedJobs
 Number of jobs that are finished. More...
 
std::atomic< std::size_t > mLastPercent
 Percentage of finished jobs when madeProgress() was last called. More...
 

Private Attributes

Results mResults
 Results of already completed jobs. More...
 

Detailed Description

Base class for all backends.

Offers appropriate hooks to model the whole workflow for backends where each job is executed individually. The run() method is called from ourside which first calls startTool() for every tool and then runs execute() for every pair of tool and benchmark. It also offers addResult() to store results and madeProgress() to provide a progress indication to the user. If a benchmark requires a completely different workflow, for example for a batch job, it should override the run() method.

Definition at line 23 of file Backend.h.

Constructor & Destructor Documentation

◆ Backend()

benchmax::Backend::Backend ( )
inlineprotected

Definition at line 35 of file Backend.h.

Member Function Documentation

◆ addResult()

void benchmax::Backend::addResult ( const Tool tool,
const fs::path &  file,
BenchmarkResult &&  result 
)
inline

Add a result.

Definition at line 97 of file Backend.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collect_results()

virtual bool benchmax::Backend::collect_results ( const Jobs ,
bool   
)
inlineprotectedvirtual

Reimplemented in benchmax::SlurmBackend.

Definition at line 60 of file Backend.h.

Here is the caller graph for this function:

◆ execute()

virtual void benchmax::Backend::execute ( const Tool ,
const fs::path &   
)
inlineprotectedvirtual

Execute a single pair of tool and benchmark.

Reimplemented in benchmax::LocalBackend, and benchmax::CondorBackend.

Definition at line 49 of file Backend.h.

Here is the caller graph for this function:

◆ finalize()

virtual void benchmax::Backend::finalize ( )
inlineprotectedvirtual

Hook to allow for asynchronous backends to wait for jobs to terminate.

Definition at line 45 of file Backend.h.

Here is the caller graph for this function:

◆ madeProgress()

void benchmax::Backend::madeProgress ( std::size_t  files = 1)
inlineprotected

Can be called to give information about the current progress, if available.

Definition at line 51 of file Backend.h.

Here is the caller graph for this function:

◆ process_results()

void benchmax::Backend::process_results ( const Jobs jobs,
bool  check_finished 
)
inline

Definition at line 88 of file Backend.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

void benchmax::Backend::run ( const Jobs jobs,
bool  wait_for_termination 
)
inline

Run the list of tools against the list of benchmarks.

Definition at line 111 of file Backend.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sanitize_results()

void benchmax::Backend::sanitize_results ( const Jobs jobs) const
inlineprotected

Definition at line 61 of file Backend.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startTool()

virtual void benchmax::Backend::startTool ( const Tool )
inlineprotectedvirtual

Hook for every tool at the beginning.

Can be used to upload the tool to some remote system.

Definition at line 41 of file Backend.h.

Here is the caller graph for this function:

◆ suspendable()

bool benchmax::Backend::suspendable ( ) const
inline

Definition at line 85 of file Backend.h.

Here is the caller graph for this function:

◆ write_results()

void benchmax::Backend::write_results ( const Jobs jobs) const
inlineprotected

Definition at line 70 of file Backend.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ mExpectedJobs

std::size_t benchmax::Backend::mExpectedJobs
protected

Number of jobs that should be run.

Definition at line 29 of file Backend.h.

◆ mFinishedJobs

std::atomic<std::size_t> benchmax::Backend::mFinishedJobs
protected

Number of jobs that are finished.

Definition at line 31 of file Backend.h.

◆ mLastPercent

std::atomic<std::size_t> benchmax::Backend::mLastPercent
protected

Percentage of finished jobs when madeProgress() was last called.

Definition at line 33 of file Backend.h.

◆ mResults

Results benchmax::Backend::mResults
private

Results of already completed jobs.

Definition at line 26 of file Backend.h.


The documentation for this class was generated from the following file: