本文整理汇总了Python中mpi4py.MPI._handleof方法的典型用法代码示例。如果您正苦于以下问题:Python MPI._handleof方法的具体用法?Python MPI._handleof怎么用?Python MPI._handleof使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpi4py.MPI
的用法示例。
在下文中一共展示了MPI._handleof方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testAHandleOf
# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import _handleof [as 别名]
def testAHandleOf(self):
for obj in self.objects:
if isinstance(obj, MPI.Status):
hdl = lambda: MPI._handleof(obj)
self.assertRaises(NotImplementedError, hdl)
continue
hdl = MPI._handleof(obj)
示例2: testHandleValue
# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import _handleof [as 别名]
def testHandleValue(self):
typemap = {ctypes.sizeof(ctypes.c_uint32): ctypes.c_uint32,
ctypes.sizeof(ctypes.c_uint64): ctypes.c_uint64}
for obj in self.objects:
uintptr_t = typemap[MPI._sizeof(obj)]
handle = uintptr_t.from_address(MPI._addressof(obj))
self.assertEqual(handle.value, MPI._handleof(obj))
示例3: testHandleValue
# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import _handleof [as 别名]
def testHandleValue(self):
ffi = cffi.FFI()
typemap = {ffi.sizeof('uint32_t'): 'uint32_t',
ffi.sizeof('uint64_t'): 'uint64_t',}
for obj in self.objects:
uintptr_t = typemap[MPI._sizeof(obj)]
handle = ffi.cast(uintptr_t+'*', MPI._addressof(obj))[0]
self.assertEqual(handle, MPI._handleof(obj))
示例4: setup_md
# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import _handleof [as 别名]
def setup_md(self, icomm_grid, xyzL, xyz_orig):
"""
setup_md(self, dt, icomm_grid, xyzL, xyz_orig)
Keyword arguments:
real -- the real part (default 0.0)
imag -- the imaginary part (default 0.0)
"""
self.py_setup_md(MPI._handleof(icomm_grid), xyzL, xyz_orig)
示例5: testAHandleOf
# 需要导入模块: from mpi4py import MPI [as 别名]
# 或者: from mpi4py.MPI import _handleof [as 别名]
def testAHandleOf(self):
for obj in self.objects:
if isinstance(obj, MPI.Status): continue
hdl = MPI._handleof(obj)