Пример #1
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    from pkg_resources import parse_version
    from numexpr.cpuinfo import cpu

    if cpu.is_AMD() or cpu.is_Intel():
        is_cpu_amd_intel = True
    else:
        is_cpu_amd_intel = False

    if parse_version(np.__version__) < parse_version(minimum_numpy_version):
        print("*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (np.__version__, minimum_numpy_version))
    print('-=' * 38)
    print("Numexpr version:   %s" % numexpr.__version__)
    print("NumPy version:     %s" % np.__version__)
    print('Python version:    %s' % sys.version)
    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        print('Platform:          %s-%s' % (sys.platform, machine))
    print("AMD/Intel CPU?     %s" % is_cpu_amd_intel)
    print("VML available?     %s" % use_vml)
    if use_vml:
        print("VML/MKL version:   %s" % numexpr.get_vml_version())
    print("Number of threads used by default: %d "
          "(out of %d detected cores)" % (numexpr.nthreads, numexpr.ncores))
    print('-=' * 38)
Пример #2
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    # from pkg_resources import parse_version
    from numexpr.cpuinfo import cpu
    import platform

    np_version = LooseVersion(np.__version__)

    if minimum_numpy_version < np_version:
        print('*Warning*: NumPy version is lower than recommended: %s < %s' % (np_version, minimum_numpy_version))
    print('-=' * 38)
    print('Numexpr version:   %s' % numexpr.__version__)
    print('NumPy version:     %s' % np.__version__)
    print('Python version:    %s' % sys.version)
    (sysname, nodename, release, os_version, machine, processor) = platform.uname()
    print('Platform:          %s-%s-%s' % (sys.platform, machine, os_version))
    try:
        # cpuinfo doesn't work on OSX well it seems, so protect these outputs 
        # with a try block
        cpu_info = cpu.info[0]
        print('CPU vendor:        %s' % cpu_info.get('VendorIdentifier', ''))
        print('CPU model:         %s' % cpu_info.get('ProcessorNameString', ''))
        print('CPU clock speed:   %s MHz' % cpu_info.get('~MHz',''))
    except KeyError:
        pass
    print('VML available?     %s' % use_vml)
    if use_vml:
        print('VML/MKL version:   %s' % numexpr.get_vml_version())
    print('Number of threads used by default: %d '
          '(out of %d detected cores)' % (numexpr.nthreads, numexpr.ncores))
    print('Maximum number of threads: %s' % numexpr.MAX_THREADS)
    print('-=' * 38)
Пример #3
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    # from pkg_resources import parse_version
    from numexpr.cpuinfo import cpu
    import platform

    np_version = LooseVersion(np.__version__)

    if np_version < minimum_numpy_version:
        print('*Warning*: NumPy version is lower than recommended: %s < %s' % (np_version, minimum_numpy_version))
    print('-=' * 38)
    print('Numexpr version:   %s' % numexpr.__version__)
    print('NumPy version:     %s' % np.__version__)
    print('Python version:    %s' % sys.version)
    (sysname, nodename, release, os_version, machine, processor) = platform.uname()
    print('Platform:          %s-%s-%s' % (sys.platform, machine, os_version))
    try:
        # cpuinfo doesn't work on OSX well it seems, so protect these outputs 
        # with a try block
        cpu_info = cpu.info[0]
        print('CPU vendor:        %s' % cpu_info.get('VendorIdentifier', ''))
        print('CPU model:         %s' % cpu_info.get('ProcessorNameString', ''))
        print('CPU clock speed:   %s MHz' % cpu_info.get('~MHz',''))
    except KeyError:
        pass
    print('VML available?     %s' % use_vml)
    if use_vml:
        print('VML/MKL version:   %s' % numexpr.get_vml_version())
    print('Number of threads used by default: %d '
          '(out of %d detected cores)' % (numexpr.nthreads, numexpr.ncores))
    print('Maximum number of threads: %s' % numexpr.MAX_THREADS)
    print('-=' * 38)
Пример #4
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""

    print('-=' * 38)
    print("PyTables version:    %s" % tables.__version__)
    print("HDF5 version:        %s" % tables.which_lib_version("hdf5")[1])
    print("NumPy version:       %s" % numpy.__version__)
    tinfo = tables.which_lib_version("zlib")
    if numexpr.use_vml:
        # Get only the main version number and strip out all the rest
        vml_version = numexpr.get_vml_version()
        vml_version = re.findall("[0-9.]+", vml_version)[0]
        vml_avail = "using VML/MKL %s" % vml_version
    else:
        vml_avail = "not using Intel's VML/MKL"
    print("Numexpr version:     %s (%s)" % (numexpr.__version__, vml_avail))
    if tinfo is not None:
        print("Zlib version:        %s (%s)" % (tinfo[1],
                                                "in Python interpreter"))
    tinfo = tables.which_lib_version("lzo")
    if tinfo is not None:
        print("LZO version:         %s (%s)" % (tinfo[1], tinfo[2]))
    tinfo = tables.which_lib_version("bzip2")
    if tinfo is not None:
        print("BZIP2 version:       %s (%s)" % (tinfo[1], tinfo[2]))
    tinfo = tables.which_lib_version("blosc")
    if tinfo is not None:
        blosc_date = tinfo[2].split()[1]
        print("Blosc version:       %s (%s)" % (tinfo[1], blosc_date))
        blosc_cinfo = tables.blosc_get_complib_info()
        blosc_cinfo = [
            "%s (%s)" % (k, v[1]) for k, v in sorted(blosc_cinfo.items())
        ]
        print("Blosc compressors:   %s" % ', '.join(blosc_cinfo))
        blosc_finfo = ['shuffle']
        if tinfo[1] >= min_blosc_bitshuffle_version:
            blosc_finfo.append('bitshuffle')
        print("Blosc filters:       %s" % ', '.join(blosc_finfo))
    try:
        from Cython import __version__ as cython_version
        print('Cython version:      %s' % cython_version)
    except:
        pass
    print('Python version:      %s' % sys.version)
    print('Platform:            %s' % platform.platform())
    #if os.name == 'posix':
    #    (sysname, nodename, release, version, machine) = os.uname()
    #    print('Platform:          %s-%s' % (sys.platform, machine))
    print('Byte-ordering:       %s' % sys.byteorder)
    print('Detected cores:      %s' % detect_number_of_cores())
    print('Default encoding:    %s' % sys.getdefaultencoding())
    print('Default FS encoding: %s' % sys.getfilesystemencoding())
    print('Default locale:      (%s, %s)' % locale.getdefaultlocale())
    print('-=' * 38)

    # This should improve readability whan tests are run by CI tools
    sys.stdout.flush()
Пример #5
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""

    print('-=' * 38)
    print("PyTables version:    %s" % tables.__version__)
    print("HDF5 version:        %s" % tables.which_lib_version("hdf5")[1])
    print("NumPy version:       %s" % numpy.__version__)
    tinfo = tables.which_lib_version("zlib")
    if numexpr.use_vml:
        # Get only the main version number and strip out all the rest
        vml_version = numexpr.get_vml_version()
        vml_version = re.findall("[0-9.]+", vml_version)[0]
        vml_avail = "using VML/MKL %s" % vml_version
    else:
        vml_avail = "not using Intel's VML/MKL"
    print("Numexpr version:     %s (%s)" % (numexpr.__version__, vml_avail))
    if tinfo is not None:
        print("Zlib version:        %s (%s)" % (tinfo[1],
                                                "in Python interpreter"))
    tinfo = tables.which_lib_version("lzo")
    if tinfo is not None:
        print("LZO version:         %s (%s)" % (tinfo[1], tinfo[2]))
    tinfo = tables.which_lib_version("bzip2")
    if tinfo is not None:
        print("BZIP2 version:       %s (%s)" % (tinfo[1], tinfo[2]))
    tinfo = tables.which_lib_version("blosc")
    if tinfo is not None:
        blosc_date = tinfo[2].split()[1]
        print("Blosc version:       %s (%s)" % (tinfo[1], blosc_date))
        blosc_cinfo = tables.blosc_get_complib_info()
        blosc_cinfo = [
            "%s (%s)" % (k, v[1]) for k, v in sorted(blosc_cinfo.items())
        ]
        print("Blosc compressors:   %s" % ', '.join(blosc_cinfo))
        blosc_finfo = ['shuffle']
        if tinfo[1] >= min_blosc_bitshuffle_version:
            blosc_finfo.append('bitshuffle')
        print("Blosc filters:       %s" % ', '.join(blosc_finfo))
    try:
        from Cython import __version__ as cython_version
        print('Cython version:      %s' % cython_version)
    except:
        pass
    print('Python version:      %s' % sys.version)
    print('Platform:            %s' % platform.platform())
    #if os.name == 'posix':
    #    (sysname, nodename, release, version, machine) = os.uname()
    #    print('Platform:          %s-%s' % (sys.platform, machine))
    print('Byte-ordering:       %s' % sys.byteorder)
    print('Detected cores:      %s' % detect_number_of_cores())
    print('Default encoding:    %s' % sys.getdefaultencoding())
    print('Default FS encoding: %s' % sys.getfilesystemencoding())
    print('Default locale:      (%s, %s)' % locale.getdefaultlocale())
    print('-=' * 38)

    # This should improve readability whan tests are run by CI tools
    sys.stdout.flush()
Пример #6
0
def info():
    """Print date and version information as a html-table."""

    # Define styles
    style1 = " style='border: 2px solid #fff; text-align: left;'"
    style2 = " style='background-color: #ccc;"
    style2 += "width: 10%; border: 2px solid #fff;'"

    # Print date and time info as title
    html = "<h3>%s</h3>" % time.strftime('%a %b %d %H:%M:%S %Y %Z')

    # Start table
    html += '<table>'

    # empymod, OS, threads, IPython
    html += "<tr" + style1 + ">"
    html += "<td" + style2 + ">%s</td>" % empymod.__version__
    html += "<td" + style1 + ">empymod</td>"
    html += "<td" + style2 + ">%s</td>" % platform.system()
    html += "<td" + style1 + ">OS</td>"
    html += "<td" + style2 + ">%s</td>" % numexpr.detect_number_of_threads()
    html += "<td" + style1 + ">CPU(s)</td>"
    html += "<td" + style2 + ">%s</td>" % IPython.__version__
    html += "<td" + style1 + ">IPython</td>"
    html += "</tr>"

    # numpy, scipy, numexpr, matplotlib
    html += "<tr" + style1 + ">"
    html += "<td" + style2 + ">%s</td>" % numpy.__version__
    html += "<td" + style1 + ">numpy</td>"
    html += "<td" + style2 + ">%s</td>" % scipy.__version__
    html += "<td" + style1 + ">scipy</td>"
    html += "<td" + style2 + ">%s</td>" % numexpr.__version__
    html += "<td" + style1 + ">numexpr</td>"
    html += "<td" + style2 + ">%s</td>" % matplotlib.__version__
    html += "<td" + style1 + ">matplotlib</td>"
    html += "</tr>"

    # sys.version
    html += "<tr" + style1 + ">"
    html += "<td" + style1 + " colspan='8'>%s</td>" % sys.version
    html += "</tr>"

    # vml version
    html += "<tr" + style2 + ">"
    html += "<td" + style2 + " colspan='8'>%s</td>" % numexpr.get_vml_version()
    html += "</tr>"

    # Finish table
    html += "</table>"

    return HTML(html)
Пример #7
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    if numpy.__version__ < minimum_numpy_version:
        print "*Warning*: NumPy version is lower than recommended: %s < %s" % (numpy.__version__, minimum_numpy_version)
    print "-=" * 38
    print "Numexpr version:   %s" % numexpr.__version__
    print "NumPy version:     %s" % numpy.__version__
    print "Python version:    %s" % sys.version
    if os.name == "posix":
        (sysname, nodename, release, version, machine) = os.uname()
        print "Platform:          %s-%s" % (sys.platform, machine)
    print "AMD/Intel CPU?     %s" % numexpr.is_cpu_amd_intel
    print "VML available?     %s" % use_vml
    if use_vml:
        print "VML/MKL version:   %s" % numexpr.get_vml_version()
    print ("Number of threads used by default: %d " "(out of %d detected cores)" % (numexpr.nthreads, numexpr.ncores))
    print "-=" * 38
Пример #8
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    if numpy.__version__ < minimum_numpy_version:
        print "*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (numpy.__version__, minimum_numpy_version)
    print '-=' * 38
    print "Numexpr version:   %s" % numexpr.__version__
    print "NumPy version:     %s" % numpy.__version__
    print 'Python version:    %s' % sys.version
    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        print 'Platform:          %s-%s' % (sys.platform, machine)
    print "AMD/Intel CPU?     %s" % numexpr.is_cpu_amd_intel
    print "VML available?     %s" % use_vml
    if use_vml:
        print "VML/MKL version:   %s" % numexpr.get_vml_version()
    print 'Detected cores:    %s' % numexpr.ncores
    print '-=' * 38
Пример #9
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    if numpy.__version__ < minimum_numpy_version:
        print "*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (numpy.__version__, minimum_numpy_version)
    print '-=' * 38
    print "Numexpr version:   %s" % numexpr.__version__
    print "NumPy version:     %s" % numpy.__version__
    print 'Python version:    %s' % sys.version
    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        print 'Platform:          %s-%s' % (sys.platform, machine)
    print "AMD/Intel CPU?     %s" % numexpr.is_cpu_amd_intel
    print "VML available?     %s" % use_vml
    if use_vml:
        print "VML/MKL version:   %s" % numexpr.get_vml_version()
    print 'Detected cores:    %s' % numexpr.ncores
    print '-=' * 38
Пример #10
0
def info():
    """Print the versions of software that numexpr relies on."""
    out = []
    if numpy.__version__ < minimum_numpy_version:
        out.append("*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (numpy.__version__, minimum_numpy_version))
    out.append('Python version:    %s' % sys.version)
    out.append("NumPy version:     %s" % numpy.__version__)
    out.append("Numexpr version:   %s" % numexpr.__version__)
    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        out.append('Platform:          %s-%s' % (sys.platform, machine))
    out.append("AMD/Intel CPU?     %s" % numexpr.is_cpu_amd_intel)
    out.append("VML available?     %s" % numexpr.use_vml)
    if numexpr.use_vml:
        out.append("VML/MKL version:   %s" % numexpr.get_vml_version())
    out.append('Detected cores:    %s' % numexpr.ncores)

    return "<br />\n".join(out)
Пример #11
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    if numpy.__version__ < minimum_numpy_version:
        print("*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (numpy.__version__, minimum_numpy_version))
    print('-=' * 38)
    print("Numexpr version:   %s" % numexpr.__version__)
    print("NumPy version:     %s" % numpy.__version__)
    print('Python version:    %s' % sys.version)
    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        print('Platform:          %s-%s' % (sys.platform, machine))
    print("AMD/Intel CPU?     %s" % numexpr.is_cpu_amd_intel)
    print("VML available?     %s" % use_vml)
    if use_vml:
        print("VML/MKL version:   %s" % numexpr.get_vml_version())
    print("Number of threads used by default: %d "
          "(out of %d detected cores)" % (numexpr.nthreads, numexpr.ncores))
    print('-=' * 38)
Пример #12
0
def print_versions():
    """Print the versions of software that numexpr relies on."""
    from pkg_resources import parse_version
    if parse_version(np.__version__) < parse_version(minimum_numpy_version):
        print("*Warning*: NumPy version is lower than recommended: %s < %s" % \
              (np.__version__, minimum_numpy_version))
    print('-=' * 38)
    print("Numexpr version:   %s" % numexpr.__version__)
    print("NumPy version:     %s" % np.__version__)
    print('Python version:    %s' % sys.version)
    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        print('Platform:          %s-%s' % (sys.platform, machine))
    print("AMD/Intel CPU?     %s" % numexpr.is_cpu_amd_intel)
    print("VML available?     %s" % use_vml)
    if use_vml:
        print("VML/MKL version:   %s" % numexpr.get_vml_version())
    print("Number of threads used by default: %d "
          "(out of %d detected cores)" % (numexpr.nthreads, numexpr.ncores))
    print('-=' * 38)
Пример #13
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""
    print '-=' * 38
    print "PyTables version:  %s" % tables.__version__
    print "HDF5 version:      %s" % tables.which_lib_version("hdf5")[1]
    print "NumPy version:     %s" % numpy.__version__
    tinfo = tables.which_lib_version("zlib")
    if numexpr.use_vml:
        # Get only the main version number and strip out all the rest
        vml_version = numexpr.get_vml_version()
        vml_version = re.findall("[0-9.]+", vml_version)[0]
        vml_avail = "using VML/MKL %s" % vml_version
    else:
        vml_avail = "not using Intel's VML/MKL"
    print "Numexpr version:   %s (%s)" % (numexpr.__version__, vml_avail)
    if tinfo is not None:
        print "Zlib version:      %s (%s)" % (tinfo[1],
                                              "in Python interpreter")
    tinfo = tables.which_lib_version("lzo")
    if tinfo is not None:
        print "LZO version:       %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.which_lib_version("bzip2")
    if tinfo is not None:
        print "BZIP2 version:     %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.which_lib_version("blosc")
    if tinfo is not None:
        blosc_date = tinfo[2].split()[1]
        print "Blosc version:     %s (%s)" % (tinfo[1], blosc_date)
    try:
        from Cython.Compiler.Main import Version as Cython_Version
        print 'Cython version:    %s' % Cython_Version.version
    except:
        pass
    print 'Python version:    %s' % sys.version
    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        print 'Platform:          %s-%s' % (sys.platform, machine)
    print 'Byte-ordering:     %s' % sys.byteorder
    print 'Detected cores:    %s' % detect_number_of_cores()
    print 'Default encoding:  %s' % sys.getdefaultencoding()
    print '-=' * 38
Пример #14
0
def print_versions():
    """Print all the versions of software that PyTables relies on."""
    print "-=" * 38
    print "PyTables version:  %s" % tables.__version__
    print "HDF5 version:      %s" % tables.whichLibVersion("hdf5")[1]
    print "NumPy version:     %s" % numpy.__version__
    tinfo = tables.whichLibVersion("zlib")
    if numexpr.use_vml:
        # Get only the main version number and strip out all the rest
        vml_version = numexpr.get_vml_version()
        vml_version = re.findall("[0-9.]+", vml_version)[0]
        vml_avail = "using VML/MKL %s" % vml_version
    else:
        vml_avail = "not using Intel's VML/MKL"
    print "Numexpr version:   %s (%s)" % (numexpr.__version__, vml_avail)
    if tinfo is not None:
        print "Zlib version:      %s (%s)" % (tinfo[1], "in Python interpreter")
    tinfo = tables.whichLibVersion("lzo")
    if tinfo is not None:
        print "LZO version:       %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("bzip2")
    if tinfo is not None:
        print "BZIP2 version:     %s (%s)" % (tinfo[1], tinfo[2])
    tinfo = tables.whichLibVersion("blosc")
    blosc_date = tinfo[2].split()[1]
    if tinfo is not None:
        print "Blosc version:     %s (%s)" % (tinfo[1], blosc_date)
    try:
        from Cython.Compiler.Main import Version as Cython_Version

        print "Cython version:    %s" % Cython_Version.version
    except:
        pass
    print "Python version:    %s" % sys.version
    if os.name == "posix":
        (sysname, nodename, release, version, machine) = os.uname()
        print "Platform:          %s-%s" % (sys.platform, machine)
    print "Byte-ordering:     %s" % sys.byteorder
    print "Detected cores:    %s" % detectNumberOfCores()
    print "-=" * 38
Пример #15
0
def print_versions():
    """
    Print the versions of software relied upon by montblanc.
    Inspired by numexpr testing suite.
    """
    print('-=' * 38)
    print('Python version:    %s' % sys.version)
    print('Montblanc version: %s' % montblanc.__version__)
    print('PyCUDA version:    %s' % pycuda.VERSION_TEXT)
    print("NumPy version:     %s" % numpy.__version__)
    print("Numexpr version:   %s" % numexpr.__version__)

    if os.name == 'posix':
        (sysname, nodename, release, version, machine) = os.uname()
        print('Platform:          %s-%s' % (sys.platform, machine))

    print("AMD/Intel CPU?     %s" % numexpr.is_cpu_amd_intel)
    print("VML available?     %s" % numexpr.use_vml)

    if numexpr.use_vml:
        print("VML/MKL version:   %s" % numexpr.get_vml_version())
    print("Number of threads used by default: %d "
          "(out of %d detected cores)" % (numexpr.nthreads, numexpr.ncores))
    print('-=' * 38)
Пример #16
0
import numpy
import numexpr
import numexpr.interpreter
from multiprocessing import freeze_support

from cio_bt.mkl_link import test_modules
test_modules([numexpr.interpreter])

has_mkl = not int(os.getenv('NOMKL', 0))
print('MKL: %r' % has_mkl)

use_vml = getattr(numexpr, 'use_vml', None)
print('numexpr.use_vml: %r' % use_vml)

assert use_vml == has_mkl == bool(getattr(numpy, '__mkl_version__', None))

if has_mkl:
    vml_version = numexpr.get_vml_version()
    print("VML: %r" % vml_version)
    vmls = 'Intel(R) Math Kernel Library Version '
    assert vml_version.startswith(vmls)


def run_tests():
    numexpr.test()


if __name__ == "__main__":
    freeze_support()
    run_tests()
Пример #17
0
    return results


if __name__ == '__main__':

    # from mkidpipeline.tests.h5speed import *
    pipe.logtoconsole(file='/scratch/baileyji/mec/speedtest/lastrun-pold.log')
    pipe.configure_pipeline(
        resource_filename('mkidpipeline',
                          os.path.join('tests', 'h5speed_pipe.yml')))
    d = pipe.load_data_description(
        resource_filename('mkidpipeline',
                          os.path.join('tests', 'h5speed_data.yml')))

    # Basic checks
    print(numexpr.get_vml_version())

    b2h_configs = pipe.bin2hdf.gen_configs(d.timeranges)

    # Summary as of 9/27/19
    # Plain shuffling of the indices seemed the clear winner for a CSI on a large 25MB/s 900s dataset
    # Bit shuffling of the data has no advantage
    # Plain shuffling of the data reduces file size a bit at a penalty to query time.

    # Index shuffling
    # settings = [dict(index=('full', 9), chunkshape=None, timesort=False, shuffle=True,
    #                  bitshuffle=False, ndx_bitshuffle=ndx_bshuffle, ndx_shuffle=ndx_shuffle)
    #             for ndx_shuffle in (True, False) for ndx_bshuffle in (True, False)]
    # for cfg in b2h_configs[0:1]:
    #     results = test_settings(cfg, settings, TEST_QUERIES, do_query=False, cleanup=False,
    #                             recovery='/scratch/baileyji/mec/speedtest/recovery.pickle')
Пример #18
0
gbs = working_set_GB / (t1 - t0)
print("Time for an algebraic expression:     %.3f s / %.3f GB/s" %
      (t1 - t0, gbs))

t0 = time()
z = np.sin(x)**2 + np.cos(y)**2
t1 = time()
gbs = working_set_GB / (t1 - t0)
print("Time for a transcendental expression: %.3f s / %.3f GB/s" %
      (t1 - t0, gbs))

if ne.use_vml:
    ne.set_vml_num_threads(1)
    ne.set_num_threads(8)
    print("NumExpr version: %s, Using MKL ver. %s, Num threads: %s" %
          (ne.__version__, ne.get_vml_version(), ne.nthreads))
else:
    ne.set_num_threads(8)
    print("NumExpr version: %s, Not Using MKL, Num threads: %s" %
          (ne.__version__, ne.nthreads))

t0 = time()
ne.evaluate('2*y + 4*x', out=z)
t1 = time()
gbs = working_set_GB / (t1 - t0)
print("Time for an algebraic expression:     %.3f s / %.3f GB/s" %
      (t1 - t0, gbs))

t0 = time()
ne.evaluate('sin(x)**2 + cos(y)**2', out=z)
t1 = time()
Пример #19
0
    import numexpr
except ImportError:
    numexpr = False

# Get available RAM, if available
if psutil:
    tmem = psutil.virtual_memory().total
    TOTAL_RAM = '{:.1f} GiB'.format(tmem / (1024.0**3))
else:
    TOTAL_RAM = False

# Get mkl info from numexpr or mkl, if available
if mkl:
    MKL_INFO = mkl.get_version_string()
elif numexpr:
    MKL_INFO = numexpr.get_vml_version()
else:
    MKL_INFO = False

# Define unusual version locations
VERSION_ATTRIBUTES = {
    'vtk': 'VTK_VERSION',
    'vtkmodules.all': 'VTK_VERSION',
    'PyQt5': 'Qt.PYQT_VERSION_STR',
    'sip': 'SIP_VERSION_STR',
}


def get_pyqt5_version():
    """Returns the PyQt5 version"""
    from PyQt5.Qt import PYQT_VERSION_STR
Пример #20
0
except ImportError:
    ipywidgets = False
try:
    import numexpr
except ImportError:
    numexpr = False
try:
    import mkl
except ImportError:
    mkl = False

# Get mkl info from numexpr or mkl, if available
if mkl:
    mklinfo = mkl.get_version_string()
elif numexpr:
    mklinfo = numexpr.get_vml_version()
else:
    mklinfo = False


class Versions:
    """Print date, time, and version information.

    Print date, time, and package version information in any environment
    (Jupyter notebook, IPython console, Python console, QT console), either as
    html-table (notebook) or as plain text (anywhere).

    Always shown are the OS, number of CPU(s), ``numpy``, ``scipy``,
    ``SimPEG``, ``cython``, ``properties``, ``vectormath``, ``discretize``,
    ``pymatsolver``, ``sys.version``, and time/date.