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
5eb3f8ad
Commit
5eb3f8ad
authored
Jan 15, 2016
by
peastman
Browse files
Merge pull request #1341 from peastman/checkpoint
Loading a checkpoint marks that positions have been set
parents
a5d900d1
2f5bb780
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
openmmapi/src/ContextImpl.cpp
openmmapi/src/ContextImpl.cpp
+1
-0
platforms/cpu/tests/TestCpuCheckpoints.cpp
platforms/cpu/tests/TestCpuCheckpoints.cpp
+9
-0
platforms/cuda/tests/TestCudaCheckpoints.cpp
platforms/cuda/tests/TestCudaCheckpoints.cpp
+9
-0
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
+9
-0
platforms/reference/tests/TestReferenceCheckpoints.cpp
platforms/reference/tests/TestReferenceCheckpoints.cpp
+9
-0
No files found.
openmmapi/src/ContextImpl.cpp
View file @
5eb3f8ad
...
@@ -449,4 +449,5 @@ void ContextImpl::loadCheckpoint(istream& stream) {
...
@@ -449,4 +449,5 @@ void ContextImpl::loadCheckpoint(istream& stream) {
parameters
[
name
]
=
value
;
parameters
[
name
]
=
value
;
}
}
updateStateDataKernel
.
getAs
<
UpdateStateDataKernel
>
().
loadCheckpoint
(
*
this
,
stream
);
updateStateDataKernel
.
getAs
<
UpdateStateDataKernel
>
().
loadCheckpoint
(
*
this
,
stream
);
hasSetPositions
=
true
;
}
}
platforms/cpu/tests/TestCpuCheckpoints.cpp
View file @
5eb3f8ad
...
@@ -92,6 +92,15 @@ void testCheckpoint() {
...
@@ -92,6 +92,15 @@ void testCheckpoint() {
integrator
.
step
(
10
);
integrator
.
step
(
10
);
State
s4
=
context
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
State
s4
=
context
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
compareStates
(
s2
,
s4
);
compareStates
(
s2
,
s4
);
// See if a checkpoint created from one Context can be loaded into a different one.
VerletIntegrator
integrator2
(
0.001
);
Context
context2
(
system
,
integrator2
,
platform
);
stream1
.
seekg
(
0
,
stream1
.
beg
);
context2
.
loadCheckpoint
(
stream1
);
State
s5
=
context2
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
|
State
::
Energy
);
compareStates
(
s1
,
s5
);
}
}
void
runPlatformTests
()
{
void
runPlatformTests
()
{
...
...
platforms/cuda/tests/TestCudaCheckpoints.cpp
View file @
5eb3f8ad
...
@@ -120,6 +120,15 @@ void testCheckpoint() {
...
@@ -120,6 +120,15 @@ void testCheckpoint() {
integrator2
.
step
(
10
);
integrator2
.
step
(
10
);
State
s8
=
context2
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
State
s8
=
context2
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
compareStates
(
s6
,
s8
);
compareStates
(
s6
,
s8
);
// See if a checkpoint created from one Context can be loaded into a different one.
VerletIntegrator
integrator3
(
0.001
);
Context
context3
(
system
,
integrator3
,
platform
);
stream1
.
seekg
(
0
,
stream1
.
beg
);
context3
.
loadCheckpoint
(
stream1
);
State
s9
=
context3
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
|
State
::
Energy
);
compareStates
(
s1
,
s9
);
}
}
void
runPlatformTests
()
{
void
runPlatformTests
()
{
...
...
platforms/opencl/tests/TestOpenCLCheckpoints.cpp
View file @
5eb3f8ad
...
@@ -120,6 +120,15 @@ void testCheckpoint() {
...
@@ -120,6 +120,15 @@ void testCheckpoint() {
integrator2
.
step
(
10
);
integrator2
.
step
(
10
);
State
s8
=
context2
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
State
s8
=
context2
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
compareStates
(
s6
,
s8
);
compareStates
(
s6
,
s8
);
// See if a checkpoint created from one Context can be loaded into a different one.
VerletIntegrator
integrator3
(
0.001
);
Context
context3
(
system
,
integrator3
,
platform
);
stream1
.
seekg
(
0
,
stream1
.
beg
);
context3
.
loadCheckpoint
(
stream1
);
State
s9
=
context3
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
|
State
::
Energy
);
compareStates
(
s1
,
s9
);
}
}
void
runPlatformTests
()
{
void
runPlatformTests
()
{
...
...
platforms/reference/tests/TestReferenceCheckpoints.cpp
View file @
5eb3f8ad
...
@@ -92,6 +92,15 @@ void testCheckpoint() {
...
@@ -92,6 +92,15 @@ void testCheckpoint() {
integrator
.
step
(
10
);
integrator
.
step
(
10
);
State
s4
=
context
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
State
s4
=
context
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
);
compareStates
(
s2
,
s4
);
compareStates
(
s2
,
s4
);
// See if a checkpoint created from one Context can be loaded into a different one.
VerletIntegrator
integrator2
(
0.001
);
Context
context2
(
system
,
integrator2
,
platform
);
stream1
.
seekg
(
0
,
stream1
.
beg
);
context2
.
loadCheckpoint
(
stream1
);
State
s5
=
context2
.
getState
(
State
::
Positions
|
State
::
Velocities
|
State
::
Parameters
|
State
::
Energy
);
compareStates
(
s1
,
s5
);
}
}
void
runPlatformTests
()
{
void
runPlatformTests
()
{
...
...
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