Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiprocessing RecursionError: maximum recursion depth exceeded while calling a Python object [WINDOWS ISSUE] #38

Open
siddhantphy opened this issue Apr 6, 2022 · 0 comments

Comments

@siddhantphy
Copy link

siddhantphy commented Apr 6, 2022

Running multiprocessed codes on larger lattices (for both union-find and MWPM) results in a recursion depth error for the pickled input arguments, i.e. code and decoder objects. For faulty measurements, this error happens for lattices as small as 4x4.
This happens on Windows. While it works perfectly in the Unix environment.
Steps to reproduce

from qsurface.main import initialize, run_multiprocess

code, decoder = initialize((4, 4), "toric", "unionfind", enabled_errors=["pauli"], faulty_measurements=True)
if __name__ == "__main__":
    run_multiprocess(code, decoder, iterations=100, error_rates={"p_bitflip": 0.01})

Error

Traceback (most recent call last):
  File "c:\Users\*\Desktop\test.py", line 5, in <module>
    run_multiprocess(code, decoder, iterations=100, error_rates={"p_bitflip": 0.01})
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\site-packages\qsurface\main.py", line 276, in run_multiprocess
    worker.start()
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
RecursionError: maximum recursion depth exceeded while calling a Python object
PS C:\Users\*> Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 126, in _main
    self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
@siddhantphy siddhantphy changed the title Multiprocessing RecursionError: maximum recursion depth exceeded while calling a Python object Multiprocessing RecursionError: maximum recursion depth exceeded while calling a Python object [WINDOWS ISSUE] Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant