Commit 8db3f031 authored by Martin Khannouz's avatar Martin Khannouz Committed by Berenger Bramas

Change post traiting script.

Script to generate only gantt chart.
Add speed plot (not speedup).
parent 3923da97
......@@ -185,6 +185,8 @@ gen_gantt <- function(dbfile)
data <- gen_gantt_grab_data(tmp_df)
gen_gantt_plot(data, all_model[mod], all_algorithm[alg], all_nnode[nno], all_npart[npa])
gen_simple_gantt_plot(data, all_model[mod], all_algorithm[alg], all_nnode[nno], all_npart[npa])
#rm(data)
#gc()
}
}
}
......
#!/bin/bash
convert_to_csv()
{
#stop_mark=`grep "stop_profiling" $1 | cut -f 2`
#start_mark=`grep "start_profiling" $1 | cut -f 2`
grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\|9\)\>\)\)' $1 > start.trace
grep -e '^\(\(%\)\|\(\(0\|1\|2\|3\|4\|5\|6\|7\|9\|18\|19\)\>\)\)' -v $1 > end.trace
sort -s -V --key=2,2 end.trace > endSorted.trace
cat start.trace endSorted.trace > outputSorted.trace
egrep -v "[[:digit:]]_t(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24)[[:space:]]" outputSorted.trace > sorted.trace
#echo "$start_mark - $stop_mark"
# Converting to .csv
#pj_dump --start=$start_mark --end=$stop_mark -n -u outputSorted.trace > $2
pj_dump -n -u sorted.trace > $2
# Keeping only the states
#perl -i -ne 'print if /^State/' $2
# Delete temporary files
rm outputSorted.trace start.trace end.trace endSorted.trace sorted.trace
# Adding a header manually
sed -i '1s/^/Nature, ResourceId, Type, Start, End, Duration, Depth, Value, Footprint, JobId, Params, Size, Tag\n/' $2
}
directory=$1
cd $directory
list_fxt_file=`ls fxt`
args=""
gantt_args=""
for j in $list_fxt_file; do
args="$args fxt/$j"
done
#Aggregate trace
starpu_fxt_tool -i $args
echo "Generate CSV ..."
convert_to_csv paje.trace paje.csv
cd ..
mkdir only_gantt 2>/dev/null
mkdir only_gantt/output 2>/dev/null
cd only_gantt
#Run a python script
echo "Run python ..."
../loutre.py -t ../$directory/trace.rec -i ../$directory/stdout -g gantt_only.db -o tmp.db
count=$(($count+1))
rm -f tmp.db
Rscript ../only_gantt.R
rm gantt_only.db
library(plyr)
library(ggplot2)
library(scales)
gen_speed_plot <- function(d, model_wanted)
{
d <- subset(d, model == model_wanted)
g <- ggplot(data=d,aes_string(x="nnode", y="global_time", color="algo"))
g <- g + geom_line()
g <- g + facet_wrap(npart ~ height, scales="free",
labeller = labeller(npart = as_labeller(npart_labeller),
height = as_labeller(height_labeller),
.default=label_both,
.multi_line=FALSE))
# Set our own colors, linetypes and point shapes.
g <- g + scale_color_manual(name="Algorithm",
breaks=get_breaks_runtime(),
labels=get_labels_runtime(),
values=get_colors_runtime())
# Set X/Y labels.
g <- g + xlab("Number of nodes")
g <- g + ylab("Speed")
# Save generated plot.
output <- paste(get_output_directory(), "/", model_wanted, "-speed.pdf", sep="")
ggsave(output, g, width=29.7, height=21, units=c("cm"), device=cairo_pdf)
}
gen_speed <- function(dbfile)
{
data <- get_data_subset(dbfile, 0L, 0L, "False")
data <- subset(data, algo != get_one_node_reference_algorithm())
all_model <- unique(data$model)
for (i in 1:length(all_model))
{
gen_speed_plot(data, all_model[i])
}
}
......@@ -15,8 +15,6 @@ print("Generate Communication volume plot")
gen_comm("loutre.db")
print("Generate Speed plot")
gen_speed("loutre.db")
print("Generate Parrallel efficiency plot")
gen_pareff("loutre.db")
print("Generate times task plot")
gen_times_taskdep("loutre.db")
print("Generate Gantt")
......@@ -25,5 +23,7 @@ print("Generate Efficiency plot")
gen_efficiencies("loutre.db")
print("Generate Normalized time plot")
gen_normalized_time("loutre.db")
print("Generate Parrallel efficiency plot")
gen_pareff("loutre.db")
print("Generate Speedup plot")
gen_speedup("loutre.db")
......@@ -197,6 +197,7 @@ def generate_gantt(config, gantt_filename, initial_dir):
stdout, stderr = proc.communicate()
line = stdout.decode().splitlines()[0].split(" ")[0]
if int(line) <= 2:
print("There is too m few line in " + csv_paje_filename)
return
#Get start profiling time
......@@ -234,12 +235,13 @@ def main():
trace_filename="trace.rec"
output_filename="loutre.db"
gantt_database=""
only_gantt=False
long_opts = ["help",
"trace-file=",
"output-trace-file=",
"gantt-database=",
"output-file="]
"output-file=",
"only-gantt"]
opts, args = getopt.getopt(sys.argv[1:], "ht:i:o:g:", long_opts)
for o, a in opts:
......@@ -255,6 +257,8 @@ def main():
output_filename = str(a)
elif o in ("-g", "--gantt-database"):
gantt_database = str(a)
elif o in ("--only-gantt"):
only_gantt = True
else:
assert False, "unhandled option"
......@@ -312,28 +316,29 @@ def main():
if(gantt_database != ""):
generate_gantt(config, gantt_database, os.path.dirname(trace_filename))
print("Generating time ...")
if (os.path.isfile(trace_filename)): #Time in milli
runtime_time, task_time, idle_time, scheduling_time, communication_time = get_times_from_trace_file(trace_filename)
else:
print("File doesn't exist " + trace_filename)
if not only_gantt:
print("Generating time ...")
if (os.path.isfile(trace_filename)): #Time in milli
runtime_time, task_time, idle_time, scheduling_time, communication_time = get_times_from_trace_file(trace_filename)
else:
print("File doesn't exist " + trace_filename)
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))
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')
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,
float(runtime_time),
float(task_time),
float(idle_time),
float(scheduling_time),
float(communication_time),
float(communication_vol),
int(rmem)))
# Write a record to the output file.
output_file.write(config.gen_record(global_time,
float(runtime_time),
float(task_time),
float(idle_time),
float(scheduling_time),
float(communication_time),
float(communication_vol),
int(rmem)))
main()
source("../common.R")
source("../gen_gantt.R")
gen_gantt("gantt_only.db")
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