Fix deadlock bug when some ranks finish early

- When some ranks finish quicker than others, if the ranks one of the
  ranks still running encounters an error it will attempt to call
  MPI.Abort. As some ranks will have already exited, this was causing
  deadlock without the error actually appearing.
这个提交包含在:
Nathan Mannall
2025-06-06 17:50:14 +01:00
父节点 5e8277ceff
当前提交 e842fcd949

查看文件

@@ -1,5 +1,5 @@
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
# and Nathan Mannall
#
# This file is part of gprMax.
@@ -187,7 +187,11 @@ class MPIContext(Context):
def run(self) -> Dict:
try:
return super().run()
result = super().run()
logger.debug("Waiting for all ranks to finish.")
self.comm.Barrier()
logger.debug("Completed.")
return result
except:
logger.exception(f"Rank {self.rank} encountered an error. Aborting...")
self.comm.Abort()