Skip to content

Commit

Permalink
Merge pull request #228 from jpwhite4/nan
Browse files Browse the repository at this point in the history
Tighten up check for corrupt performance counter values.
  • Loading branch information
jpwhite4 authored Oct 9, 2020
2 parents a2d3e43 + 9a7feea commit 158d5fe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/supremm/plugins/CpuPerfCounters.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ def results(self):
if hasFlops:
results['flops'] = calculate_stats(flops)

if numpy.isnan(cpiref).any():
results['cpiref'] = {"error": ProcessingError.RAW_COUNTER_UNAVAILABLE}
else:
if numpy.isfinite(cpiref).any():
results['cpiref'] = calculate_stats(cpiref)

if (not hasCpld) or numpy.isnan(cpldref).any():
results['cpldref'] = {"error": ProcessingError.RAW_COUNTER_UNAVAILABLE}
else:
results['cpiref'] = {"error": ProcessingError.RAW_COUNTER_UNAVAILABLE}

if hasCpld and numpy.isfinite(cpldref).any():
results['cpldref'] = calculate_stats(cpldref)
else:
results['cpldref'] = {"error": ProcessingError.RAW_COUNTER_UNAVAILABLE}

results['clk_mhz'] = calculate_stats(clks)

Expand Down

0 comments on commit 158d5fe

Please sign in to comment.