Commit 953cb49e authored by Jaime Arias's avatar Jaime Arias
Browse files

fix: add script to normalize the output of the hybrid mode

parent 27840bb5
This diff is collapsed.
......@@ -232,7 +232,7 @@ def create_log_figure(table, table_errors, model, tool_x, tool_y, show_strategy=
print(e)
# In[6]:
# In[47]:
# Experiment filters
......@@ -304,13 +304,20 @@ def compare_couvreur_strategies(experiments):
"""
return only_couvreur_strategy(experiments) and same_thread_library(experiments) and same_number_threads(experiments)
def same_distributed_number_threads(experiments):
"""Selects only experiments where the multiplication of theirs nodes with cores are the same."""
exp1, exp2 = experiments
nodes_exp1, threads_exp1 = exp1.split('_')[-2:]
nodes_exp2, threads_exp2 = exp2.split('_')[-2:]
return (int(nodes_exp1) * int(threads_exp1)) == (int(nodes_exp2) * int(threads_exp2))
def compare_tools(experiments):
"""Compares pmc-sog and pnml2lts-mc using the DFS algorithm.
It selects experiments where the tools are not the same, the exploration algorithm is DFS and
the number of processus and cores are the same.
"""
return same_number_threads(experiments) and not (same_tool(experiments, 'pmc-sog') or same_tool(experiments,'pnml2lts-mc')) and versus_dfs(experiments)
return same_distributed_number_threads(experiments) and not (same_tool(experiments, 'pmc-sog') or same_tool(experiments,'pnml2lts-mc')) and versus_dfs(experiments)
def compare_multithreading(experiments):
"""Compares the sequential and multi-core version of pmc-sog.
......@@ -320,18 +327,23 @@ def compare_multithreading(experiments):
"""
return same_tool(experiments, 'pmc-sog') and same_thread_library(experiments) and same_strategy(experiments) and versus_sequential(experiments)
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 equivalent_number_threads(experiments)
# Plots to be created
plots = {
'compare_thread_library': compare_threads_library,
'compare_couvreur_algorithm': compare_couvreur_strategies,
'compare_tools': compare_tools,
'compare_multicore': compare_multithreading
'compare_multicore': compare_multithreading,
'compare_distributed': compare_distributed
}
# # Load Data
# In[7]:
# In[9]:
# Root folder
......@@ -345,7 +357,7 @@ OUTPUT_FOLDER = os.path.join(PROJECT_FOLDER,"results", "figures")
create_folder(OUTPUT_FOLDER)
# In[8]:
# In[10]:
# read data
......@@ -358,7 +370,7 @@ df = df.drop(columns=['strategy', 'num_nodes', 'num_threads'])
df.head()
# In[9]:
# In[26]:
# ground truth for properties
......@@ -367,7 +379,7 @@ p_df =p_df[
(p_df.tool=='pnml2lts-mc') &
(p_df.strategy == 'ndfs') &
(p_df.num_nodes == 1) &
(p_df.num_threads == 1)]
(p_df.num_threads == 16)]
# only property column is needed
p_df = p_df.drop(columns=['tool', 'strategy', 'num_nodes', 'num_threads', 'time', 'error'])
......@@ -378,7 +390,7 @@ p_df.sort_index(inplace=True)
p_df.head()
# In[10]:
# In[27]:
# table with times, verification output and error for each experiment
......@@ -388,14 +400,14 @@ table.head()
# # Preprocessing of data
# In[11]:
# In[28]:
ZERO = 10e-5
TIMEOUT = 10 * 60 # 5 minutes = 300 seconds
# In[12]:
# In[29]:
# table with times for each experiment
......@@ -413,7 +425,7 @@ table_time = pd.concat([table_time, p_df], axis=1)
table_time.head()
# In[13]:
# In[30]:
# table with verification output for each experiment
......@@ -428,7 +440,7 @@ table_property = pd.concat([table_property, p_df], axis=1)
table_property.head()
# In[14]:
# In[31]:
# table with error for each experiment
......@@ -439,23 +451,23 @@ table_error.head()
# # Examples
# In[15]:
# In[32]:
fig = create_figure(df, "philo10")
fig = create_figure(df, "spool1")
fig.show()
# In[26]:
# In[34]:
fig = create_log_figure(table_time, table_error, "train12", "pmc-sog_otfP_couv99-default_1_8", "pnml2lts-mc_dfs_1_8")
fig = create_log_figure(table_time, table_error, "spool1", "pmc-sog_otfP_couv99-default_2_8", "pnml2lts-mc_dfs_1_16")
fig.show()
# # Generate Figures
# In[19]:
# In[35]:
# models
......
#!/bin/bash
for f in `find . -type f -name "*.out"`; do
sed -i 's/TIME OF CONSTRUCTION OF THE SOG/Verification duration :/' $f;
done
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