GUROBI threads setting

762 views
Skip to first unread message

Gary

unread,
Jun 20, 2018, 2:18:37 PM6/20/18
to Gurobi Optimization
Hello,

I am solving a big MIP problem using Matlab/Gurobi interface. In parameter structure, I set the TimeLimit to 1000s and MIP gap to 4000. All the other parameters are kept as default.  It takes about 566s to meet the MIP gap, and the threads count is 20. However, if I set the params.Threads to 20, and solve it again, the MIP will hit the 1000s time limit. I am wondering why the same parameters can give the totally different solution time?

I appreciate any insight/comments. Thanks.

Michael Winkler

unread,
Jun 21, 2018, 10:04:33 PM6/21/18
to Gurobi Optimization
Hi Gary,

are you sure about the MIP gap value of 4000? Because this means 4000 %, which would be pretty huge.
Anyway, to answer your question by default Gurobi uses all available cores and sometimes decides to use hyperthreads as well, but this can sometimes hurt performance. So in this sense, setting the Thread parameter to a fixed value is different from running it with the default value.

Best,
Michael 

Gary

unread,
Jul 9, 2018, 9:49:46 AM7/9/18
to Gurobi Optimization
Hi, Michael,

Thank you for your help.
The MIP gap is the absolute MIP gap, not the relative MIP gap. You mention the hyperthreads, which is a new concept for me? If you explain a little bit more about this concept, I will appreciate. I saw in both way, default or setting the threads number, the used thread number is the same, however the solution time is quite different.

Thanks
Gary

Tobias Achterberg

unread,
Jul 13, 2018, 5:56:29 AM7/13/18
to gur...@googlegroups.com
Modern CPUs feature the concept of "hyper-threading". This means that each core of the CPU
is usually able to process multiple instructions (usually two) in parallel, but this
parallelization is a bit limited so that this is definitely not the same as having another
core.

The operating system is using these so-called "virtual cores" just as regular cores and
will schedule threads to run on them.

For example, with a typical 4 core CPU you will have 8 virtual cores. On such a system, in
default settings Gurobi will use up to 8 threads, but in some cases it will decide to only
use 4 threads. This depends on the algorithm (barrier, MIP), and also on the size of the
model and the point in the algorithm where you are (root node or parallel tree search).


Best regards,

Tobias
Reply all
Reply to author
Forward
0 new messages