LLNL / Juqbox.jl

Juqbox.jl solves quantum optimal control problems in closed quantum systems
MIT License
42 stars 10 forks source link

Parallelism? #16

Closed jasonchadwick closed 3 years ago

jasonchadwick commented 3 years ago

Can Juqbox be set up to take advantage of multiple cores at the same time? The original Ipopt package seems to have some options for this, depending on the linear solver used, but I can't figure out how to get it to work with the Ipopt.jl package.

andersp commented 3 years ago

There is currently no support for parallel execution in Juqbox.jl. If you want to explore this, the easiest would be to propagate the different initial conditions in the basis on different cores, and use MPI to gather the contributions to the objective function and gradient.

jasonchadwick commented 3 years ago

It seems like Ipopt can do some parallelism in their linear solver if it is compiled to support it (based on choice of linear solver - Pardiso and WSMP seem to support multiple threads). Is there any relatively simple way to enable these options?

andersp commented 3 years ago

The time spent in Ipopt is only a small fraction of the total simulation time, so running Ipopt on several threads will not make any significant difference. Pardiso was briefly used as a linear solver in Juqbox, within the time-stepping routine. Last summer, it was replaced by a Neumann iteration, which is significantly faster. The most time consuming part of the algorithm is to calculate the objective function and its gradient. One way of speeding that up would be to run different initial conditions on different cores, using MPI to gather the results. In principle, this is straightforward, but would require non-trivial modifications of the code.

jasonchadwick commented 3 years ago

I'll look into it, thanks!