OmniSciDB  5ade3759e0
analyze-benchmark.BenchmarkLoader Class Reference

Public Member Functions

def __init__ (self, dir_name, filename_list)
 
def load (self, bench_filename)
 
def getFrontAttribute (self, attribute)
 
def getExistingDataRunLabel (self)
 
def getGpuName (self)
 
def getRunTableName (self)
 
def fetchAttribute (self, attribute, query_names)
 
def fetchQueryNames (self)
 

Public Attributes

 dir_name
 
 filename_list
 
 data
 

Detailed Description

Definition at line 10 of file analyze-benchmark.py.

Constructor & Destructor Documentation

◆ __init__()

def analyze-benchmark.BenchmarkLoader.__init__ (   self,
  dir_name,
  filename_list 
)

Definition at line 11 of file analyze-benchmark.py.

11  def __init__(self, dir_name, filename_list):
12  self.dir_name = dir_name
13  self.filename_list = filename_list
14  self.data = []
15 

Member Function Documentation

◆ fetchAttribute()

def analyze-benchmark.BenchmarkLoader.fetchAttribute (   self,
  attribute,
  query_names 
)

Definition at line 42 of file analyze-benchmark.py.

References analyze-benchmark.BenchmarkLoader.data.

42  def fetchAttribute(self, attribute, query_names):
43  result = []
44  for query in query_names:
45  for experiment in self.data:
46  assert attribute in experiment["results"], (
47  attribute + " is not a valid attribute."
48  )
49  if query == experiment["results"]["query_id"]:
50  result.append(experiment["results"][attribute])
51  break
52  return result
53 

◆ fetchQueryNames()

def analyze-benchmark.BenchmarkLoader.fetchQueryNames (   self)

Definition at line 54 of file analyze-benchmark.py.

References analyze-benchmark.BenchmarkLoader.data.

54  def fetchQueryNames(self):
55  result = []
56  for experiment in self.data:
57  result.append(experiment["results"]["query_id"])
58  return result
59 
60 

◆ getExistingDataRunLabel()

def analyze-benchmark.BenchmarkLoader.getExistingDataRunLabel (   self)

Definition at line 32 of file analyze-benchmark.py.

References analyze-benchmark.BenchmarkLoader.getFrontAttribute().

32  def getExistingDataRunLabel(self):
33  return self.getFrontAttribute("run_label")
34 
+ Here is the call graph for this function:

◆ getFrontAttribute()

def analyze-benchmark.BenchmarkLoader.getFrontAttribute (   self,
  attribute 
)

Definition at line 26 of file analyze-benchmark.py.

References analyze-benchmark.BenchmarkLoader.data.

Referenced by analyze-benchmark.BenchmarkLoader.getExistingDataRunLabel(), analyze-benchmark.BenchmarkLoader.getGpuName(), and analyze-benchmark.BenchmarkLoader.getRunTableName().

26  def getFrontAttribute(self, attribute):
27  if self.data:
28  return self.data[0]["results"][attribute]
29  else:
30  return "None"
31 
+ Here is the caller graph for this function:

◆ getGpuName()

def analyze-benchmark.BenchmarkLoader.getGpuName (   self)

Definition at line 35 of file analyze-benchmark.py.

References analyze-benchmark.BenchmarkLoader.getFrontAttribute().

35  def getGpuName(self):
36  return self.getFrontAttribute("run_gpu_name")
37 
+ Here is the call graph for this function:

◆ getRunTableName()

def analyze-benchmark.BenchmarkLoader.getRunTableName (   self)

Definition at line 38 of file analyze-benchmark.py.

References analyze-benchmark.BenchmarkLoader.getFrontAttribute().

38  def getRunTableName(self):
39  return self.getFrontAttribute("run_table")
40 
+ Here is the call graph for this function:

◆ load()

def analyze-benchmark.BenchmarkLoader.load (   self,
  bench_filename 
)

Definition at line 17 of file analyze-benchmark.py.

References analyze-benchmark.BenchmarkLoader.data, analyze-benchmark.BenchmarkLoader.dir_name, analyze-benchmark.BenchmarkLoader.filename_list, and File_Namespace.open().

17  def load(self, bench_filename):
18  assert bench_filename in self.filename_list
19 
20  with open(self.dir_name + bench_filename) as json_file:
21  self.data = sorted(
22  json.load(json_file),
23  key=lambda experiment: experiment["results"]["query_id"],
24  )
25 
FILE * open(int fileId)
Opens/creates the file with the given id; returns NULL on error.
Definition: File.cpp:83
+ Here is the call graph for this function:

Member Data Documentation

◆ data

◆ dir_name

analyze-benchmark.BenchmarkLoader.dir_name

Definition at line 12 of file analyze-benchmark.py.

Referenced by analyze-benchmark.BenchmarkLoader.load().

◆ filename_list

analyze-benchmark.BenchmarkLoader.filename_list

Definition at line 13 of file analyze-benchmark.py.

Referenced by analyze-benchmark.BenchmarkLoader.load().


The documentation for this class was generated from the following file: