NAME

PAPI_stop_counters - PAPI High Level: stop counting hardware events

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Examples
Authors
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

int PAPI_stop_counters(long_long *values, int array_len); 

Fortran Interface

PAPIF_stop_counters(C_LONG_LONG(*) values, C_INT array_len, C_INT check) 

#include fpapi.h 

DESCRIPTION

PAPI_stop_counters()

This function stops the counters and returns their values. The counters must have been started by a previous call to PAPI_start_counters().

ARGUMENTS

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

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

RETURN VALUES

On success, this function returns PAPI_OK.
On error, a non-zero error code is returned.

ERRORS

PAPI_EINVAL
  One or more of the arguments is invalid.
PAPI_ENOTRUN
  The eventset is not started yet.

EXAMPLES


  int Events[2] = { PAPI_TOT_CYC, PAPI_TOT_INS };
  long_long values[2];
  int num_hwcntrs = 0;
        
  if ((num_hwcntrs = PAPI_num_counters()) < PAPI_OK)
    handle_error(1);

if (num_hwcntrs > 2) num_hwcntrs = 2;

/* Start counting events */

if (PAPI_start_counters(Events, num_hwcntrs) != PAPI_OK) handle_error(1);

your_slow_code();

/* Stop counting events */

if (PAPI_stop_counters(values, num_hwcntrs) != PAPI_OK) handle_error(1);

AUTHORS

The PAPI Team. See them at the PAPI Web Site: http://icl.cs.utk.edu/projects/papi

BUGS

This function has no known bugs.

SEE ALSO

PAPI_num_counters (3), PAPI_start_counters (3), PAPI_read_counters (3)


PAPI Programmer’s Reference PAPI_stop_counters (3) November, 2003

  Innovative Computing Laboratory
2001 R&D Winner  
Contact PAPI: papi@cs.utk.edu Computer Science Department
  University of Tennessee