from numexpr.tests import test, print_versions
from numexpr.utils import (get_vml_version, set_vml_accuracy_mode,
                           set_vml_num_threads, set_num_threads,
                           detect_number_of_cores, detect_number_of_threads)

# Detect the number of cores
ncores = detect_number_of_cores()
nthreads = detect_number_of_threads()

# Initialize the number of threads to be used
if 'sparc' in platform.machine():
    import warnings

    warnings.warn(
        'The number of threads have been set to 1 because problems related '
        'to threading have been reported on some sparc machine. '
        'The number of threads can be changed using the "set_num_threads" '
        'function.')
    set_num_threads(1)
else:
    set_num_threads(nthreads)

# The default for VML is 1 thread (see #39)
set_vml_num_threads(1)

import version

dirname = os.path.dirname(__file__)

__version__ = version.version
Beispiel #2
0
from numexpr.necompiler import NumExpr, disassemble, evaluate
from numexpr.tests import test, print_versions
from numexpr.utils import (
    get_vml_version, set_vml_accuracy_mode, set_vml_num_threads,
    set_num_threads, detect_number_of_cores)

# Initialize the number of threads to be used
ncores = detect_number_of_cores()
# Check that we don't surpass the MAX_THREADS in interpreter.cpp
if ncores > 4096:
    ncores = 4096
if 'sparc' in platform.machine():
    import warnings
    warnings.warn('The number of threads have been set to 1 because problems related '
                  'to threading have been reported on some sparc machine. '
                  'The number of threads can be changes using the "set_num_threads" '
                  'function.')
    set_num_threads(1)
else:
    set_num_threads(ncores)

# The default for VML is 1 thread (see #39)
set_vml_num_threads(1)

import version

dirname = os.path.dirname(__file__)

__version__ = version.version

Beispiel #3
0
    get_vml_version, set_vml_accuracy_mode, set_vml_num_threads,
    set_num_threads, detect_number_of_cores, detect_number_of_threads)

# Detect the number of cores
ncores = detect_number_of_cores()
nthreads = detect_number_of_threads()

# Initialize the number of threads to be used
if 'sparc' in platform.machine():
    import warnings

    warnings.warn('The number of threads have been set to 1 because problems related '
                  'to threading have been reported on some sparc machine. '
                  'The number of threads can be changed using the "set_num_threads" '
                  'function.')
    set_num_threads(1)
else:
    set_num_threads(nthreads)

# The default for VML is 1 thread (see #39)
set_vml_num_threads(1)

import version

dirname = os.path.dirname(__file__)

__version__ = version.version

def print_versions():
    """Print the versions of software that numexpr relies on."""
    try:
Beispiel #4
0
from numexpr.necompiler import NumExpr, disassemble, evaluate
from numexpr.tests import test, print_versions
from numexpr.utils import (get_vml_version, set_vml_accuracy_mode,
                           set_vml_num_threads, set_num_threads,
                           detect_number_of_cores)

# Initialize the number of threads to be used
ncores = detect_number_of_cores()
# Check that we don't surpass the MAX_THREADS in interpreter.cpp
if ncores > 4096:
    ncores = 4096
if 'sparc' in platform.machine():
    import warnings
    warnings.warn(
        'The number of threads have been set to 1 because problems related '
        'to threading have been reported on some sparc machine. '
        'The number of threads can be changes using the "set_num_threads" '
        'function.')
    set_num_threads(1)
else:
    set_num_threads(ncores)

# The default for VML is 1 thread (see #39)
set_vml_num_threads(1)

import version

dirname = os.path.dirname(__file__)

__version__ = version.version