Skip to content

Commit 5979020

Browse files
committed
Graph make rule
1 parent a1b2dd2 commit 5979020

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ report-check:
139139
fi ; \
140140
done ; \
141141

142+
graph:
143+
@echo "Generating graph for $(dataset)"
144+
@python src/graph.py -d $(dataset) csv csv
145+
142146
extract-medpub:
143147
@echo "--- Exporting medpub dataset ---"
144148
@cd .datasets && python extract_csv.py --offset 1 --threshold 600 --column "abstract" train.csv medpub

src/graph.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import argparse
2+
from typing import Dict
23

34
import matplotlib.pyplot as plt
45
import pandas
5-
from typing import Dict
66

77
parser = argparse.ArgumentParser(
88
description="Generate a graph with the execution times of the MPI/OMP MinHash implementations."
99
)
1010

11-
parser.add_argument(
12-
"-p", "--processes",
13-
required=True,
14-
type=int,
15-
help="Max number of processes in the csv file",
16-
)
1711
parser.add_argument(
1812
"-d", "--dataset",
1913
type=str,
@@ -36,7 +30,6 @@
3630

3731
def draw_graph(
3832
dists: Dict[str, pandas.DataFrame],
39-
4033
x_label: str,
4134
y_label: str,
4235
title: str = None,
@@ -63,7 +56,6 @@ def draw_graph(
6356
for name, df in dists.items():
6457
plt.plot(df[x_label], df[y_label], label=name, marker='o', markersize=3)
6558

66-
6759
# Add labels
6860
plt.title(title)
6961
plt.xlabel(x_label)
@@ -115,7 +107,7 @@ def get_dataframe(csv_path: str) -> pandas.DataFrame:
115107

116108
# Read the CSV files
117109
csv_paths = {
118-
lib: f"{args.in_csv_path}/time_{lib}_{args.dataset}_{args.processes}.csv"
110+
lib: f"{args.in_csv_path}/time_{lib}_{args.dataset}.csv"
119111
for lib in ["MPI", "OMP"]
120112
}
121113
data = {
@@ -124,7 +116,7 @@ def get_dataframe(csv_path: str) -> pandas.DataFrame:
124116
}
125117

126118
# Compute save path
127-
save_path = f"{args.out_png_path}/time_{args.dataset}_{args.processes}.png" if args.out_png_path else None
119+
save_path = f"{args.out_png_path}/time_{args.dataset}.svg" if args.out_png_path else None
128120

129121
# Draw a graph
130122
draw_graph(

0 commit comments

Comments
 (0)