miniBUDE icon indicating copy to clipboard operation
miniBUDE copied to clipboard

openmp: fix FLOP/s calculation

Open milthorpe opened this issue 1 year ago • 0 comments

The GFLOP/s calculation in printTimings() for the OpenMP implementation was reporting incorrect (negative) values for large inputs, due to overflow. Computing ops_per_wg using long (rather than 32-bit) ints fixes the problem.

To test, run e.g.

./bude --deck ../data/bm2

before this change, miniBUDE reported:

...
Running C/OpenMP
- Total time:     30353.730 ms
- Average time:   3794.216 ms
- Interactions/s: 123.319 billion
- GFLOP/s:        -61.996
- GFInst/s:       3082.980

after the change, it reports:

Running C/OpenMP
- Total time:     30727.736 ms
- Average time:   3840.967 ms
- Interactions/s: 121.818 billion
- GFLOP/s:        3660.127
- GFInst/s:       3045.456

milthorpe avatar Nov 29 '22 05:11 milthorpe