Skip to content

Commit

Permalink
[XEB] Multiprocessing spawn (#4090)
Browse files Browse the repository at this point in the history
There are two multiprocessing "modes": fork and spawn. Fork used to always be the default. Now sometimes on Mac it defaults to spawn (?) but in any event: spawn works way better. This could prevent some of the c++-looking errors that @mrwojtek has seen. It fixed different-but-still-c++-looking-errors for me
  • Loading branch information
mpharrigan committed May 13, 2021
1 parent 5fdb80d commit ce58f42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cirq-google/cirq_google/calibration/xeb_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _maybe_multiprocessing_pool(
yield None
return

with multiprocessing.Pool(processes=n_processes) as pool:
with multiprocessing.get_context('spawn').Pool(processes=n_processes) as pool:
yield pool


Expand Down

0 comments on commit ce58f42

Please sign in to comment.