[CoinUtils] User and System time in CoinCpuTime

Giacomo Nannicini giacomo.n at gmail.com
Wed Nov 3 18:29:01 EDT 2010


On Wed, Nov 3, 2010 at 6:12 PM, Lou Hafer <lou at cs.sfu.ca> wrote:
> Giacomo,
>
>        Thanks for pursuing this. It's nice to know it's not a cbc bug :-)
>
>        On the other hand, if user code is executing and the user time is not
> increasing, that sounds like a bug within Linux. It would be useful to
> know if you see the same behaviour on other platforms.
>
>        Coming at this from another direction, is it a bug or just a deficiency
> in CoinCpuTime, as you suggest. Is this a failure to correctly account
> for user time, or is your code really spending all its time executing
> system tasks?

I find it hard to believe that the code is spending all its time in
system calls, because the number of processed/active nodes reported in
the Branch-and-Bound log changes over time even after the timer stops
advancing. This makes me think that user time is being used, but I
cannot completely rule out what you suggest.

It could be a problem with my machine, but I know another user that
had the same problem (on a different machine). I will try to see if we
had the same Linux distribution, and let you know if I find something.

>
>        I don't know the reason for the original decision to not include system
> time. Someone else will have to speak to that. Speculation would be that
> user time accounts for the cost of your code, while system time
> potentially includes costs attributable to other code running on the
> system and interrupting the continuous execution of your code.
>

Maybe the choice could be added as an option at compile time.
I personally find user + system CPU time to be closer to the human
perception of passed time, but I can see its drawback.

Giacomo




More information about the CoinUtils mailing list