Blame man/man3/PAPI_read_counters.3

Packit 577717
.TH "PAPI_read_counters" 3 "Mon Dec 18 2017" "Version 5.6.0.0" "PAPI" \" -*- nroff -*-
Packit 577717
.ad l
Packit 577717
.nh
Packit 577717
.SH NAME
Packit 577717
PAPI_read_counters \- 
Packit 577717
.PP
Packit 577717
Read and reset counters\&.  
Packit 577717
Packit 577717
.SH SYNOPSIS
Packit 577717
.br
Packit 577717
.PP
Packit 577717
.SH "Detailed Description"
Packit 577717
.PP 
Packit 577717
Packit 577717
.PP
Packit 577717
.nf
Packit 577717
@par C Interface:
Packit 577717
\#include <papi.h> @n
Packit 577717
int PAPI_read_counters( long long *values, int array_len );
Packit 577717
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
.PP
Packit 577717
\fBParameters:\fP
Packit 577717
.RS 4
Packit 577717
\fI*values\fP an array to hold the counter values of the counting events 
Packit 577717
.br
Packit 577717
\fIarry_len\fP the number of items in the *events array
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBPrecondition:\fP
Packit 577717
.RS 4
Packit 577717
These calls assume an initialized PAPI library and a properly added event set\&.
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBPostcondition:\fP
Packit 577717
.RS 4
Packit 577717
The counters are reset and left running after the call\&.
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBReturn values:\fP
Packit 577717
.RS 4
Packit 577717
\fIPAPI_EINVAL\fP One or more of the arguments is invalid\&. 
Packit 577717
.br
Packit 577717
\fIPAPI_ESYS\fP A system or C library call failed inside PAPI, see the errno variable\&.
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBPAPI_read_counters()\fP copies the event counters into the array *values\&.
Packit 577717
.PP
Packit 577717
.PP
Packit 577717
.nf
Packit 577717
do_100events();
Packit 577717
if ( PAPI_read_counters( values, num_hwcntrs ) != PAPI_OK )
Packit 577717
    handlw_error(1);
Packit 577717
// values[0] now equals 100 
Packit 577717
do_100events();
Packit 577717
if ( PAPI_accum_counters( values, num_hwcntrs ) != PAPI_OK )
Packit 577717
    handle_error(1);
Packit 577717
// values[0] now equals 200
Packit 577717
values[0] = -100;
Packit 577717
do_100events();
Packit 577717
if ( PAPI_accum_counters(values, num_hwcntrs ) != PAPI_OK )
Packit 577717
    handle_error();
Packit 577717
// values[0] now equals 0
Packit 577717
 *  
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
.PP
Packit 577717
\fBSee Also:\fP
Packit 577717
.RS 4
Packit 577717
\fBPAPI_set_opt()\fP \fBPAPI_start_counters()\fP
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBFortran Interface:\fP
Packit 577717
.RS 4
Packit 577717
#include 'fpapi\&.h' 
Packit 577717
.br
Packit 577717
 PAPIF_read_counters( C_LONG_LONG(*) values, C_INT array_len, C_INT check )
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBSee Also:\fP
Packit 577717
.RS 4
Packit 577717
\fBPAPI_read_counters\fP 
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
Packit 577717
Packit 577717
.SH "Author"
Packit 577717
.PP 
Packit 577717
Generated automatically by Doxygen for PAPI from the source code\&.