DifferentialEquations Multithreading ; How to use EnsembleProblem

Hi, would like to parallelize the solving of an ODE with DiferentialEquations.jl utilizing multi-threading, but i fail to understand how EnsembleProblem works exactly, I am a bit confused over the “tarjectories” parameter.

When I solve my ODEProblem that i converted to an EnsembleProblem, the following will use one of my thread

sim = solve(ensemble_prob,alg,EnsembleThreads(),trajectories=1)

Whereas this would use 12 of my threads

sim = solve(ensemble_prob,alg,EnsembleThreads(),trajectories=12)

I see in the provided examples thousands of trajectories are used, what does it mean exactly ?
Is it the wrong way of parallelizing a solver ?

It means that’s the number of ODEs that are being solved.

It doesn’t “parallelize a solver”, it parallelizes the solver over many parameters, initial conditions, etc.

1 Like