[Top][All Lists]

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

[Help-gsl] efficient use of gsl in multithreaded programs

From: Analabha Roy
Subject: [Help-gsl] efficient use of gsl in multithreaded programs
Date: Tue, 17 Jan 2006 00:00:56 -0600


  I'm trying to solve an ODE system using GSL (ver 1.7) in a multithreaded
environment. It's an IBM AIX 224-way teragrid system and I'm using OpenMP to
parallelize my code. I'm coding in C.

 Now I'm aware that the GSL libraries are not multithread-optimized or
anything, but I would just like to solve the same differential equation for
(say) 5000 initial conditions, and I'd like to do the 5000 in parallel, but
each evolution can be serial no probs. The walltime will be significantly
reduced anyways.

 Now, I'm using rk4imp method in GSL, and, for reference, say I'm doing the
same ODE that's there in the GSL manual on page 287-288 chapter 25 (insert
link here).

 Now, let's say I define the func and jac subroutines (tho it won't need jac
in rk4imp I guess). Now, I start main() and define all the data types for
the ODE system, allocate space and all that. Now, I need to fork off a set
of OMP threads for evaluating the same ODE for 5000 ICs. The question is
that which variables should I set to shared and which should I keep private
to a particular thread? I mean, I've defined:

const gsl_odeiv_step_type,
gsl_odeiv_step, g
sl_odeiv_control and

datatypes. Since each thread calls the integrator with a different set of
initial values for y[i], they should be marked private in the code, right?
What about the other datatypes? All of the above datatypes are also
evaluated separately by each thread, so they should all be set to private,
right? I did, and my program just hung on evaluating the first IC at t=0 and
stayed there.

 I'd really appreciate some help if my shared/private allocation of GSL
datatypes is wrong or I have missed anything.

reply via email to

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