ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/math/ParallelRandNumGen.cpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/math/ParallelRandNumGen.cpp (file contents):
Revision 2076 by tim, Wed Mar 2 15:36:14 2005 UTC vs.
Revision 2082 by tim, Mon Mar 7 22:39:33 2005 UTC

# Line 64 | Line 64 | ParallelRandNumGen::ParallelRandNumGen( const uint32&
64  
65      int nProcessors;
66      MPI_Comm_size(MPI_COMM_WORLD, &nProcessors);
67 <
67 >    MPI_Comm_rank( MPI_COMM_WORLD, &myRank_);
68      //In order to generate independent random number stream, the actual seed used by random
69      //number generator is the seed passed to the constructor plus the number of random number
70      //generators which are already created.    
71      int newSeed = oneSeed + nCreatedRNG_;
72 <    mtRand_ = new MTRand(newSeed, nProcessors, worldRank);
72 >    mtRand_ = new MTRand(newSeed, nProcessors, myRank_);
73  
74      ++nCreatedRNG_;
75   }
# Line 80 | Line 80 | ParallelRandNumGen::ParallelRandNumGen() {
80      const int masterNode = 0;
81      int nProcessors;
82      MPI_Comm_size(MPI_COMM_WORLD, &nProcessors);
83 <    mtRand_ = new MTRand(nProcessors, worldRank);
83 >    MPI_Comm_rank( MPI_COMM_WORLD, &myRank_);
84 >    mtRand_ = new MTRand(nProcessors, myRank_);
85  
86      seed();       /** @todo calling virtual function in constructor is not a good design */
87   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines