PAPI 7.1.0.0
Loading...
Searching...
No Matches
PAPI_mix_ll_rate.c File Reference
Include dependency graph for PAPI_mix_ll_rate.c:

Go to the source code of this file.

Macros

#define THRESHOLD   10000
 
#define ERROR_RETURN(retval)   { fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); }
 

Functions

int your_slow_code ()
 
int main ()
 

Macro Definition Documentation

◆ ERROR_RETURN

#define ERROR_RETURN (   retval)    { fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); }

Definition at line 15 of file PAPI_mix_ll_rate.c.

◆ THRESHOLD

#define THRESHOLD   10000

Definition at line 14 of file PAPI_mix_ll_rate.c.

Function Documentation

◆ main()

int main ( )

Definition at line 19 of file PAPI_mix_ll_rate.c.

20{
21 float real_time, proc_time, ipc;
22 long long ins;
23 int retval;
24 int EventSet = PAPI_NULL;
26
27 if ( (retval = PAPI_ipc(&real_time, &proc_time, &ins ,&ipc)) < PAPI_OK )
29
31
32 if ( (retval = PAPI_ipc( &real_time, &proc_time, &ins, &ipc)) < PAPI_OK )
34
35 printf("Results from PAPI_ipc:\n");
36 printf("Real_time: %f Proc_time: %f Instructions: %lld IPC: %f\n",
37 real_time, proc_time,ins,ipc);
38
39 if ( (retval = PAPI_rate_stop()) < PAPI_OK )
41
42 /* get IPC using low-level API */
45
50
51 if ( (retval = PAPI_start(EventSet)) < PAPI_OK )
53
55
58
59 ipc = (float) ((float)values[0] / (float) ( values[1]));
60
61 printf("Results from the low-level API:\n");
62 printf("IPC: %f\n", ipc);
63
64 exit(0);
65}
#define ERROR_RETURN(retval)
int your_slow_code()
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
Simplified call to get instructions per cycle, real and processor time.
Stop a running event set of a rate function.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
#define PAPI_TOT_CYC
Definition: f90papi.h:308
#define PAPI_TOT_INS
Definition: f90papi.h:317
static int EventSet
Definition: init_fini.c:8
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
#define long_long
Definition: papi.h:559
int retval
Definition: zero_fork.c:53
Here is the call graph for this function:

◆ your_slow_code()

int your_slow_code ( )

Definition at line 67 of file PAPI_mix_ll_rate.c.

68{
69 int i;
70 double tmp=1.1;
71
72 for(i=1; i<2000; i++)
73 {
74 tmp=(tmp+100)/i;
75 }
76 return 0;
77}
double tmp
int i
Here is the caller graph for this function: