exact run time of a model in AMPL

1,009 views
Skip to first unread message

momeni....@gmail.com

unread,
Oct 30, 2015, 9:53:42 AM10/30/15
to AMPL Modeling Language
Hi every one,

How  can I have the exact run time of a model in AMPL?

 I used 3 comments   _total_ solve_user_time ,  _total_solve_system_time , _total_solve_time   and in different runs these 3 comments give different values for time.


Why the time value is not fix?

Thank you  very much in advance.

Robert Fourer

unread,
Oct 31, 2015, 11:30:16 AM10/31/15
to am...@googlegroups.com
_total_solve_time is the sum of _total_solve_user_time and _total_solve_system_time. We recommend that you use _total_solve_time, except if you are running a solver that executes on multiple cores in parallel, in which case we recommend _total_solve_elapsed_time. Note that these give the time of all solver runs in your AMPL session; if you want the time for only the most recent solve, then use _solve_time or _solve_elapsed_time instead.

Bob Fourer
am...@googlegroups.com

=======

Robert Fourer

unread,
Oct 31, 2015, 3:18:03 PM10/31/15
to am...@googlegroups.com
_total_solve_time is the sum of _total_solve_user_time and _total_solve_system_time. We recommend that you use _total_solve_time, except if you are running a solver that executes on multiple cores in parallel, in which case we recommend _total_solve_elapsed_time. Note that these give the time of all solver runs in your AMPL session; if you want the time for only the most recent solve, then use _solve_time or _solve_elapsed_time instead.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of momeni....@gmail.com
Sent: Friday, October 30, 2015 5:12 AM
To: AMPL Modeling Language

momeni....@gmail.com

unread,
Nov 1, 2015, 11:07:19 AM11/1/15
to AMPL Modeling Language, momeni....@gmail.com
Dear Bob,

Thank you very much for your answer. I send my models to NEOS site. 

Which comment do you think is more suitable? _total_solve_time  or  _total_solve_elapsed_time?

What is the difference between _total_solve_user_time and  _total_solve_system_time?


Thank you so much

Robert Fourer

unread,
Nov 1, 2015, 9:18:29 PM11/1/15
to am...@googlegroups.com
As indicated in my previous post, we recommend that you use _total_solve_time, except if you are running a solver that executes on multiple cores in parallel, in which case we recommend _total_solve_elapsed_time. So for example if you are solving a linear program using the simplex method then usually that involves a single-threaded algorithm and you would use _total_solve_time, but if you are solving a mixed-integer program then by default the most popular solvers search a tree of solutions using multiple cores in parallel, and you would use _total_solve_elapsed_time. (When multiple cores are used, _total_solve_time gives the sum of times on all of the cores, which is not a good measure of efficiency.)

User time and system time are computer operating system concepts that are not specific to AMPL or optimization. Basically all CPU time is divided into user time and system time, as explained at http://stackoverflow.com/questions/5688949/what-are-user-and-system-times-measuring. The sum of these times is _total_solve_time which is the most useful.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of momeni....@gmail.com
Sent: Sunday, November 1, 2015 8:10 AM
To: AMPL Modeling Language

masomeh momeni

unread,
Nov 2, 2015, 5:31:11 PM11/2/15
to am...@googlegroups.com
Dear Bob,

Thank you so much for your answer.

All the best,

--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/9Ir4KPzzyD4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages