xPC-target slower than Simulink in my application?!

1 view (last 30 days)
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?

Answers (2)

Kaustubha Govind
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.

Azzi Abdelmalek
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.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!