当前位置: 首页>>代码示例>>Python>>正文


Python MPI.Finalize方法代码示例

本文整理汇总了Python中mpi4py.MPI.Finalize方法的典型用法代码示例。如果您正苦于以下问题:Python MPI.Finalize方法的具体用法?Python MPI.Finalize怎么用?Python MPI.Finalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mpi4py.MPI的用法示例。


在下文中一共展示了MPI.Finalize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __exit__

# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import Finalize [as 别名]
def __exit__(self, type, value, traceback):
        try:
            # Import MPI4Py without initializing it
            import mpi4py.rc
            mpi4py.rc.initialize = False
            from mpi4py import MPI

            mpi_init = MPI.Is_initialized()
        except:
            mpi_init = False
        if mpi_init or os.getenv('D500_IN_MPI') is not None:
                MPI.Finalize() 
开发者ID:deep500,项目名称:deep500,代码行数:14,代码来源:mpi_helper.py

示例2: mpi_end_barrier

# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import Finalize [as 别名]
def mpi_end_barrier():
    """ Invokes a barrier and finalization if MPI is running, or nothing 
        otherwise. """
    # Import MPI4Py without initializing it
    import mpi4py.rc
    mpi4py.rc.initialize = False
    from mpi4py import MPI
    if MPI.Is_initialized():
        MPI.COMM_WORLD.Barrier()
        MPI.Finalize() 
开发者ID:deep500,项目名称:deep500,代码行数:12,代码来源:mpi_helper.py

示例3: __del__

# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import Finalize [as 别名]
def __del__(self):
        """
        Overriding the delete function to explicitly call MPI.finalize().
        This is also required so we can tell the teams to get out of the
        while loop they are in and exit gracefully and they themselves call
        finalize when they die.
        """

        #Tell the teams they can exit gracefully.
        self.__command_teams(self.OP_FINISH, None)

        #Finalize the connection because the teams should have finished.
        MPI.Finalize()
        self.finalized = True 
开发者ID:eth-cscs,项目名称:abcpy,代码行数:16,代码来源:mpi.py

示例4: finalize

# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import Finalize [as 别名]
def finalize():
    return MPI.Finalize() 
开发者ID:IanLee1521,项目名称:utilities,代码行数:4,代码来源:mpi.py


注:本文中的mpi4py.MPI.Finalize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。