reprospect.tools.nsys.cacher module

class reprospect.tools.nsys.cacher.Cacher(*, directory: str | Path | None = None)View on GitHub

Bases: Cacher

Cacher tailored to nsys results.

nsys runs require quite some time to acquire results.

On a cache hit, the cacher will serve:

  • .nsys-rep file

  • .sqlite file

On a cache miss, nsys is launched and the cache entry populated accordingly.

Note

It is assumed that hashing is faster than running nsys itself.

Warning

The cache should not be shared between machines, since there may be differences between machines that influence the results but are not included in the hashing.

TABLE: ClassVar[str] = 'nsys'

Name of the table.

__init__(*, directory: str | Path | None = None)View on GitHub
static export_to_sqlite(command: Command, entry: Entry, **kwargs) PathView on GitHub

Export report to .sqlite.

hash(**kwargs) blake3View on GitHub
hash_impl(*, command: Command) blake3View on GitHub

Hash based on:

  • nsys version

  • nsys options (but not the output files)

  • executable content

  • executable arguments

  • linked libraries

  • environment

populate(directory: Path, **kwargs) NoneView on GitHub

When there is a cache miss, call reprospect.tools.nsys.session.Session.run(). Fill the directory with the artifacts.

run(command: Command, **kwargs) EntryView on GitHub

On a cache hit, copy files from the cache entry.