1

I am trying to run a MiniZinc model with a OSICBC solver via bash, with the following command-line arguments (subject to a time limit of 30000ms or 30s):

minizinc --solver osicbc model.mzn data.dzn --time-limit 30000 --output-time

But for just this run, the entire process upon executing the command to getting outputs takes about a minute, and the output shows that "Time Elapsed: 36.21s" at the end.

Is this the right approach to imposing a time limit in running this model, where total time taken includes the time from which the command is invoked to which the outputs are shown in my terminal?

jww
  • 97,681
  • 90
  • 411
  • 885
Stoner
  • 846
  • 1
  • 10
  • 30

1 Answers1

2

The --time-limit command line flag was introduced in MiniZinc 2.2.0 to allow the user to restrict the combined time that the compiler and the solver take. It also introduced --solver-time-limit to just limit the solver time.

Note that minizinc will allow the solver some extra time to output their final solutions.

If you experience that these flags do not limit the solver to the specified times and they are not stopped within a second of the given limit, then this would suggest a bug and I would invite you to make a bug report: https://github.com/MiniZinc/libminizinc/issues

Dekker1
  • 5,565
  • 25
  • 33
  • Thank you for the detailed breakdown and clarifications! And also for answering one of my MiniZinc-related questions again :) – Stoner Oct 15 '18 at 01:13
  • Just out of curiousity, does the `--solver-time-limit` flag work as well for the `osicbc` solver? For e.g., when invoked in the following manner: `minizinc --solver osicbc --solver-time-limit 10000 model.mzn data.dzn`? – Stoner Oct 15 '18 at 01:14
  • I noticed that from http://www.minizinc.org/doc-2.2.1/en/find_mus.html, some solvers have their own options such as `--timeout ` which `osicbc` does not seem to have.. – Stoner Oct 15 '18 at 01:15
  • 1
    Solvers can have their own command line arguments, although I think the `timeout` flag for findMUS is likely a mistake. Things like time outs are supported my the use of "standard flags" (http://www.minizinc.org/doc-2.2.1/en/fzn-spec.html#solver-configuration-files). If the solver supports setting a timeout it will be given using the `-t` flag. if it does not or tries to run for longer, then it will be killed by the MiniZinc driver. – Dekker1 Oct 15 '18 at 02:42
  • Thanks for your clarification! That helps a lot :) – Stoner Oct 15 '18 at 02:51