legate.util.benchmark.BenchmarkLogFromFilename#

class legate.util.benchmark.BenchmarkLogFromFilename(
file_name: os.PathLike[str],
constructor: Callable[[TextIO], BenchmarkLog],
)#

Wrap a BenchmarkLog in a context that also opens a file.

__init__(
file_name: os.PathLike[str],
constructor: Callable[[TextIO], BenchmarkLog],
) None#

Create a context manager that opens a file for a BenchmarkLog.

This class exists so benchmark_log() can conditionally open output files, most users should use that function and not call this directly.

Parameters:
  • file_name (os.PathLike[str]) – The path for the file to open.

  • constructor (Callable[[TextIO], BenchmarkLog]) – Thunk for creating a BenchmarkLog from the file handle that was opened from file_name.

Attributes

Methods

__enter__()

__exit__(exc_type, exc_value, exc_traceback)