Skip to content

Unhelpful error message with waveform extraction writing and insufficient space #1063

Closed
@DradeAW

Description

@DradeAW

Hi,

I have the following code:

si.extract_waveforms(recording, sorting, folder_path, allow_unfiltered=True, ms_before=5.0, ms_after=5.0, max_spikes_per_unit=2000, chunk_duration='1s', n_jobs=16)

Which gave the following error message:

Traceback (most recent call last):
  File "/users/nsr/wyngaard/dev/miniconda3/envs/lussac2/bin/lussac", line 33, in <module>
    sys.exit(load_entry_point('lussac', 'console_scripts', 'lussac')())
  File "/export/home1/users/nsr/wyngaard/Documents/lussac2/lussac/main.py", line 58, in main
    pipeline.launch()
  File "/export/home1/users/nsr/wyngaard/Documents/lussac2/lussac/core/pipeline.py", line 41, in launch
    self._run_mono_sorting_module(module, module_key, category, params)
  File "/export/home1/users/nsr/wyngaard/Documents/lussac2/lussac/core/pipeline.py", line 79, in _run_mono_sorting_module
    sub_sorting = module_instance.run(params)
  File "/export/home1/users/nsr/wyngaard/Documents/lussac2/lussac/modules/align_units.py", line 34, in run
    templates, wvf_extractor, margin = self.get_templates(params['wvf_extraction'], params['filter'], return_extractor=True)
  File "/export/home1/users/nsr/wyngaard/Documents/lussac2/lussac/core/module.py", line 194, in get_templates
    wvf_extractor = self.extract_waveforms(sub_folder=sub_folder, **params)
  File "/export/home1/users/nsr/wyngaard/Documents/lussac2/lussac/core/module.py", line 163, in extract_waveforms
    return si.extract_waveforms(self.data.recording, sorting, folder_path, allow_unfiltered=True, **params)
  File "/export/home1/users/nsr/wyngaard/dev/spikeinterface/spikeinterface/spikeinterface/core/waveform_extractor.py", line 987, in extract_waveforms
    we.run_extract_waveforms(seed=seed, **job_kwargs)
  File "/export/home1/users/nsr/wyngaard/dev/spikeinterface/spikeinterface/spikeinterface/core/waveform_extractor.py", line 858, in run_extract_waveforms
    wfs_arrays = extract_waveforms_to_buffers(self.recording, spikes, unit_ids, nbefore, nafter,
  File "/export/home1/users/nsr/wyngaard/dev/spikeinterface/spikeinterface/spikeinterface/core/waveform_tools.py", line 83, in extract_waveforms_to_buffers
    distribute_waveforms_to_buffers(recording, spikes, unit_ids, wfs_arrays_info, nbefore, nafter, return_scaled,
  File "/export/home1/users/nsr/wyngaard/dev/spikeinterface/spikeinterface/spikeinterface/core/waveform_tools.py", line 234, in distribute_waveforms_to_buffers
    processor.run()
  File "/export/home1/users/nsr/wyngaard/dev/spikeinterface/spikeinterface/spikeinterface/core/job_tools.py", line 312, in run
    for res in results:
  File "/users/nsr/wyngaard/dev/miniconda3/envs/lussac2/lib/python3.10/concurrent/futures/process.py", line 567, in _chain_from_iterable_of_lists
    for element in iterable:
  File "/users/nsr/wyngaard/dev/miniconda3/envs/lussac2/lib/python3.10/concurrent/futures/_base.py", line 609, in result_iterator
    yield fs.pop().result()
  File "/users/nsr/wyngaard/dev/miniconda3/envs/lussac2/lib/python3.10/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/users/nsr/wyngaard/dev/miniconda3/envs/lussac2/lib/python3.10/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

It was a pain to debug, but it turns out that the problem was due to my disk not having enough space left to extract the waveforms.

I think there should be a check to see if there is enough space left on the disk or a try catch, so that a more helpful error message can be thrown during multi-threading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions