Skip to content

Commit

Permalink
#470 Adjust unit test, update warmup for jit in benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
N720720 committed Jun 8, 2024
1 parent e10ab01 commit ea596f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions benchmarking/synthetic_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def generate_test_data(num_frames, num_atoms):


def benchmark(function, positions, iterations=3):
index = function(positions) # Warm-up
index = function(generate_test_data(10, 10)) # Warm-up
times = []
for _ in range(iterations):
start_time = time.time()
Expand All @@ -27,7 +27,7 @@ def main():
num_atoms = 1103
print(in_gb(num_frames, num_atoms))
positions = generate_test_data(num_frames, num_atoms)
iterations = 1
iterations = 3

mean_time, std_time, index = benchmark(per_trj.calculate, positions, iterations=iterations)
print(f"Mean time of {iterations} runs: {mean_time:.6f} s ± {std_time:.6f} s")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_example/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ def test_none_flag_multi():
app, ["tests/test_example/459_01.lammpstrj", "tests/test_example/459_02.lammpstrj"]
)
assert result.exit_code == 0
assert "0.0259238" in result.stdout
assert "0.025923" in result.stdout
assert "0.026426" in result.stdout

0 comments on commit ea596f0

Please sign in to comment.