ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
This group is for Timer. More...
Typedefs | |
typedef struct ABT_timer_opaque * | ABT_timer |
Timer handle type. More... | |
Functions | |
double | ABT_get_wtime (void) |
Get elapsed wall clock time. More... | |
int | ABT_timer_create (ABT_timer *newtimer) |
Create a new timer. More... | |
int | ABT_timer_dup (ABT_timer timer, ABT_timer *newtimer) |
Duplicate a timer. More... | |
int | ABT_timer_free (ABT_timer *timer) |
Free a timer. More... | |
int | ABT_timer_start (ABT_timer timer) |
Start a timer. More... | |
int | ABT_timer_stop (ABT_timer timer) |
Stop a timer. More... | |
int | ABT_timer_read (ABT_timer timer, double *secs) |
Read the elapsed time of the timer. More... | |
int | ABT_timer_stop_and_read (ABT_timer timer, double *secs) |
Stop a timer and read an elapsed time of a timer. More... | |
int | ABT_timer_stop_and_add (ABT_timer timer, double *secs) |
Stop a timer and add an elapsed time of a timer. More... | |
int | ABT_timer_get_overhead (double *overhead) |
Obtain an overhead time of using ABT_timer. More... | |
This group is for Timer.
typedef struct ABT_timer_opaque* ABT_timer |
double ABT_get_wtime | ( | void | ) |
Get elapsed wall clock time.
ABT_get_wtime()
returns the elapsed wall clock time in seconds since an arbitrary time in the past.
The resolution of elapsed time depends on the clock resolution of the system.
int ABT_timer_create | ( | ABT_timer * | newtimer | ) |
Create a new timer.
ABT_timer_create()
creates a new timer and returns its handle through newtimer
. The initial start time and stop time of newtimer
are undefined.
The created timer must be freed by ABT_timer_free()
after its use.
newtimer
is set to ABT_TIMER_NULL
if an error occurs.newtimer
is not updated if an error occurs. newtimer
when an error occurs. ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_MEM
is returned if memory allocation fails.ABT_ERR_SYS
is returned if an error related to system calls and standard libraries occurs.newtimer
is NULL
, the results are undefined.[out] | newtimer | timer handle |
Duplicate a timer.
ABT_timer_dup()
creates a new timer and copies the start and stop time of the timer timer
to the new timer. The handle of the new timer is returned through newtimer
.
The created timer must be freed by ABT_timer_free()
after its use.
newtimer
is set to ABT_TIMER_NULL
if an error occurs.newtimer
is not updated if an error occurs. newtimer
when an error occurs. ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_MEM
is returned if memory allocation fails.ABT_ERR_SYS
is returned if an error related to system calls and standard libraries occurs.ABT_ERR_INV_TIMER
is returned if timer
is ABT_TIMER_NULL
.newtimer
is NULL
, the results are undefined.[in] | timer | handle to a timer to be duplicated |
[out] | newtimer | handle to a new timer |
int ABT_timer_free | ( | ABT_timer * | timer | ) |
Free a timer.
ABT_timer_free()
deallocates the resource used for the timer timer
and sets timer
to ABT_TIMER_NULL
.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_TIMER
is returned if timer
points to ABT_TIMER_NULL
.timer
is NULL
, the results are undefined.timer
is accessed after calling this routine, the results are undefined.[in,out] | timer | timer handle |
int ABT_timer_get_overhead | ( | double * | overhead | ) |
Obtain an overhead time of using ABT_timer.
ABT_timer_get_overhead()
returns the overhead time when measuring the elapsed time with ABT_timer
and returns the overhead time in seconds through overhead
. It measures the time difference in consecutive calls of ABT_timer_start()
and ABT_timer_stop()
.
The resolution of elapsed time depends on the clock resolution of the system.
This function is deprecated because the returned overhead is not a reliable value. The users are recommended to write their own benchmarks to measure the performance.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_MEM
is returned if memory allocation fails.ABT_ERR_SYS
is returned if an error related to system calls and standard libraries occurs.overhead
is NULL
, the results are undefined.[out] | overhead | overhead time of ABT_timer |
int ABT_timer_read | ( | ABT_timer | timer, |
double * | secs | ||
) |
Read the elapsed time of the timer.
ABT_timer_read()
returns the time difference in seconds between the start time and the stop time of the timer timer
through secs
. If either the start time or the stop time of timer
has not been set, secs
is set to an undefined value.
The resolution of elapsed time depends on the clock resolution of the system.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_TIMER
is returned if timer
is ABT_TIMER_NULL
.secs
is NULL
, the results are undefined.[in] | timer | timer handle |
[out] | secs | elapsed time in seconds |
int ABT_timer_start | ( | ABT_timer | timer | ) |
Start a timer.
ABT_timer_start()
sets the start time of the timer timer
to the current time.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_TIMER
is returned if timer
is ABT_TIMER_NULL
.timer
is accessed concurrently, the results are undefined.[in] | timer | timer handle |
int ABT_timer_stop | ( | ABT_timer | timer | ) |
Stop a timer.
ABT_timer_stop()
sets the stop time of the timer timer
to the current time.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_TIMER
is returned if timer
is ABT_TIMER_NULL
.timer
is accessed concurrently, the results are undefined.[in] | timer | timer handle |
int ABT_timer_stop_and_add | ( | ABT_timer | timer, |
double * | secs | ||
) |
Stop a timer and add an elapsed time of a timer.
ABT_timer_stop_and_add()
sets the stop time of the timer timer
to the current time and adds the time difference in seconds between the start time and the stop time of timer
to secs
. If the start time has not been set, the returned value is undefined.
The resolution of elapsed time depends on the clock resolution of the system.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_TIMER
is returned if timer
is ABT_TIMER_NULL
.secs
is NULL
, the results are undefined.timer
is accessed concurrently, the results are undefined.[in] | timer | timer handle |
[in,out] | secs | accumulated elapsed time in seconds |
int ABT_timer_stop_and_read | ( | ABT_timer | timer, |
double * | secs | ||
) |
Stop a timer and read an elapsed time of a timer.
ABT_timer_stop_and_read()
sets the stop time of the timer timer
to the current time and returns the time difference in seconds between the start time and the stop time of timer
through secs
. If the start time of timer
has not been set, secs
is set to an undefined value.
The resolution of elapsed time depends on the clock resolution of the system.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_TIMER
is returned if timer
is ABT_TIMER_NULL
.secs
is NULL
, the results are undefined.timer
is accessed concurrently, the results are undefined.[in] | timer | timer handle |
[out] | secs | elapsed time in seconds |