PAPI 7.1.0.0
Loading...
Searching...
No Matches
PAPI_mix_hl_rate.c File Reference
Include dependency graph for PAPI_mix_hl_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 17 of file PAPI_mix_hl_rate.c.

◆ THRESHOLD

#define THRESHOLD   10000

Definition at line 16 of file PAPI_mix_hl_rate.c.

Function Documentation

◆ main()

int main ( )

Definition at line 21 of file PAPI_mix_hl_rate.c.

22{
23 float real_time, proc_time,ipc;
24 long long ins;
25 int retval;
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("Real_time: %f Proc_time: %f Instructions: %lld IPC: %f\n",
36 real_time, proc_time,ins,ipc);
37
38
39 if ( (retval = PAPI_hl_region_begin("slow_code")) < PAPI_OK )
41
43
44 if ( (retval = PAPI_hl_region_end("slow_code")) < PAPI_OK )
46
47
48 if ( (retval = PAPI_ipc(&real_time, &proc_time, &ins ,&ipc)) < PAPI_OK )
50
52
53 if ( (retval = PAPI_ipc( &real_time, &proc_time, &ins, &ipc)) < PAPI_OK )
55
56 printf("Real_time: %f Proc_time: %f Instructions: %lld IPC: %f\n",
57 real_time, proc_time,ins,ipc);
58
59 if ( (retval = PAPI_rate_stop()) < PAPI_OK )
61
62 exit(0);
63}
#define ERROR_RETURN(retval)
int your_slow_code()
Read performance events at the beginning of a region.
Read performance events at the end of a region and store the difference to the corresponding beginnin...
Simplified call to get instructions per cycle, real and processor time.
Stop a running event set of a rate function.
#define PAPI_OK
Definition: f90papi.h:73
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 65 of file PAPI_mix_hl_rate.c.

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