Add plot scripts
This commit is contained in:
parent
c6c0279d24
commit
1ca63adaee
21
plot/convergence.py
Normal file
21
plot/convergence.py
Normal file
@ -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")
|
||||||
|
|
27
plot/readywave-cmp-ovni.R
Normal file
27
plot/readywave-cmp-ovni.R
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user