← Back to team overview

dolfin team mailing list archive

Re: Timing broken?

 

On Monday August 30 2010 12:30:33 Anders Logg wrote:
> On Mon, Aug 30, 2010 at 12:23:25PM -0700, Johan Hake wrote:
> > On Monday August 30 2010 12:06:30 Anders Logg wrote:
> > > On Mon, Aug 30, 2010 at 12:02:14PM -0700, Johan Hake wrote:
> > > > On Monday August 30 2010 11:53:54 Anders Logg wrote:
> > > > > Is timing broken? It seems to be for me.
> > > > > 
> > > > > Can anyone try the following:
> > > > > 
> > > > > python -c "from dolfin import *; import time; tic(); time.sleep(1);
> > > > > print toc()"
> > > > > 
> > > > > It should print out something like 1.0, but I get 0.0.
> > > > 
> > > > I get 0.0.
> > > > 
> > > > > std::clock() is giving very strange values.
> > > > 
> > > > Do you suggest that it is broken in std::clock and not in our wrapped
> > > > version?
> > > 
> > > Yes, since we didn't change anything. (At least I don't remember
> > > changing anything.)
> > > 
> > > When I print the values I get from std::clock(), I get values like
> > > 
> > > 66400000
> > > 
> > > The precision seems to be very low.
> > 
> > I just compiled a C++ program using std::clock directly and anotherone
> > using dolfin::tic/toc, and they gave reasonable results. Maybee there is
> > something screwed with the python wrapper?
> 
> What do you get when you print stuff inside toc() in timing.cpp?

Everything looks good in a simple C++ program. It looks like the <ctime> 
module gets hijacked when compiled together with the swig generated wrapper 
file?

Johan

> Can it be something wrong with the compiler flags for DOLFIN?
> 
> --
> Anders
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp



References