AMPL/GUROBI: How to Limit "CPU Time" instead of "ELAPSED time"

542 views
Skip to first unread message

tolentin...@gmail.com

unread,
Jul 2, 2013, 3:20:57 PM7/2/13
to am...@googlegroups.com
Hey, I am using Gurobi Solver in AMPL and I know one can limit the "elapsed time" with the "timelim" parameter of GUROBI. But is there any way to limit the SOLVE TIME (CPU TIME) instead?

(I know one can display the total CPU Time at the end in AMPL with display _solve_time, but can we limit it?)

Thanks,
MT

Robert Fourer

unread,
Jul 18, 2013, 6:25:49 PM7/18/13
to am...@googlegroups.com

As far as I can tell, Gurobi can only be asked to report elapsed times.  Except in certain situations (you are running a primal or dual simplex method on a continuous linear program, you have limited Gurobi to a single thread by specifying the "threads=1" directive, you have a very old single-core computer) Gurobi runs multiple threads in parallel, with the result that it is hard to find a meaningful "CPU time" to report.  In particular the AMPL _solve_time may be the sum of the CPU times on all cores, which is a misleading measure of how long Gurobi took to solve the problem.

 

Bob Fourer

am...@googlegroups.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of tolentin...@gmail.com
Sent: Tuesday, July 2, 2013 2:21 PM
To: am...@googlegroups.com
Subject: [AMPL 7223] AMPL/GUROBI: How to Limit "CPU Time" instead of "ELAPSED time"

Reply all
Reply to author
Forward
0 new messages