Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sandmaennchen
Copy link
Contributor

@sandmaennchen sandmaennchen commented Apr 29, 2024

This PR implements a parallelizable batch solve for integrators and OCP solvers. The batch solve is interfaced from python with AcadosOcpBatchSolver and AcadosSimBatchSolver. These classes hold N_batch identical solvers and provide a parallelizable solve function. All other operations have to be called individually for each of the solvers via their standard interface.

Parallelization via openmp can be switched on by setting num_threads_in_batch_solve which has been added to the solver options.

@sandmaennchen sandmaennchen requested a review from FreyJo April 29, 2024 08:39
Copy link
Member

@FreyJo FreyJo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! ⚡

@sandmaennchen sandmaennchen merged commit a156845 into acados:master Apr 29, 2024
@FreyJo FreyJo deleted the wip_batch_sim branch April 29, 2024 15:07
FreyJo pushed a commit that referenced this pull request Apr 30, 2024
Apparently, shared libraries with and without openmp cannot easily be
combined. If the acados batch solvers introduced in #1087 should be
used, it is thus recommended to compile the acados shared library with
openmp and set the number of threads to 1.
This problem seems to be related to:
* JuliaLang/julia#10938
* casadi/casadi#2447

This PR implements corresponding warnings in `AcadosOcpBatchSolver` and
`AcadosSimBatchSolver` and removes the examples from the tests (as we do
not want to compile acados with openmp for all tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants