Beispiel #1
0
    get_cbuffer_sizes,
    print_versions,
    )

# Dictionaries for the maps between compressor names and libs
cnames = compressor_list()
# Map for compression names and libs
cname2clib = dict((name, clib_info(name)[0]) for name in cnames)
# Map for compression libraries and versions
clib_versions = dict(clib_info(name) for name in cnames)


# Initialize Blosc
init()
# default to keep GIL, since it's just extra overhead if we aren't 
# threading ourselves
set_releasegil(False)
# Internal Blosc threading
nthreads = ncores = detect_number_of_cores()
# Protection against too many cores
if nthreads > 4:
    nthreads = 4
set_nthreads(nthreads)
blosclib_version = "%s (%s)" % (VERSION_STRING, VERSION_DATE)
import atexit
atexit.register(destroy)


# Tests
from blosc.test import run as test
Beispiel #2
0
# Map for compression libraries and versions
clib_versions = dict(clib_info(name) for name in cnames)

# Blosc symbols that we want to export
from blosc.blosc_extension import (
    BLOSC_VERSION_STRING,
    BLOSC_VERSION_DATE,
    BLOSC_MAX_BUFFERSIZE,
    BLOSC_MAX_THREADS,
    BLOSC_MAX_TYPESIZE,
    init,
    destroy,
)

# Initialize Blosc
init()
ncores = detect_number_of_cores()
set_nthreads(ncores)
blosclib_version = "%s (%s)" % (BLOSC_VERSION_STRING, BLOSC_VERSION_DATE)
import atexit
atexit.register(destroy)

# Tests
from blosc.test import run as test

__all__ = [
    'compress', 'compress_ptr', 'decompress', 'decompress_ptr', 'pack_array',
    'unpack_array', 'detect_number_of_cores', 'free_resources', 'set_nthreads',
    'compressor_list', 'clib_info', 'get_clib', 'print_versions', 'test'
]
Beispiel #3
0
    Set the number of threads to be used during Blosc operation.

"""

from blosc.version import __version__

from blosc.toplevel import (
    compress,
    decompress,
    pack_array,
    unpack_array,
    detect_number_of_cores,
    free_resources,
    set_nthreads,
    )

# Blosc symbols that we want to export
from blosc.blosc_extension import (
    BLOSC_VERSION_STRING,
    BLOSC_VERSION_DATE,
    BLOSC_MAX_BUFFERSIZE,
    BLOSC_MAX_THREADS,
    BLOSC_MAX_TYPESIZE,
    )


# Initialize Blosc
ncores = detect_number_of_cores()
set_nthreads(ncores)
blosclib_version = "%s (%s)" % (BLOSC_VERSION_STRING, BLOSC_VERSION_DATE)
Beispiel #4
0
    get_clib,
    get_cbuffer_sizes,
    cbuffer_validate,
    print_versions,
)

# Dictionaries for the maps between compressor names and libs
cnames = compressor_list()
# Map for compression names and libs
cname2clib = dict((name, clib_info(name)[0]) for name in cnames)
# Map for compression libraries and versions
clib_versions = dict(clib_info(name) for name in cnames)

# Initialize Blosc
init()
# default to keep GIL, since it's just extra overhead if we aren't
# threading ourselves
set_releasegil(False)
# Internal Blosc threading
nthreads = ncores = detect_number_of_cores()
# Protection against too many cores
if nthreads > 8:
    nthreads = 8
set_nthreads(nthreads)
blosclib_version = "%s (%s)" % (VERSION_STRING, VERSION_DATE)
import atexit
atexit.register(destroy)

# Tests
from blosc.test import run as test