Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 1e8623ca authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas
Browse files

Update script to generate graphics

parent af736687
No related branches found
No related tags found
No related merge requests found
......@@ -34,18 +34,19 @@ get_data_subset <- function(f, n, h, p)
# OMP Compiler/runtime breaks, colors...
get_breaks_runtime <- function()
{
return (c('implicit', 'explicit'))
return (c('implicit', 'explicit', 'implicit limited'))
}
get_labels_runtime <- function()
{
return (c('Implicit', 'Explicit'))
return (c('Implicit', 'Explicit', 'Implicit Limited'))
}
get_colors_runtime <- function()
{
return (c('implicit' = "#266d83",
'explicit' = "#e20025"))
'explicit' = "#e20025",
'implicit limited' = "#bd02b6"))
}
# Scheme breaks, colors ...
......
library(plyr)
library(reshape)
library(ggplot2)
library(plyr)
gen_efficiencies_plot <- function(output, data)
{
......
......@@ -140,7 +140,7 @@ gen_gantt_plot <- function(data, model, algo, nnode, npart)
g <- g + scale_color_brewer(palette="Set1")
g <- g + facet_wrap(~Origin, ncol=1, scales="free_y")
g <- g + scale_y_discrete(breaks=NULL)
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
ggsave(output, g, width=29.7, height=42, units=c("cm"), device=cairo_pdf)
}
gen_gantt_grab_data <- function(df)
{
......
......@@ -35,9 +35,6 @@ gen_speedup_taskdep_plot <- function(d, model_wanted)
g <- g + xlab("Number of nodes")
g <- g + ylab("Speedup")
# Set y-axis range
#g <- g + ylim(ylimits)
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-speedup.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
......
......@@ -6,14 +6,24 @@ source("gen_parallel_efficiency_plots.R")
source("gen_normalized_time_plots.R")
source("gen_comm.R")
source("gen_gantt.R")
source("gen_speed_plots.R")
###
# Generate display of bars with the time spent in Task, Runtime and Idle.
###
gen_times_taskdep("loutre.db")
gen_efficiencies("loutre.db")
print("Generate Communication volume plot")
gen_comm("loutre.db")
gen_speedup("loutre.db")
print("Generate Speed plot")
gen_speed("loutre.db")
print("Generate Parrallel efficiency plot")
gen_pareff("loutre.db")
gen_normalized_time("loutre.db")
print("Generate times task plot")
gen_times_taskdep("loutre.db")
print("Generate Gantt")
gen_gantt("canard.db")
print("Generate Efficiency plot")
gen_efficiencies("loutre.db")
print("Generate Normalized time plot")
gen_normalized_time("loutre.db")
print("Generate Speedup plot")
gen_speedup("loutre.db")
......@@ -153,26 +153,30 @@ def get_times_from_trace_file(filename):
if arr[0] == "Name":
continue
if len(arr) >= 4:
value = float(arr[3])
if value < 0:
print("\033[31mError negative " + arr[2] + ":" + arr[0] + " -> " + arr[3] + "\033[39m")
value = math.fabs(value)
if arr[2] == "Runtime":
if arr[0] == "Scheduling":
scheduling_time += float(arr[3])
scheduling_time += value
else:
runtime_time += float(arr[3])
runtime_time += value
elif arr[2] == "Task":
task_time += float(arr[3])
task_time += value
elif arr[2] == "Other":
idle_time += float(arr[3])
idle_time += value
elif arr[2] == "MPI":
communication_time += float(arr[3])
communication_time += value
elif arr[2] == "User":
if arr[0] == "Decoding task for MPI":
communication_time += float(arr[3])
communication_time += value
elif arr[0] == "Preparing task for MPI":
communication_time += float(arr[3])
communication_time += value
elif arr[0] == "Post-processing task for MPI":
communication_time += float(arr[3])
communication_time += value
else:
runtime_time += float(arr[3])
runtime_time += value
else:
print("Error type " + arr[2])
# sys.exit("Invalid time!")
......@@ -186,6 +190,14 @@ def generate_gantt(config, gantt_filename, initial_dir):
gantt_file.write(config.gen_header_gantt())
csv_paje_filename = initial_dir + "/paje.csv"
simple_paje_filename = initial_dir + "/paje.trace"
if not os.path.exists(csv_paje_filename):
return
proc = subprocess.Popen(['wc', '-l', csv_paje_filename], stdout=subprocess.PIPE)
stdout, stderr = proc.communicate()
line = stdout.decode().splitlines()[0].split(" ")[0]
if int(line) <= 2:
return
#Get start profiling time
cmd = "grep start_profiling " + simple_paje_filename
......@@ -306,12 +318,13 @@ def main():
else:
print("File doesn't exist " + trace_filename)
sum_time = (runtime_time + task_time + scheduling_time + communication_time)/(config.num_nodes*config.num_threads)
sum_time = (runtime_time + task_time + scheduling_time + communication_time + idle_time)/(config.num_nodes*config.num_threads)
diff_time = float('%.2f'%(abs(global_time-sum_time)/global_time))
if diff_time > 0.01:
print('\033[31m/!\\Timing Error of ' + str(diff_time) + '\033[39m')
print('\033[31m Global ' + str(global_time) + ' Sum ' + str(sum_time) + '\033[39m')
print('\033[31m Nodes number ' + str(config.num_nodes) + ' CPU ' + str(config.num_threads) + '\033[39m')
# Write a record to the output file.
output_file.write(config.gen_record(global_time,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment