[BUG] JMP & GCP crashing when using "Threads" parallel profile
RobSalati opened this issue · 1 comments
Describe the bug
When you set the Matlab parallel profile to multithreading, JMP and GCP crash while making calls to OpenSim functions.
JMP exits with error message:
Error using Model
Unable to resolve the name 'org.opensim.modeling.Model'.
Error in computeInnerOptimization (line 37)
model = Model(modelFile);
....
GCP exits with error message:
Error using Model
Unable to resolve the name 'org.opensim.modeling.Model'.
Error in calcGroundContactPersonalizationTaskCost (line 38)
models.("model_" + foot) = Model(inputs.surfaces{foot}.model);
....
To Reproduce
- Go to Parallel Computing Toolbox Preferences.
- Set Default Profile to Threads.
- Execute either RunJMP.m or runGCP.m in nmsm-tutorial folder.
Expected behavior
JMP and GCP should run without crashing.
Desktop (please complete the following information):
- OS: Windows
- OpenSim Version: 4,4
- MATLAB Version: 2023a
- NMSM Pipeline Version: v1.0
Additional context
This error only occurs when the parallel profile is set to threads. I have run JMP and GCP with multiprocessing with no issues.
I think this documentation explains the issue. Based on how some of our old mex files are written, I don't think Matlab's thread-based parallel processing will support the OpenSim API. We probably don't have a way of changing this, so we should warn users in our documentation not to switch to the thread-based mode.