sdwfrost / liblsoda

The LSODA algorithm for differential equations as a shared library
MIT License
32 stars 16 forks source link

LSODA using OpenMP #16

Open LeighKorbel opened 6 years ago

LeighKorbel commented 6 years ago

Has anyone acheived OpenMP threading with this algorithm? I took the test example and tried using basic OpenMP compiler pragmas to thread the for loop that calls LSODA. The example with OpenMP pragmas is here (and includes omp.h):

test_openmp.zip

The algorithm fails because the initial time step seems randomized rather than what is hard coded. Multiple runs of the test program results in different "t" values to begin each time. If anyone has a minute and doesn't mind looking I would appreciate it. Might be worth noting that I am using gcc.

mattfidler commented 6 years ago

I don't have time to look into your code. However, I have used open MP threading with a very close variant of this package with RxODE https://github.com/nlmxirdevelopment/RxODE. Because RxODE has been on CRAN it has been tested in multiple environments including linux, mac with various different linear algebra systems, so it should work.