OmniSciDB  f632821e96
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 48 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.data.

48  def fetchAttribute(self, attribute, query_names):
49  result = []
50  for query in query_names:
51  for experiment in self.data:
52  assert attribute in experiment["results"], (
53  attribute + " is not a valid attribute."
54  )
55  if query == experiment["results"]["query_id"]:
56  result.append(experiment["results"][attribute])
57  break
58  return result
59 

◆ fetchQueryNames()

def analyze_benchmark.BenchmarkLoader.fetchQueryNames (   self)

Definition at line 60 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.data.

60  def fetchQueryNames(self):
61  result = []
62  for experiment in self.data:
63  result.append(experiment["results"]["query_id"])
64  return result
65 
66 

◆ getExistingDataRunLabel()

def analyze_benchmark.BenchmarkLoader.getExistingDataRunLabel (   self)

Definition at line 38 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.getFrontAttribute().

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

◆ getFrontAttribute()

def analyze_benchmark.BenchmarkLoader.getFrontAttribute (   self,
  attribute 
)

Definition at line 32 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().

32  def getFrontAttribute(self, attribute):
33  if self.data:
34  return self.data[0]["results"][attribute]
35  else:
36  return "None"
37 
+ Here is the caller graph for this function:

◆ getGpuName()

def analyze_benchmark.BenchmarkLoader.getGpuName (   self)

Definition at line 41 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.getFrontAttribute().

41  def getGpuName(self):
42  return self.getFrontAttribute("run_gpu_name")
43 
+ Here is the call graph for this function:

◆ getRunTableName()

def analyze_benchmark.BenchmarkLoader.getRunTableName (   self)

Definition at line 44 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.getFrontAttribute().

44  def getRunTableName(self):
45  return self.getFrontAttribute("run_table")
46 
+ 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 omnisci.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  # only load those queries that were successful
22  filtered_input_data = filter(
23  lambda experiment: experiment["succeeded"] is True,
24  json.load(json_file),
25  )
26  # sort queries based on their IDs
27  self.data = sorted(
28  filtered_input_data,
29  key=lambda experiment: experiment["results"]["query_id"],
30  )
31 
int open(const char *path, int flags, int mode)
Definition: omnisci_fs.cpp:64
+ 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: