Documentation
¶
Overview ¶
Package bench provides solver benchmarking utilities.
Package bench addresses the needs of solver benchmarking by:
1. providing a format for a benchmark suite. The format is command line friendly for unix commands.
2. providing a tool to create such benchmarks suites.
3. providing a format for runs on benchmarks by a solver/solver configuration.
4. providing a tool to run commands on instances in suite and output the format
5. providing a tool to query and report/compare runtimes.
Index ¶
- func IsRunDir(root string) bool
- func IsSuiteDir(d string) bool
- func Listing(s *Suite, filt func(*Run) bool) string
- func MatchSelect(pattern string, N int, dirs ...string) []string
- func SatTotal(r *Run) int
- func Select(N int, dirs ...string) []string
- func SolvePortion(r *Run) float64
- func SolveRate(r *Run, unit time.Duration) (real float64, user float64, sys float64)
- func SolveTotal(r *Run) int
- func Summary(s *Suite) string
- func Times(r *Run) (real float64, user float64, sys float64)
- func TotalResult(r *Run, filt func(r int) bool) int
- func UnknownTotal(r *Run) int
- func UnsatTotal(r *Run) int
- type Cactus
- type InstRun
- type Run
- type Scatter
- type Suite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSuiteDir ¶
IsSuiteDir returns true if d appears to contain a bench.Suite
func MatchSelect ¶
MatchSelect is like Select but filters files with filepath.Match using pattern.
func Select ¶
Select walks all the directories listed in dirs and selects up to N files randomly from all files in any directory in p.
Select logs errors.
func SolvePortion ¶
SolvePortion gives the portion of instances in r solved.
func SolveRate ¶
SolveRate gives the rate in terms of solutions found per second for the run r. It returns the results in terms of real time, user time, and system time.
SolveRate is only valid w.r.t. a instance/global timeout because unsolved instances have unknown time. SolveRate counts unsolved time.
func SolveTotal ¶
SolveTotal gives the total number of solved instances for the run r.
func UnknownTotal ¶
func UnsatTotal ¶
Types ¶
type Cactus ¶
type Cactus struct { Runs []*Run // runs to plot. D [][]int // D[i] permutation for run i instances sorted according to dur. MaxDur time.Duration }
Type Cactus contains info necessary for cactus plot of an arbitrary number of runs.
type InstRun ¶
type Run ¶
type Run struct { Root string Name string Suite *Suite Cmd string Desc string Commit string Env map[string]string Arch string Os string NumCPU int Start time.Time Timeout time.Duration InstTimeout time.Duration InstRuns []*InstRun }
Type Run describes a run of a command/solver on a *Suite
type Scatter ¶
type Scatter struct { Runs [2]*Run Xs []time.Duration // Xs[i], Ys[i] gives point for run 0,1 on instance i. Ys []time.Duration }
Type Scatter contains info necessary for a scatter plot of 2 runs.
func NewScatter ¶
NewScatter creates a new Scatter object for a pair of runs r1, r2. iFilt, if non-nil, selects the instances to show in the scatter.
type Suite ¶
type Suite struct { Root string // root directory Insts []string // instance pathnames. Map []string // map from instance to origin path Hashes []string // map from instance to hash Runs []*Run // runs linked to this input }
Type Suite describes the inputs to benchmark runs In general, the info in the struct is read-only.
func CreateSuite ¶
CreateSuite creates a benchmark suite rooted in root with the specified instances.
func LinkSuite ¶
LinkSuite creates a benchmark suite in which instances are symlinks to the origin files.