MAX_COMPUTATION_TIME does not work?

410 views
Skip to first unread message

morgoth

unread,
Jan 26, 2009, 6:09:25 PM1/26/09
to Xpress-MP
Hi,

I have a mosel model which I want to test on several instances of a
problem. Therefore, I decided to set a time limit to 1800 seconds,
after which the best solution so far shall be put out.
I tried the following code line:
setparam("MAX_COMPUTATION_TIME", 1800)

but it does not seem to work, the computation time is at 4800s right
now. Do I have to set an other parameter too?

amirah

unread,
Jan 26, 2009, 6:38:06 PM1/26/09
to xpre...@googlegroups.com
Hi there

Try using this instead.
setparam("XPRS_MAXTIME",-1800)

You can find this by choosing "Wizards" from the menu and then "Results & tuning". A new window will pop up and under "Parameter" you'll be able to se "MAXTIME". Click on it and it'll give you the description on the right. Here it is in case you can't find it:
The maximum time in seconds that the Optimizer will run before it terminates, including the problem setup time and solution time. For MIP problems, this is the total time taken to solve all the nodes.
Type:  Integer
Values: 
0   No time limit.
n>0   If an integer solution has been found, stop MIP search after n seconds, otherwise continue until an integer solution is finally found.
n<0   Stop in LP or MIP search after -n seconds.
Default Value:  0

Hope this helps.
P.S. Be aware that they count the seconds in CPU time and not realtime. You can check this on the logfile.


Amirah

morgoth

unread,
Jan 26, 2009, 7:19:51 PM1/26/09
to Xpress-MP
Thank you a lot, MAXTIME works well, just as intended.

David

morgoth

unread,
Jan 29, 2009, 7:15:57 AM1/29/09
to Xpress-MP
Ok, another question:
Can I somehow read out the time taken to find the optimal solution? I
mean the cpu time, which appears when VERBOSE is set to true. Of
course, I could do a time measurement by myself, but that would be the
real time, not the CPU time, right? So.. is there a control to find
out how long the optimization has taken?

amirah

unread,
Jan 29, 2009, 3:45:02 PM1/29/09
to xpre...@googlegroups.com
The time should show up in the logfile, at the end. Here's what I use to print out the logfile:
setparam("XPRS_MIPLOG",-1)      
setparam("XPRS_CPUTIME",1)

Is this what you had in mind?

morgoth

unread,
Jan 29, 2009, 4:16:55 PM1/29/09
to Xpress-MP
First, thank you for your answer.

Actually, I wanted to create files in a benchmark-session, like this:

setparam("XPRS_MAXTIME",1000)
tstart:=gettime
minimize( height )
tstop:=gettime
writeln("instance: ",datainpack)
writeln("heuristic: ",mH)
writeln("best UB: ", getobjval)
writeln("LB:",getparam("XPRS_BESTBOUND"))
writeln("time:",tstop-tstart)

now, i wanted to replace the tstop-tstart part by getparam
("XPRS_...???...") to get the CPU time.
I am running this benchmark on about 100 instances of which some of
them terminate before the MAXTIME and some dont.
So i just wanted to save this data and later parse it by a small
application to automaticaly make a nice table for my paper.

The "gettime"-time measurement is quite inaccurate, so I hoped there
is a parameter to get the computation time. Is there anything like
that?

On Jan 29, 9:45 pm, amirah <amirah.rah...@gmail.com> wrote:
> The time should show up in the logfile, at the end. Here's what I use to
> print out the logfile:
> setparam("XPRS_MIPLOG",-1)
> setparam("XPRS_CPUTIME",1)
>
> Is this what you had in mind?
>
Reply all
Reply to author
Forward
0 new messages