Commit 07d923ed authored by Niklas Bohn's avatar Niklas Bohn
Browse files

Disabled multiprocessing on Windows again since start method "fork" is not available there.


Signed-off-by: Niklas Bohn's avatarnbohn <nbohn@gfz-potsdam.de>
parent a1b8983d
......@@ -1125,7 +1125,9 @@ def __minimize__(fo, opt_func, unknowns=False, logger=None):
warnings.filterwarnings("always")
processes = fo.cpu
if processes == 1:
if platform.system() == "Windows" and processes > 1:
logger.warning('Multiprocessing is currently not available on Windows.')
if platform.system() == "Windows" or processes == 1:
logger.info("Singleprocessing on 1 cpu")
else:
logger.info("Setting up multiprocessing...")
......@@ -1227,8 +1229,10 @@ def __minimize__(fo, opt_func, unknowns=False, logger=None):
# start optimization
logger.info("Optimization...")
t0 = time()
# check if operating system is 'Windows'; in that case, multiprocessing is currently not working
# TODO: enable Windows compatibility for multiprocessing
if processes == 1:
if platform.system() == "Windows" or processes == 1:
initializer(globals(), globs)
[mp_fun(ii) for ii in tqdm(rng, disable=fo.disable_progressbars)]
else:
......
......@@ -145,7 +145,7 @@ def empirical_line_solution(X, rdn_subset, data_l2a_seg, rows, cols, bands, segs
global _globs
_globs = dict(tree=tree, locs=locations_subset, k=15, rdn=rdn_subset, data=data_l2a_seg, bands=bands)
if processes == 1:
if platform.system() == "Windows" or processes == 1:
initializer(globals(), _globs)
results = []
for ii in tqdm(unique_labels, disable=disable_progressbars):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment