Skip to content

Commit

Permalink
Benchmark plot labels particles per rank
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Oct 16, 2023
1 parent 23a1ffc commit dd2bf9c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions benchmark/plot/Cabana_BenchmarkPlotUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def __init__(self, description, line):

# All performance results from multiple files.
class AllData:
mpi = False

def __init__(self, filelist, grid=False):
self.grid = grid
self.results = []
Expand Down Expand Up @@ -213,6 +215,8 @@ def getAllCategories(self):

# All MPI performance results from multiple files.
class AllDataMPI(AllData):
mpi = True

def _endOfFile(self, l):
return l >= self.total

Expand All @@ -239,6 +243,8 @@ def _readFile(self, filename):

# All MPI performance results from multiple files.
class AllDataGrid(AllData):
mpi = True

def _endOfFile(self, l):
return l > self.total

Expand All @@ -264,6 +270,8 @@ def _readFile(self, filename):

# All p2g/g2p performance results from multiple files.
class AllDataInterpolation(AllData):
mpi = True

def _getDescription(self, line):
return DataDescriptionInterpolation(line)

Expand Down Expand Up @@ -381,8 +389,11 @@ def createPlot(fig, ax, data: AllData, speedup=False, backend_label=True, cpu_na
ax.set_ylabel("Speedup")
else:
ax.set_ylabel("Time (seconds)")
if data.grid:
ax.set_xlabel("Number of grid points")

if data.grid: # Always uses MPI
ax.set_xlabel("Number of grid points per rank")
elif data.mpi:
ax.set_xlabel("Number of particles per rank")
else:
ax.set_xlabel("Number of particles")

Expand Down

0 comments on commit dd2bf9c

Please sign in to comment.