xPC-target slower than Simulink in my application?!
1 view (last 30 days)
Show older comments
Hi everyone,
I am running a Simulink model consisting of 3 C-mex S-functions with static linked libraries to an optimization solver (IPOPT) linked to them.
This Simulink model runs faster than real-time on my laptop. I am using a delirately large (but allowable) sample-time of 0.5 seconds. The processor can at all times handle the excecutions in that 0.5 seconds time.
When I compile and run on xPC-target, the performance is much, much worse, while the CPU hardware is much better. The Tet time is very steady around 0.36-0.37 seconds. This is not only slower than in Simulink, but also with a lot less variation (a different optimization problem is solved every timestep).
What could be the reason for code to run slower on xPC-target than on Simulink?
Thoughts:
- Item one Does something strange happen when compiling?
- Item two Why do I have to recompile the C mex S-functions for xPC? Can't it use the already generated mex files?
0 Comments
Answers (2)
Kaustubha Govind
on 24 Sep 2012
Martijn: I don't have a lot of experience with xPC Target, so I'll leave others with more expertise to help you our on the performance issue. (Please contact MathWorks Tech Support with your model and configuration information if you do not receive general advice on this forum). I think I can however answer question #2 - MEX-files are essentially shared libraries (DLLs on a PC) with a different extension. I think that format is not suitable for the xPC operating system, so they need to be recompiled to the correct binary format.
0 Comments
Azzi Abdelmalek
on 24 Sep 2012
less faster, compared to what? xpc target is supposed to run faster if you boot on a target computer without its OS.
0 Comments
See Also
Categories
Find more on Target Computer Setup in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!