[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] OpenMP and GSL ?

From: Maxime Boissonneault
Subject: Re: [Help-gsl] OpenMP and GSL ?
Date: Fri, 24 Apr 2009 13:21:46 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; fr; rv: Gecko/20090302 Thunderbird/ Mnenhy/

I realize that my answer never reached the list, so here it is once again.

Jochen Küpper a écrit :
Hi Maxime,

I would like to know if there is any plan in adding OpenMP support to GSL ?

I had looked into this myself before with limited success.
Most importantly, however, I just didn't find time to get serious about it...

OpenMP is the easiest way of parallelizing any code and require almost no work. I have myself modified the Runge-Kutta-Felhberg (4,5) algorithm to take profit of my Core 2 Duo CPU. In the attached file, I simply added a couple of #pragma that tells the compiler to split the loop in many threads. If these pragma are not understood, it does not break the compilation. If they are, you can get a speedup that is close to the number of CPUs you have in many cases.

What speed-up (in wall time) are you really seeing from these modifications?
How complex/expensive is your function evaluation?
I've done some tests a long time ago. From what I remember, my function was taking 75% of the running time, and the integration with RKF45 was taking about 25%. With the OpenMP version of the RKF45 that I attached to my first email, I obtained a gain of about 10% in running time with 2 CPUs. This means that RKF45 was running almost twice as fast with 2 cpus. I emphasize that this change was _really_ easy to make.

I don't know if you guys use unit testing to test GSL, but if you do, adding OpenMP support could be very easy (since I believe that whatever change you make to a code must be tested against unit tests).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]