Skip to content

Commit

Permalink
Adding more error prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Dec 5, 2024
1 parent 9b59393 commit b43c753
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions snudda/detect/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())}")

Expand Down

0 comments on commit b43c753

Please sign in to comment.