From 1ca63adaeeccc7ee747f9ba76f2e7112e4120401 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 23 Jun 2023 17:15:54 +0200 Subject: [PATCH] Add plot scripts --- plot/convergence.py | 21 +++++++++++++++++++++ plot/readywave-cmp-ovni.R | 27 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 plot/convergence.py create mode 100644 plot/readywave-cmp-ovni.R diff --git a/plot/convergence.py b/plot/convergence.py new file mode 100644 index 0000000..68c3917 --- /dev/null +++ b/plot/convergence.py @@ -0,0 +1,21 @@ +import pandas as pd +import sys +import matplotlib.pyplot as plt + +#df = pd.read_csv("convergence.csv", delimiter=" ") +df_gs = pd.read_csv("gs.csv", delimiter=" ") +df_sor = pd.read_csv("sor.csv", delimiter=" ") + +fig, axes = plt.subplots() + +#df.plot(ax=axes, x="time", y="error", label="Current") +df_sor.plot(ax=axes, x="time", y="error", label="SOR", color="red") +df_gs.plot( ax=axes, x="time", y="error", label="GS", color="blue") + +plt.grid(True) +plt.title("Heat 2D steady state Gauss-Seidel vs Succesive-Over-Relaxation") +plt.ylabel("Absolute error (K)") +plt.xlabel("Time (s)") +plt.yscale("log") +plt.savefig("err.png") + diff --git a/plot/readywave-cmp-ovni.R b/plot/readywave-cmp-ovni.R new file mode 100644 index 0000000..202fb2b --- /dev/null +++ b/plot/readywave-cmp-ovni.R @@ -0,0 +1,27 @@ +library(ggplot2) +library(dplyr, warn.conflicts = FALSE) +library(scales) +library(jsonlite) +library(readr) + +# Load the arguments (argv) +args = commandArgs(trailingOnly=TRUE) + +input_file = "data/readywave-instr.csv" + +df = read_delim(input_file, delim=",", show_col_types = FALSE) %>% + mutate(instr = as.factor(instr)) + +dpi = 150 +h = 2 +w = 7 + +# --------------------------------------------------------------------- + +p = ggplot(df, aes(time_ms, fill=instr)) + + geom_histogram(color="white", bins=50) + + #theme_bw() + + labs(x = "Time (ms)", title="bench6.readywave -r 100 -t 5000 -w 10") + # TODO: Add ntasks and taskwork to labels + +ggsave(sprintf("%s.png", input_file), plot=p, width=w, height=h, dpi=dpi)