Skip to content

Error when compressing a large tree sequence: Codec does not support buffers of > 2147483647 bytes #118

@Jesson-mark

Description

@Jesson-mark

Hi tskit-dev,

I am using tszip v0.2.6 to compress a tree sequence from the entire chromosome 1 in humans. The raw (uncompressed) tree sequence is 26 GB; but an error occured as shown below:

Traceback (most recent call last):
  File "/opt/miniforge3/envs/py3.10/bin/tszip", line 10, in <module>
    sys.exit(tszip_main())
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/tszip/cli.py", line 180, in tszip_main
    main(args)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/tszip/cli.py", line 174, in main
    run_compress(args)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/tszip/cli.py", line 128, in run_compress
    tszip.compress(ts, outfile, variants_only=args.variants_only)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/tszip/compression.py", line 103, in compress
    compress_zarr(ts, root, variants_only=variants_only)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/tszip/compression.py", line 259, in compress_zarr
    ).compress(root, compressor)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/tszip/compression.py", line 157, in compress
    compressed_array[:] = self.array
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/zarr/core.py", line 1449, in __setitem__
    self.set_basic_selection(pure_selection, value, fields=fields)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/zarr/core.py", line 1545, in set_basic_selection
    return self._set_basic_selection_nd(selection, value, fields=fields)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/zarr/core.py", line 1935, in _set_basic_selection_nd
    self._set_selection(indexer, value, fields=fields)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/zarr/core.py", line 1988, in _set_selection
    self._chunk_setitem(chunk_coords, chunk_selection, chunk_value, fields=fields)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/zarr/core.py", line 2261, in _chunk_setitem
    self._chunk_setitem_nosync(chunk_coords, chunk_selection, value, fields=fields)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/zarr/core.py", line 2271, in _chunk_setitem_nosync
    self.chunk_store[ckey] = self._encode_chunk(cdata)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/zarr/core.py", line 2395, in _encode_chunk
    cdata = self._compressor.encode(chunk)
  File "numcodecs/blosc.pyx", line 559, in numcodecs.blosc.Blosc.encode
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/numcodecs/compat.py", line 151, in ensure_contiguous_ndarray
    ensure_contiguous_ndarray_like(buf, max_buffer_size=max_buffer_size, flatten=flatten)
  File "/opt/miniforge3/envs/py3.10/lib/python3.10/site-packages/numcodecs/compat.py", line 117, in ensure_contiguous_ndarray_like
    raise ValueError(msg)
ValueError: Codec does not support buffers of > 2147483647 bytes

Do you have any insights regarding this issue? Any input would be greatly appreciated.

Best regards,

Jie

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions