[Top][All Lists]

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

Re: [Help-gsl] Usage of GSL random in parallel code [OpenMP]

From: Rhys Ulerich
Subject: Re: [Help-gsl] Usage of GSL random in parallel code [OpenMP]
Date: Sun, 4 May 2014 15:06:59 -0500

> I would simply use a wrapper around a C++ std::vector who holds as many
> C++11 random number generators (engines) as you use threads in your code.
> By calling a random number, the engine in the ith index of the vector is
> used, where i is the thread id.

If your threads aren't doing much work beyond random number
generation, you might see a less-than-ideal speedup due to contention
on the contiguous std::vector memory.

Not that you will see such a thing, but suspect it if you run into a wall.

- Rhys

reply via email to

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