Skip to content

Commit

Permalink
Merge pull request #909 from MDAnalysis/issue-883-openmpflag
Browse files Browse the repository at this point in the history
Added flag at lib.distances.USED_OPENMP

closes #883
  • Loading branch information
orbeckst authored Jul 29, 2016
2 parents e5c98de + 6ab7b26 commit df6cec8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Enhancements
with 'quiet=False'
* The 'run' method from all 'AnalysisBase' derived classes return the
class itself.
* Added boolean flag at lib.distances.USED_OPENMP to reveal if
OpenMP was used in compilation (Issue #883)

Fixes
* GROWriter resids now truncated properly (Issue #886)
Expand Down
4 changes: 4 additions & 0 deletions package/MDAnalysis/lib/distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
Fast C-routines to calculate distance arrays from coordinate
arrays. Many of the functions also exist in parallel versions, that
typically provide higher performance than the serial code.
The boolean attribute MDAnalysis.lib.distances.USED_OPENMP can be
checked to see if OpenMP was used in the compilation of MDAnalysis.
Selection of acceleration ("backend")
-------------------------------------
Expand Down Expand Up @@ -110,6 +112,8 @@ def _run(funcname, args=None, kwargs=None, backend="serial"):
ortho_pbc,
triclinic_pbc)

from c_distances_openmp import OPENMP_ENABLED as USED_OPENMP


def _box_check(box):
"""Take a box input and deduce what type of system it represents based
Expand Down
2 changes: 2 additions & 0 deletions testsuite/MDAnalysisTests/test_distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,3 +715,5 @@ def test_missing_backend_raises_ValueError(self):
backend="not_implemented_stuff")


def test_used_openmpflag():
assert_(isinstance(MDAnalysis.lib.distances.USED_OPENMP, bool))

0 comments on commit df6cec8

Please sign in to comment.