def __init__(self):
# Delayed ImportError of mpi4py
if not HAS_MPI4PY:
raise ImportError("No module named mpi4py, you must install mpi4py to use MPIMIgration!")
super(MPIMigration, self).__init__()
self.comm = MPI.COMM_WORLD
self.pid = self.comm.rank
if self.pid == 0:
self.source = self.comm.size - 1
else:
self.source = self.comm.rank - 1
self.dest = (self.comm.rank + 1) % (self.comm.size)
self.all_stars = None
# -----------------------------------------------------------------
评论列表
文章目录