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
1eb4a6ec
Commit
1eb4a6ec
authored
May 30, 2015
by
Kyle Beauchamp
Browse files
Add elapsed time column in statedatareporter
parent
50442b0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
wrappers/python/simtk/openmm/app/statedatareporter.py
wrappers/python/simtk/openmm/app/statedatareporter.py
+7
-1
No files found.
wrappers/python/simtk/openmm/app/statedatareporter.py
View file @
1eb4a6ec
...
@@ -55,7 +55,7 @@ class StateDataReporter(object):
...
@@ -55,7 +55,7 @@ class StateDataReporter(object):
"""
"""
def
__init__
(
self
,
file
,
reportInterval
,
step
=
False
,
time
=
False
,
potentialEnergy
=
False
,
kineticEnergy
=
False
,
totalEnergy
=
False
,
temperature
=
False
,
volume
=
False
,
density
=
False
,
def
__init__
(
self
,
file
,
reportInterval
,
step
=
False
,
time
=
False
,
potentialEnergy
=
False
,
kineticEnergy
=
False
,
totalEnergy
=
False
,
temperature
=
False
,
volume
=
False
,
density
=
False
,
progress
=
False
,
remainingTime
=
False
,
speed
=
False
,
separator
=
','
,
systemMass
=
None
,
totalSteps
=
None
):
progress
=
False
,
remainingTime
=
False
,
speed
=
False
,
elapsedTime
=
False
,
separator
=
','
,
systemMass
=
None
,
totalSteps
=
None
):
"""Create a StateDataReporter.
"""Create a StateDataReporter.
Parameters:
Parameters:
...
@@ -74,6 +74,7 @@ class StateDataReporter(object):
...
@@ -74,6 +74,7 @@ class StateDataReporter(object):
- remainingTime (boolean=False) Whether to write an estimate of the remaining clock time until
- remainingTime (boolean=False) Whether to write an estimate of the remaining clock time until
completion to the file. If this is True, you must also specify totalSteps.
completion to the file. If this is True, you must also specify totalSteps.
- speed (bool=False) Whether to write an estimate of the simulation speed in ns/day to the file
- speed (bool=False) Whether to write an estimate of the simulation speed in ns/day to the file
- elapsedTime (bool=False) Whether to write the elapsed time of the simulation in seconds to the file.
- separator (string=',') The separator to use between columns in the file
- separator (string=',') The separator to use between columns in the file
- systemMass (mass=None) The total mass to use for the system when reporting density. If this is
- systemMass (mass=None) The total mass to use for the system when reporting density. If this is
None (the default), the system mass is computed by summing the masses of all particles. This
None (the default), the system mass is computed by summing the masses of all particles. This
...
@@ -113,6 +114,7 @@ class StateDataReporter(object):
...
@@ -113,6 +114,7 @@ class StateDataReporter(object):
self
.
_progress
=
progress
self
.
_progress
=
progress
self
.
_remainingTime
=
remainingTime
self
.
_remainingTime
=
remainingTime
self
.
_speed
=
speed
self
.
_speed
=
speed
self
.
_elapsedTime
=
elapsedTime
self
.
_separator
=
separator
self
.
_separator
=
separator
self
.
_totalMass
=
systemMass
self
.
_totalMass
=
systemMass
self
.
_totalSteps
=
totalSteps
self
.
_totalSteps
=
totalSteps
...
@@ -207,6 +209,8 @@ class StateDataReporter(object):
...
@@ -207,6 +209,8 @@ class StateDataReporter(object):
values
.
append
(
'%.3g'
%
(
elapsedNs
/
elapsedDays
))
values
.
append
(
'%.3g'
%
(
elapsedNs
/
elapsedDays
))
else
:
else
:
values
.
append
(
'--'
)
values
.
append
(
'--'
)
if
self
.
_elapsedTime
:
values
.
append
(
time
.
time
()
-
self
.
_initialClockTime
)
if
self
.
_remainingTime
:
if
self
.
_remainingTime
:
elapsedSeconds
=
clockTime
-
self
.
_initialClockTime
elapsedSeconds
=
clockTime
-
self
.
_initialClockTime
elapsedSteps
=
simulation
.
currentStep
-
self
.
_initialSteps
elapsedSteps
=
simulation
.
currentStep
-
self
.
_initialSteps
...
@@ -284,6 +288,8 @@ class StateDataReporter(object):
...
@@ -284,6 +288,8 @@ class StateDataReporter(object):
headers
.
append
(
'Density (g/mL)'
)
headers
.
append
(
'Density (g/mL)'
)
if
self
.
_speed
:
if
self
.
_speed
:
headers
.
append
(
'Speed (ns/day)'
)
headers
.
append
(
'Speed (ns/day)'
)
if
self
.
_elapsedTime
:
headers
.
append
(
'Elapsed Time (s)'
)
if
self
.
_remainingTime
:
if
self
.
_remainingTime
:
headers
.
append
(
'Time Remaining'
)
headers
.
append
(
'Time Remaining'
)
return
headers
return
headers
...
...
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