imate.get_config#

imate.get_config(key=None)#

Returns the definitions used in the compile-time of the package.

Parameters:
keystr, default=None

A string with one of the following values:

  • 'use_cblas': inquiries if the package is compiled with OpenBLAS support.

  • 'use_mkl': inquiries if the package is compiled with MKL support.

  • 'use_openmp': inquiries if the package is compiled with OpenMP support.

  • 'use_loop_unrolling': inquiries if the package is compiled with loop unrolling (also known as loop unwinding).

  • 'use_cuda': inquiries if the package is compiled with CUDA support.

  • 'cuda_dynamic_loading': inquiries if the package is compiled with enabling the dynamic loading of CUDA libraries.

  • 'debug_mode': inquiries if the package is compiled with the debugging mode enabled.

  • 'cython_build_in_source': inquiries if the Cython source files were generated in the source directory during compilation.

  • 'cython_build_for_doc': inquiries if the docstring for Cython functions are generated for the purpose of Sphinx documentation.

  • 'use_long_int': inquiries if the 64-bit long integer type is used for array indices at compile time.

  • 'use_unsigned_long_int': inquiries if unsigned 64-bit integer type is used for array indices at compile time.

If None, the full list of all above configurations is returned.

Returns:
configdict

If a key input argument is given, a boolean value corresponding to the status of the key is returned. If key is set to None or no key is given, a dictionary with all the above keys is returned.

See also

imate.info

Notes

To configure the compile-time definitions, export either of these variables and set them to 0 or 1 as applicable:

export USE_CBLAS=1
export USE_MKL=0
export USE_OPENMP=1
export USE_LOOP_UNROLLING=1
export USE_CUDA=1
export CUDA_DYNAMIC_LOADING=1
export DEBUG_MODE=1
export CYTHON_BUILD_IN_SOURCE=1
export CYTHON_BUILD_FOR_DOC=1
export USE_LONG_INT=1
export USE_UNSIGNED_LONG_INT=1
$env:USE_CBLAS = "1"
$env:USE_MKL = "0"
$env:USE_OPENMP = "1"
$env:USE_LOOP_UNROLLING = "1"
$env:USE_CUDA = "1"
$env:CUDA_DYNAMIC_LOADING = "1"
$env:DEBUG_MODE = "1"
$env:CYTHON_BUILD_IN_SOURCE = "1"
$env:CYTHON_BUILD_FOR_DOC = "1"
$env:USE_LONG_INT = "1"
$env:USE_UNSIGNED_LONG_INT = "1"

Examples

>>> from imate import get_config

>>> # Using a config key
>>> get_config('use_cuda')
True

>>> # Using no key, results in returning all config
>>> get_config()
{
    'use_cblas': False,
    'use_mkl': False,
    'use_openmp': True,
    'use_loop_unrolling': True,
    'use_cuda': True,
    'cuda_dynamic_loading': True,
    'debug_mode': False,
    'cython_build_in_source': False,
    'cython_build_for_doc': False,
    'use_long_int': False,
    'use_unsigned_long_int': False,
}