| 1 |
MiniZinc Flattening Benchmarks |
| 2 |
============================== |
| 3 |
|
| 4 |
## Setup |
| 5 |
|
| 6 |
```sh |
| 7 |
# Only required to run compare.py |
| 8 |
pip install -r requirements.txt |
| 9 |
``` |
| 10 |
|
| 11 |
## Running benchmarks |
| 12 |
|
| 13 |
`flatten.py` creates a CSV file `statistics.csv` containing statistics output of flattening of a set |
| 14 |
of instances in the MiniZinc Challenge directory structure (e.g. from the |
| 15 |
[minizinc-benchmarks](https://github.com/minizinc/minizinc-benchmarks) repository). It will run |
| 16 |
benchmarks in parallel by default. You can set the number of workers with `--parallel=<n>` where `n` |
| 17 |
is the number of workers. Use `--parallel=0` (the default) for as many workers as CPUs, or |
| 18 |
`-parallel=-1` for as many workers as instances. |
| 19 |
|
| 20 |
```sh |
| 21 |
flatten.py --args="-Glinear" instances/ statistics.csv |
| 22 |
``` |
| 23 |
|
| 24 |
It can also flatten a set of instances specified in CSV format (files are relative to CSV location). |
| 25 |
|
| 26 |
`instances.csv`: |
| 27 |
``` |
| 28 |
model1.mzn,data1.dzn |
| 29 |
model2.mzn,data2.dzn |
| 30 |
... |
| 31 |
``` |
| 32 |
|
| 33 |
```sh |
| 34 |
flatten.py --args="-Gstd" instances.csv statistics.csv |
| 35 |
``` |
| 36 |
|
| 37 |
Use `--minizinc="/path/to/minizinc_binary"` to use a different MiniZinc installation (the default is the one found in your `PATH`). |
| 38 |
The `--prefix-args` option can be used to add a prefix to the `minizinc` command (e.g. `--prefix-args="timeout 10s"` to add a 10 second flattening timeout). |
| 39 |
|
| 40 |
## Comparing benchmark runs |
| 41 |
|
| 42 |
`compare.py` creates an HTML file which highlights significant differences in flattening performance |
| 43 |
or statistics. These are considered to be changes of 10% or more (times are rounded for this |
| 44 |
purpose, but the values reported are the true differences). |
| 45 |
|
| 46 |
```sh |
| 47 |
compare.py statistics_baseline.csv statistics_new.csv output.html |
| 48 |
``` |