Commit d422c306 authored by Jason Swails's avatar Jason Swails
Browse files

Change comments so that it does not reference generating seeds from the clock.

parent 118aab89
...@@ -115,9 +115,9 @@ public: ...@@ -115,9 +115,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -100,9 +100,9 @@ public: ...@@ -100,9 +100,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -445,9 +445,9 @@ public: ...@@ -445,9 +445,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -100,9 +100,9 @@ public: ...@@ -100,9 +100,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -168,9 +168,9 @@ public: ...@@ -168,9 +168,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -124,9 +124,9 @@ public: ...@@ -124,9 +124,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -221,9 +221,9 @@ public: ...@@ -221,9 +221,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -122,9 +122,9 @@ public: ...@@ -122,9 +122,9 @@ public:
* In particular, Platforms are permitted to use non-deterministic algorithms which produce different * In particular, Platforms are permitted to use non-deterministic algorithms which produce different
* results on successive runs, even if those runs were initialized identically. * results on successive runs, even if those runs were initialized identically.
* *
* If seed is set to 0 (which is the default value assigned), a new seed is generated from the system * If seed is set to 0 (which is the default value assigned), a unique seed is chosen when a Context
* clock when a Context is created from this Force. This is done to ensure that each Context receives * is created from this Force. This is done to ensure that each Context receives unique random seeds
* unique random seeds without you needing to set them explicitly. * without you needing to set them explicitly.
*/ */
void setRandomNumberSeed(int seed) { void setRandomNumberSeed(int seed) {
randomNumberSeed = seed; randomNumberSeed = seed;
......
...@@ -62,7 +62,7 @@ void MonteCarloAnisotropicBarostatImpl::initialize(ContextImpl& context) { ...@@ -62,7 +62,7 @@ void MonteCarloAnisotropicBarostatImpl::initialize(ContextImpl& context) {
numAccepted[i] = 0; numAccepted[i] = 0;
} }
int randSeed = owner.getRandomNumberSeed(); int randSeed = owner.getRandomNumberSeed();
// A random seed of 0 means pull a new one from the clock // A random seed of 0 means use a unique one
if (randSeed == 0) randSeed = osrngseed(); if (randSeed == 0) randSeed = osrngseed();
init_gen_rand(randSeed, random); init_gen_rand(randSeed, random);
} }
......
...@@ -60,7 +60,7 @@ void MonteCarloBarostatImpl::initialize(ContextImpl& context) { ...@@ -60,7 +60,7 @@ void MonteCarloBarostatImpl::initialize(ContextImpl& context) {
numAttempted = 0; numAttempted = 0;
numAccepted = 0; numAccepted = 0;
int randSeed = owner.getRandomNumberSeed(); int randSeed = owner.getRandomNumberSeed();
// A random seed of 0 means pull a new one from the clock // A random seed of 0 means use a unique one
if (randSeed == 0) randSeed = osrngseed(); if (randSeed == 0) randSeed = osrngseed();
init_gen_rand(randSeed, random); init_gen_rand(randSeed, random);
} }
......
...@@ -62,7 +62,7 @@ void MonteCarloMembraneBarostatImpl::initialize(ContextImpl& context) { ...@@ -62,7 +62,7 @@ void MonteCarloMembraneBarostatImpl::initialize(ContextImpl& context) {
numAccepted[i] = 0; numAccepted[i] = 0;
} }
int randSeed = owner.getRandomNumberSeed(); int randSeed = owner.getRandomNumberSeed();
// A random seed of 0 means pull a new one from the clock // A random seed of 0 means use a unique one
if (randSeed == 0) randSeed = osrngseed(); if (randSeed == 0) randSeed = osrngseed();
init_gen_rand(randSeed, random); init_gen_rand(randSeed, random);
} }
......
...@@ -51,7 +51,7 @@ void CpuRandom::initialize(int seed, int numThreads) { ...@@ -51,7 +51,7 @@ void CpuRandom::initialize(int seed, int numThreads) {
nextGaussianIsValid.resize(numThreads, false); nextGaussianIsValid.resize(numThreads, false);
/* Use a quick and dirty RNG to pick seeds for the real random number generator. /* Use a quick and dirty RNG to pick seeds for the real random number generator.
* A random seed of 0 means pick a new random seed based on wall clock * A random seed of 0 means pick a unique seed
*/ */
unsigned int r = (unsigned int) seed; unsigned int r = (unsigned int) seed;
......
...@@ -5969,7 +5969,7 @@ void CudaIntegrateCustomStepKernel::prepareForComputation(ContextImpl& context, ...@@ -5969,7 +5969,7 @@ void CudaIntegrateCustomStepKernel::prepareForComputation(ContextImpl& context,
randomSeed = CudaArray::create<int4>(cu, cu.getNumThreadBlocks()*CudaContext::ThreadBlockSize, "randomSeed"); randomSeed = CudaArray::create<int4>(cu, cu.getNumThreadBlocks()*CudaContext::ThreadBlockSize, "randomSeed");
vector<int4> seed(randomSeed->getSize()); vector<int4> seed(randomSeed->getSize());
int rseed = integrator.getRandomNumberSeed(); int rseed = integrator.getRandomNumberSeed();
// A random seed of 0 means generate a new one from the wall clock // A random seed of 0 means use a unique one
if (rseed == 0) if (rseed == 0)
rseed = osrngseed(); rseed = osrngseed();
unsigned int r = (unsigned int) (rseed+1); unsigned int r = (unsigned int) (rseed+1);
......
...@@ -1004,7 +1004,7 @@ void OpenCLIntegrationUtilities::initRandomNumberGenerator(unsigned int randomNu ...@@ -1004,7 +1004,7 @@ void OpenCLIntegrationUtilities::initRandomNumberGenerator(unsigned int randomNu
vector<mm_int4> seed(randomSeed->getSize()); vector<mm_int4> seed(randomSeed->getSize());
unsigned int r = randomNumberSeed; unsigned int r = randomNumberSeed;
// A seed of 0 means pull one from the clock // A seed of 0 means use a unique one
if (r == 0) r = (unsigned int) osrngseed(); if (r == 0) r = (unsigned int) osrngseed();
for (int i = 0; i < randomSeed->getSize(); i++) { for (int i = 0; i < randomSeed->getSize(); i++) {
seed[i].x = r = (1664525*r + 1013904223) & 0xFFFFFFFF; seed[i].x = r = (1664525*r + 1013904223) & 0xFFFFFFFF;
......
...@@ -6202,7 +6202,7 @@ void OpenCLIntegrateCustomStepKernel::prepareForComputation(ContextImpl& context ...@@ -6202,7 +6202,7 @@ void OpenCLIntegrateCustomStepKernel::prepareForComputation(ContextImpl& context
randomSeed = OpenCLArray::create<mm_int4>(cl, cl.getNumThreadBlocks()*OpenCLContext::ThreadBlockSize, "randomSeed"); randomSeed = OpenCLArray::create<mm_int4>(cl, cl.getNumThreadBlocks()*OpenCLContext::ThreadBlockSize, "randomSeed");
vector<mm_int4> seed(randomSeed->getSize()); vector<mm_int4> seed(randomSeed->getSize());
int rseed = integrator.getRandomNumberSeed(); int rseed = integrator.getRandomNumberSeed();
// A random seed of 0 means generate a new one from the wall clock // A random seed of 0 means use a unique one
if (rseed == 0) if (rseed == 0)
rseed = osrngseed(); rseed = osrngseed();
unsigned int r = (unsigned int) (rseed+1); unsigned int r = (unsigned int) (rseed+1);
......
...@@ -362,7 +362,7 @@ void SimTKOpenMMUtilities::setRandomNumberSeed( uint32_t seed ) { ...@@ -362,7 +362,7 @@ void SimTKOpenMMUtilities::setRandomNumberSeed( uint32_t seed ) {
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// If the seed is 0, generate one from the clock // If the seed is 0, use a unique seed
if (seed == 0) if (seed == 0)
_randomNumberSeed = (uint32_t) osrngseed(); _randomNumberSeed = (uint32_t) osrngseed();
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment