dtmm.conf

dtmm configuration functions and constants

Module Contents

dtmm.conf.get_home_dir()

Return user home directory

dtmm.conf.is_module_installed(name)

Checks whether module with name ‘name’ is istalled or not

dtmm.conf.clear_cache(func=None)

Clears compute cache.

Parameters

func (function) – A cached function of which cache results are to be cleared (removed from cache). If not provided (default) all cache data is cleared from all registred cached function - functions returned by the cached_function() decorator

dtmm.conf.cached_function(f)

A decorator that converts a function into a cached function.

The function needs to be a function that returns a numpy array as a result. This result is then cached and future function calls with same arguments return result from the cache. Function arguments must all be hashable, or are small numpy arrays. The function can also take “out” keyword argument for an output array in which the resulting array is copied to.

Notes

When caching is enabled, cached numpy arrayes have a read-only attribute. You need to copy first, or provide an output array if you need to write to the result.

dtmm.conf.cached_result(f)

A decorator that converts a function into a cached result function.

The function needs to be a function that returns any result. Function arguments must all be hashable, or are small numpy arrays.

dtmm.conf.detect_number_of_cores()

detect_number_of_cores()

Detect the number of cores in this system.

Returns

out – The number of cores in this system.

Return type

int

dtmm.conf.disable_mkl_threading()

Disables mkl threading.

dtmm.conf.enable_mkl_threading()

Enables mkl threading.

class dtmm.conf.DTMMConfig

Bases: object

DTMM settings are here. You should use the set_* functions in the conf.py module to set these values

dtmm.conf.get_default_config_option(name, value=None)

Returns default config option specified with ‘name’, if value is not None, returns value instead

dtmm.conf.print_config()

Prints all compile-time and run-time configurtion parameters and settings.

dtmm.conf.set_verbose(level)

Sets verbose level (0-2) used by compute functions.

dtmm.conf.set_nthreads(num)

Sets number of threads used by fft functions.

dtmm.conf.set_cache(level)

Sets compute cache level.

dtmm.conf.set_fftlib(name='numpy.fft')

Sets fft library. Returns previous setting.