diff --git a/package/CHANGELOG b/package/CHANGELOG index 9a1bb52719d..30a9ed4a2f5 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -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) diff --git a/package/MDAnalysis/lib/distances.py b/package/MDAnalysis/lib/distances.py index c7aceef39a8..7f649bebd70 100644 --- a/package/MDAnalysis/lib/distances.py +++ b/package/MDAnalysis/lib/distances.py @@ -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") ------------------------------------- @@ -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 diff --git a/testsuite/MDAnalysisTests/test_distances.py b/testsuite/MDAnalysisTests/test_distances.py index 87d92d47a19..3f6108d96f9 100644 --- a/testsuite/MDAnalysisTests/test_distances.py +++ b/testsuite/MDAnalysisTests/test_distances.py @@ -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))