Skip to content

Commit

Permalink
#469 Add mem use in synthetic benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
N720720 committed Jun 8, 2024
1 parent 60ff6c6 commit e80c310
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion benchmarking/synthetic_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

Expand Down

0 comments on commit e80c310

Please sign in to comment.