diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df61881a..f6bd3ffa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-16.04", "ubuntu-18.04", "ubuntu-20.04", "macos-latest"] - compiler: [gcc-7, gcc-8, gcc-9, clang] + compiler: [gcc-7, gcc-9, gcc-10, clang] python-version: ["2.7", "3.5", "3.6", "3.7", "3.8"] numpy-version: ["1.14", "1.16", "1.18"] exclude: @@ -18,30 +18,30 @@ jobs: # Only run with 'clang' on OSX - os: "macos-latest" compiler: gcc-7 - - os: "macos-latest" - compiler: gcc-8 - os: "macos-latest" compiler: gcc-9 + - os: "macos-latest" + compiler: gcc-10 # Don't use 'clang' on linux + - os: "ubuntu-16.04" + compiler: clang - os: "ubuntu-18.04" compiler: clang - os: "ubuntu-20.04" compiler: clang - - os: "ubuntu-16.04" - compiler: clang - # only gcc-9 on 20.04 + # only gcc-10 on 20.04 - os: "ubuntu-20.04" - compiler: gcc-7 + compiler: gcc-9 - os: "ubuntu-20.04" - compiler: gcc-8 + compiler: gcc-7 - # only gcc-7 on 16.04 + # only gcc-9 on 16.04 - os: "ubuntu-16.04" - compiler: gcc-8 + compiler: gcc-7 - os: "ubuntu-16.04" - compiler: gcc-9 + compiler: gcc-10 # python3.8 only on 20.04 - os: "ubuntu-16.04" diff --git a/CHANGES.rst b/CHANGES.rst index c39bb308..91b09a51 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -17,6 +17,7 @@ Enhancements ------------ - In the theoretical VPF calculation (``theory.vpf``), the total volume of the random spheres can now exceed the volume of the sample [#238] - Gridlink (the binning of particles into cells) now uses a parallel algorithm for the theory module [#239] +- Add detection of known-bad Cray hugepages library at NERSC [#246] Bug fixes --------- diff --git a/Corrfunc/__init__.py b/Corrfunc/__init__.py index 32a7d488..78197ea0 100644 --- a/Corrfunc/__init__.py +++ b/Corrfunc/__init__.py @@ -25,6 +25,8 @@ from . import theory from . import mocks + utils.check_runtime_env() + def read_text_file(filename, encoding="utf-8"): """ diff --git a/Corrfunc/utils.py b/Corrfunc/utils.py index d6191f59..3e3d3979 100644 --- a/Corrfunc/utils.py +++ b/Corrfunc/utils.py @@ -6,7 +6,10 @@ from __future__ import (absolute_import, division, print_function, unicode_literals) import sys +import os +import warnings from os.path import exists as file_exists + import wurlitzer from contextlib import contextmanager @@ -1054,6 +1057,22 @@ def sys_pipes(): except: yield + +def check_runtime_env(): + ''' + Detect any computing environment conditions that may cause Corrfunc + to fail, and inform the user if there is any action they can take. + ''' + + # Check if Cray hugepages is enabled at NERSC, which will crash + # C Python extensions due to a hugepages bug + if 'NERSC_HOST' in os.environ and os.getenv('HUGETLB_DEFAULT_PAGE_SIZE'): + warnings.warn('Warning: Cray hugepages has a bug that may crash ' + 'Corrfunc. You might be able to fix such a crash with ' + '`module unload craype-hugepages2M` (see ' + 'https://github.com/manodeep/Corrfunc/issues/245 ' + 'for details)') + if __name__ == '__main__': import doctest doctest.testmod()