8 int ABTI_timer_create(ABTI_timer **pp_newtimer);
26 return ABTI_get_wtime();
45 ABTI_timer *p_newtimer;
47 abt_errno = ABTI_timer_create(&p_newtimer);
48 ABTI_CHECK_ERROR(abt_errno);
50 *newtimer = ABTI_timer_get_handle(p_newtimer);
79 ABTI_timer *p_timer = ABTI_timer_get_ptr(timer);
80 ABTI_CHECK_NULL_TIMER_PTR(p_timer);
82 ABTI_timer *p_newtimer;
84 abt_errno = ABTI_timer_create(&p_newtimer);
85 ABTI_CHECK_ERROR(abt_errno);
87 memcpy(p_newtimer, p_timer,
sizeof(ABTI_timer));
89 *newtimer = ABTI_timer_get_handle(p_newtimer);
116 ABTI_timer *p_timer = ABTI_timer_get_ptr(*timer);
117 ABTI_CHECK_NULL_TIMER_PTR(p_timer);
149 ABTI_timer *p_timer = ABTI_timer_get_ptr(timer);
150 ABTI_CHECK_NULL_TIMER_PTR(p_timer);
152 ABTD_time_get(&p_timer->start);
177 ABTI_timer *p_timer = ABTI_timer_get_ptr(timer);
178 ABTI_CHECK_NULL_TIMER_PTR(p_timer);
180 ABTD_time_get(&p_timer->end);
207 ABTI_timer *p_timer = ABTI_timer_get_ptr(timer);
208 ABTI_CHECK_NULL_TIMER_PTR(p_timer);
212 start = ABTD_time_read_sec(&p_timer->start);
213 end = ABTD_time_read_sec(&p_timer->end);
243 ABTI_timer *p_timer = ABTI_timer_get_ptr(timer);
244 ABTI_CHECK_NULL_TIMER_PTR(p_timer);
248 ABTD_time_get(&p_timer->end);
249 start = ABTD_time_read_sec(&p_timer->start);
250 end = ABTD_time_read_sec(&p_timer->end);
280 ABTI_timer *p_timer = ABTI_timer_get_ptr(timer);
281 ABTI_CHECK_NULL_TIMER_PTR(p_timer);
285 ABTD_time_get(&p_timer->end);
286 start = ABTD_time_read_sec(&p_timer->start);
287 end = ABTD_time_read_sec(&p_timer->end);
289 *secs += (end - start);
317 const int iter = 5000;
318 double secs, sum = 0.0;
321 ABTI_CHECK_ERROR(abt_errno);
323 for (i = 0; i < iter; i++) {
331 ABTI_CHECK_ERROR(abt_errno);
333 *overhead = sum / iter;
347 int ABTI_timer_create(ABTI_timer **pp_newtimer)
355 ABTI_timer *p_newtimer = (ABTI_timer *)malloc(
sizeof(ABTI_timer));
358 *pp_newtimer = p_newtimer;
int ABT_timer_stop(ABT_timer timer)
Stop the timer.
int ABT_timer_stop_and_add(ABT_timer timer, double *secs)
Stop the timer and add the elapsed time of the timer.
int ABT_timer_dup(ABT_timer timer, ABT_timer *newtimer)
Duplicate the timer.
int ABT_timer_read(ABT_timer timer, double *secs)
Read the elapsed time of the timer.
int ABT_timer_get_overhead(double *overhead)
Obtain the overhead time of using ABT_timer.
#define HANDLE_ERROR_FUNC_WITH_CODE(n)
int ABT_timer_create(ABT_timer *newtimer)
Create a new timer.
int ABT_timer_free(ABT_timer *timer)
Free the timer object.
int ABT_timer_stop_and_read(ABT_timer timer, double *secs)
Stop the timer and read the elapsed time of the timer.
int ABT_timer_start(ABT_timer timer)
Start the timer.
double ABT_get_wtime(void)
Get elapsed wall clock time.
struct ABT_timer_opaque * ABT_timer