OpenMDAO / dymos

Open Source Optimization of Dynamic Multidisciplinary Systems
Apache License 2.0
208 stars 66 forks source link

traj.simulate and dm.run_problem(..., simulate=True) causes hangs under MPI #777

Closed robfalck closed 2 years ago

robfalck commented 2 years ago

Issue Type

Description

The simulate option of dm.run_problem will cause a hang with testflo if running on an MPI case, as does the traj.simulate method. This is likely because simulate calls the simulate method of each underlying phase but probably isn't checking to see if that phase is available on the local processor.

Example

See the finite burn orbit raise example under MPI.

class TestExampleTwoBurnOrbitRaiseMPI(unittest.TestCase):
    N_PROCS = 3

    def test_ex_two_burn_orbit_raise(self):
        optimizer = 'IPOPT'

        p = two_burn_orbit_raise_problem(transcription='gauss-lobatto', transcription_order=3,
                                         compressed=False, optimizer=optimizer, simulate=False,
                                         show_output=False)

        if p.model.traj.phases.burn2 in p.model.traj.phases._subsystems_myproc:
            assert_near_equal(p.get_val('traj.burn2.states:deltav')[-1], 0.3995,
                              tolerance=2.0E-3)

Setting simulate=True in the two_burn_orbit_raise_problem call should demonstrate the issue.

Environment

dymos 1.5.1-dev

naylor-b commented 2 years ago

This was caused by a hang in the Opt report (see OpenMDAO PR 2596)