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