From b43c75399087605069634503bc9e99c585ea56b9 Mon Sep 17 00:00:00 2001 From: Johannes Hjorth Date: Thu, 5 Dec 2024 08:10:33 +0100 Subject: [PATCH] Adding more error prints --- snudda/detect/detect.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/snudda/detect/detect.py b/snudda/detect/detect.py index 0107f2387..4163912ce 100644 --- a/snudda/detect/detect.py +++ b/snudda/detect/detect.py @@ -2611,8 +2611,22 @@ def setup_parallel(self, d_view=None): self.write_log("Workers already initialised.") return - with d_view.sync_imports(): - from snudda.detect.detect import SnuddaDetect + self.write_log(f"setup_parallel: {d_view = }") + + try: + with d_view.sync_imports(): + from snudda.detect.detect import SnuddaDetect + + except Exception as e: + self.write_log("Error during sync_imports:") + self.write_log(str(e)) + + worker_errors = d_view.apply_sync(lambda: str(e)).values() + + for engine_id, error in enumerate(worker_errors): + self.write_log(f"Engine {engine_id}: {error}") + + raise # Re-raise the exception to stop the job self.write_log(f"Setting up workers: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())}")