Migration.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码
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

    # -----------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号