Does efficiency of casadi code affect the final performance of the solver? #328
-
Having worked in casadi a lot, the complexity of the expression graph can depend on the person coding for a given application. I think this can affect the overall performance of the solver when it comes to function evaluations. For example, multiple shooting methods can be evaluated in serial and parallel. I would like your suggestions before working on OpEn. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@sandeep026 We use CasADi to generate C code for some gradients. The C code is then co-compiled with our Rust code. The generated code can indeed be very lengthy. We have a paper where we implemented a custom code generator for optimal control problems, which has a significantly lower footprint in terms of geneated code: and in some examples seems to run faster (esp. for large prediction horizons): We have implemented this in That said, overall I find that CasADi performs decently well, despite the fact that it can lead to very large auto-generated files. |
Beta Was this translation helpful? Give feedback.
@sandeep026 We use CasADi to generate C code for some gradients. The C code is then co-compiled with our Rust code. The generated code can indeed be very lengthy. We have a paper where we implemented a custom code generator for optimal control problems, which has a significantly lower footprint in terms of geneated code:
and in some examples seems to run faster (esp. for large prediction horizons):
We have implemented this in
gradgen
, but we haven't integrated it with OpEn.That said, overall I find that CasADi performs decently well, despite the fact that it can lead to very large auto-generated files.