From e80c3104cc82f04a2b8a5b06ccffc085123fee47 Mon Sep 17 00:00:00 2001 From: Sebastian Thurm Date: Sat, 8 Jun 2024 08:01:49 +0200 Subject: [PATCH] #469 Add mem use in synthetic benchmark --- benchmarking/synthetic_benchmark.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmarking/synthetic_benchmark.py b/benchmarking/synthetic_benchmark.py index dc780aa..1c94d3f 100644 --- a/benchmarking/synthetic_benchmark.py +++ b/benchmarking/synthetic_benchmark.py @@ -3,11 +3,12 @@ import numpy as np from lindemann.index import per_atoms, per_frames, per_trj +from lindemann.index.mem_use import in_gb def generate_test_data(num_frames, num_atoms): rng = np.random.default_rng(seed=42) - return rng.random((num_frames, num_atoms, 3)).astype(np.float32) + return rng.random((num_frames, num_atoms, 3), dtype=np.float32) def benchmark(function, positions, iterations=3): @@ -24,6 +25,7 @@ def benchmark(function, positions, iterations=3): def main(): num_frames = 5000 num_atoms = 1103 + print(in_gb(num_frames, num_atoms)) positions = generate_test_data(num_frames, num_atoms) iterations = 1