Skip to content

Commit 1fc121a

Browse files
committed
plot: commit plotting scripts after submission
1 parent f24d10e commit 1fc121a

File tree

12 files changed

+338
-121
lines changed

12 files changed

+338
-121
lines changed

Diff for: tasks/elastic/plot.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
from os.path import join
66
from pandas import read_csv
77
from tasks.util.elastic import ELASTIC_PLOTS_DIR, ELASTIC_RESULTS_DIR
8-
from tasks.util.plot import SINGLE_COL_FIGSIZE, get_color_for_baseline, save_plot
8+
from tasks.util.plot import (
9+
SINGLE_COL_FIGSIZE,
10+
get_color_for_baseline,
11+
save_plot,
12+
)
913

1014

1115
def _read_results():

Diff for: tasks/lammps/run.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def wasm(ctx, w, repeats=1):
5959
)
6060
)
6161
workload_config = LAMMPS_SIM_WORKLOAD_CONFIGS[workload]
62-
data_file = basename(get_lammps_data_file(workload_config["data-file"])["data"][0])
62+
data_file = basename(
63+
get_lammps_data_file(workload_config["data-file"])["data"][0]
64+
)
6365

6466
csv_name = "lammps_granny_{}.csv".format(workload)
6567
_init_csv_file(csv_name)
@@ -109,7 +111,9 @@ def native(ctx, w, repeats=1):
109111
)
110112
)
111113
workload_config = LAMMPS_SIM_WORKLOAD_CONFIGS[workload]
112-
data_file = get_lammps_data_file(workload_config["data-file"])["data"][0]
114+
data_file = get_lammps_data_file(workload_config["data-file"])["data"][
115+
0
116+
]
113117

114118
pod_names, pod_ips = get_native_mpi_pods("lammps")
115119
assert (

Diff for: tasks/makespan/plot.py

+89-26
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,27 @@ def migration(ctx):
4545

4646
# RHS: zoom in one of the bars
4747
timeseries_num_vms = num_vms[-1]
48-
timeseries_num_tasks = num_tasks[-1]
4948

5049
results = {}
5150
for (n_vms, n_tasks) in zip(num_vms, num_tasks):
52-
results[n_vms] = read_locality_results(n_vms, n_tasks, num_cpus_per_vm, migrate=True)
51+
results[n_vms] = read_locality_results(
52+
n_vms, n_tasks, num_cpus_per_vm, migrate=True
53+
)
5354

5455
# ----------
5556
# Plot 1: aggregate idle vCPUs
5657
# ----------
5758

5859
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
5960

60-
plot_locality_results("percentage_vcpus", results, ax, num_vms, num_tasks)
61+
plot_locality_results(
62+
"percentage_vcpus",
63+
results,
64+
ax,
65+
num_vms=num_vms,
66+
num_tasks=num_tasks,
67+
migrate=True,
68+
)
6169

6270
# Manually craft the legend
6371
baselines = ["slurm", "batch", "granny", "granny-migrate"]
@@ -72,7 +80,7 @@ def migration(ctx):
7280
handles=legend_entries,
7381
loc="upper center",
7482
ncols=2,
75-
bbox_to_anchor=(0.57, 0.2),
83+
bbox_to_anchor=(0.535, 0.3),
7684
)
7785

7886
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_migrate_vcpus")
@@ -83,7 +91,14 @@ def migration(ctx):
8391

8492
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
8593

86-
plot_locality_results("percentage_xvm", results, ax, num_vms, num_tasks)
94+
plot_locality_results(
95+
"percentage_xvm",
96+
results,
97+
ax,
98+
num_vms=num_vms,
99+
num_tasks=num_tasks,
100+
migrate=True,
101+
)
87102

88103
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_migrate_xvm")
89104

@@ -94,7 +109,7 @@ def migration(ctx):
94109
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
95110

96111
plot_locality_results(
97-
"ts_vcpus", results, ax, timeseries_num_vms, timeseries_num_tasks
112+
"ts_vcpus", results, ax, num_vms=timeseries_num_vms, migrate=True
98113
)
99114

100115
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_migrate_ts_vcpus")
@@ -106,7 +121,7 @@ def migration(ctx):
106121
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
107122

108123
plot_locality_results(
109-
"ts_xvm_links", results, ax, timeseries_num_vms, timeseries_num_tasks
124+
"ts_xvm_links", results, ax, num_vms=timeseries_num_vms, migrate=True
110125
)
111126

112127
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_migrate_ts_xvm")
@@ -126,59 +141,107 @@ def locality(ctx):
126141
# num_tasks = [10, 50]
127142
# num_vms = [8]
128143
# num_tasks = [50]
129-
num_vms = [4, 8, 16]
130-
num_tasks = [10, 25, 50]
144+
num_vms = [8, 16, 24, 32]
145+
num_tasks = [25, 50, 75, 100]
131146
num_cpus_per_vm = 8
132147

133148
# RHS: zoom in one of the bars
134-
timeseries_num_vms = 32
135-
timeseries_num_tasks = 200
149+
timeseries_num_vms = num_vms[-1]
150+
timeseries_num_tasks = num_tasks[-1]
136151

137152
results = {}
138153
for (n_vms, n_tasks) in zip(num_vms, num_tasks):
139154
results[n_vms] = read_locality_results(n_vms, n_tasks, num_cpus_per_vm)
140155

141-
return
156+
# ----------
157+
# Plot 1: makespan bar plot
158+
# ----------
159+
160+
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
161+
162+
plot_locality_results(
163+
"makespan", results, ax, num_vms=num_vms, num_tasks=num_tasks
164+
)
142165

143-
fig, (ax1, ax2, ax3, ax4) = subplots(nrows=1, ncols=4, figsize=(12, 3))
166+
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_locality_makespan")
144167

145168
# ----------
146-
# Plot 1: boxplot of idle vCPUs and num xVM links for various cluster sizes
169+
# Plot 2: Aggregate vCPUs metric
147170
# ----------
148171

149-
plot_locality_results("percentage_vcpus", results, ax1, num_vms, num_tasks)
172+
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
150173

151-
plot_locality_results("percentage_xvm", results, ax2, num_vms, num_tasks)
174+
plot_locality_results(
175+
"percentage_vcpus", results, ax, num_vms=num_vms, num_tasks=num_tasks
176+
)
152177

153178
# ----------
154-
# Plot 2: (two) timeseries of one of the cluster sizes
179+
# Plot 3: Aggregate xVM metric
155180
# ----------
156181

182+
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
183+
157184
plot_locality_results(
158-
"ts_vcpus", results, ax3, timeseries_num_vms, timeseries_num_tasks
185+
"percentage_xvm", results, ax, num_vms=num_vms, num_tasks=num_tasks
159186
)
160187

188+
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_locality_xvm")
189+
190+
# ----------
191+
# Plot 4: execution time CDF
192+
# ----------
193+
194+
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
195+
161196
plot_locality_results(
162-
"ts_xvm_links", results, ax4, timeseries_num_vms, timeseries_num_tasks
197+
"cdf_jct",
198+
results,
199+
ax,
200+
cdf_num_vms=timeseries_num_vms,
201+
cdf_num_tasks=timeseries_num_tasks,
163202
)
164203

165204
# Manually craft the legend
166-
baselines = ["slurm", "batch", "granny", "granny-migrate"]
205+
baselines = ["granny-batch", "granny", "granny-migrate"]
167206
legend_entries = [
168207
Patch(
169-
color=get_color_for_baseline("mpi-migrate", baseline),
170-
label=get_label_for_baseline("mpi-migrate", baseline),
208+
color=get_color_for_baseline("mpi-locality", baseline),
209+
label=get_label_for_baseline("mpi-locality", baseline),
171210
)
172211
for baseline in baselines
173212
]
174213
fig.legend(
175214
handles=legend_entries,
176-
loc="upper center",
177-
ncols=len(baselines),
178-
bbox_to_anchor=(0.52, 1.07),
215+
loc="lower center",
216+
ncols=2,
217+
bbox_to_anchor=(0.65, 0.17),
218+
)
219+
220+
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_locality_vcpus")
221+
222+
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_locality_cdf_jct")
223+
224+
# ----------
225+
# Plot 5: time-series of idle vCPUs
226+
# ----------
227+
228+
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
229+
230+
plot_locality_results("ts_vcpus", results, ax, num_vms=timeseries_num_vms)
231+
232+
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_locality_ts_vcpus")
233+
234+
# ----------
235+
# Plot 5: time-series of cross-VM links
236+
# ----------
237+
238+
fig, ax = subplots(figsize=DOUBLE_COL_FIGSIZE_THIRD)
239+
240+
plot_locality_results(
241+
"ts_xvm_links", results, ax, num_vms=timeseries_num_vms
179242
)
180243

181-
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_locality")
244+
save_plot(fig, MAKESPAN_PLOTS_DIR, "makespan_locality_ts_xvm")
182245

183246

184247
@task

Diff for: tasks/makespan/run.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ def granny(
8181
), "--fault flag should only be used with omp-elastic workload!"
8282
baseline = "granny-elastic"
8383
if workload == "mpi-locality":
84-
assert migrate, "mpi-locality for granny can only be run with --migrate!"
84+
assert (
85+
migrate
86+
), "mpi-locality for granny can only be run with --migrate!"
8587

8688
workload = _validate_workload(workload)
8789
trace = get_trace_from_parameters(workload, num_tasks, num_cpus_per_vm)

Diff for: tasks/makespan/scheduler.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
LAMMPS_MIGRATION_NET_DOCKER_BINARY,
4747
LAMMPS_MIGRATION_NET_DOCKER_DIR,
4848
LAMMPS_SIM_NUM_ITERATIONS,
49-
LAMMPS_SIM_WORKLOAD,
5049
get_lammps_data_file,
5150
get_lammps_migration_params,
5251
get_lammps_workload,
@@ -279,8 +278,12 @@ def thread_print(msg):
279278
lammps_workload = "compute"
280279

281280
workload_config = get_lammps_workload(lammps_workload)
282-
assert "data_file" in workload_config, "Workload config has no data file!"
283-
data_file = get_lammps_data_file(workload_config["data_file"])["data"][0]
281+
assert (
282+
"data_file" in workload_config
283+
), "Workload config has no data file!"
284+
data_file = get_lammps_data_file(workload_config["data_file"])[
285+
"data"
286+
][0]
284287

285288
# Record the start timestamp
286289
start_ts = 0
@@ -306,7 +309,7 @@ def thread_print(msg):
306309
num_loops=workload_config["num_iterations"],
307310
num_net_loops=workload_config["num_net_loops"],
308311
chunk_size=workload_config["chunk_size"],
309-
native=True
312+
native=True,
310313
),
311314
"-np {}".format(world_size),
312315
# To improve OpenMPI performance, we tell it exactly where

Diff for: tasks/makespan/traces/trace_mpi-locality_75_8.csv

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
TaskId,App,Size,InterArrivalTimeSecs
2+
0,mpi-locality,2,0
3+
1,mpi-locality,10,19
4+
2,mpi-locality,15,5
5+
3,mpi-locality,11,0
6+
4,mpi-locality,11,8
7+
5,mpi-locality,10,3
8+
6,mpi-locality,4,27
9+
7,mpi-locality,5,1
10+
8,mpi-locality,15,8
11+
9,mpi-locality,13,10
12+
10,mpi-locality,2,2
13+
11,mpi-locality,11,5
14+
12,mpi-locality,14,29
15+
13,mpi-locality,11,8
16+
14,mpi-locality,12,8
17+
15,mpi-locality,4,14
18+
16,mpi-locality,4,4
19+
17,mpi-locality,12,20
20+
18,mpi-locality,2,9
21+
19,mpi-locality,12,3
22+
20,mpi-locality,8,14
23+
21,mpi-locality,3,1
24+
22,mpi-locality,13,32
25+
23,mpi-locality,2,16
26+
24,mpi-locality,5,10
27+
25,mpi-locality,3,13
28+
26,mpi-locality,5,6
29+
27,mpi-locality,11,5
30+
28,mpi-locality,3,32
31+
29,mpi-locality,8,7
32+
30,mpi-locality,8,5
33+
31,mpi-locality,6,12
34+
32,mpi-locality,15,0
35+
33,mpi-locality,4,17
36+
34,mpi-locality,6,4
37+
35,mpi-locality,7,2
38+
36,mpi-locality,7,13
39+
37,mpi-locality,7,13
40+
38,mpi-locality,13,0
41+
39,mpi-locality,9,0
42+
40,mpi-locality,9,2
43+
41,mpi-locality,12,6
44+
42,mpi-locality,11,4
45+
43,mpi-locality,7,0
46+
44,mpi-locality,4,1
47+
45,mpi-locality,11,3
48+
46,mpi-locality,3,9
49+
47,mpi-locality,4,4
50+
48,mpi-locality,9,24
51+
49,mpi-locality,2,8
52+
50,mpi-locality,4,8
53+
51,mpi-locality,2,3
54+
52,mpi-locality,14,5
55+
53,mpi-locality,2,1
56+
54,mpi-locality,9,13
57+
55,mpi-locality,7,1
58+
56,mpi-locality,6,20
59+
57,mpi-locality,5,26
60+
58,mpi-locality,5,0
61+
59,mpi-locality,3,15
62+
60,mpi-locality,12,1
63+
61,mpi-locality,3,3
64+
62,mpi-locality,10,40
65+
63,mpi-locality,13,15
66+
64,mpi-locality,7,5
67+
65,mpi-locality,15,2
68+
66,mpi-locality,3,1
69+
67,mpi-locality,15,2
70+
68,mpi-locality,4,5
71+
69,mpi-locality,11,0
72+
70,mpi-locality,13,5
73+
71,mpi-locality,5,4
74+
72,mpi-locality,11,4
75+
73,mpi-locality,5,7
76+
74,mpi-locality,15,0

Diff for: tasks/migration/run.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def run(ctx, w, check_in=None, repeats=1, num_cores_per_vm=8):
6262
)
6363
)
6464
workload_config = LAMMPS_SIM_WORKLOAD_CONFIGS[workload]
65-
data_file = basename(get_lammps_data_file(workload_config["data_file"])["data"][0])
65+
data_file = basename(
66+
get_lammps_data_file(workload_config["data_file"])["data"][0]
67+
)
6668

6769
csv_name = "migration_{}.csv".format(workload)
6870
_init_csv_file(csv_name)

Diff for: tasks/motivation/plot.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def locality(ctx):
3636
# ----------
3737

3838
fig, ax1 = subplots(figsize=(6, 2))
39-
plot_locality_results("ts_vcpus", results, ax1, num_vms=num_vms, num_tasks=num_tasks)
39+
plot_locality_results(
40+
"ts_vcpus", results, ax1, num_vms=num_vms, num_tasks=num_tasks
41+
)
4042

4143
# Manually craft the legend
4244
baselines = ["slurm", "batch", "granny-migrate"]
@@ -61,7 +63,9 @@ def locality(ctx):
6163
# ----------
6264

6365
fig, ax2 = subplots(figsize=(6, 2))
64-
plot_locality_results("ts_xvm_links", results, ax2, num_vms=num_vms, num_tasks=num_tasks)
66+
plot_locality_results(
67+
"ts_xvm_links", results, ax2, num_vms=num_vms, num_tasks=num_tasks
68+
)
6569
save_plot(fig, MOTIVATION_PLOTS_DIR, "motivation_xvm_links")
6670

6771

Diff for: tasks/util/lammps.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ def get_lammps_workload(workload):
118118
if workload not in LAMMPS_SIM_WORKLOAD_CONFIGS:
119119
print("Unrecognized workload: {}".format(workload))
120120
print(
121-
"The supported LAMMPS workloads are: {}".format(LAMMPS_SIM_WORKLOAD_CONFIGS.keys())
121+
"The supported LAMMPS workloads are: {}".format(
122+
LAMMPS_SIM_WORKLOAD_CONFIGS.keys()
123+
)
122124
)
123125
raise RuntimeError("Unrecognized LAMMPS workload")
124126

0 commit comments

Comments
 (0)