Skip to content

Commit

Permalink
Merge e7bc698 into 21c6de6
Browse files Browse the repository at this point in the history
  • Loading branch information
naylor-b committed May 31, 2019
2 parents 21c6de6 + e7bc698 commit d925cc9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions openmdao/core/tests/test_prob_remote.py
Expand Up @@ -73,16 +73,14 @@ def test_remote_var_access_prom(self):
np.testing.assert_almost_equal(prob['prod.z'], 20., decimal=5)


# @unittest.skipUnless(MPI and PETScVector, "only run with MPI and PETSc.")
@unittest.skip("FIXME: test is unreliable on CI... (timeout)")
#@unittest.skip("FIXME: test is unreliable on CI... (timeout)")
@unittest.skipUnless(MPI and PETScVector, "only run with MPI and PETSc.")
class ProbRemote4TestCase(unittest.TestCase):

N_PROCS = 4

def test_prob_split_comm(self):
colors = [0, 0, 1, 1]
alloc = DefaultAllocator(parallel=True)

comm = MPI.COMM_WORLD.Split(colors[MPI.COMM_WORLD.rank])

# split the size 4 comm into 2 size 2 comms
Expand Down Expand Up @@ -117,7 +115,14 @@ def test_prob_split_comm(self):

failed = prob.run_driver()

self.assertFalse(failed, "Optimization failed, info = " +
str(prob.driver.pyopt_solution.optInform))

assert_rel_error(self, prob['obj.o'], 2.0, 1e-6)
all_failed = comm.allgather(failed)
if any(all_failed):
all_msgs = comm.allgather(str(prob.driver.pyopt_solution.optInform))
for i, tup in enumerate(zip(all_failed, all_msgs)):
failed, msg = tup
if failed:
self.fail("Optimization failed on rank %d: %s" % (i, msg))

objs = comm.allgather(prob['obj.o'])
for i, obj in enumerate(objs):
assert_rel_error(self, obj, 2.0, 1e-6)

0 comments on commit d925cc9

Please sign in to comment.