Skip to content

Commit 1f0e428

Browse files
committed
just adapting memory monitor
1 parent 3da258b commit 1f0e428

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

test/partitioner/memory_monitor.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import psutil
33
import time
44
import matplotlib.pyplot as plt
5+
from pathlib import Path
6+
57

68
def monitor(command):
79
# Start the C++ process
@@ -31,9 +33,9 @@ def monitor(command):
3133

3234
# Run and Plot
3335
inputs = [
34-
"/workspaces/sb-graph/test/partitioner/data/air_conditioners_cont_4_1000.json",
35-
"/workspaces/sb-graph/test/partitioner/data/air_conditioners_cont_4_10000.json",
36-
"/workspaces/sb-graph/test/partitioner/data/air_conditioners_cont_4_100000.json"
36+
"/workspaces/sb-graph/test/partitioner/external_tools/data/advection_1000.json",
37+
"/workspaces/sb-graph/test/partitioner/external_tools/data/advection_10000.json",
38+
"/workspaces/sb-graph/test/partitioner/external_tools/data/advection_100000.json"
3739
]
3840

3941
colors = {
@@ -58,13 +60,13 @@ def monitor(command):
5860

5961
for f in inputs:
6062
for _ in range(1):
61-
times, mem, mem2 = monitor(f"/workspaces/sb-graph/install/bin/sbg-partitioner -f {f} -p 4 -m Kahip")
63+
times, mem, mem2 = monitor(f"sleep 1; /workspaces/sb-graph/install/bin/sbg-partitioner -f {f} -p 16")
6264

63-
plt.plot(times, mem, color=colors[f])
64-
plt.plot(times, mem2, color=colors2[f])
65+
# plt.plot(times, mem, color=colors[f])
66+
plt.plot(times, mem2, color=colors2[f], label=Path(f).stem)
6567
plt.legend()
6668

6769
# Save the plot instead of showing it
68-
output_file = "memory_benchmark.png"
69-
plt.savefig(output_file)
70+
output_file = "memory_benchmark_advection_16.svg"
71+
plt.savefig(output_file, format='svg', bbox_inches='tight')
7072
print(f"Benchmark finished. Results saved to {output_file}")

0 commit comments

Comments
 (0)