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
f2958043
Commit
f2958043
authored
Feb 18, 2015
by
peastman
Browse files
Minor changes to speed up some test cases
parent
1c271535
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
29 deletions
+29
-29
platforms/cuda/tests/TestCudaLocalEnergyMinimizer.cpp
platforms/cuda/tests/TestCudaLocalEnergyMinimizer.cpp
+4
-4
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
+4
-4
platforms/opencl/tests/TestOpenCLLocalEnergyMinimizer.cpp
platforms/opencl/tests/TestOpenCLLocalEnergyMinimizer.cpp
+4
-4
platforms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
...rms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
+4
-4
platforms/reference/tests/TestReferenceCustomNonbondedForce.cpp
...rms/reference/tests/TestReferenceCustomNonbondedForce.cpp
+3
-3
platforms/reference/tests/TestReferenceLocalEnergyMinimizer.cpp
...rms/reference/tests/TestReferenceLocalEnergyMinimizer.cpp
+4
-4
platforms/reference/tests/TestReferenceVariableLangevinIntegrator.cpp
...ference/tests/TestReferenceVariableLangevinIntegrator.cpp
+4
-4
plugins/drude/platforms/reference/tests/TestReferenceDrudeLangevinIntegrator.cpp
.../reference/tests/TestReferenceDrudeLangevinIntegrator.cpp
+1
-1
plugins/drude/platforms/reference/tests/TestReferenceDrudeSCFIntegrator.cpp
...forms/reference/tests/TestReferenceDrudeSCFIntegrator.cpp
+1
-1
No files found.
platforms/cuda/tests/TestCudaLocalEnergyMinimizer.cpp
View file @
f2958043
...
@@ -77,10 +77,10 @@ void testHarmonicBonds() {
...
@@ -77,10 +77,10 @@ void testHarmonicBonds() {
}
}
void
testLargeSystem
()
{
void
testLargeSystem
()
{
const
int
numMolecules
=
5
0
;
const
int
numMolecules
=
2
5
;
const
int
numParticles
=
numMolecules
*
2
;
const
int
numParticles
=
numMolecules
*
2
;
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
const
double
boxSize
=
5
.0
;
const
double
boxSize
=
4
.0
;
const
double
tolerance
=
5
;
const
double
tolerance
=
5
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
...
@@ -134,10 +134,10 @@ void testLargeSystem() {
...
@@ -134,10 +134,10 @@ void testLargeSystem() {
}
}
void
testVirtualSites
()
{
void
testVirtualSites
()
{
const
int
numMolecules
=
5
0
;
const
int
numMolecules
=
2
5
;
const
int
numParticles
=
numMolecules
*
3
;
const
int
numParticles
=
numMolecules
*
3
;
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
const
double
boxSize
=
5
.0
;
const
double
boxSize
=
4
.0
;
const
double
tolerance
=
5
;
const
double
tolerance
=
5
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
...
...
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
View file @
f2958043
...
@@ -296,7 +296,7 @@ void testArgonBox() {
...
@@ -296,7 +296,7 @@ void testArgonBox() {
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
VariableLangevinIntegrator
integrator
(
temp
,
6.0
,
1e-
5
);
VariableLangevinIntegrator
integrator
(
temp
,
6.0
,
1e-
4
);
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
context
.
setVelocitiesToTemperature
(
temp
);
context
.
setVelocitiesToTemperature
(
temp
);
...
@@ -308,13 +308,13 @@ void testArgonBox() {
...
@@ -308,13 +308,13 @@ void testArgonBox() {
// Make sure the temperature is correct.
// Make sure the temperature is correct.
double
ke
=
0.0
;
double
ke
=
0.0
;
for
(
int
i
=
0
;
i
<
2
000
;
++
i
)
{
for
(
int
i
=
0
;
i
<
1
000
;
++
i
)
{
double
t
=
2.0
+
0.0
1
*
(
i
+
1
);
double
t
=
2.0
+
0.0
2
*
(
i
+
1
);
integrator
.
stepTo
(
t
);
integrator
.
stepTo
(
t
);
State
state
=
context
.
getState
(
State
::
Energy
);
State
state
=
context
.
getState
(
State
::
Energy
);
ke
+=
state
.
getKineticEnergy
();
ke
+=
state
.
getKineticEnergy
();
}
}
ke
/=
2
000
;
ke
/=
1
000
;
double
expected
=
1.5
*
numParticles
*
BOLTZ
*
temp
;
double
expected
=
1.5
*
numParticles
*
BOLTZ
*
temp
;
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
0.01
);
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
0.01
);
}
}
...
...
platforms/opencl/tests/TestOpenCLLocalEnergyMinimizer.cpp
View file @
f2958043
...
@@ -77,10 +77,10 @@ void testHarmonicBonds() {
...
@@ -77,10 +77,10 @@ void testHarmonicBonds() {
}
}
void
testLargeSystem
()
{
void
testLargeSystem
()
{
const
int
numMolecules
=
5
0
;
const
int
numMolecules
=
2
5
;
const
int
numParticles
=
numMolecules
*
2
;
const
int
numParticles
=
numMolecules
*
2
;
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
const
double
boxSize
=
5
.0
;
const
double
boxSize
=
4
.0
;
const
double
tolerance
=
5
;
const
double
tolerance
=
5
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
...
@@ -134,10 +134,10 @@ void testLargeSystem() {
...
@@ -134,10 +134,10 @@ void testLargeSystem() {
}
}
void
testVirtualSites
()
{
void
testVirtualSites
()
{
const
int
numMolecules
=
5
0
;
const
int
numMolecules
=
2
5
;
const
int
numParticles
=
numMolecules
*
3
;
const
int
numParticles
=
numMolecules
*
3
;
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
const
double
boxSize
=
5
.0
;
const
double
boxSize
=
4
.0
;
const
double
tolerance
=
5
;
const
double
tolerance
=
5
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
...
...
platforms/opencl/tests/TestOpenCLVariableLangevinIntegrator.cpp
View file @
f2958043
...
@@ -296,7 +296,7 @@ void testArgonBox() {
...
@@ -296,7 +296,7 @@ void testArgonBox() {
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
VariableLangevinIntegrator
integrator
(
temp
,
6.0
,
1e-
5
);
VariableLangevinIntegrator
integrator
(
temp
,
6.0
,
1e-
4
);
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
context
.
setVelocitiesToTemperature
(
temp
);
context
.
setVelocitiesToTemperature
(
temp
);
...
@@ -308,13 +308,13 @@ void testArgonBox() {
...
@@ -308,13 +308,13 @@ void testArgonBox() {
// Make sure the temperature is correct.
// Make sure the temperature is correct.
double
ke
=
0.0
;
double
ke
=
0.0
;
for
(
int
i
=
0
;
i
<
2
000
;
++
i
)
{
for
(
int
i
=
0
;
i
<
1
000
;
++
i
)
{
double
t
=
2.0
+
0.0
1
*
(
i
+
1
);
double
t
=
2.0
+
0.0
2
*
(
i
+
1
);
integrator
.
stepTo
(
t
);
integrator
.
stepTo
(
t
);
State
state
=
context
.
getState
(
State
::
Energy
);
State
state
=
context
.
getState
(
State
::
Energy
);
ke
+=
state
.
getKineticEnergy
();
ke
+=
state
.
getKineticEnergy
();
}
}
ke
/=
2
000
;
ke
/=
1
000
;
double
expected
=
1.5
*
numParticles
*
BOLTZ
*
temp
;
double
expected
=
1.5
*
numParticles
*
BOLTZ
*
temp
;
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
0.01
);
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
0.01
);
}
}
...
...
platforms/reference/tests/TestReferenceCustomNonbondedForce.cpp
View file @
f2958043
...
@@ -383,12 +383,12 @@ void testContinuous3DFunction() {
...
@@ -383,12 +383,12 @@ void testContinuous3DFunction() {
const
int
xsize
=
10
;
const
int
xsize
=
10
;
const
int
ysize
=
11
;
const
int
ysize
=
11
;
const
int
zsize
=
12
;
const
int
zsize
=
12
;
const
double
xmin
=
0.
4
;
const
double
xmin
=
0.
6
;
const
double
xmax
=
1.1
;
const
double
xmax
=
1.1
;
const
double
ymin
=
0.0
;
const
double
ymin
=
0.0
;
const
double
ymax
=
0.
9
;
const
double
ymax
=
0.
7
;
const
double
zmin
=
0.2
;
const
double
zmin
=
0.2
;
const
double
zmax
=
1.3
;
const
double
zmax
=
0.9
;
ReferencePlatform
platform
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
addParticle
(
1.0
);
system
.
addParticle
(
1.0
);
...
...
platforms/reference/tests/TestReferenceLocalEnergyMinimizer.cpp
View file @
f2958043
...
@@ -76,10 +76,10 @@ void testHarmonicBonds() {
...
@@ -76,10 +76,10 @@ void testHarmonicBonds() {
}
}
void
testLargeSystem
()
{
void
testLargeSystem
()
{
const
int
numMolecules
=
5
0
;
const
int
numMolecules
=
2
5
;
const
int
numParticles
=
numMolecules
*
2
;
const
int
numParticles
=
numMolecules
*
2
;
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
const
double
boxSize
=
5
.0
;
const
double
boxSize
=
4
.0
;
const
double
tolerance
=
5
;
const
double
tolerance
=
5
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
...
@@ -134,10 +134,10 @@ void testLargeSystem() {
...
@@ -134,10 +134,10 @@ void testLargeSystem() {
}
}
void
testVirtualSites
()
{
void
testVirtualSites
()
{
const
int
numMolecules
=
5
0
;
const
int
numMolecules
=
2
5
;
const
int
numParticles
=
numMolecules
*
3
;
const
int
numParticles
=
numMolecules
*
3
;
const
double
cutoff
=
2.0
;
const
double
cutoff
=
2.0
;
const
double
boxSize
=
5
.0
;
const
double
boxSize
=
4
.0
;
const
double
tolerance
=
5
;
const
double
tolerance
=
5
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
...
...
platforms/reference/tests/TestReferenceVariableLangevinIntegrator.cpp
View file @
f2958043
...
@@ -300,7 +300,7 @@ void testArgonBox() {
...
@@ -300,7 +300,7 @@ void testArgonBox() {
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxSize
,
0
,
0
),
Vec3
(
0
,
boxSize
,
0
),
Vec3
(
0
,
0
,
boxSize
));
system
.
addForce
(
nonbonded
);
system
.
addForce
(
nonbonded
);
VariableLangevinIntegrator
integrator
(
temp
,
6.0
,
1e-
5
);
VariableLangevinIntegrator
integrator
(
temp
,
6.0
,
1e-
4
);
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
context
.
setVelocitiesToTemperature
(
temp
);
context
.
setVelocitiesToTemperature
(
temp
);
...
@@ -312,13 +312,13 @@ void testArgonBox() {
...
@@ -312,13 +312,13 @@ void testArgonBox() {
// Make sure the temperature is correct.
// Make sure the temperature is correct.
double
ke
=
0.0
;
double
ke
=
0.0
;
for
(
int
i
=
0
;
i
<
2
000
;
++
i
)
{
for
(
int
i
=
0
;
i
<
1
000
;
++
i
)
{
double
t
=
2.0
+
0.0
1
*
(
i
+
1
);
double
t
=
2.0
+
0.0
2
*
(
i
+
1
);
integrator
.
stepTo
(
t
);
integrator
.
stepTo
(
t
);
State
state
=
context
.
getState
(
State
::
Energy
);
State
state
=
context
.
getState
(
State
::
Energy
);
ke
+=
state
.
getKineticEnergy
();
ke
+=
state
.
getKineticEnergy
();
}
}
ke
/=
2
000
;
ke
/=
1
000
;
double
expected
=
1.5
*
numParticles
*
BOLTZ
*
temp
;
double
expected
=
1.5
*
numParticles
*
BOLTZ
*
temp
;
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
0.01
);
ASSERT_USUALLY_EQUAL_TOL
(
expected
,
ke
,
0.01
);
}
}
...
...
plugins/drude/platforms/reference/tests/TestReferenceDrudeLangevinIntegrator.cpp
View file @
f2958043
...
@@ -99,7 +99,7 @@ void testWater() {
...
@@ -99,7 +99,7 @@ void testWater() {
// Create a box of SWM4-NDP water molecules. This involves constraints, virtual sites,
// Create a box of SWM4-NDP water molecules. This involves constraints, virtual sites,
// and Drude particles.
// and Drude particles.
const
int
gridSize
=
4
;
const
int
gridSize
=
3
;
const
int
numMolecules
=
gridSize
*
gridSize
*
gridSize
;
const
int
numMolecules
=
gridSize
*
gridSize
*
gridSize
;
const
double
spacing
=
0.6
;
const
double
spacing
=
0.6
;
const
double
boxSize
=
spacing
*
(
gridSize
+
1
);
const
double
boxSize
=
spacing
*
(
gridSize
+
1
);
...
...
plugins/drude/platforms/reference/tests/TestReferenceDrudeSCFIntegrator.cpp
View file @
f2958043
...
@@ -54,7 +54,7 @@ void testWater() {
...
@@ -54,7 +54,7 @@ void testWater() {
// Create a box of SWM4-NDP water molecules. This involves constraints, virtual sites,
// Create a box of SWM4-NDP water molecules. This involves constraints, virtual sites,
// and Drude particles.
// and Drude particles.
const
int
gridSize
=
4
;
const
int
gridSize
=
3
;
const
int
numMolecules
=
gridSize
*
gridSize
*
gridSize
;
const
int
numMolecules
=
gridSize
*
gridSize
*
gridSize
;
const
double
spacing
=
0.6
;
const
double
spacing
=
0.6
;
const
double
boxSize
=
spacing
*
(
gridSize
+
1
);
const
double
boxSize
=
spacing
*
(
gridSize
+
1
);
...
...
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