PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PAPI_flops.c File Reference
Include dependency graph for PAPI_flops.c:

Go to the source code of this file.

Functions

 main ()
 
int your_slow_code ()
 

Function Documentation

main ( )

Definition at line 23 of file PAPI_flops.c.

24 {
25  float real_time, proc_time,mflops;
26  long long flpops;
27  float ireal_time, iproc_time, imflops;
28  long long iflpops;
29  int retval;
30 
31  /***********************************************************************
32  * if PAPI_FP_OPS is a derived event in your platform, then your *
33  * platform must have at least three counters to support PAPI_flops, *
34  * because PAPI needs one counter to cycles. So in UltraSparcIII, even *
35  * the platform supports PAPI_FP_OPS, but UltraSparcIII only has two *
36  * available hardware counters and PAPI_FP_OPS is a derived event in *
37  * this platform, so PAPI_flops returns an error. *
38  ***********************************************************************/
39  if((retval=PAPI_flops(&ireal_time,&iproc_time,&iflpops,&imflops)) < PAPI_OK)
40  {
41  printf("Could not initialise PAPI_flops \n");
42  printf("Your platform may not support floating point operation event.\n");
43  printf("retval: %d\n", retval);
44  exit(1);
45  }
46 
48 
49 
50  if((retval=PAPI_flops( &real_time, &proc_time, &flpops, &mflops))<PAPI_OK)
51  {
52  printf("retval: %d\n", retval);
53  exit(1);
54  }
55 
56 
57  printf("Real_time: %f Proc_time: %f Total flpops: %lld MFLOPS: %f\n",
58  real_time, proc_time,flpops,mflops);
59 
60  exit(0);
61 }
int PAPI_flops(float *rtime, float *ptime, long long *flpops, float *mflops)
Definition: papi_hl.c:259
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
int your_slow_code()
Definition: PAPI_flips.c:63
ssize_t retval
Definition: libasync.c:338
void exit()

Here is the call graph for this function:

int your_slow_code ( )

Definition at line 63 of file PAPI_flops.c.

64 {
65  int i;
66  double tmp=1.1;
67 
68  for(i=1; i<2000; i++)
69  {
70  tmp=(tmp+100)/i;
71  }
72  return 0;
73 }
int i
Definition: fileop.c:140
long long tmp
Definition: iozone.c:12031