How to speed up the code using CODER (mex file generation) in numerical analysis simulation ?

1 visualización (últimos 30 días)
Hi all,
I'm solving PDE expressed by conservation equations (mass, heat, and momentum).
To solve the problem, firstly I discretized the space domain and newly formulated 2-D PDE into a 1-D ODE. The ode15s solver was introduced to reflect the system's stiffness.
The thing is that CODER does not help speed up..!
What I want is to use the CODER correctly to speed up the computation.
I'm wondering if using a function related on matrix generation (eyes, ones, diag) or ode15s adversely affects speed improvement. If so, is there any alternatives?
Thanks in advances :D

Respuesta aceptada

Gaurav Garg
Gaurav Garg el 11 de Ag. de 2020
Hey Kim,
The speed-up factor would vary from application to application, and mainly because of the style of writing code.
I would suggest you to look at some techniques you can use to accelerate your MATLAB algorithm or application.
Overall, simply running an application using MATLAB Coder won't return you an optimized C/C++/MEX executable. For example, you may not see a good speedup when MATLAB code uses optimized libraries like BLAS. For more info, refer here. Moreover, refer to the MATLAB Coder documentation, and functions and objects that are supported for C/C++ code generation here.
  1 comentario
Jinsu Kim
Jinsu Kim el 11 de Ag. de 2020
Thanks for your detailed explanation :D
In terms of algorithms, I considered before such as parellel computing or code profiler.
At that time, I concluded that (1) parallel computing is not applicable for my problem, and (2) I couldn't have any hints on code profiling results.
Actually, I asksed similar question..
https://kr.mathworks.com/matlabcentral/answers/564635-how-to-speed-up-a-code-from-the-code-profiler-results?s_tid=srchtitle
Could you give me additional comments on the above question?
Have a good day

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by