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

Comparing trunk/src/math/ParallelRandNumGen.cpp (file contents):
Revision 1796 by gezelter, Mon Sep 10 18:38:44 2012 UTC vs.
Revision 1938 by gezelter, Thu Oct 31 15:32:17 2013 UTC

# Line 35 | Line 35
35   *                                                                      
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39   * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40   * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42
43 #include "math/ParallelRandNumGen.hpp"
42   #ifdef IS_MPI
43   #include <mpi.h>
44   #endif
45  
46 + #include "math/ParallelRandNumGen.hpp"
47 +
48   namespace OpenMD {
49  
50    int ParallelRandNumGen::nCreatedRNG_ = 0;
# Line 85 | Line 85 | namespace OpenMD {
85  
86    ParallelRandNumGen::ParallelRandNumGen() {
87  
88    std::vector<uint32> bigSeed;
88      int nProcessors;
89   #ifdef IS_MPI
90      nProcessors = MPI::COMM_WORLD.Get_size();
# Line 124 | Line 123 | namespace OpenMD {
123    void ParallelRandNumGen::seed() {
124  
125      std::vector<uint32> bigSeed;
127    int size;
126  
127   #ifdef IS_MPI
128 +    int size;
129      const int masterNode = 0;
130      if (worldRank == masterNode) {
131   #endif
132  
133        bigSeed = mtRand_->generateSeeds();
135      size = bigSeed.size();
134  
135   #ifdef IS_MPI
136 +      size = bigSeed.size();
137        MPI::COMM_WORLD.Bcast(&size, 1, MPI::INT, masterNode);
138        MPI::COMM_WORLD.Bcast(&bigSeed[0], size, MPI::UNSIGNED_LONG, masterNode);
139      }else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines