Blame man/man3/PAPI_set_granularity.3

Packit 577717
.TH "PAPI_set_granularity" 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_set_granularity \- 
Packit 577717
.PP
Packit 577717
Set the default counting granularity for eventsets bound to the cpu component\&.  
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 Prototype:
Packit 577717
    \#include <papi.h> @n
Packit 577717
    int PAPI_set_granularity( int granularity );
Packit 577717
Packit 577717
@param -- granularity one of the following constants as defined in the papi.h header file
Packit 577717
@arg PAPI_GRN_THR   -- Count each individual thread
Packit 577717
@arg PAPI_GRN_PROC  -- Count each individual process
Packit 577717
@arg PAPI_GRN_PROCG -- Count each individual process group
Packit 577717
@arg PAPI_GRN_SYS   -- Count the current CPU
Packit 577717
@arg PAPI_GRN_SYS_CPU   -- Count all CPUs individually
Packit 577717
@arg PAPI_GRN_MIN   -- The finest available granularity
Packit 577717
@arg PAPI_GRN_MAX   -- The coarsest available granularity 
Packit 577717
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
  
Packit 577717
    
Packit 577717
.PP
Packit 577717
\fBReturn values:\fP
Packit 577717
.RS 4
Packit 577717
\fIPAPI_OK\fP 
Packit 577717
.br
Packit 577717
\fIPAPI_EINVAL\fP One or more of the arguments is invalid\&.  
Packit 577717
    
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBPAPI_set_granularity\fP sets the default counting granularity for all new event sets created by \fBPAPI_create_eventset\fP\&. This call implicitly sets the granularity for the cpu component (component 0) and is included to preserve backward compatibility\&.
Packit 577717
.PP
Packit 577717
\fBExample:\fP
Packit 577717
.RS 4
Packit 577717
Packit 577717
.PP
Packit 577717
.nf
Packit 577717
int ret;
Packit 577717
Packit 577717
// Initialize the library
Packit 577717
ret = PAPI_library_init(PAPI_VER_CURRENT);
Packit 577717
if (ret > 0 && ret != PAPI_VER_CURRENT) {
Packit 577717
  fprintf(stderr,"PAPI library version mismatch!\n");
Packit 577717
  exit(1); 
Packit 577717
}
Packit 577717
if (ret < 0) handle_error(ret);
Packit 577717
Packit 577717
// Set the default granularity for the cpu component
Packit 577717
ret = PAPI_set_granularity(PAPI_GRN_PROC);
Packit 577717
if (ret != PAPI_OK) handle_error(ret);
Packit 577717
ret = PAPI_create_eventset(&EventSet);
Packit 577717
if (ret != PAPI_OK) handle_error(ret);
Packit 577717
 *  
Packit 577717
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBSee Also:\fP
Packit 577717
.RS 4
Packit 577717
\fBPAPI_set_cmp_granularity\fP \fBPAPI_set_domain\fP \fBPAPI_set_opt\fP \fBPAPI_get_opt\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\&.