Skip to content

Commit

Permalink
test: Fix testsuite for Open MPI 1.10.3 and upcoming 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Jun 16, 2016
1 parent d98fa7a commit 914dda7
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 35 deletions.
2 changes: 2 additions & 0 deletions test/test_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ def tearDown(self):
if MPI.Query_thread() > MPI.THREAD_SINGLE:
del BaseTestComm.testIDup
if name == 'Open MPI':
if version == (2,0,0):
del BaseTestComm.testSplitType
if version < (1,8,2):
del BaseTestComm.testCreateGroup
if version < (1,4,0):
Expand Down
3 changes: 3 additions & 0 deletions test/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ class TestFileSelf(BaseTestFile, unittest.TestCase):
import sys
name, version = MPI.get_vendor()
if name == 'Open MPI':
if version == (2,0,0):
del BaseTestFile.testPreallocate
del BaseTestFile.testGetByteOffset
if version < (1,2,9):
if MPI.Query_thread() > MPI.THREAD_SINGLE:
del BaseTestFile.testPreallocate
Expand Down
66 changes: 40 additions & 26 deletions test/test_rma.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,29 +358,44 @@ def testStartCompletePostTest(self):
group.Free()
wingroup.Free()

def testFlushSync(self):
size = self.COMM.Get_size()
def testSync(self):
win = self.WIN
try:
win.Lock_all()
win.Sync()
win.Unlock_all()
except NotImplementedError:
return
for rank in range(size):
win.Lock(rank)
win.Flush(rank)
win.Unlock(rank)
win.Lock_all()
win.Flush_all()
win.Unlock_all()
for rank in range(size):
win.Lock(rank)
win.Flush_local(rank)
win.Unlock(rank)
win.Lock_all()
win.Flush_local_all()
win.Unlock_all()
comm = self.COMM
rank = comm.Get_rank()
win.Lock(rank)
win.Sync()
win.Unlock(rank)
comm.Barrier()

def testFlush(self):
win = self.WIN
comm = self.COMM
size = comm.Get_size()
rank = comm.Get_rank()
#
for i in range(size):
win.Lock(i)
win.Flush(i)
win.Unlock(i)
comm.Barrier()
for i in range(size):
if i == rank:
win.Lock_all()
win.Flush_all()
win.Unlock_all()
comm.Barrier()
#
for i in range(size):
win.Lock(i)
win.Flush_local(i)
win.Unlock(i)
comm.Barrier()
for i in range(size):
if i == rank:
win.Lock_all()
win.Flush_local_all()
win.Unlock_all()
comm.Barrier()

class TestRMASelf(BaseTestRMA, unittest.TestCase):
COMM = MPI.COMM_SELF
Expand All @@ -395,10 +410,6 @@ class TestRMAWorld(BaseTestRMA, unittest.TestCase):
else:
name, version = MPI.get_vendor()
if name == 'Open MPI':
if (version == (1,10,2) or
version == (1,10,1) or
version == (1,10,0)):
del BaseTestRMA.testFlushSync
if version == (1,8,7):
del BaseTestRMA.testStartCompletePostTest
del BaseTestRMA.testStartCompletePostWait
Expand All @@ -414,6 +425,9 @@ class TestRMAWorld(BaseTestRMA, unittest.TestCase):
del TestRMAWorld
if name == 'HP MPI':
BaseTestRMA.COUNT_MIN = 1
if MPI.Get_version() < (3,0):
del BaseTestRMA.testSync
del BaseTestRMA.testFlush

if __name__ == '__main__':
unittest.main()
23 changes: 14 additions & 9 deletions test/test_rma_nb.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,34 +132,38 @@ def testGetAccumulate(self):
self.assertEqual(gbuf[-1], -1)

def testPutProcNull(self):
self.WIN.Lock_all()
rank = self.COMM.Get_rank()
self.WIN.Lock(rank)
r = self.WIN.Rput(None, MPI.PROC_NULL, None)
r.Wait()
self.WIN.Unlock_all()
self.WIN.Unlock(rank)

def testGetProcNull(self):
self.WIN.Lock_all()
rank = self.COMM.Get_rank()
self.WIN.Lock(rank)
r = self.WIN.Rget(None, MPI.PROC_NULL, None)
r.Wait()
self.WIN.Unlock_all()
self.WIN.Unlock(rank)

def testAccumulateProcNullReplace(self):
rank = self.COMM.Get_rank()
zeros = mkzeros(8)
self.WIN.Lock_all()
self.WIN.Lock(rank)
r = self.WIN.Raccumulate([zeros, MPI.INT], MPI.PROC_NULL, None, MPI.REPLACE)
r.Wait()
r = self.WIN.Raccumulate([zeros, MPI.INT], MPI.PROC_NULL, None, MPI.REPLACE)
r.Wait()
self.WIN.Unlock_all()
self.WIN.Unlock(rank)

def testAccumulateProcNullSum(self):
rank = self.COMM.Get_rank()
zeros = mkzeros(8)
self.WIN.Lock_all()
self.WIN.Lock(rank)
r = self.WIN.Raccumulate([zeros, MPI.INT], MPI.PROC_NULL, None, MPI.SUM)
r.Wait()
r = self.WIN.Raccumulate([None, MPI.INT], MPI.PROC_NULL, None, MPI.SUM)
r.Wait()
self.WIN.Unlock_all()
self.WIN.Unlock(rank)


class TestRMASelf(BaseTestRMA, unittest.TestCase):
Expand All @@ -176,7 +180,8 @@ class TestRMAWorld(BaseTestRMA, unittest.TestCase):
else:
name, version = MPI.get_vendor()
if name == 'Open MPI':
if (version == (1,10,2) or
if (version == (1,10,3) or
version == (1,10,2) or
version == (1,10,1) or
version == (1,10,0)):
def SKIP(*t, **k): pass
Expand Down

0 comments on commit 914dda7

Please sign in to comment.