Zoltan Developer's Guide  |  Next  |  Previous

Timing Routines

To assist in performance measurements and profiling, several timing routines are included in the Zoltan library. The main timer function, Zoltan_Time, provides access to at least two portable timers: one CPU clock and one wall clock. On most systems, user time can also be measured. A higher-level timing capability built using Zoltan_Time is also available; see ZOLTAN_TIMER for more details.

The routines included in the utility are listed below.

Zoltan_Time: Returns the time (in seconds) after some fixed reference point in time.
Zoltan_Time_Resolution:  The resolution of the specified timer.
Currently, the following timers are supported: Within Zoltan, it is recommended to select which timer to use by setting the TIMER general parameter via Zoltan_Set_Param. The default value of TIMER is wall.  Zoltan stores an integer representation of the selected timing method in zz->Timer. This value should be passed to Zoltan_Time, as in Zoltan_Time(zz->Timer).



double Zoltan_Time(int timer); 

Zoltan_Time returns the time in seconds, measured from some fixed reference time. Note that the time is not synchronized among different processors or processes. The time may be either CPU time or wall-clock time. The timer is selected through Zoltan_Set_Param.
 
Arguments:
   timer The timer type (e.g., wall or cpu) represented as an integer. See top of page for a list of valid values.
Returned Value:
   double  The time in seconds. The time is always positive; a negative value indicates an error.



double Zoltan_Time_Resolution(int timer) ; 

Zoltan_Time_Resolution returns the resolution of the current timer.  The returned resolution is a lower bound on the actual resolution.
 
Arguments:
   timer The timer type (e.g., wall or cpu) represented as an integer. See top of page for a list of valid values.
Returned Value:
   double  The timer resolution in seconds.  If the resolution is unknown, -1 is returned.

 



Example:
Here is a simple example for how to use the timer routines:

[Table of Contents  |  Next:  Debugging ServicesPrevious:  Hash Function  |  Privacy and Security]