How to set multithreads parameters in AMPL for Gurobi?

149 views
Skip to first unread message

david

unread,
Oct 12, 2017, 10:56:43 PM10/12/17
to ampl, 2289257066
Dear Sir/Madam,

         I have a very large ILP to solve and would like to use multiple threads inside AMPL mod so that once a thread finds a solution then the main program exists.

         But I could not find detailed instruction to build such a AMPL mod online.

         please help for this.

         Thanks a lot,

         David

Robert Fourer

unread,
Oct 13, 2017, 4:00:00 PM10/13/17
to am...@googlegroups.com
The AMPL model translator is a single-threaded application. However when you send a problem from AMPL to Gurobi, then Gurobi automatically uses multiple threads when it solves the problem, and there is nothing special that you need to do. To see how many threads Gurobi is using, specify

option gurobi_options 'outlev=1';

and in the log output that appears, look for a message like

Thread count was 4 (of 4 available processors)

If you want to use fewer threads, you can also specify the number of threads in the gurobi_options string, as in this example:

option gurobi_options 'outlev=1 threads=2';

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages