Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
73f248e7
Commit
73f248e7
authored
Feb 18, 2009
by
Mark Friedrichs
Browse files
Reactivated dupfac dynamic setting
Made setting of RNG seed consistent w/ logic used for Cuda
parent
6eb3c418
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
platforms/brook/src/BrookIntegrateLangevinStepKernel.cpp
platforms/brook/src/BrookIntegrateLangevinStepKernel.cpp
+9
-1
platforms/brook/src/BrookLangevinDynamics.cpp
platforms/brook/src/BrookLangevinDynamics.cpp
+7
-6
platforms/brook/src/BrookPlatform.cpp
platforms/brook/src/BrookPlatform.cpp
+4
-3
No files found.
platforms/brook/src/BrookIntegrateLangevinStepKernel.cpp
View file @
73f248e7
...
...
@@ -31,6 +31,7 @@
#include "BrookIntegrateLangevinStepKernel.h"
#include "BrookStreamInternal.h"
#include <ctime>
using
namespace
OpenMM
;
using
namespace
std
;
...
...
@@ -201,13 +202,20 @@ void BrookIntegrateLangevinStepKernel::initialize( const System& system, const L
_brookRandomNumberGenerator
=
new
BrookRandomNumberGenerator
(
);
_brookRandomNumberGenerator
->
setup
(
(
int
)
masses
.
size
(),
getPlatform
()
);
unsigned
long
int
seed
=
static_cast
<
unsigned
long
int
>
(
integrator
.
getRandomNumberSeed
()
);
unsigned
long
int
seed
;
if
(
integrator
.
getRandomNumberSeed
()
<=
1
){
seed
=
static_cast
<
unsigned
long
int
>
(
time
(
NULL
)
&
0x000fffff
);
}
else
{
seed
=
static_cast
<
unsigned
long
int
>
(
integrator
.
getRandomNumberSeed
()
);
}
_brookRandomNumberGenerator
->
setRandomNumberSeed
(
seed
);
if
(
printOn
){
(
void
)
fprintf
(
log
,
"%s done setup:
\n
BrookShakeAlgorithm:
\n
%s
\n
BrookRandomNumberGenerator:
\n
%s
\n\n
"
,
methodName
.
c_str
(),
_brookShakeAlgorithm
->
getContentsString
().
c_str
(),
_brookRandomNumberGenerator
->
getContentsString
().
c_str
()
);
(
void
)
fprintf
(
log
,
"LangevinIntegrator seed=%d
\n
"
,
integrator
.
getRandomNumberSeed
()
);
(
void
)
fflush
(
log
);
}
...
...
platforms/brook/src/BrookLangevinDynamics.cpp
View file @
73f248e7
...
...
@@ -1098,7 +1098,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
static
int
showAux
=
1
;
if
(
printOn
){
if
(
printOn
&&
showAux
){
(
void
)
fprintf
(
log
,
"%s step=%d shake=%d
\n
"
,
methodName
.
c_str
(),
_internalStepCount
,
brookShakeAlgorithm
.
getNumberOfConstraints
()
);
(
void
)
fflush
(
log
);
}
...
...
@@ -1119,6 +1119,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
(
void
)
fprintf
(
log
,
"%s step=%d Shake contents
\n
%s"
,
methodName
.
c_str
(),
_internalStepCount
,
contents
.
c_str
()
);
(
void
)
fflush
(
log
);
}
}
// diagnostics
...
...
@@ -1178,7 +1179,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
// diagnostics
if
(
printOn
){
if
(
0
&&
printOn
){
(
void
)
fprintf
(
log
,
"
\n
%s step=%d Post kupdate_sd1_fix1: particleStrW=%3d rngStrW=%3d rngOff=%5d "
"EM=%12.5e Sd1pc[]=[%12.5e %12.5e %12.5e]"
,
methodName
.
c_str
(),
_internalStepCount
,
getLangevinDynamicsParticleStreamWidth
(),
...
...
@@ -1264,7 +1265,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
brookShakeAlgorithm
.
getShakeXCons3Stream
()
->
getBrookStream
(),
getXPrimeStream
()
->
getBrookStream
()
);
if
(
printOn
){
if
(
0
&&
printOn
){
(
void
)
fprintf
(
log
,
"
\n
%s Post kshakeh_update1: sw=%d ShkCnstStrW=%3d tol=%.3f maxIt=%d"
,
methodName
.
c_str
(),
getLangevinDynamicsParticleStreamWidth
(),
...
...
@@ -1328,7 +1329,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
// diagnostics
if
(
printOn
){
if
(
0
&&
printOn
){
(
void
)
fprintf
(
log
,
"
\n
%s step=%d Post kupdate_sd2_fix1: particleStrW=%3d rngStrW=%3d rngOff=%5d "
"Sd2pc[]=[%12.5e %12.5e]"
,
methodName
.
c_str
(),
_internalStepCount
,
getLangevinDynamicsParticleStreamWidth
(),
...
...
@@ -1408,7 +1409,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
// diagnostics
if
(
printOn
){
if
(
0
&&
printOn
){
(
void
)
fprintf
(
log
,
"
\n
%s step=%d Post kshakeh_update2_fix1: ShakeConstraintStreamWidth=%3d rngStrW=%3d rngOff=%5d "
"Sd2pc[]=[%12.5e %12.5e]
\n
"
,
methodName
.
c_str
(),
_internalStepCount
,
brookShakeAlgorithm
.
getShakeConstraintStreamWidth
(),
...
...
@@ -1453,7 +1454,7 @@ int BrookLangevinDynamics::update( BrookStreamImpl& positionStream, BrookStreamI
// no constraints
if
(
printOn
){
if
(
0
&&
printOn
){
(
void
)
fprintf
(
log
,
"
\n
%s Pre ksetStr3 (no constraints)"
,
methodName
.
c_str
()
);
BrookStreamInternal
*
brookStreamInternalPos
=
positionStream
.
getBrookStreamInternal
();
(
void
)
fprintf
(
log
,
"
\n
PositionStream
\n
"
);
...
...
platforms/brook/src/BrookPlatform.cpp
View file @
73f248e7
...
...
@@ -394,12 +394,12 @@ int BrookPlatform::getDuplicationFactor( int numberOfParticles ) const {
int
duplicationFactor
=
4
;
if
(
numberOfParticles
<
65
){
duplicationFactor
=
1
;
(
void
)
fprintf
(
stderr
,
"%s forcing duplicationFactor
=
%d since number of particles=%d < 65
\n
"
,
(
void
)
fprintf
(
stderr
,
"%s forcing
optimization parameter '
duplicationFactor
' to
%d since number of particles=%d < 65
\n
"
,
methodName
.
c_str
(),
duplicationFactor
,
numberOfParticles
);
}
// set only if _minSuggestedThreads is available from board
/*
if
(
_minSuggestedThreads
>
0
){
float
threads
=
static_cast
<
float
>
(
_minSuggestedThreads
);
float
numP
=
static_cast
<
float
>
(
numberOfParticles
);
...
...
@@ -414,8 +414,9 @@ int BrookPlatform::getDuplicationFactor( int numberOfParticles ) const {
duplicationFactor
=
static_cast
<
int
>
(
ceil
(
factor
*
0.25
f
)
);
duplicationFactor
*=
4
;
}
// (void) fprintf( stderr, "getDuplicationFactor %.1f numiP=%.1f factor=%.1f duplicationFactor=%d\n", threads, numP, factor, duplicationFactor );
}
*/
return
duplicationFactor
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment