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
72f3fe31
Commit
72f3fe31
authored
May 11, 2012
by
Peter Eastman
Browse files
Checkpointing works with Python
parent
6d7a47b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
wrappers/python/src/swig_doxygen/swigInputConfig.py
wrappers/python/src/swig_doxygen/swigInputConfig.py
+2
-0
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
+35
-0
No files found.
wrappers/python/src/swig_doxygen/swigInputConfig.py
View file @
72f3fe31
...
@@ -138,6 +138,8 @@ SKIP_METHODS = [('State',),
...
@@ -138,6 +138,8 @@ SKIP_METHODS = [('State',),
(
'VdwInfo'
,),
(
'VdwInfo'
,),
(
'WcaDispersionInfo'
,),
(
'WcaDispersionInfo'
,),
(
'Context'
,
'getState'
),
(
'Context'
,
'getState'
),
(
'Context'
,
'createCheckpoint'
),
(
'Context'
,
'loadCheckpoint'
),
(
'CudaPlatform'
,),
(
'CudaPlatform'
,),
(
'Force'
,
'Force'
),
(
'Force'
,
'Force'
),
(
'ParticleParameterInfo'
,),
(
'ParticleParameterInfo'
,),
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
View file @
72f3fe31
...
@@ -73,6 +73,41 @@
...
@@ -73,6 +73,41 @@
return
state
return
state
}
}
%
feature
(
"docstring"
)
createCheckpoint1
"Create a checkpoint recording the current state of the Context.
This should be treated as an opaque block of binary data. See loadCheckpoint() for more details.
Returns: a string containing the checkpoint data
"
std
::
string
createCheckpoint1
()
{
std
::
stringstream
stream
(
std
::
ios_base
::
in
|
std
::
ios_base
::
out
|
std
::
ios_base
::
binary
)
;
self-
>
createCheckpoint
(
stream
)
;
return
stream
.
str
()
;
}
%
feature
(
"docstring"
)
loadCheckpoint
"Load a checkpoint that was written by createCheckpoint().
A checkpoint contains not only publicly visible data such as the particle positions and
velocities, but also internal data such as the states of random number generators. Ideally,
loading a checkpoint should restore the Context to an identical state to when it was written,
such that continuing the simulation will produce an identical trajectory. This is not strictly
guaranteed to be true, however, and should not be relied on. For most purposes, however, the
internal state should be close enough to be reasonably considered equivalent.
A checkpoint contains data that is highly specific to the Context from which it was created.
It depends on the details of the System, the Platform being used, and the hardware and software
of the computer it was created on. If you try to load it on a computer with different hardware,
or for a System that is different in any way, loading is likely to fail. Checkpoints created
with different versions of OpenMM are also often incompatible. If a checkpoint cannot be loaded,
that is signaled by throwing an exception.
Parameters:
- checkpoint (string) the checkpoint data to load
"
void
loadCheckpoint
(
std
::
string
checkpoint
)
{
std
::
stringstream
stream
(
std
::
ios_base
::
in
|
std
::
ios_base
::
out
|
std
::
ios_base
::
binary
)
;
stream
<<
checkpoint
;
self-
>
loadCheckpoint
(
stream
)
;
}
}
}
%
extend
OpenMM
::
RPMDIntegrator
{
%
extend
OpenMM
::
RPMDIntegrator
{
...
...
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