Commit 83937658 authored by Jaime Arias's avatar Jaime Arias
Browse files

fix: generations of distributed comparison figures

parent c86e473c
This diff is collapsed.
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# In[2]:
import os
......@@ -49,7 +49,7 @@ LAYOUT_FIGURES = dict(
# # Auxiliary Functions
# In[2]:
# In[3]:
def create_folder(path):
......@@ -69,7 +69,7 @@ def create_folder(path):
os.makedirs(path)
# In[3]:
# In[4]:
def create_figure(df, model):
......@@ -108,7 +108,7 @@ def create_figure(df, model):
return figure
# In[4]:
# In[21]:
def get_axis_title(experiment, show_strategy=True):
......@@ -139,7 +139,8 @@ def get_axis_title(experiment, show_strategy=True):
library_dic = {
'otfL': 'Lace',
'otfP': 'Pthreads',
'otfC': 'Cthreads'
'otfC': 'Cthreads',
'otf': 'Hybrid'
}
if (len(information) == 5):
......@@ -159,7 +160,7 @@ def get_axis_title(experiment, show_strategy=True):
return title
# In[5]:
# In[22]:
def create_log_figure(table, table_errors, model, tool_x, tool_y, show_strategy=True):
......@@ -232,7 +233,7 @@ def create_log_figure(table, table_errors, model, tool_x, tool_y, show_strategy=
print(e)
# In[47]:
# In[31]:
# Experiment filters
......@@ -327,9 +328,17 @@ def compare_multithreading(experiments):
"""
return same_tool(experiments, 'pmc-sog') and same_thread_library(experiments) and same_strategy(experiments) and versus_sequential(experiments)
def against_hybrid(experiments):
"""Selects only experiments comparing with hybrid mode"""
exp1, exp2 = experiments
library_exp1 = exp1.split('_')[1]
library_exp2 = exp2.split('_')[1]
return (library_exp1 == 'otf') or (library_exp2 == 'otf')
def compare_distributed(experiments):
"""Compares the hybrid version of pmc-sog"""
return same_tool(experiments, 'pmc-sog') and same_thread_library(experiments) and same_strategy(experiments) and same_distributed_number_threads(experiments)
return same_tool(experiments, 'pmc-sog') and same_strategy(experiments) and same_distributed_number_threads(experiments) and against_hybrid(experiments)
# Plots to be created
plots = {
......@@ -343,7 +352,7 @@ plots = {
# # Load Data
# In[9]:
# In[8]:
# Root folder
......@@ -357,7 +366,7 @@ OUTPUT_FOLDER = os.path.join(PROJECT_FOLDER,"results", "figures")
create_folder(OUTPUT_FOLDER)
# In[10]:
# In[9]:
# read data
......@@ -370,7 +379,7 @@ df = df.drop(columns=['strategy', 'num_nodes', 'num_threads'])
df.head()
# In[26]:
# In[10]:
# ground truth for properties
......@@ -390,7 +399,7 @@ p_df.sort_index(inplace=True)
p_df.head()
# In[27]:
# In[11]:
# table with times, verification output and error for each experiment
......@@ -400,14 +409,14 @@ table.head()
# # Preprocessing of data
# In[28]:
# In[12]:
ZERO = 10e-5
TIMEOUT = 10 * 60 # 5 minutes = 300 seconds
# In[29]:
# In[13]:
# table with times for each experiment
......@@ -425,7 +434,7 @@ table_time = pd.concat([table_time, p_df], axis=1)
table_time.head()
# In[30]:
# In[14]:
# table with verification output for each experiment
......@@ -440,7 +449,7 @@ table_property = pd.concat([table_property, p_df], axis=1)
table_property.head()
# In[31]:
# In[15]:
# table with error for each experiment
......@@ -451,23 +460,23 @@ table_error.head()
# # Examples
# In[32]:
# In[19]:
fig = create_figure(df, "spool1")
fig = create_figure(df, "philo10")
fig.show()
# In[34]:
# In[23]:
fig = create_log_figure(table_time, table_error, "spool1", "pmc-sog_otfP_couv99-default_2_8", "pnml2lts-mc_dfs_1_16")
fig = create_log_figure(table_time, table_error, "philo10", "pmc-sog_otf_couv99-default_2_8", "pnml2lts-mc_dfs_1_16")
fig.show()
# # Generate Figures
# In[35]:
# In[24]:
# models
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment