[Boost-MPI][Boost-ODEINT] Running odeint within MPI-context without using mpi_state

Hei, I am currently using the odeint-solver for calculating the right hand side of a non-linear equation. For speeding up the calculation of the right hand side, I decided to test the MPI-implementation. Now, after I would prefer to keep the code backwards compatible, I did not want to replace state_type with mpi_state, and instead split up the initial vector by hand before calling odeint without telling odeint that I am operating within an MPI context. I take care of all communications which involve the vectors, and therefore I assumed that this approach should work (especially after it worked correctly in small test programs). Nevertheless, I encountered the issue that after a certain amount of steps the step size between the different threads starts to differ by a small amount, even though I am in the same iteration. As example: step number rank step size n 1 0.00025 n 0 0.00025 //Ok n + 1 1 0.00051152 n + 1 0 0.000511523 //Not ok I checked my program with valgrind for possible memory leaks/corruption which could overwrite something, but nothing relevant came up. The problem is repeatable. Therefore, is the general idea correct at all, or am I doing something wrong here by neglecting a possible communication between the different threads within odeint? Thanks! Regards, Roland

Hello
Therefore, is the general idea correct at all, or am I doing something wrong here by neglecting a possible communication between the different threads within odeint?
You probably must only use steppers where you decide the step size and which don't adjust their step size dynamically. Otherwise I guess you'd have to modify the dynamic step size code to synchronize step sizes between different mpi processes, etc. Ilja

So, there is no communication between the threads about the step size, and each thread can choose their own step size? Thanks, regards, Roland Am 19.01.21 um 09:52 schrieb Ilja Honkonen:
Hello
Therefore, is the general idea correct at all, or am I doing something wrong here by neglecting a possible communication between the different threads within odeint?
You probably must only use steppers where you decide the step size and which don't adjust their step size dynamically. Otherwise I guess you'd have to modify the dynamic step size code to synchronize step sizes between different mpi processes, etc. Ilja
participants (2)
-
Ilja Honkonen
-
Roland Richter