PAPI3:PAPI stop counters.3
From PAPIDocs
Jump to: navigation, search


Contents

NAME

  • PAPI_stop_counters - PAPI High Level: stop counting hardware events and reset values to zero

Synopsis

C Interface

#include <papi.h>
int PAPI_stop_counters( long long * values, int  array_len );

Fortran Interface

#include "fpapi.h"
PAPIF_stop_counters( C_LONG_LONG(*)  values,  C_INT  array_len,  C_INT  check )

Description

The PAPI_stop_counters() function stops the counters and copies the counts into the *values array. The counters must have been started by a previous call to PAPI_start_counters(). After this function is called, the values are reset to zero.

Arguments

*values -- an array where to put the counter values

array_len -- the number of items in the *values array

Errors

PAPI_EINVAL One or more of the arguments is invalid.

PAPI_ENOTRUN The EventSet is not started yet.

PAPI_ENOEVST The EventSet has not been added yet.

Examples

int Events[2] = { PAPI_TOT_CYC, PAPI_TOT_INS };
long_long values[2];
/* Start counting events */
if (PAPI_start_counters(Events, 2) != PAPI_OK)
  handle_error(1);
your_slow_code();
/* Stop counting events */
if (PAPI_stop_counters(values, 2) != PAPI_OK)
  handle_error(1);

Bugs

This function has no known bugs.

See Also

PAPI_read_counters(3), PAPI(3), PAPIF(3), PAPI_start_counters(3), PAPI_set_opt(3)