[CoinUtils] User and System time in CoinCpuTime

Matthew Saltzman mjs at clemson.edu
Thu Nov 4 19:37:20 EDT 2010


I think I recall that long ago there was a timer bug in the Linux
kernel, but I don't recall its nature and I find it hard to believe that
it would have persisted this long.

I'm also suspicious of the idea that a cpu-intensive task like this
would not accumulate user time at a much higher rate than system time.
Is the trouble you're seeing reproducible, or is it intermittent?

CoinCpuTime uses various mechanisms in an attempt to be portable, so
what service is being called depends on various macro variable settings.
It's kind of ugly.

Ah, according to the clock() man page, if the code spawns children to do
the work, clock() is definitely the wrong thing to use.

On Wed, 2010-11-03 at 18:29 -0400, Giacomo Nannicini wrote: 
> 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
> 
> 
> _______________________________________________
> CoinUtils mailing list
> CoinUtils at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coinutils

-- 
                Matthew Saltzman

Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs




More information about the CoinUtils mailing list