detkit.Profile.print_profile#

Profile.print_profile(shape=None, dtype=None)#

Print profile information.

Parameters:
shapetuple, default=None

A tuple of size two representing the shape of the matrix.

dtypestr, default=None

The data type of the matrix.

Examples

>>> from detkit import Profile, memdet

>>> # Initialize with MB unit
>>> prof = Profile()

>>> # Set (or reset) the starting point of inquiry
>>> prof.set()

>>> # Perform an operation that reads from and writes to disk
>>> import numpy
>>> A = numpy.random.randn(1000, 1000)
>>> ld = memdet(A, num_blocks=4)

>>> # Inquiry write to disk during the above operation, in MB unit
>>> prof.print_profile(shape=A.shape, dtype=A.dtype)
| time:  661 ms | cpu:  20% | alloc:    5.4 MB | read:      0  B |
| write:   10.2 MB |