Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor edits to benchmarking code #1985

Merged
merged 18 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ pythonenv*/
# JS dependencies
mesa/visualization/templates/external/
mesa/visualization/templates/js/external/
*.pclprof
*.pickle
EwoutH marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 5 additions & 1 deletion benchmarks/global_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import time
import timeit

# making sure we use this version of mesa and not one
# also installed in site_packages or so.
sys.path.insert(0, os.path.abspath('..'))

from configurations import configurations


Expand Down Expand Up @@ -56,7 +60,7 @@ def run_experiments(model_class, config):
mean_run = sum(results[1]) / len(results[1])

print(
f"{time.strftime("%H:%M:%S", time.localtime())} {model.__name__:<14} ({size}) timings: Init {mean_init:.5f} s; Run {mean_run:.4f} s"
f"{time.strftime('%H:%M:%S', time.localtime())} {model.__name__:<14} ({size}) timings: Init {mean_init:.5f} s; Run {mean_run:.4f} s"
)

results_dict[model, size] = results
Expand Down