你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Call MPI.Abort if an MPI rank raises an error
这个提交包含在:
@@ -166,13 +166,12 @@ class MPIContext(Context):
|
|||||||
self.comm = MPI.COMM_WORLD
|
self.comm = MPI.COMM_WORLD
|
||||||
self.rank = self.comm.rank
|
self.rank = self.comm.rank
|
||||||
|
|
||||||
requested_mpi_size = np.product(config.sim_config.mpi)
|
requested_mpi_size = np.prod(config.sim_config.mpi)
|
||||||
if self.comm.size < requested_mpi_size:
|
if self.comm.size < requested_mpi_size:
|
||||||
logger.error(
|
raise ValueError(
|
||||||
f"MPI_COMM_WORLD size of {self.comm.size} is too small for requested dimensions of"
|
f"MPI_COMM_WORLD size of {self.comm.size} is too small for requested dimensions of"
|
||||||
f" {config.sim_config.mpi}. {requested_mpi_size} ranks are required."
|
f" {config.sim_config.mpi}. {requested_mpi_size} ranks are required."
|
||||||
)
|
)
|
||||||
raise ValueError
|
|
||||||
|
|
||||||
if self.rank >= requested_mpi_size:
|
if self.rank >= requested_mpi_size:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
@@ -186,7 +185,10 @@ class MPIContext(Context):
|
|||||||
return MPIModel()
|
return MPIModel()
|
||||||
|
|
||||||
def run(self) -> Dict:
|
def run(self) -> Dict:
|
||||||
|
try:
|
||||||
return super().run()
|
return super().run()
|
||||||
|
except:
|
||||||
|
self.comm.Abort()
|
||||||
|
|
||||||
def _run_model(self, model_num: int) -> None:
|
def _run_model(self, model_num: int) -> None:
|
||||||
"""Process for running a single model.
|
"""Process for running a single model.
|
||||||
|
在新工单中引用
屏蔽一个用户