opensim-core
opensim-core copied to clipboard
Matlab Crash: solver.get_parallel()
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
Just tried to replicate, but used the solver.set_parallel(int)
call first, and it didn't crash.
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.
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 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.
The settings are described here: https://github.com/opensim-org/opensim-core/blob/6953a250f6dd6ffab2ebefdab03575973cfd80a3/OpenSim/Moco/MocoCasADiSolver/MocoCasADiSolver.h#L145
Please re-open if this is still causing issues.