1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
import mpiunittest as unittest
from mpi4py import MPI
class TestMemory(unittest.TestCase):
#
def testMemory1(self):
for size in range(0, 10000, 100):
try:
mem1 = MPI.Alloc_mem(size)
self.assertEqual(len(mem1), size)
MPI.Free_mem(mem1)
except NotImplementedError:
self.skipTest("mpi-alloc_mem")
def testMemory2(self):
for size in range(0, 10000, 100):
try:
mem2 = MPI.Alloc_mem(size, MPI.INFO_NULL)
self.assertEqual(len(mem2), size)
MPI.Free_mem(mem2)
except NotImplementedError:
self.skipTest("mpi-alloc_mem")
if __name__ == "__main__":
unittest.main()
|