diff --git a/mdevaluate/correlation.py b/mdevaluate/correlation.py index 34cbcd8..525a2f4 100644 --- a/mdevaluate/correlation.py +++ b/mdevaluate/correlation.py @@ -192,13 +192,22 @@ def shifted_correlation( ) else: pool = ProcessPool(nodes=nodes) - result = np.array( - pool.map(partial(get_correlation, idx=idx, selector=selector), start_frames) - ) - pool.terminate() - pool.restart() + try: + result = np.array( + pool.map( + partial(get_correlation, idx=idx, selector=selector), start_frames + ) + ) + except Exception: + logger.warning( + "WARNING: Something went wrong during multiprocessing " + "in shifted_correlation." + ) + finally: + pool.terminate() + pool.restart() - if average == True: + if average: clean_result = [] for entry in result: if np.all(entry == 0):