-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MATLAB crashes when calling code-generated function #30
Comments
I confirm a crash on this line: There appears to be a problem with the generated code interface in the case that the whole of the For the moment, you can do this:
|
Thanks for the workaround. The code doesn't crash anymore. Fyi: you have a typo in the third line of your code snippet - the name of the matrix which is passed to the update-function Nevertheless, another issue arose. The solver seems to be numerically less stable and even has a worse performance (takes longer to solve the problem) after code generation. In my example, I first solve the problem with the 'normal' functions and then with the code-generated function. The matrix |
It is possible that the code generated for you does not have the rho adaptation feature enabled, while the solver you get through the ordinary matlab interface does. I made a small example to check, and it seems that the following happens (with all options default):
It is possible that the net effect is that there is no rho adaptation effect in the embedded code, which would explain the difference in performance. Could you try generating your embedded code with Otherwise, please send an MWE and we can have a closer look. |
Thanks for the fast answer. The performance got way better with this option ( |
Please note that the crash when the matrix size isn't specified has been fixed in 0.6.2 released earlier this year. |
Hello,
I'm using the code-generation feature to speed up the solver. The code generation is done like shown in the documentation:
I then want to run the solver in a for loop where I update the bounds and the A-matrix accordingly
When the 'update_A' function is called, MATLAB crashes. I uploaded the crash report. I'm using MATLAB 2020b under Ubuntu 20.04 LTS.
matlab crash osqp2.txt
Note: At my first try to generate the mex-file I got the following errors in MATLAB
after some googling, I found a solution where I preload the library path as follows (executing the following command in the shell before I start matlab from the same shell):
export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
The text was updated successfully, but these errors were encountered: