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
e1c4e1f8
Unverified
Commit
e1c4e1f8
authored
Jan 16, 2023
by
Peter Eastman
Committed by
GitHub
Jan 16, 2023
Browse files
Fixed exceptions in benchmark script (#3912)
parent
4c2f3323
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
examples/benchmark.py
examples/benchmark.py
+3
-5
No files found.
examples/benchmark.py
View file @
e1c4e1f8
...
@@ -4,10 +4,11 @@ import openmm as mm
...
@@ -4,10 +4,11 @@ import openmm as mm
import
openmm.unit
as
unit
import
openmm.unit
as
unit
from
datetime
import
datetime
from
datetime
import
datetime
import
argparse
import
argparse
import
os
def
cpuinfo
():
def
cpuinfo
():
"""Return CPU info"""
"""Return CPU info"""
import
os
,
platform
,
subprocess
,
re
import
platform
,
subprocess
,
re
if
platform
.
system
()
==
"Windows"
:
if
platform
.
system
()
==
"Windows"
:
return
platform
.
processor
()
return
platform
.
processor
()
elif
platform
.
system
()
==
"Darwin"
:
elif
platform
.
system
()
==
"Darwin"
:
...
@@ -41,7 +42,6 @@ def appendTestResult(filename=None, test_result=None, system_info=None):
...
@@ -41,7 +42,6 @@ def appendTestResult(filename=None, test_result=None, system_info=None):
if
filename
is
None
:
if
filename
is
None
:
return
return
import
os
all_results
=
{
'benchmarks'
:
list
()
}
all_results
=
{
'benchmarks'
:
list
()
}
if
system_info
is
not
None
:
if
system_info
is
not
None
:
all_results
[
'system'
]
=
system_info
all_results
[
'system'
]
=
system_info
...
@@ -266,7 +266,6 @@ def serializeTest(directory=None, system=None, integrator=None, state=None, core
...
@@ -266,7 +266,6 @@ def serializeTest(directory=None, system=None, integrator=None, state=None, core
metadata : dict
metadata : dict
Metadata to dump to YAML
Metadata to dump to YAML
"""
"""
import
os
os
.
makedirs
(
directory
,
exist_ok
=
True
)
os
.
makedirs
(
directory
,
exist_ok
=
True
)
import
openmm
import
openmm
def
serialize
(
obj
,
filename
):
def
serialize
(
obj
,
filename
):
...
@@ -512,7 +511,6 @@ for key, value in system_info.items():
...
@@ -512,7 +511,6 @@ for key, value in system_info.items():
if
args
.
outfile
is
not
None
:
if
args
.
outfile
is
not
None
:
# Remove output file
# Remove output file
import
os
if
os
.
path
.
exists
(
args
.
outfile
):
if
os
.
path
.
exists
(
args
.
outfile
):
os
.
unlink
(
args
.
outfile
)
os
.
unlink
(
args
.
outfile
)
# Write system info
# Write system info
...
@@ -561,4 +559,4 @@ elif args.style == 'table':
...
@@ -561,4 +559,4 @@ elif args.style == 'table':
print
(
e
)
print
(
e
)
pass
pass
else
:
else
:
raise
ValueError
(
f
"style
{
args
.
style
}
unkown; must be one of ['simple', 'table']"
)
raise
ValueError
(
f
"style
{
args
.
style
}
unk
n
own; must be one of ['simple', 'table']"
)
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