Open
Description
Describe the bug
There seems to be a weird edge case when processing single file "datasets" using more than one worker. I guess this is because
graphnet/src/graphnet/data/dataconverter.py
Lines 277 to 293 in 65ec11c
n_workers = 1
when there is one file and does not use multiprocessing, but graphnet/src/graphnet/data/dataconverter.py
Lines 259 to 263 in 65ec11c
self._num_workers
and tries to access the global variables that are used for multiprocessing.
To Reproduce
Steps to reproduce the behavior:
- Process i3 files using >1 workers and only one file in the input folder
Expected behavior
It should allocate just one worker and be processed normally.
Full traceback
File "<path>/graphnet/src/graphnet/data/dataconverter.py", line 260, in _request_event_nos
with global_index.get_lock(): # type: ignore[name-defined]
^^^^^^^^^^^^
NameError: name 'global_index' is not defined. Did you mean: 'init_global_index'?