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
a993d7ab
Commit
a993d7ab
authored
Jul 15, 2014
by
Peter Eastman
Browse files
Merge remote-tracking branch 'origin/master' into charmm
parents
fd76052f
fcba92a6
Changes
81
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
165 additions
and
50 deletions
+165
-50
platforms/opencl/tests/TestOpenCLCustomIntegrator.cpp
platforms/opencl/tests/TestOpenCLCustomIntegrator.cpp
+2
-0
platforms/opencl/tests/TestOpenCLMonteCarloAnisotropicBarostat.cpp
.../opencl/tests/TestOpenCLMonteCarloAnisotropicBarostat.cpp
+1
-1
platforms/reference/tests/TestReferenceMonteCarloAnisotropicBarostat.cpp
...ence/tests/TestReferenceMonteCarloAnisotropicBarostat.cpp
+1
-1
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
...ns/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
+1
-1
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
+1
-1
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
+1
-1
plugins/amoeba/openmmapi/src/AmoebaVdwForce.cpp
plugins/amoeba/openmmapi/src/AmoebaVdwForce.cpp
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/amoebaGk.cu
plugins/amoeba/platforms/cuda/src/kernels/amoebaGk.cu
+8
-8
plugins/amoeba/platforms/cuda/src/kernels/amoebaWcaForce.cu
plugins/amoeba/platforms/cuda/src/kernels/amoebaWcaForce.cu
+2
-2
plugins/amoeba/platforms/cuda/src/kernels/multipoleElectrostatics.cu
...eba/platforms/cuda/src/kernels/multipoleElectrostatics.cu
+2
-2
plugins/amoeba/platforms/cuda/src/kernels/multipoleFixedField.cu
.../amoeba/platforms/cuda/src/kernels/multipoleFixedField.cu
+2
-2
plugins/amoeba/platforms/cuda/src/kernels/multipoleInducedField.cu
...moeba/platforms/cuda/src/kernels/multipoleInducedField.cu
+2
-2
plugins/amoeba/platforms/cuda/src/kernels/pmeMultipoleElectrostatics.cu
.../platforms/cuda/src/kernels/pmeMultipoleElectrostatics.cu
+2
-2
plugins/cpupme/CMakeLists.txt
plugins/cpupme/CMakeLists.txt
+5
-1
plugins/cpupme/src/CpuPmeKernels.cpp
plugins/cpupme/src/CpuPmeKernels.cpp
+14
-7
serialization/include/openmm/serialization/XmlSerializer.h
serialization/include/openmm/serialization/XmlSerializer.h
+2
-2
serialization/src/XmlSerializer.cpp
serialization/src/XmlSerializer.cpp
+23
-16
tests/TestFindExclusions.cpp
tests/TestFindExclusions.cpp
+53
-0
tools/ci/after_success.sh
tools/ci/after_success.sh
+21
-0
tools/ci/install.sh
tools/ci/install.sh
+21
-0
No files found.
platforms/opencl/tests/TestOpenCLCustomIntegrator.cpp
View file @
a993d7ab
...
@@ -292,6 +292,7 @@ void testWithThermostat() {
...
@@ -292,6 +292,7 @@ void testWithThermostat() {
system
.
addForce
(
forceField
);
system
.
addForce
(
forceField
);
AndersenThermostat
*
thermostat
=
new
AndersenThermostat
(
temp
,
collisionFreq
);
AndersenThermostat
*
thermostat
=
new
AndersenThermostat
(
temp
,
collisionFreq
);
system
.
addForce
(
thermostat
);
system
.
addForce
(
thermostat
);
integrator
.
setRandomNumberSeed
(
thermostat
->
getRandomNumberSeed
());
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
numParticles
);
vector
<
Vec3
>
positions
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
...
@@ -424,6 +425,7 @@ void testParameter() {
...
@@ -424,6 +425,7 @@ void testParameter() {
integrator
.
addGlobalVariable
(
"temp"
,
0
);
integrator
.
addGlobalVariable
(
"temp"
,
0
);
integrator
.
addComputeGlobal
(
"temp"
,
"AndersenTemperature"
);
integrator
.
addComputeGlobal
(
"temp"
,
"AndersenTemperature"
);
integrator
.
addComputeGlobal
(
"AndersenTemperature"
,
"temp*2"
);
integrator
.
addComputeGlobal
(
"AndersenTemperature"
,
"temp*2"
);
integrator
.
setRandomNumberSeed
(
thermostat
->
getRandomNumberSeed
());
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
// See if the parameter is being used correctly.
// See if the parameter is being used correctly.
...
...
platforms/opencl/tests/TestOpenCLMonteCarloAnisotropicBarostat.cpp
View file @
a993d7ab
...
@@ -389,7 +389,7 @@ int main(int argc, char* argv[]) {
...
@@ -389,7 +389,7 @@ int main(int argc, char* argv[]) {
testIdealGasAxis
(
1
);
testIdealGasAxis
(
1
);
testIdealGasAxis
(
2
);
testIdealGasAxis
(
2
);
testRandomSeed
();
testRandomSeed
();
testEinsteinCrystal
();
//
testEinsteinCrystal();
}
}
catch
(
const
exception
&
e
)
{
catch
(
const
exception
&
e
)
{
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
...
...
platforms/reference/tests/TestReferenceMonteCarloAnisotropicBarostat.cpp
View file @
a993d7ab
...
@@ -389,7 +389,7 @@ int main() {
...
@@ -389,7 +389,7 @@ int main() {
testIdealGasAxis
(
1
);
testIdealGasAxis
(
1
);
testIdealGasAxis
(
2
);
testIdealGasAxis
(
2
);
testRandomSeed
();
testRandomSeed
();
testEinsteinCrystal
();
//
testEinsteinCrystal();
}
}
catch
(
const
exception
&
e
)
{
catch
(
const
exception
&
e
)
{
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
View file @
a993d7ab
...
@@ -126,7 +126,7 @@ public:
...
@@ -126,7 +126,7 @@ public:
*
*
* @return the cutoff distance, measured in nm
* @return the cutoff distance, measured in nm
*/
*/
double
getCutoffDistance
(
void
)
const
;
double
getCutoffDistance
()
const
;
/**
/**
* Set the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
* Set the cutoff distance (in nm) being used for nonbonded interactions. If the NonbondedMethod in use
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
View file @
a993d7ab
...
@@ -191,7 +191,7 @@ public:
...
@@ -191,7 +191,7 @@ public:
/**
/**
* Get the cutoff distance.
* Get the cutoff distance.
*/
*/
double
getCutoff
(
void
)
const
;
double
getCutoff
()
const
;
/**
/**
* Get the method used for handling long range nonbonded interactions.
* Get the method used for handling long range nonbonded interactions.
...
...
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
View file @
a993d7ab
...
@@ -61,7 +61,7 @@ void AmoebaMultipoleForce::setPolarizationType( AmoebaMultipoleForce::Polarizati
...
@@ -61,7 +61,7 @@ void AmoebaMultipoleForce::setPolarizationType( AmoebaMultipoleForce::Polarizati
polarizationType
=
type
;
polarizationType
=
type
;
}
}
double
AmoebaMultipoleForce
::
getCutoffDistance
(
void
)
const
{
double
AmoebaMultipoleForce
::
getCutoffDistance
()
const
{
return
cutoffDistance
;
return
cutoffDistance
;
}
}
...
...
plugins/amoeba/openmmapi/src/AmoebaVdwForce.cpp
View file @
a993d7ab
...
@@ -106,7 +106,7 @@ void AmoebaVdwForce::setCutoff( double inputCutoff ){
...
@@ -106,7 +106,7 @@ void AmoebaVdwForce::setCutoff( double inputCutoff ){
cutoff
=
inputCutoff
;
cutoff
=
inputCutoff
;
}
}
double
AmoebaVdwForce
::
getCutoff
(
void
)
const
{
double
AmoebaVdwForce
::
getCutoff
()
const
{
return
cutoff
;
return
cutoff
;
}
}
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaGk.cu
View file @
a993d7ab
...
@@ -97,11 +97,11 @@ extern "C" __global__ void computeBornSum(unsigned long long* __restrict__ bornS
...
@@ -97,11 +97,11 @@ extern "C" __global__ void computeBornSum(unsigned long long* __restrict__ bornS
// Extract the coordinates of this tile
// Extract the coordinates of this tile
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
unsigned
int
x
,
y
;
int
x
,
y
;
AtomData1
data
;
AtomData1
data
;
data
.
bornSum
=
0
;
data
.
bornSum
=
0
;
if
(
pos
<
end
)
{
if
(
pos
<
end
)
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
sqrt
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
sqrt
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
@@ -232,10 +232,10 @@ extern "C" __global__ void computeGKForces(
...
@@ -232,10 +232,10 @@ extern "C" __global__ void computeGKForces(
// Extract the coordinates of this tile
// Extract the coordinates of this tile
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
unsigned
int
x
,
y
;
int
x
,
y
;
AtomData2
data
;
AtomData2
data
;
if
(
pos
<
end
)
{
if
(
pos
<
end
)
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
@@ -471,10 +471,10 @@ extern "C" __global__ void computeChainRuleForce(
...
@@ -471,10 +471,10 @@ extern "C" __global__ void computeChainRuleForce(
// Extract the coordinates of this tile
// Extract the coordinates of this tile
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
unsigned
int
x
,
y
;
int
x
,
y
;
AtomData3
data
;
AtomData3
data
;
if
(
pos
<
end
)
{
if
(
pos
<
end
)
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
@@ -766,8 +766,8 @@ extern "C" __global__ void computeEDiffForce(
...
@@ -766,8 +766,8 @@ extern "C" __global__ void computeEDiffForce(
while
(
pos
<
end
)
{
while
(
pos
<
end
)
{
// Extract the coordinates of this tile.
// Extract the coordinates of this tile.
unsigned
int
x
,
y
;
int
x
,
y
;
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaWcaForce.cu
View file @
a993d7ab
...
@@ -207,10 +207,10 @@ extern "C" __global__ void computeWCAForce(unsigned long long* __restrict__ forc
...
@@ -207,10 +207,10 @@ extern "C" __global__ void computeWCAForce(unsigned long long* __restrict__ forc
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tgx
=
threadIdx
.
x
&
(
TILE_SIZE
-
1
);
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
const
unsigned
int
tbx
=
threadIdx
.
x
-
tgx
;
const
unsigned
int
localGroupIndex
=
threadIdx
.
x
/
TILE_SIZE
;
const
unsigned
int
localGroupIndex
=
threadIdx
.
x
/
TILE_SIZE
;
unsigned
int
x
,
y
;
int
x
,
y
;
AtomData
data
;
AtomData
data
;
if
(
pos
<
end
)
{
if
(
pos
<
end
)
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/multipoleElectrostatics.cu
View file @
a993d7ab
...
@@ -234,14 +234,14 @@ extern "C" __global__ void computeElectrostatics(
...
@@ -234,14 +234,14 @@ extern "C" __global__ void computeElectrostatics(
// Extract the coordinates of this tile.
// Extract the coordinates of this tile.
unsigned
int
x
,
y
;
int
x
,
y
;
#ifdef USE_CUTOFF
#ifdef USE_CUTOFF
if
(
numTiles
<=
maxTiles
)
if
(
numTiles
<=
maxTiles
)
x
=
tiles
[
pos
];
x
=
tiles
[
pos
];
else
else
#endif
#endif
{
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/multipoleFixedField.cu
View file @
a993d7ab
...
@@ -599,14 +599,14 @@ extern "C" __global__ void computeFixedField(
...
@@ -599,14 +599,14 @@ extern "C" __global__ void computeFixedField(
// Extract the coordinates of this tile.
// Extract the coordinates of this tile.
unsigned
int
x
,
y
;
int
x
,
y
;
#ifdef USE_CUTOFF
#ifdef USE_CUTOFF
if
(
numTiles
<=
maxTiles
)
if
(
numTiles
<=
maxTiles
)
x
=
tiles
[
pos
];
x
=
tiles
[
pos
];
else
else
#endif
#endif
{
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/multipoleInducedField.cu
View file @
a993d7ab
...
@@ -337,14 +337,14 @@ extern "C" __global__ void computeInducedField(
...
@@ -337,14 +337,14 @@ extern "C" __global__ void computeInducedField(
// Extract the coordinates of this tile.
// Extract the coordinates of this tile.
unsigned
int
x
,
y
;
int
x
,
y
;
#ifdef USE_CUTOFF
#ifdef USE_CUTOFF
if
(
numTiles
<=
maxTiles
)
if
(
numTiles
<=
maxTiles
)
x
=
tiles
[
pos
];
x
=
tiles
[
pos
];
else
else
#endif
#endif
{
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/pmeMultipoleElectrostatics.cu
View file @
a993d7ab
...
@@ -321,14 +321,14 @@ extern "C" __global__ void computeElectrostatics(
...
@@ -321,14 +321,14 @@ extern "C" __global__ void computeElectrostatics(
// Extract the coordinates of this tile.
// Extract the coordinates of this tile.
unsigned
int
x
,
y
;
int
x
,
y
;
#ifdef USE_CUTOFF
#ifdef USE_CUTOFF
if
(
numTiles
<=
maxTiles
)
if
(
numTiles
<=
maxTiles
)
x
=
tiles
[
pos
];
x
=
tiles
[
pos
];
else
else
#endif
#endif
{
{
y
=
(
unsigned
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
y
=
(
int
)
floor
(
NUM_BLOCKS
+
0.5
f
-
SQRT
((
NUM_BLOCKS
+
0.5
f
)
*
(
NUM_BLOCKS
+
0.5
f
)
-
2
*
pos
));
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
x
=
(
pos
-
y
*
NUM_BLOCKS
+
y
*
(
y
+
1
)
/
2
);
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
if
(
x
<
y
||
x
>=
NUM_BLOCKS
)
{
// Occasionally happens due to roundoff error.
y
+=
(
x
<
y
?
-
1
:
1
);
y
+=
(
x
<
y
?
-
1
:
1
);
...
...
plugins/cpupme/CMakeLists.txt
View file @
a993d7ab
...
@@ -57,7 +57,11 @@ ENDFOREACH(subdir)
...
@@ -57,7 +57,11 @@ ENDFOREACH(subdir)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
IF
(
NOT MSVC
)
IF
(
NOT MSVC
)
IF
(
ANDROID
)
SET_SOURCE_FILES_PROPERTIES
(
${
SOURCE_FILES
}
PROPERTIES COMPILE_FLAGS
""
)
ELSE
(
ANDROID
)
SET_SOURCE_FILES_PROPERTIES
(
${
SOURCE_FILES
}
PROPERTIES COMPILE_FLAGS
"-msse4.1"
)
SET_SOURCE_FILES_PROPERTIES
(
${
SOURCE_FILES
}
PROPERTIES COMPILE_FLAGS
"-msse4.1"
)
ENDIF
(
ANDROID
)
ENDIF
(
NOT MSVC
)
ENDIF
(
NOT MSVC
)
# Include FFTW related files.
# Include FFTW related files.
...
...
plugins/cpupme/src/CpuPmeKernels.cpp
View file @
a993d7ab
...
@@ -569,13 +569,20 @@ double CpuCalcPmeReciprocalForceKernel::finishComputation(IO& io) {
...
@@ -569,13 +569,20 @@ double CpuCalcPmeReciprocalForceKernel::finishComputation(IO& io) {
}
}
bool
CpuCalcPmeReciprocalForceKernel
::
isProcessorSupported
()
{
bool
CpuCalcPmeReciprocalForceKernel
::
isProcessorSupported
()
{
// Make sure the CPU supports SSE 4.1 or NEON.
#ifdef __ANDROID__
uint64_t
features
=
android_getCpuFeatures
();
return
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
#else
int
cpuInfo
[
4
];
int
cpuInfo
[
4
];
cpuid
(
cpuInfo
,
0
);
cpuid
(
cpuInfo
,
0
);
if
(
cpuInfo
[
0
]
>=
1
)
{
if
(
cpuInfo
[
0
]
>=
1
)
{
cpuid
(
cpuInfo
,
1
);
cpuid
(
cpuInfo
,
1
);
return
((
cpuInfo
[
2
]
&
((
int
)
1
<<
19
))
!=
0
);
// Require SSE 4.1
return
((
cpuInfo
[
2
]
&
((
int
)
1
<<
19
))
!=
0
);
}
}
return
false
;
return
false
;
#endif
}
}
int
CpuCalcPmeReciprocalForceKernel
::
findFFTDimension
(
int
minimum
)
{
int
CpuCalcPmeReciprocalForceKernel
::
findFFTDimension
(
int
minimum
)
{
...
...
serialization/include/openmm/serialization/XmlSerializer.h
View file @
a993d7ab
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -79,7 +79,7 @@ public:
...
@@ -79,7 +79,7 @@ public:
private:
private:
static
void
serialize
(
const
SerializationNode
&
node
,
std
::
ostream
&
stream
);
static
void
serialize
(
const
SerializationNode
&
node
,
std
::
ostream
&
stream
);
static
void
*
deserializeStream
(
std
::
istream
&
stream
);
static
void
*
deserializeStream
(
std
::
istream
&
stream
);
static
TiXmlElement
*
encodeNode
(
const
SerializationNode
&
node
);
static
void
encodeNode
(
const
SerializationNode
&
node
,
std
::
ostream
&
stream
,
int
depth
);
static
void
decodeNode
(
SerializationNode
&
node
,
const
TiXmlElement
&
element
);
static
void
decodeNode
(
SerializationNode
&
node
,
const
TiXmlElement
&
element
);
};
};
...
...
serialization/src/XmlSerializer.cpp
View file @
a993d7ab
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2010 Stanford University and the Authors.
*
* Portions copyright (c) 2010
-2014
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -36,25 +36,32 @@ using namespace OpenMM;
...
@@ -36,25 +36,32 @@ using namespace OpenMM;
using
namespace
std
;
using
namespace
std
;
void
XmlSerializer
::
serialize
(
const
SerializationNode
&
node
,
std
::
ostream
&
stream
)
{
void
XmlSerializer
::
serialize
(
const
SerializationNode
&
node
,
std
::
ostream
&
stream
)
{
TiXmlDocument
doc
;
stream
<<
"<?xml version=
\"
1.0
\"
?>
\n
"
;
TiXmlDeclaration
*
decl
=
new
TiXmlDeclaration
(
"1.0"
,
""
,
""
);
encodeNode
(
node
,
stream
,
0
);
doc
.
LinkEndChild
(
decl
);
doc
.
LinkEndChild
(
encodeNode
(
node
));
TiXmlPrinter
printer
;
printer
.
SetIndent
(
"
\t
"
);
doc
.
Accept
(
&
printer
);
stream
<<
printer
.
Str
();
}
}
TiXmlElement
*
XmlSerializer
::
encodeNode
(
const
SerializationNode
&
node
)
{
void
XmlSerializer
::
encodeNode
(
const
SerializationNode
&
node
,
std
::
ostream
&
stream
,
int
depth
)
{
TiXmlElement
*
element
=
new
TiXmlElement
(
node
.
getName
());
for
(
int
i
=
0
;
i
<
depth
;
i
++
)
stream
<<
'\t'
;
stream
<<
'<'
<<
node
.
getName
();
const
map
<
string
,
string
>&
properties
=
node
.
getProperties
();
const
map
<
string
,
string
>&
properties
=
node
.
getProperties
();
for
(
map
<
string
,
string
>::
const_iterator
iter
=
properties
.
begin
();
iter
!=
properties
.
end
();
++
iter
)
for
(
map
<
string
,
string
>::
const_iterator
iter
=
properties
.
begin
();
iter
!=
properties
.
end
();
++
iter
)
{
element
->
SetAttribute
(
iter
->
first
.
c_str
(),
iter
->
second
.
c_str
());
string
name
,
value
;
TiXmlBase
::
EncodeString
(
iter
->
first
,
&
name
);
TiXmlBase
::
EncodeString
(
iter
->
second
,
&
value
);
stream
<<
' '
<<
name
<<
"=
\"
"
<<
value
<<
'\"'
;
}
const
vector
<
SerializationNode
>&
children
=
node
.
getChildren
();
const
vector
<
SerializationNode
>&
children
=
node
.
getChildren
();
if
(
children
.
size
()
==
0
)
stream
<<
"/>
\n
"
;
else
{
stream
<<
">
\n
"
;
for
(
int
i
=
0
;
i
<
(
int
)
children
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
children
.
size
();
i
++
)
element
->
LinkEndChild
(
encodeNode
(
children
[
i
]));
encodeNode
(
children
[
i
],
stream
,
depth
+
1
);
return
element
;
for
(
int
i
=
0
;
i
<
depth
;
i
++
)
stream
<<
'\t'
;
stream
<<
"</"
<<
node
.
getName
()
<<
">
\n
"
;
}
}
}
void
*
XmlSerializer
::
deserializeStream
(
std
::
istream
&
stream
)
{
void
*
XmlSerializer
::
deserializeStream
(
std
::
istream
&
stream
)
{
...
...
tests/TestFindExclusions.cpp
View file @
a993d7ab
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/CustomNonbondedForce.h"
#include "openmm/NonbondedForce.h"
#include "openmm/NonbondedForce.h"
#include "openmm/OpenMMException.h"
#include "openmm/OpenMMException.h"
#include <iostream>
#include <iostream>
...
@@ -166,10 +167,62 @@ void testReplaceExceptions() {
...
@@ -166,10 +167,62 @@ void testReplaceExceptions() {
ASSERT
(
charge
==
5.0
);
ASSERT
(
charge
==
5.0
);
}
}
/**
* This is the same as testFindExceptions(), except it tests adding exclusions to a CustomNonbondedForce.
*/
void
testFindCustomExclusions
()
{
CustomNonbondedForce
nonbonded
(
"r"
);
vector
<
pair
<
int
,
int
>
>
bonds
;
vector
<
double
>
params
;
for
(
int
i
=
0
;
i
<
NUM_ATOMS
;
i
++
)
nonbonded
.
addParticle
(
params
);
// loop over all main-chain atoms (even numbered atoms)
for
(
int
i
=
0
;
i
<
NUM_ATOMS
-
1
;
i
+=
2
)
{
// side-chain bonds
bonds
.
push_back
(
pair
<
int
,
int
>
(
i
,
i
+
1
));
// main-chain bonds
if
(
i
<
NUM_ATOMS
-
2
)
// penultimate atom (NUM_ATOMS-2) has no subsequent main-chain atom
bonds
.
push_back
(
pair
<
int
,
int
>
(
i
,
i
+
2
));
}
nonbonded
.
createExclusionsFromBonds
(
bonds
,
3
);
// Build lists of the expected exclusions.
vector
<
set
<
int
>
>
expectedExclusions
(
NUM_ATOMS
);
int
totalExclusions
=
0
;
for
(
int
i
=
0
;
i
<
NUM_ATOMS
;
i
+=
2
)
{
addAtomsToExclusions
(
i
,
i
+
1
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
,
i
+
2
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
,
i
+
3
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
,
i
+
4
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
+
1
,
i
+
2
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
,
i
+
5
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
,
i
+
6
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
+
1
,
i
+
3
,
expectedExclusions
,
totalExclusions
);
addAtomsToExclusions
(
i
+
1
,
i
+
4
,
expectedExclusions
,
totalExclusions
);
}
for
(
int
i
=
0
;
i
<
nonbonded
.
getNumExclusions
();
i
++
)
{
int
particle1
,
particle2
;
nonbonded
.
getExclusionParticles
(
i
,
particle1
,
particle2
);
}
// Compare them to the exceptions that were generated.
ASSERT_EQUAL
(
totalExclusions
,
nonbonded
.
getNumExclusions
());
for
(
int
i
=
0
;
i
<
nonbonded
.
getNumExclusions
();
i
++
)
{
int
particle1
,
particle2
;
nonbonded
.
getExclusionParticles
(
i
,
particle1
,
particle2
);
ASSERT
(
expectedExclusions
[
particle1
].
find
(
particle2
)
!=
expectedExclusions
[
particle1
].
end
());
}
}
int
main
()
{
int
main
()
{
try
{
try
{
testFindExceptions
();
testFindExceptions
();
testReplaceExceptions
();
testReplaceExceptions
();
testFindCustomExclusions
();
}
}
catch
(
const
exception
&
e
)
{
catch
(
const
exception
&
e
)
{
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
...
...
tools/ci/after_success.sh
0 → 100755
View file @
a993d7ab
echo
$TRAVIS_PULL_REQUEST
$TRAVIS_BRANCH
if
[[
"
$TRAVIS_PULL_REQUEST
"
==
"true"
]]
;
then
echo
"This is a pull request. No deployment will be done."
;
exit
0
fi
if
[[
"
$TRAVIS_BRANCH
"
!=
"master"
]]
;
then
echo
"No deployment on BRANCH='
$TRAVIS_BRANCH
'"
;
exit
0
fi
if
[[
"2.7 3.3"
=
~
"
$python
"
]]
;
then
conda
install
--yes
binstar
binstar
-t
$BINSTAR_TOKEN
upload
--force
-u
omnia
-p
openmm-dev
$HOME
/miniconda/conda-bld/linux-64/openmm-dev-
*
fi
if
[[
"
$python
"
!=
"2.7"
]]
;
then
echo
"No deploy on PYTHON_VERSION=
${
python
}
"
;
exit
0
fi
tools/ci/install.sh
0 → 100755
View file @
a993d7ab
# Original OpenMM .travis.yml requirements.
sudo
apt-get update
-qq
sudo
apt-get
install
-qq
libpcre3 libpcre3-dev gromacs
sudo
apt-get
install
-qq
swig doxygen llvm-3.3
sudo
apt-get
install
-qq
libgl1-mesa-dev opencl-headers
fglrx
=
2:8.960-0ubuntu1
# for opencl support
export
ASAN_SYMBOLIZER_PATH
=
/usr/bin/llvm-symbolizer-3.3
# New requirements.
sudo
apt-get
install
-qq
-y
g++ gfortran csh
sudo
apt-get
install
-qq
-y
g++-multilib gcc-multilib
wget http://repo.continuum.io/miniconda/Miniconda-3.0.5-Linux-x86_64.sh
bash Miniconda-3.0.5-Linux-x86_64.sh
-b
PIP_ARGS
=
"-U"
export
PATH
=
$HOME
/miniconda/bin:
$PATH
conda update
--yes
conda
conda config
--add
channels http://conda.binstar.org/omnia
conda create
--yes
-n
${
python
}
python
=
${
python
}
--file
tools/ci/requirements-conda.txt
source
activate
$python
$HOME
/miniconda/envs/
${
python
}
/bin/pip
install
$PIP_ARGS
nose-exclude
Prev
1
2
3
4
5
Next
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