The Minizinc IDE has a parallel solver option ("Number of threads") in the config section. When compiling from the commandline, however, the mzn2fzn
binary doesn't seem to support a parallel option. Is it possible to solve in parallel from a commandline-compiled file?
Asked
Active
Viewed 940 times
4

beardc
- 20,283
- 17
- 76
- 94
-
2The multi-threading commandline switch `-p` is accepted by some of the MiniZinc solver back-ends. However, the MiniZinc compiler is single-threaded. This should be no problem, as the solving phase typically consumes much more computation power than the compilation from MiniZinc to FlatZinc. – Axel Kemper Jan 07 '16 at 18:33
-
To be clear, I'm interested in passing an option to mzn2fzn that tells the backend solver to solve in parallel when possible (I'm not interested in compiling the program in parallel). But it sounds like you're saying this doesn't exist and must be specified on a case-by-case basis depending on the backend solver, right? – beardc Jan 07 '16 at 20:05
1 Answers
4
You can either use MiniZinc via the integrated development environment (IDE
) or via commandline call. I am using IDE 2.0.8
In the IDE
, use the configuration
tab to specify the number of threads to be used for searching/solving. Depending on the selected backend, you may end up with an error message, that multi-threading is not supported for the respective backend.
Via commandline, you can either call compiler and backend separately, or you can use minizinc.exe
to act as an umbrella tool to call them sequentially. All the tools have a commandline option --help
to explain the parameters. minizinc.exe
accepts -p
or --parallel
to run the backend in multi-threading mode, provided this is supported.

Axel Kemper
- 10,544
- 2
- 31
- 54
-
I somehow didn't know about the `minizinc` binary in place of mzn2fzn + backend binaries, but it looks like that answers my question. – beardc Jan 08 '16 at 15:37
-
MiniZinc 2.5.5 for Windows, build 273041792, doesn't mention `-p` or `--parallel` in its `--help`. Also, although supplying `-p 8` with the `COIN-BC` solver causes it to pass in `-threads 8` to the solver, the prebuilt `COIN-BC` solver included with the MiniZinc download was compiled *without* `--enable-cbc-parallel`, so it doesn't recognise the option :( – j_random_hacker Feb 16 '22 at 01:20
-
My 2.5.5 MiniZinc IDE 273051464 (Windows 10) starts the solver with `cbc -threads 8 -solve -quit`. But you are right: The solver does not recognize the option. – Axel Kemper Feb 16 '22 at 09:05