llg3d.benchmarks.compare_commits

Compare simple benchmark timings between commits using GitPython.

This script keeps repository objects local to main() so it fails fast when not run from the llg3d repository.

Functions

checkout_commit(repo, commit)

Checkout the given commit in repo.

ensure_clean_worktree(repo)

Exit if the worktree contains changes or untracked files.

get_current_commit(repo)

Return the current commit hexsha for repo.

get_current_ref(repo)

Return the current branch name, or the commit if HEAD is detached.

get_llg3d_repo()

Return the llg3d GitPython Repo object.

main()

Command-line entry point: compare benchmark timings between commits.

print_separator([char, length])

Print a simple separator line to stdout.

run_single_benchmark(solver, Jx, Jy, Jz, ...)

Run a single benchmark and return a dict with timing results.

get_llg3d_repo()[source]

Return the llg3d GitPython Repo object.

Return type:

Repo

get_current_commit(repo)[source]

Return the current commit hexsha for repo.

Parameters:

repo (Repo)

Return type:

str

get_current_ref(repo)[source]

Return the current branch name, or the commit if HEAD is detached.

Parameters:

repo (Repo)

Return type:

str

ensure_clean_worktree(repo)[source]

Exit if the worktree contains changes or untracked files.

Parameters:

repo (Repo)

Return type:

None

checkout_commit(repo, commit)[source]

Checkout the given commit in repo.

Parameters:
  • repo (Repo)

  • commit (str)

Return type:

None

run_single_benchmark(solver, Jx, Jy, Jz, n_mean, N, launcher=None, np_procs=1, precision='single', repo_root=None)[source]

Run a single benchmark and return a dict with timing results.

Parameters:
  • solver (str)

  • Jx (int)

  • Jy (int)

  • Jz (int)

  • n_mean (int)

  • N (int)

  • launcher (str | None)

  • np_procs (int)

  • precision (str)

  • repo_root (Path | None)

Return type:

dict

print_separator(char='=', length=40)[source]

Print a simple separator line to stdout.

Parameters:
  • char (str)

  • length (int)

Return type:

None

main()[source]

Command-line entry point: compare benchmark timings between commits.

Return type:

None