eqcorrscan / EQcorrscan

Earthquake detection and analysis in Python.
https://eqcorrscan.readthedocs.io/en/latest/
Other
166 stars 86 forks source link

catalog_to_dd.write_correlations struct.error #360

Closed calum-chamberlain closed 4 years ago

calum-chamberlain commented 5 years ago

Describe the bug Running write_correlations for a large dataset for Python versions < 3.7 can result in multiprocessing errors during filtering. This appears to be fixed by this PR on cPython.

The error looks something like this:

Traceback (most recent call last):
  File "python3.6/multiprocessing/queues.py", line 240, in _feed
    send_bytes(obj)
  File "python3.6/multiprocessing/connection.py", line 200, in send_bytes
    self._send_bytes(m[offset:offset + size])
  File "python3.6/multiprocessing/connection.py", line 393, in _send_bytes
    header = struct.pack("!i", n)
struct.error: 'i' format requires -2147483648 <= number <= 2147483647

Additional context I will leave this here as a note: it is worth updating to Python 3.7 or greater. However, I could/should have a serial option for max_workers=1 rather than using multiprocessing for 1 worker so that this can be worked-around without having to update Python.

calum-chamberlain commented 4 years ago

Options for not using multiprocessing implemented in #374