opensim-core icon indicating copy to clipboard operation
opensim-core copied to clipboard

Matlab Crash: solver.get_parallel()

Open stingjp opened this issue 2 years ago • 5 comments

Was trying to play around with parallelization. Set up a full muscle-driven, 3D tracking simulation. After getting the solver object, tried to call solver.get_parallel(), and it crashes MATLAB. Attached the crash log. solver.get_parallel_crashReport.txt

stingjp avatar Apr 16 '22 00:04 stingjp

Just tried to replicate, but used the solver.set_parallel(int) call first, and it didn't crash.

stingjp avatar Apr 16 '22 00:04 stingjp

solver.get_parallel() crashes because the parallel property is optional, so it doesn't have a value by default. Makes sense that it doesn't crash after you set it.

There's some comments about why it is optional in the MocoCasADiSolver documentation.

nickbianco avatar Apr 18 '22 17:04 nickbianco

It's not great that a crash occurs when the value is not set, but this property needs to stay optional so that the parallel setting logic remains intact.

Perhaps we add a warning in the MocoCasADiSolver docs that this property is optional and will crash if accessed before setting.

nickbianco avatar Apr 18 '22 17:04 nickbianco

@nickbianco What is the meaning of the value passed in to set_parallel()? I'd assume some default of 0 or 1 would mean no parallelization without additional work but I don't know enough about how the solvers internals work.

aymanhab avatar Apr 18 '22 17:04 aymanhab

The settings are described here: https://github.com/opensim-org/opensim-core/blob/6953a250f6dd6ffab2ebefdab03575973cfd80a3/OpenSim/Moco/MocoCasADiSolver/MocoCasADiSolver.h#L145

nickbianco avatar Apr 18 '22 17:04 nickbianco

Please re-open if this is still causing issues.

jenhicks avatar Nov 23 '22 18:11 jenhicks