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
a058d6ae
Commit
a058d6ae
authored
Jan 07, 2009
by
Mark Friedrichs
Browse files
Mods
parent
adb4ec5a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
128 additions
and
73 deletions
+128
-73
platforms/brook/src/BrookBonded.cpp
platforms/brook/src/BrookBonded.cpp
+67
-47
platforms/brook/src/BrookCalcNonbondedForceKernel.cpp
platforms/brook/src/BrookCalcNonbondedForceKernel.cpp
+4
-3
platforms/brook/src/BrookGbsa.cpp
platforms/brook/src/BrookGbsa.cpp
+2
-1
platforms/brook/src/BrookNonBonded.cpp
platforms/brook/src/BrookNonBonded.cpp
+26
-16
platforms/brook/src/BrookPlatform.cpp
platforms/brook/src/BrookPlatform.cpp
+2
-1
platforms/brook/src/OpenMMBrookInterface.cpp
platforms/brook/src/OpenMMBrookInterface.cpp
+27
-5
No files found.
platforms/brook/src/BrookBonded.cpp
View file @
a058d6ae
...
...
@@ -706,7 +706,6 @@ int BrookBonded::_matchPair( int i, int j, int nbondeds, int *particles ){
* @param params arrays of bond parameters
* @param rbTorsionIndices the four particles connected by each Ryckaert-Bellemans torsion term
* @param rbTorsionParameters the coefficients (in order of increasing powers) for each Ryckaert-Bellemans torsion term
* @param log log reference
*
* @return nonzero value if error
*
...
...
@@ -777,7 +776,6 @@ int BrookBonded::_addRBTorsions( int *nbondeds, int *particles, float *params[],
* @param params arrays of bond parameters
* @param periodicTorsionIndices the four particles connected by each periodic torsion term
* @param periodicTorsionParameters the force parameters (k, phase, periodicity) for each periodic torsion term
* @param log log reference
*
* @return nonzero value if error
*
...
...
@@ -843,7 +841,6 @@ int BrookBonded::_addPTorsions( int *nbondeds, int *particles, BrookOpenMMFloat*
* @param params arrays of bond parameters
* @param angleIndices the angle bond particle indices
* @param angleParameters the angle parameters (angle in radians, force constant)
* @param log log reference
*
* @return nonzero value if error
*
...
...
@@ -905,7 +902,6 @@ int BrookBonded::_addAngles( int *nbondeds, int *particles, float *params[], con
* @param params arrays of bond parameters
* @param bondIndices two harmonic bond particle indices
* @param bondParameters the force parameters (distance, k)
* @param log log reference
*
* @return nonzero value if error
*
...
...
@@ -997,7 +993,7 @@ int BrookBonded::_addPairs( int *nbondeds, int *particles, BrookOpenMMFloat* par
static
const
std
::
string
methodName
=
"BrookBonded::_addPairs"
;
static
const
double
oneSixth
=
1.0
/
6.0
;
static
const
int
debug
=
1
;
static
const
int
debug
=
0
;
// ---------------------------------------------------------------------------------------
...
...
@@ -1069,11 +1065,13 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int
// ---------------------------------------------------------------------------------------
static
const
std
::
string
methodName
=
"BrookBonded::_loadInvMaps"
;
static
const
int
PrintOn
=
0
;
static
int
PrintOn
=
0
;
double
dangleValue
=
0.0
;
// ---------------------------------------------------------------------------------------
PrintOn
=
(
PrintOn
&&
getLog
())
?
1
:
0
;
// get particle stream size
/*
...
...
@@ -1116,7 +1114,7 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int
}
}
if
(
PrintOn
&&
getLog
()
){
if
(
PrintOn
){
(
void
)
fprintf
(
getLog
(),
"%s force stream strms=%d nbondeds=%d max counts=[%d %d %d %d] strSz&Wd=%d %d
\n
"
,
methodName
.
c_str
(),
getNumberOfForceStreams
(),
nbondeds
,
getMaxInverseMapStreamCount
(
0
),
getMaxInverseMapStreamCount
(
1
),
getMaxInverseMapStreamCount
(
2
),
getMaxInverseMapStreamCount
(
3
),
particleStreamSize
,
particleStreamWidth
);
...
...
@@ -1129,13 +1127,15 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int
for
(
int
jj
=
0
;
jj
<
4
*
getMaxInverseMapStreamCount
()
*
particleStreamSize
;
jj
++
){
block
[
jj
]
=
-
1.0
f
;
}
_gpuCalcInvMap
(
ii
,
4
,
nbondeds
,
nparticles
,
particles
,
getInverseMapStreamCount
(
ii
),
counts
,
invmaps
,
&
(
_inverseMapStreamCount
[
ii
])
);
//(void) fprintf( getLog(), "%s _gpuCalcInvMap %d getInverseMapStreamCount=%d\n", methodName.c_str(), ii, getInverseMapStreamCount( ii ) ); (void) fflush( getLog() );
_gpuCalcInvMap
(
ii
,
4
,
nbondeds
,
nparticles
,
particles
,
getMaxInverseMapStreamCount
(
ii
),
counts
,
invmaps
,
&
(
_inverseMapStreamCount
[
ii
])
);
//gpuPrintInvMaps( _inverseMapStreamCount[ii], nparticles, counts, invmaps, getLog() );
_validateInverseMapStreamCount
(
ii
,
_inverseMapStreamCount
[
ii
]
);
for
(
int
jj
=
0
;
jj
<
_inverseMapStreamCount
[
ii
];
jj
++
){
_inverseStreamMaps
[
ii
][
jj
]
->
loadFromArray
(
invmaps
[
jj
]
);
if
(
PrintOn
&&
getLog
()
){
if
(
PrintOn
){
(
void
)
fprintf
(
getLog
(),
"%s inverseMap stream strms=%d count=%d index=%d %d InverseMapStreamCount[ii]=%d max=%d
\n
"
,
methodName
.
c_str
(),
getNumberOfForceStreams
(),
_inverseMapStreamCount
[
ii
],
ii
,
jj
,
getInverseMapStreamCount
(
ii
),
getMaxInverseMapStreamCount
(
ii
)
);
...
...
@@ -1163,7 +1163,7 @@ int BrookBonded::_loadInvMaps( int nbondeds, int nparticles, int *particles, int
// diagnostics
if
(
PrintOn
&&
getLog
()
){
if
(
PrintOn
){
(
void
)
fprintf
(
getLog
(),
"%s done
\n
"
,
methodName
.
c_str
()
);
(
void
)
fflush
(
getLog
()
);
}
...
...
@@ -1216,12 +1216,14 @@ int BrookBonded::setup( int numberOfParticles,
// ---------------------------------------------------------------------------------------
static
const
std
::
string
methodName
=
"BrookBonded::setup"
;
static
const
int
PrintOn
=
0
;
static
int
PrintOn
=
0
;
double
dangleValue
=
0.0
;
// ---------------------------------------------------------------------------------------
if
(
PrintOn
&&
getLog
()
){
PrintOn
=
(
PrintOn
&&
getLog
())
?
1
:
0
;
if
(
PrintOn
){
(
void
)
fprintf
(
getLog
(),
"%s particles=%d
\n
[%p %p %p %p %p] (bond, angle, pd, rb, 14)
\n
"
"StreamW=%d StreamSz=%d
\n
"
,
methodName
.
c_str
(),
numberOfParticles
,
harmonicBondBrookBondParameters
,
harmonicAngleBrookBondParameters
,
...
...
@@ -1307,11 +1309,14 @@ int BrookBonded::setup( int numberOfParticles,
// return if no bonds
(
void
)
fprintf
(
getLog
(),
"%s WARNING: particles=%d number of bonds=%d maxBonds=%d
\n
"
,
methodName
.
c_str
(),
numberOfParticles
,
nbondeds
,
maxBonds
);
if
(
PrintOn
||
getLog
()
){
(
void
)
fprintf
(
getLog
(),
"%s WARNING: particles=%d number of bonds=%d maxBonds=%d
\n
"
,
methodName
.
c_str
(),
numberOfParticles
,
nbondeds
,
maxBonds
);
}
_setupCompleted
=
1
;
return
DefaultReturnValue
;
}
else
if
(
PrintOn
&&
getLog
()
){
}
else
if
(
PrintOn
){
(
void
)
fprintf
(
getLog
(),
"%s particles=%d number of bonds=%d maxBonds=%d
\n
"
,
methodName
.
c_str
(),
numberOfParticles
,
nbondeds
,
maxBonds
);
(
void
)
fflush
(
getLog
()
);
}
...
...
@@ -1361,7 +1366,7 @@ int BrookBonded::setup( int numberOfParticles,
// debug stuff
if
(
PrintOn
&&
getLog
()
){
if
(
PrintOn
){
(
void
)
fprintf
(
getLog
(),
"%s nbondeds=%d strDim [%d %d ] sz=%d
\n
"
,
methodName
.
c_str
(),
nbondeds
,
_particleIndicesStream
->
getStreamWidth
(),
...
...
@@ -1403,6 +1408,10 @@ int BrookBonded::setup( int numberOfParticles,
// load inverse maps to streams
if
(
PrintOn
){
(
void
)
fprintf
(
getLog
(),
"
\n
_loadInvMaps %d %d %d %d
\n
"
,
nbondeds
,
getNumberOfParticles
(),
particleStreamWidth
,
particleStreamSize
);
(
void
)
fflush
(
getLog
()
);
}
_loadInvMaps
(
nbondeds
,
getNumberOfParticles
(),
particles
,
particleStreamWidth
,
particleStreamSize
);
// ---------------------------------------------------------------------------------------
...
...
@@ -1565,6 +1574,9 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np
static
const
char
*
NotSet
=
"Not set"
;
static
const
int
PrintOn
=
0
;
int
particleRange
[
2
]
=
{
90000000
,
-
90000000
};
int
mapnumRange
[
2
]
=
{
90000000
,
-
90000000
};
// ---------------------------------------------------------------------------------------
memset
(
counts
,
0
,
sizeof
(
int
)
*
nparticles
);
...
...
@@ -1586,9 +1598,6 @@ int BrookBonded::_gpuCalcInvMap( int posflag, int niparticles, int nints, int np
(
void
)
fflush
(
getLog
()
);
}
int
particleRange
[
2
]
=
{
90000000
,
-
90000000
};
int
mapnumRange
[
2
]
=
{
90000000
,
-
90000000
};
for
(
i
=
0
;
i
<
nints
;
i
++
){
//This is our particle
particle
=
particles
[
(
niparticles
+
1
)
*
i
+
posflag
+
1
];
...
...
@@ -1805,7 +1814,7 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
static
const
std
::
string
methodName
=
"BrookBonded::computeForces"
;
static
const
int
PrintOn
=
0
;
static
int
PrintOn
=
1
;
static
const
int
I_Stream
=
0
;
static
const
int
J_Stream
=
1
;
...
...
@@ -1821,6 +1830,8 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// ---------------------------------------------------------------------------------------
PrintOn
=
(
PrintOn
&&
getLog
())
?
1
:
0
;
// bonded
float
epsfac
=
(
float
)
(
getCoulombFactor
());
...
...
@@ -1856,38 +1867,41 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// diagnostics
if
(
1
&&
PrintOn
){
//if( 1 && PrintOn ){
if
(
1
){
//FILE* log = getLog();
FILE
*
log
=
stderr
;
int
countPrintInvMap
[
4
]
=
{
3
,
5
,
2
,
4
};
(
void
)
fprintf
(
getLog
()
,
"
\n
Post kbonded_CDLJ: epsFac=%.6f %.6f"
,
epsfac
,
getCoulombFactor
());
(
void
)
fprintf
(
getLog
()
,
"
\n
Particle indices stream
\n
"
);
getParticleIndicesStream
()
->
printToFile
(
getLog
()
);
(
void
)
fprintf
(
log
,
"
\n
Post kbonded_CDLJ: epsFac=%.6f %.6f"
,
epsfac
,
getCoulombFactor
());
(
void
)
fprintf
(
log
,
"
\n
Particle indices stream
\n
"
);
getParticleIndicesStream
()
->
printToFile
(
log
);
(
void
)
fprintf
(
getLog
()
,
"
\n
Charge stream
\n
"
);
getChargeStream
()
->
printToFile
(
getLog
()
);
(
void
)
fprintf
(
log
,
"
\n
Charge stream
\n
"
);
getChargeStream
()
->
printToFile
(
log
);
for
(
int
ii
=
0
;
ii
<
5
;
ii
++
){
(
void
)
fprintf
(
getLog
()
,
"
\n
Param stream %d
\n
"
,
ii
);
bondedParameters
[
ii
]
->
printToFile
(
getLog
()
);
(
void
)
fprintf
(
log
,
"
\n
Param stream %d
\n
"
,
ii
);
bondedParameters
[
ii
]
->
printToFile
(
log
);
}
for
(
int
ii
=
0
;
ii
<
4
;
ii
++
){
(
void
)
fprintf
(
getLog
()
,
"
\n
Force stream %d
\n
"
,
ii
);
bondedForceStreams
[
ii
]
->
printToFile
(
getLog
()
);
(
void
)
fprintf
(
log
,
"
\n
Force stream %d
\n
"
,
ii
);
bondedForceStreams
[
ii
]
->
printToFile
(
log
);
}
/*
(void) fprintf(
getLog()
, "\nNB1 forces" );
(void) fprintf(
log
, "\nNB1 forces" );
BrookStreamInternal* brookStreamInternalF = forceStream.getBrookStreamImpl();
brookStreamInternalF->printToFile(
getLog()
);
brookStreamInternalF->printToFile(
log
);
*/
(
void
)
fprintf
(
getLog
()
,
"
\n
Inverse map streams
\n
"
);
(
void
)
fprintf
(
log
,
"
\n
Inverse map streams
\n
"
);
for
(
int
ii
=
0
;
ii
<
4
;
ii
++
){
(
void
)
fprintf
(
getLog
()
,
"
\n
Inverse map streams -- StreamIndex=%d cnt=%d
\n
"
,
ii
,
getInverseMapStreamCount
(
ii
)
);
(
void
)
fprintf
(
log
,
"
\n
Inverse map streams -- StreamIndex=%d cnt=%d
\n
"
,
ii
,
getInverseMapStreamCount
(
ii
)
);
for
(
int
jj
=
0
;
jj
<
countPrintInvMap
[
ii
];
jj
++
){
(
void
)
fprintf
(
getLog
()
,
"
\n
Inverse map streams index=%d %d
\n
"
,
ii
,
jj
);
inverseStreamMaps
[
ii
][
jj
]
->
printToFile
(
getLog
()
);
(
void
)
fprintf
(
log
,
"
\n
Inverse map streams index=%d %d
\n
"
,
ii
,
jj
);
inverseStreamMaps
[
ii
][
jj
]
->
printToFile
(
log
);
}
}
}
...
...
@@ -1969,11 +1983,12 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// case not handled -- throw an exception
if
(
getLog
()
&&
ErrorMessages
++
<
MaxErrorMessages
&&
getInverseMapStreamCount
(
I_Stream
)
>
0
&&
getInverseMapStreamCount
(
K_Stream
)
>
0
){
(
void
)
fprintf
(
getLog
(),
"%s case: I-map=%d K-map=%d -- not handled.
\n
"
,
FILE
*
log
=
getLog
()
?
getLog
()
:
stderr
;
if
(
ErrorMessages
++
<
MaxErrorMessages
&&
getInverseMapStreamCount
(
I_Stream
)
>
0
&&
getInverseMapStreamCount
(
K_Stream
)
>
0
){
(
void
)
fprintf
(
log
,
"%s case: I-map=%d K-map=%d -- not handled.
\n
"
,
methodName
.
c_str
(),
getInverseMapStreamCount
(
I_Stream
),
getInverseMapStreamCount
(
K_Stream
)
);
(
void
)
fflush
(
getLog
()
);
(
void
)
fflush
(
log
);
}
kinvmap_gather3_3
(
width
,
...
...
@@ -2000,11 +2015,13 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// diagnostics
if
(
0
&&
PrintOn
){
//if( 1 && PrintOn ){
if
(
1
){
(
void
)
fprintf
(
getLog
(),
"
\n
Post 3_4/3_5 && NB forces"
);
FILE
*
log
=
getLog
()
?
getLog
()
:
stderr
;
(
void
)
fprintf
(
log
,
"
\n
Post 3_4/3_5 && NB forces"
);
BrookStreamInternal
*
brookStreamInternalF
=
forceStream
.
getBrookStreamImpl
();
brookStreamInternalF
->
printToFile
(
getLog
()
);
brookStreamInternalF
->
printToFile
(
log
);
}
...
...
@@ -2035,11 +2052,12 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// case not handled -- throw an exception
if
(
getLog
()
&&
ErrorMessages
++
<
MaxErrorMessages
&&
getInverseMapStreamCount
(
J_Stream
)
>
0
&&
getInverseMapStreamCount
(
L_Stream
)
>
0
){
(
void
)
fprintf
(
getLog
(),
"%s case: J-map=%d L-map=%d -- not handled.
\n
"
,
FILE
*
log
=
getLog
()
?
getLog
()
:
stderr
;
if
(
ErrorMessages
++
<
MaxErrorMessages
&&
getInverseMapStreamCount
(
J_Stream
)
>
0
&&
getInverseMapStreamCount
(
L_Stream
)
>
0
){
(
void
)
fprintf
(
log
,
"%s case: J-map=%d L-map=%d -- not handled.
\n
"
,
methodName
.
c_str
(),
getInverseMapStreamCount
(
J_Stream
),
getInverseMapStreamCount
(
L_Stream
)
);
(
void
)
fflush
(
getLog
()
);
(
void
)
fflush
(
log
);
}
// this is for testing purposes a-- may need to be cleaned
...
...
@@ -2068,11 +2086,13 @@ void BrookBonded::computeForces( BrookStreamImpl& positionStream, BrookStreamImp
// diagnostics
if
(
1
&&
PrintOn
){
//if( 1 && PrintOn ){
if
(
1
){
(
void
)
fprintf
(
getLog
(),
"
\n
Final NB & bonded forces"
);
FILE
*
log
=
getLog
()
?
getLog
()
:
stderr
;
(
void
)
fprintf
(
log
,
"
\n
Final NB & bonded forces"
);
BrookStreamInternal
*
brookStreamInternalF
=
forceStream
.
getBrookStreamImpl
();
brookStreamInternalF
->
printToFile
(
getLog
()
);
brookStreamInternalF
->
printToFile
(
log
);
/*
void* dataV = brookStreamInternalF->getData(1);
float* data = (float*) dataV;
...
...
platforms/brook/src/BrookCalcNonbondedForceKernel.cpp
View file @
a058d6ae
...
...
@@ -67,7 +67,6 @@ BrookCalcNonbondedForceKernel::BrookCalcNonbondedForceKernel( std::string name,
_openMMBrookInterface
.
setNumberOfParticles
(
system
.
getNumParticles
()
);
_brookBondParameters
=
NULL
;
_log
=
NULL
;
const
BrookPlatform
brookPlatform
=
dynamic_cast
<
const
BrookPlatform
&>
(
platform
);
...
...
@@ -139,7 +138,9 @@ void BrookCalcNonbondedForceKernel::initialize( const System& system, const Nonb
// ---------------------------------------------------------------------------------------
FILE
*
log
=
getLog
();
(
void
)
fprintf
(
log
,
"%s begin
\n
"
,
methodName
.
c_str
()
);
fflush
(
log
);
if
(
log
){
(
void
)
fprintf
(
log
,
"%s begin
\n
"
,
methodName
.
c_str
()
);
fflush
(
log
);
}
_numberOfParticles
=
force
.
getNumParticles
();
/*
...
...
@@ -230,7 +231,7 @@ void BrookCalcNonbondedForceKernel::initialize14Interactions( const System& syst
force
.
getNonbonded14Parameters
(
ii
,
particle1
,
particle2
,
charge
,
radius
,
depth
);
(
void
)
fprintf
(
log
,
"%s idx=%d [%d %d] [%f %f %f]
\n
"
,
methodName
.
c_str
(),
ii
,
particle1
,
particle2
,
charge
,
radius
,
depth
);
//
(void) fprintf( log, "%s idx=%d [%d %d] [%f %f %f]\n", methodName.c_str(), ii, particle1, particle2, charge, radius, depth );
particles
[
0
]
=
particle1
;
particles
[
1
]
=
particle2
;
...
...
platforms/brook/src/BrookGbsa.cpp
View file @
a058d6ae
...
...
@@ -745,13 +745,14 @@ int BrookGbsa::setup( const std::vector<std::vector<double> >& vectorOfParticleP
// setup for Born radii calculation
/*
ObcParameters* obcParameters = new ObcParameters( numberOfParticles, ObcParameters::ObcTypeII );
obcParameters->setAtomicRadii( particleRadii);
obcParameters->setScaledRadiusFactors( scaleFactors );
obcParameters->setSolventDielectric( static_cast<RealOpenMM>(solventDielectric) );
obcParameters->setSoluteDielectric( static_cast<RealOpenMM>(soluteDielectric) );
*/
//_cpuObc = new CpuObc(obcParameters);
//_cpuObc->setIncludeAceApproximation( true );
...
...
platforms/brook/src/BrookNonBonded.cpp
View file @
a058d6ae
...
...
@@ -616,7 +616,7 @@ int BrookNonBonded::_initializeExclusions( const std::vector<std::set<int> >& ex
// ---------------------------------------------------------------------------------------
static
const
std
::
string
methodName
=
"BrookNonBonded::_initializeExclusions"
;
static
const
int
debug
=
1
;
static
const
int
debug
=
0
;
// ---------------------------------------------------------------------------------------
...
...
@@ -762,7 +762,7 @@ int BrookNonBonded::_initializeVdwAndCharge( const vector<vector<double> >& nonb
// ---------------------------------------------------------------------------------------
static
const
std
::
string
methodName
=
"BrookNonBonded::_initializeVdwAndCharge"
;
static
const
int
debug
=
1
;
static
const
int
debug
=
0
;
// ---------------------------------------------------------------------------------------
...
...
@@ -861,7 +861,7 @@ int BrookNonBonded::_initializeJStreamVdw( const vector<vector<double> >& nonbon
// ---------------------------------------------------------------------------------------
static
const
std
::
string
methodName
=
"BrookNonBonded::_initializeJStreamVdw"
;
static
const
int
debug
=
1
;
static
const
int
debug
=
0
;
// ---------------------------------------------------------------------------------------
...
...
@@ -1279,7 +1279,7 @@ void BrookNonBonded::computeForces( BrookStreamImpl& positionStream, BrookStream
static
const
std
::
string
methodName
=
"BrookNonBonded::computeForces"
;
static
const
int
PrintOn
=
0
;
static
int
PrintOn
=
1
;
static
const
int
MaxErrorMessages
=
2
;
static
int
ErrorMessages
=
0
;
...
...
@@ -1289,6 +1289,8 @@ void BrookNonBonded::computeForces( BrookStreamImpl& positionStream, BrookStream
// ---------------------------------------------------------------------------------------
PrintOn
=
(
PrintOn
&&
getLog
())
?
1
:
0
;
// nonbonded forces
float
epsfac
=
138.935485
f
;
...
...
@@ -1326,18 +1328,24 @@ nonbondedForceStreams[3]->fillWithValue( &zerof );
// diagnostics
if
(
1
&&
PrintOn
&&
getLog
()
){
FILE
*
log
=
getLog
();
//if( 1 && PrintOn ){
if
(
1
){
//FILE* log = getLog();
FILE
*
log
=
stderr
;
(
void
)
fprintf
(
log
,
"%s
\n
"
,
methodName
.
c_str
()
);
(
void
)
fflush
(
log
);
(
void
)
fprintf
(
log
,
"
\n
Post knbforce_CDLJ4: particles=%6d ceiling=%3d dupFac=%3d"
,
getNumberOfParticles
(),
getParticleSizeCeiling
(),
getDuplicationFactor
()
);
getParticleSizeCeiling
(),
getDuplicationFactor
()
);
(
void
)
fprintf
(
log
,
"
\n
hght=%6d width=%3d jWid=%3d"
,
getParticleStreamHeight
(
),
getParticleStreamWidth
(
),
getJStreamWidth
(
)
);
getParticleStreamWidth
(
),
getJStreamWidth
(
)
);
(
void
)
fprintf
(
log
,
"
\n
pFrc=%6d eps=%12.5e
\n
"
,
getPartialForceStreamWidth
(
),
epsfac
);
(
void
)
fprintf
(
log
,
"
\n
Final NB & bonded forces"
);
BrookStreamInternal
*
brookStreamInternalF
=
forceStream
.
getBrookStreamImpl
();
brookStreamInternalF
->
printToFile
(
log
);
(
void
)
fprintf
(
log
,
"
\n
OuterVdwStreamd
\n
"
);
getOuterVdwStream
()
->
printToFile
(
log
);
...
...
@@ -1347,8 +1355,8 @@ nonbondedForceStreams[3]->fillWithValue( &zerof );
(
void
)
fprintf
(
log
,
"
\n
InnerEpsilonStream
\n
"
);
getInnerEpsilonStream
()
->
printToFile
(
log
);
(
void
)
fprintf
(
log
,
"
\n
ExclusionStream
\n
"
);
getExclusionStream
()
->
printToFile
(
log
);
//
(void) fprintf( log, "\nExclusionStream\n" );
//
getExclusionStream()->printToFile( log );
(
void
)
fprintf
(
log
,
"
\n
ChargeStream
\n
"
);
getChargeStream
()
->
printToFile
(
log
);
...
...
@@ -1378,11 +1386,13 @@ nonbondedForceStreams[3]->fillWithValue( &zerof );
// diagnostics
if
(
PrintOn
&&
getLog
()
){
if
(
PrintOn
){
FILE
*
log
=
getLog
();
(
void
)
fprintf
(
log
,
"
\n
%s NB forces"
,
methodName
.
c_str
()
);
(
void
)
fflush
(
log
);
// forceStream.printToFile( log );
//FILE* log = getLog();
FILE
*
log
=
stderr
;
(
void
)
fprintf
(
log
,
"
\n
%s NB forces"
,
methodName
.
c_str
()
);
BrookStreamInternal
*
brookStreamInternalF
=
forceStream
.
getBrookStreamImpl
();
brookStreamInternalF
->
printToFile
(
log
);
(
void
)
fprintf
(
log
,
"
\n
%s Done"
,
methodName
.
c_str
()
);
(
void
)
fflush
(
log
);
}
...
...
platforms/brook/src/BrookPlatform.cpp
View file @
a058d6ae
...
...
@@ -197,6 +197,7 @@ BrookPlatform::BrookPlatform( ){
_particleStreamWidth
=
DefaultParticleStreamWidth
;
_log
=
NULL
;
//_log = stderr;
// get Brook runtime
...
...
@@ -454,7 +455,7 @@ void BrookPlatform::contextCreated( OpenMMContextImpl& context ) const {
// ---------------------------------------------------------------------------------------
OpenMMBrookInterface
*
openMMBrookInterface
=
new
OpenMMBrookInterface
(
getParticleStreamWidth
()
);
openMMBrookInterface
->
setLog
(
stderr
);
//
openMMBrookInterface->setLog( stderr );
context
.
setPlatformData
(
openMMBrookInterface
);
}
...
...
platforms/brook/src/OpenMMBrookInterface.cpp
View file @
a058d6ae
...
...
@@ -533,7 +533,7 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
static
const
std
::
string
methodName
=
"OpenMMBrookInterface::executeForces"
;
static
const
int
PrintOn
=
0
;
static
int
PrintOn
=
1
;
static
const
int
MaxErrorMessages
=
2
;
static
int
ErrorMessages
=
0
;
...
...
@@ -543,6 +543,8 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
// ---------------------------------------------------------------------------------------
PrintOn
=
(
PrintOn
&&
getLog
())
?
1
:
0
;
// nonbonded forces
BrookStreamImpl
*
positions
=
getParticlePositions
();
...
...
@@ -556,10 +558,12 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
// bonded forces
if
(
PrintOn
&&
getLog
()
){
(
void
)
fprintf
(
getLog
(),
"%s done nonbonded: bonded=%d completed=%d
\n
"
,
methodName
.
c_str
(),
//if( PrintOn ){
if
(
1
){
FILE
*
log
=
stderr
;
(
void
)
fprintf
(
log
,
"%s done nonbonded: bonded=%d completed=%d
\n
"
,
methodName
.
c_str
(),
_brookBonded
.
isActive
(),
_brookBonded
.
isSetupCompleted
()
);
(
void
)
fflush
(
getLog
()
);
(
void
)
fflush
(
log
);
}
if
(
_brookBonded
.
isActive
()
){
...
...
@@ -573,11 +577,24 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
getParticleStreamWidth
(),
getParticleStreamSize
()
);
}
/*
(void) fprintf( getLog(), "%s done nonbonded: bonded=%d completed=%d\n", methodName.c_str(),
_brookBonded.isActive(), _brookBonded.isSetupCompleted() );
(void) fflush( getLog() );
*/
_brookBonded
.
computeForces
(
*
positions
,
*
forces
);
// diagnostics
if
(
1
&&
PrintOn
){
//if( 1 && PrintOn ){
if
(
1
){
FILE
*
log
=
stderr
;
static
int
step
=
0
;
static
const
int
stopStep
=
10
;
(
void
)
fprintf
(
log
,
"%s done bonded computeForces
\n
"
,
methodName
.
c_str
(),
_brookBonded
.
isActive
(),
_brookBonded
.
isSetupCompleted
()
);
(
void
)
fflush
(
log
);
/*
(void) fprintf( getLog(), "\nFinal NB & bonded forces" );
...
...
@@ -591,9 +608,14 @@ void OpenMMBrookInterface::computeForces( OpenMMContextImpl& context ){
}
*/
if
(
step
++
>=
stopStep
){
exit
(
0
);
}
}
}
// GBSA OBC forces
if
(
_brookGbsa
.
isActive
()
){
...
...
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