diff --git a/pycbc/__init__.py b/pycbc/__init__.py index 850adc67dd5..fc478e449c2 100644 --- a/pycbc/__init__.py +++ b/pycbc/__init__.py @@ -186,8 +186,13 @@ def makedir(path): # preserve common state information which we have relied on when using # multiprocessing based pools. import multiprocessing - if hasattr(multiprocessing, 'set_start_method'): - multiprocessing.set_start_method('fork') + if multiprocessing.get_start_method(allow_none=True) is None: + if hasattr(multiprocessing, 'set_start_method'): + multiprocessing.set_start_method('fork') + elif multiprocessing.get_start_method() != 'fork': + warnings.warn("PyCBC requires the use of the 'fork' start method" + " for multiprocessing, it is currently set to {}" + .format(multiprocessing.get_start_method())) else: HAVE_OMP = True