[Developers] Proposed Cactus Timer API Completion

Jonathan Thornburg jthorn at aei.mpg.de
Tue Aug 3 08:04:06 CDT 2004


Hi, Steve,

On Tue, 3 Aug 2004, Steve White wrote:

> unsigned int
> CCTK_NumTimerClocks( const cTimerData *info )
> 	// Gets the number of clocks recorded in a timer measurement

What happens if 'unsigned int' isn't big enough?

E.g. at 1 microsecond resolution, a 32-bit unsigned integer will
overflow in 71 minutes.  At 0.5 nanosecond resolution (= counting
cpu clock cycles for a 2 GHz processor) it will overflow in just 2.1
seconds. :(

Maybe we want either 'double' or CCTK_INT8 here?

ciao,

-- 
-- Jonathan Thornburg <jthorn at aei.mpg.de>      
   Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
   Golm, Germany, "Old Europe"     http://www.aei.mpg.de/~jthorn/home.html      
   "Washing one's hands of the conflict between the powerful and the
    powerless means to side with the powerful, not to be neutral."
                                      -- quote by Freire / poster by Oxfam




More information about the Developers mailing list