help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Random number generators and Pthreads


From: Joseph Wakeling
Subject: Re: [Help-gsl] Random number generators and Pthreads
Date: Wed, 21 Mar 2007 10:53:50 +0000
User-agent: Thunderbird 1.5.0.10 (X11/20070306)

Joseph Wakeling wrote:
> Of course, in many cases it's fine to do this in a serial program and I
> often do.  I was wondering about the scenario outlined in the discussion
> below, of using one random number generator (or an incremented sequence)
> to generate seeds for the rng's used in the threads.  Would it be worth
> doing this in a _serial_ program, generating different seeds for the
> individual runs?  Or is it better to stick with one rng for a serial
> program?

Let me clarify what I'm asking here.  If I have a program whose form is
basically,

   for(i=0;i<N;++i) {
           PLAY_GAME(i);
   }
   analyse_results_of_GAMES();

Then is it better to seed random number generation in this way,

   seed_rng(newseed)
   for(i=0;i<N;++i) {
           PLAY_GAME(i);
   }
   analyse_results_of_GAMES();

or,

   for(i=0;i<N;++i) {
           seed_rng(different_seed_each_time);
           PLAY_GAME(i);
   }
   analyse_results_of_GAMES();





reply via email to

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