PAPI_set_granularity - Online Linux Manual PageSection : 3
Updated : April, 2007
Source : PAPI Programmer's Reference
Note : PAPI

NAME
 PAPI_set_granularity − set the default counting granularity for eventsets bound to the cpu component
 PAPI_set_cmp_granularity − set the default counting granularity for eventsets bound to the specified component

SYNOPSISC Interface #include <papi.h> int PAPI_set_granularity(int granularity); int PAPI_set_cmp_granularity(int granularity, int cidx");Fortran Interface #include "fpapi.h" PAPIF_set_granularity(C_INT granularity, C_INT check)

DESCRIPTIONPAPI_set_granularity" sets the default counting granularity for all new event sets created by "PAPI_create_eventset(3). This call implicitly sets the granularity for the cpu component (component 0) and is included to preserve backward compatibility. PAPI_set_cmp_granularity" sets the default counting granularity for all new event sets,
 and requires an explicit component argument.
 Event sets that are already in existence are not affected. To change the granularity of an existing event set, please see the "PAPI_set_opt(3) man page. The reader should note that the granularity of an event set affects only the mode in which the counter continues to run.

ARGUMENTScidx -- An integer identifier for a component. By convention, component 0 is always the cpu component. granularity" -- one of the following constants as defined in the papi.h header file: PAPI_GRN_THRCount each individual thread PAPI_GRN_PROCCount each individual process PAPI_GRN_PROCGCount each individual process group PAPI_GRN_SYSCount the current CPU PAPI_GRN_SYS_CPUCount all CPU's individually PAPI_GRN_MINThe finest available granularity PAPI_GRN_MAXThe coarsest available granularity

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

ERRORSPAPI_EINVAL"  One or more of the arguments is invalid. PAPI_ENOEVST"  The event set specified does not exist. PAPI_ENOCMP"  The argument cidx is not a valid component. PAPI_EISRUN"  The event set is currently counting events.

EXAMPLESint retval; /* Initialize the library */ retval = PAPI_library_init(PAPI_VER_CURRENT); if (retval > 0 && retval != PAPI_VER_CURRENT) { fprintf(stderr,"PAPI library version mismatch!\n"); exit(1); } if (retval < 0) handle_error(retval); /* Set the default granularity for the cpu component */ if ((retval = PAPI_set_cmp_granularity(PAPI_GRN_PROC,0)) != PAPI_OK) handle_error(retval); if ((retval = PAPI_create_eventset(&EventSet)) != PAPI_OK) handle_error(retval);

BUGSThis function has no known bugs.

SEE ALSOPAPI_set_domain(3), PAPI_set_opt (3), PAPI_get_opt (3)"
0
Johanes Gumabo
Data Size   :   10,367 byte
man-PAPI_set_cmp_granularity.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 170,315
Visitor ID   :     :  
Visitor IP   :   3.14.245.172   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_nr_x|149|PAPI_set_granularity.3|87|\n");| fprintf(stderr,"PAPI library version mismatch!\n"); )