# ChronoZinc Small wrapper for `mzn-fzn` to benchmark MiniZinc models ## Usage ``` chronozinc [config]* [models]* [data]* ``` Files are matched on extension: - Models: `.mzn` - Data: `.dzn` - Configuration: `.json`, `.toml`, `.yml` (viper extensions) ## Installation `go get -u github.com/jjdekker/chronozinc` ## Sample Configuration The following configuration can be used to time a model using `flatzinc`, `fzn-gcode` and `fzn-or-tools`. Running is as easy as: `chronozinc config.toml model.mzn data1.dzn data2.dzn`. Tip: Remove the parameters line and place it in `$HOME/.config/chronozinc/settings.toml` or `/etc/chronozinc/settings.toml`. You can now make project specific settings files while using the solvers settings as declared in this file. ```toml parameters = ["time", "time_ms", "solvetime", "solvetime_ms", "status"] processes = 2 [solvers.flatzinc] binary = "flatzinc" [solvers.gecode] binary = "fzn-gecode" globals = "gecode" override_flags = "-s" [solvers.gecode.extractors] time = "runtime:\\s*(?P\\d+.\\d+)\\s" solvetime = "solvetime:\\s*(?P\\d+.\\d+)\\s" solutions = "solutions:\\s*(?P\\d+)" variables = "variables:\\s*(?P\\d+)" propagators = "propagators:\\s*(?P\\d+)" propagations = "propagations:\\s*(?P\\d+)" nodes = "nodes:\\s*(?P\\d+)" failures = "failures:\\s*(?P\\d+)" restarts = "restarts:\\s*(?P\\d+)" peak_depth = "peak depth:\\s*(?P\\d+)" [solvers.or_tools] binary = "fzn-or-tools" globals = "or_tools_cp" [solvers.or_tools.extractors] time_ms = "total runtime:\\s*(?P\\d+)\\s" buildtime_ms = "build time:\\s*(?P\\d+)\\s" solvetime_ms = "solve time:\\s*(?P\\d+)\\s" solutions = "solutions:\\s*(?P\\d+)" constraints = "constraints:\\s*(?P\\d+)" propagations = "normal propagations:\\s*(?P\\d+)" delayed_propagations = "delayed propagations:\\s*(?P\\d+)" branches = "branches:\\s*(?P\\d+)" failures = "failures:\\s*(?P\\d+)" memory = "memory:\\s*(?P\\d+.\\d+)\\s" # in MB [extractors] time = "overall time\\s*(?P\\d+\\.\\d+)\\s*s" [matchers.status] COMPLETE = "==========" UNSAT = "=====UNSATISFIABLE=====" TIMEOUT = "TIMEOUT" UNKNOWN = "=====UNKNOWN=====" SAT = "----------" ``` ## TODO - Remove all usage of `viper` from parsing and runtime packages - Provide separate the `run` and `parse` commands - Internal data transformation - MORE DOCUMENTATION!!!