# \[AMPL 24516\] Partitioning running times

**URL:** <https://discuss.ampl.com/t/ampl-24516-partitioning-running-times/363>\
**Category:** Google Group Mirror\
**Created:** [February 7, 2023, 10:11am UTC](https://discuss.ampl.com/t/ampl-24516-partitioning-running-times/363 "2023-02-07T10:11:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.gr\_gmail.com](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/peter.gr_gmail.com/32/644_2.png) [@peter.gr\_gmail.com](https://discuss.ampl.com/u/peter.gr_gmail.com)\
**Post date:** [February 7, 2023, 10:11am UTC](https://discuss.ampl.com/t/ampl-24516-partitioning-running-times/363/1 "2023-02-07T10:11:36Z")

</div>

Dear all, I beg your pardon, I can’t get that sorted …

In general, I want to specify the total running time of an algorithm as the sum of the total AMPL-time and the total SOLVE-time. So, there is one AMPL-run with a number, k \> 1, of solve-commands. So far, I have assumed:

Total algorithm sec. = \_ampl\_elapsed\_time + \<SUM of k \_solve\_elapsed\_time’s\>,

which always appeared to be correct, comparing the result with manual stopwatch measuring or simply calculating the (integer-sec-)difference between a time() at the start and a time() at the end of the algorithm.

But now I came across Bob Fourer’s contribution [here](https://groups.google.com/g/ampl/c/attIOKNdYUE), where I could learn that “Thus  
\_ampl\_elapsed\_time _includes_ the \_total\_solve\_elapsed\_time …”, which, from my view, would also mean that \_ampl\_elapsed\_time includes my \<SUM of k \_solve\_elapsed\_time’s\>, provided this SUM = \_total\_solve\_elapsed\_time.

I see a contradiction … which doesn’t mean that there really exists one …

Thanks for any input,

Peter

---

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@AMPL\_Google\_Group](https://discuss.ampl.com/u/AMPL_Google_Group)\
**Post date:** [February 7, 2023, 5:58pm UTC](https://discuss.ampl.com/t/ampl-24516-partitioning-running-times/363/2 "2023-02-07T17:58:57Z")

</div>

It may have worked the way I described in 2006, but in our current release, \_ampl\_elapsed\_time is not included in \_solve\_elapsed\_time. This is seen clearly in the following example, where both times are displayed before and after a call to the solver:

`_ampl_elapsed_time = 0.015`  
`_solve_elapsed_time = 0`

`Gurobi 10.0.0: optimal solution; objective 266`  
`346327 simplex iterations`  
`39312 branching nodes`

`_ampl_elapsed_time = 0.031`  
`_solve_elapsed_time = 10.125`

Note that the sum of elapsed times of all solver runs in the current AMPL session is also available in \_total\_solve\_elapsed\_time.

---

<div class="post-metadata">

**Author:** ![peter.gr\_gmail.com](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/peter.gr_gmail.com/32/644_2.png) [@peter.gr\_gmail.com](https://discuss.ampl.com/u/peter.gr_gmail.com)\
**Post date:** [February 7, 2023, 7:40pm UTC](https://discuss.ampl.com/t/ampl-24516-partitioning-running-times/363/3 "2023-02-07T19:40:51Z")

</div>

Finally, we may simply say \_ampl\_elapsed\_time and \_solve\_elapsed\_time are disjoint. This and your note support my current view:) Sorry, I didn’t pay attention to the year of this post … thanks for the clarification!
