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
e5e2d9c9
Unverified
Commit
e5e2d9c9
authored
Nov 28, 2018
by
peastman
Committed by
GitHub
Nov 28, 2018
Browse files
Merge pull request #2215 from peastman/test
Improvements to testInstallation script
parents
6aeccb40
5f6a4b65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
wrappers/python/simtk/testInstallation.py
wrappers/python/simtk/testInstallation.py
+16
-3
No files found.
wrappers/python/simtk/testInstallation.py
View file @
e5e2d9c9
...
...
@@ -27,6 +27,10 @@ def run_tests():
between them for a test system. If a problem is detected, TestingError is
raised.
"""
print
()
print
(
'OpenMM Version:'
,
Platform
.
getOpenMMVersion
())
print
(
'Git Revision:'
,
version
.
git_revision
)
print
()
# Create a System for the tests.
data_dir
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
split
(
__file__
)[
0
]),
'openmm'
,
'app'
,
'data'
)
...
...
@@ -63,6 +67,7 @@ def run_tests():
# See how well the platforms agree.
errorsOk
=
True
if
numPlatforms
>
1
:
print
()
print
(
"Median difference in forces between platforms:"
)
...
...
@@ -75,9 +80,17 @@ def run_tests():
d
=
f1
-
f2
error
=
sqrt
((
d
[
0
]
*
d
[
0
]
+
d
[
1
]
*
d
[
1
]
+
d
[
2
]
*
d
[
2
])
/
(
f1
[
0
]
*
f1
[
0
]
+
f1
[
1
]
*
f1
[
1
]
+
f1
[
2
]
*
f1
[
2
]))
errors
.
append
(
error
)
print
(
"{0} vs. {1}: {2:g}"
.
format
(
Platform
.
getPlatform
(
j
).
getName
(),
Platform
.
getPlatform
(
i
).
getName
(),
sorted
(
errors
)[
len
(
errors
)
//
2
]))
median
=
sorted
(
errors
)[
len
(
errors
)
//
2
]
if
median
<
1e-4
:
message
=
''
else
:
message
=
' *** LARGE DIFFERENCE **'
errorsOk
=
False
print
(
"{0} vs. {1}: {2:g}{3}"
.
format
(
Platform
.
getPlatform
(
j
).
getName
(),
Platform
.
getPlatform
(
i
).
getName
(),
median
,
message
))
if
errorsOk
:
print
()
print
(
'All differences are within tolerance.'
)
def
main
():
...
...
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