Skip to content

Commit

Permalink
Update benchmark plots for grid halo and FFT
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Jul 27, 2023
1 parent 361d6e3 commit 5a15d4c
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions benchmark/plot/Cabana_BenchmarkPlotUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ def __init__(self, description, line, n, size):
#self.description.params.append(results[1])
self.description.params.append(str(n))

# Single Cajita result (single line in results file).
class DataPointCajita(DataPoint):
def __init__(self, description, line):
self.description = description

#rank grid_size_per_dim min max ave
self.line = line
results = line.split()
self.num_rank = int(results[0])
self.size = int(float(results[1]))
self._initTimeResults(results[2:])

# Single p2g/g2p result (single line in results file).
class DataPointInterpolation(DataPoint):
# Purposely not calling base __init__
Expand Down Expand Up @@ -214,6 +226,31 @@ def _readFile(self, filename):
else:
l += 1

# All MPI performance results from multiple files.
class AllDataCajita(AllData):
def _endOfFile(self, l):
return l > self.total

def _readFile(self, filename):
with open(filename) as f:
txt = f.readlines()

l = 7
self.total = len(txt)-1
while not self._endOfFile(l):
if self._emptyLine(txt[l]):
l += 1
description = DataDescription(txt[l])
elif self._headerLine(txt[l]):
l += 1
n = 0
while not self._endOfFile(l) and not self._emptyLine(txt[l]):
self.results.append(DataPointCajita(description, txt[l]))
l += 1
n += 1
else:
l += 1

# All p2g/g2p performance results from multiple files.
class AllDataInterpolation(AllData):
def _getDescription(self, line):
Expand Down Expand Up @@ -245,8 +282,8 @@ def getData(filelist):
txt = f.read()
if "Cabana Comm" in txt:
return AllDataMPI(filelist)
elif "Cajita Halo" in txt:
return AllDataMPI(filelist, grid=True)
elif "Cajita Halo" in txt or "Cajita FFT" in txt:
return AllDataCajita(filelist, grid=True)
elif "g2p" in txt:
return AllDataInterpolation(filelist, grid=True)

Expand Down

0 comments on commit 5a15d4c

Please sign in to comment.