Skip to content

Commit

Permalink
Merge branch 'release-3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmadsen committed Jul 10, 2020
2 parents 8df2055 + fd2d617 commit b12de7e
Show file tree
Hide file tree
Showing 897 changed files with 138,093 additions and 35,726 deletions.
57 changes: 34 additions & 23 deletions .appveyor.yml
@@ -1,7 +1,8 @@
version: 1.0.{build}

# https://developercommunity.visualstudio.com/content/problem/457095/cannot-bind-temporary-int-object-to-an-rvalue-refe.html
# ^ this issue has caused support to be dropped for Visual Studio 2017
image:
- Visual Studio 2017
- Visual Studio 2019

test: on
Expand All @@ -15,17 +16,23 @@ platform:
environment:
matrix:
- PYTHON: 36
CPP: 17
CPP: 14
CONFIG: MinSizeRel
- PYTHON: 37
CPP: 17
CONFIG: RelWithDebInfo
- CONDA: 36
CPP: 14
CONFIG: MinSizeRel
- CONDA: 37
CPP: 17
CONFIG: Release

matrix:
exclude:
- image: Visual Studio 2017
- PYTHON: 38
CPP: 17
CONFIG: Debug
CONFIG: MinSizeRel
- CONDA: 38
CPP: 14
CONFIG: MinSizeRel

install:
# Configure environment
Expand All @@ -48,56 +55,60 @@ install:
$env:PATH = "C:\Python$env:PYTHON-x64;C:\Python$env:PYTHON-x64\Scripts;C:\Users\appveyor\AppData\Roaming\Python\Python$env:PYTHON\Scripts;$env:PATH"
$env:CMAKE_PREFIX_PATH = "C:\Python$env:PYTHON-x64;C:\Python$env:PYTHON-x64\Scripts"
$env:PYTHON_EXE = "C:\Python$env:PYTHON-x64\python.exe"
$env:TIMEMORY_USE_MPI = "ON"
} else {
$env:PATH = "C:\Python$env:PYTHON;C:\Python$env:PYTHON\Scripts;C:\Users\appveyor\AppData\Roaming\Python\Python$env:PYTHON\Scripts;$env:PATH"
$env:CMAKE_PREFIX_PATH = "C:\Python$env:PYTHON;C:\Python$env:PYTHON\Scripts"
$env:PYTHON_EXE = "C:\Python$env:PYTHON\python.exe"
$env:TIMEMORY_USE_MPI = "ON"
}
python -m pip install --disable-pip-version-check --user --upgrade pip wheel
python -m pip install --disable-pip-version-check --user cython
} elseif ($env:CONDA) {
if ($env:PLATFORM -eq "x64") {
$env:PATH = "C:\Miniconda$env:CONDA-x64;C:\Miniconda$env:CONDA-x64\Scripts;$env:PATH"
$env:CMAKE_PREFIX_PATH = "C:\Miniconda$env:CONDA-x64;C:\Miniconda$env:CONDA-x64\Scripts"
$env:PYTHONHOME = "C:\Miniconda$env:CONDA-x64"
$env:PYTHON_EXE = "C:\Miniconda$env:CONDA-x64\python.exe"
$env:TIMEMORY_USE_MPI = "ON"
} else {
$env:PATH = "C:\Miniconda$env:CONDA;C:\Miniconda$env:CONDA\Scripts;$env:PATH"
$env:CMAKE_PREFIX_PATH = "C:\Miniconda$env:CONDA;C:\Miniconda$env:CONDA\Scripts"
$env:PYTHONHOME = "C:\Miniconda$env:CONDA"
$env:PYTHON_EXE = "C:\Miniconda$env:CONDA\python.exe"
$env:TIMEMORY_USE_MPI = "OFF"
}
conda update -y -q -n base conda
conda config --add channels conda-forge
conda install -y -q pip setuptools scikit-build numpy matplotlib pillow
conda install -y -c defaults -c conda-forge -q pip setuptools scikit-build numpy matplotlib pillow cython
}
# pip installation
$env:TIMEMORY_VERBOSE = 2
$env:TIMEMORY_FILE_OUTPUT = "OFF"
$env:TIMEMORY_AUTO_OUTPUT = "OFF"
mkdir "C:\Users\appveyor\CTestTemp"
$env:TEMP = "C:\Users\appveyor\CTestTemp"
build_script:
- mkdir build-timemory
- cd build-timemory
- cmake
- cmake .. -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
-DBUILD_STATIC_LIBS=ON
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE="%CONFIG%"
-DCMAKE_CXX_STANDARD="%CPP%"
-DCMAKE_INSTALL_PREFIX=..\install-timemory
-DPYTHON_EXECUTABLE="%PYTHON_EXE%"
-DTIMEMORY_USE_MPI=OFF
-DTIMEMORY_BUILD_C=OFF
-DTIMEMORY_USE_PYTHON=ON
-DTIMEMORY_BUILD_C=ON
-DTIMEMORY_BUILD_PYTHON=ON
-DTIMEMORY_BUILD_EXAMPLES=ON
-DTIMEMORY_BUILD_GTEST=OFF
.. -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
-DTIMEMORY_BUILD_GOOGLE_TEST=OFF
-DTIMEMORY_BUILD_TOOLS=ON
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cmake --build . --config "%CONFIG%" --target ALL_BUILD -- /m /v:m /logger:%MSBuildLogger%
- cmake --build . --config "%CONFIG%" --target INSTALL -- /m /v:m /logger:%MSBuildLogger%
- ls
- .\outputs\runtime\%CONFIG%\ex_cxx_basic.exe
#- .\outputs\runtime\%CONFIG%\ex_optional_on.exe
- .\outputs\runtime\%CONFIG%\ex_optional_off.exe
#- .\outputs\runtime\%CONFIG%\ex_cxx_overhead.exe
#- .\outputs\runtime\%CONFIG%\ex_cxx_tuple.exe
- .\outputs\runtime\%CONFIG%\ex_cxx_basic.exe & exit 0
- .\outputs\runtime\%CONFIG%\ex_optional_on.exe & exit 0
- .\outputs\runtime\%CONFIG%\ex_cxx_overhead.exe & exit 0
- .\outputs\runtime\%CONFIG%\ex_cxx_tuple.exe & exit 0
- .\outputs\runtime\%CONFIG%\ex_c_minimal.exe & exit 0
- .\outputs\runtime\%CONFIG%\ex_c_minimal_library.exe & exit 0
- .\outputs\runtime\%CONFIG%\ex_c_timing.exe & exit 0
- cmake -P tests/test-python-install-import.cmake
39 changes: 39 additions & 0 deletions .github/workflows/python-package.yml
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=90 --statistics
#- name: Test with pytest
# run: |
# pytest
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -13,6 +13,8 @@ settings.json
# build directories
/build-*
/build
/install-*
/install
/examples/**/build*
/_skbuild

Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Expand Up @@ -13,3 +13,9 @@
[submodule "external/gotcha"]
path = external/gotcha
url = https://github.com/jrmadsen/GOTCHA.git
[submodule "external/llvm-ompt"]
path = external/llvm-ompt
url = https://github.com/NERSC/LLVM-openmp.git
[submodule "external/line-profiler"]
path = external/line-profiler
url = https://github.com/jrmadsen/line_profiler.git
File renamed without changes.
File renamed without changes.
210 changes: 210 additions & 0 deletions .misc/spack/package.py
@@ -0,0 +1,210 @@
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#
# ----------------------------------------------------------------------------

from spack import *
from sys import platform


class Timemory(CMakePackage):
"""Timing + Memory + Hardware Counter Utilities for C/C++/CUDA/Python"""

homepage = 'https://timemory.readthedocs.io/en/latest/'
git = 'https://github.com/NERSC/timemory.git'
maintainers = ['jrmadsen']

version('master', branch='master', submodules=True)
version('develop', branch='develop', submodules=True)
version('3.0.1', commit='ef638e1cde90275ce7c0e12fc4902c27bcbdeefd',
submodules=True)
version('3.0.0', commit='b36b1673b2c6b7ff3126d8261bef0f8f176c7beb',
submodules=True)

linux = False if platform == 'darwin' else True

variant('shared', default=True, description='Build shared libraries')
variant('static', default=False, description='Build static libraries')
variant('python', default=True, description='Enable Python support')
variant('mpi', default=True, description='Enable MPI support')
variant('tau', default=False, description='Enable TAU support')
variant('papi', default=linux, description='Enable PAPI support')
variant('cuda', default=linux, description='Enable CUDA support')
variant('cupti', default=linux, description='Enable CUPTI support')
variant('tools', default=True, description='Build/install extra tools')
variant('vtune', default=False, description='Enable VTune support')
variant('upcxx', default=False, description='Enable UPC++ support')
variant('gotcha', default=linux, description='Enable GOTCHA support')
variant('likwid', default=linux, description='Enable LIKWID support')
variant('caliper', default=False, description='Enable Caliper support')
variant('dyninst', default=linux,
description='Build dynamic instrumentation tools')
variant('examples', default=False, description='Build/install examples')
variant('gperftools', default=True,
description='Enable gperftools support')
variant('kokkos_tools', default=True,
description=('Build generic kokkos-tools libraries, e.g. '
'kp_timemory, kp_timemory_filter'))
variant('kokkos_build_config', default=False,
description=('Build pre-configured (i.e. dedicated) kokkos-tools '
'libraries, e.g. kp_timemory_cpu_flops'))
variant('cuda_arch', default='auto', description='CUDA architecture name',
values=('auto', 'kepler', 'tesla', 'maxwell', 'pascal',
'volta', 'turing'), multi=False)
variant('cpu_target', default='auto',
description=('Build for specific cpu architecture (specify '
'cpu-model)'))
variant('use_arch', default=False,
description=('Build all of timemory w/ cpu_target architecture '
'flags (default: roofline toolkit only)'))
variant('tls_model', default='global-dynamic',
description='Thread-local static model', multi=False,
values=('global-dynamic', 'local-dynamic', 'initial-exec',
'local-exec'))
variant('lto', default=False,
description='Build w/ link-time optimization')
variant('statistics', default=True,
description=('Build components w/ support for statistics '
'(min/max/stddev)'))
variant('extra_optimizations', default=True,
description='Build timemory with extra optimization flags')
variant('cxxstd', default='14', description='C++ language standard',
values=('14', '17', '20'), multi=False)
variant('mpip_library', default=linux,
description='Build stand-alone timemory-mpip GOTCHA library')
variant('ompt', default=True, description=('Enable OpenMP tools support'))
variant('ompt_standalone', default=True,
description=('Enable OpenMP tools support via drop-in '
'replacement of libomp/libgomp/libiomp5'))
variant('ompt_llvm', default=False,
description='Enable OpenMP tools support as part of llvm build')
variant('ompt_library', default=True,
description='Build stand-alone timemory-ompt library')
variant('allinea_map', default=False,
description='Enable Allinea ARM-MAP support')
variant('require_packages', default=False,
description=('find_package(...) resulting in NOTFOUND '
'generates error'))

depends_on('cmake@3.11:', type='build')

extends('python', when='+python')
depends_on('python@3:', when='+python', type=('build', 'run'))
depends_on('py-numpy', when='+python', type=('run'))
depends_on('py-pillow', when='+python', type=('run'))
depends_on('py-matplotlib', when='+python', type=('run'))
depends_on('mpi', when='+mpi')
depends_on('tau', when='+tau')
depends_on('papi', when='+papi')
depends_on('cuda', when='+cuda')
depends_on('cuda', when='+cupti')
depends_on('upcxx', when='+upcxx')
depends_on('likwid', when='+likwid')
depends_on('gotcha', when='+gotcha')
depends_on('caliper', when='+caliper')
depends_on('dyninst', when='+dyninst')
depends_on('gperftools', when='+gperftools')
depends_on('intel-parallel-studio', when='+vtune')
depends_on('llvm-openmp-ompt+standalone', when='+ompt_standalone')
depends_on('llvm-openmp-ompt~standalone', when='+ompt_llvm')
depends_on('arm-forge', when='+allinea_map')

conflicts('+python', when='~shared',
msg='+python requires building shared libraries')
conflicts('+cupti', when='~cuda', msg='CUPTI requires CUDA')
conflicts('+kokkos_tools', when='~tools',
msg='+kokkos_tools requires +tools')
conflicts('+kokkos_build_config', when='~tools',
msg='+kokkos_build_config requires +tools')
conflicts('+kokkos_build_config', when='~kokkos_tools',
msg='+kokkos_build_config requires +kokkos_tools')
conflicts('tls_model=local-dynamic', when='+python',
msg='+python require tls_model=global-dynamic')
conflicts('tls_model=initial-exec', when='+python',
msg='+python require tls_model=global-dynamic')
conflicts('tls_model=local-exec', when='+python',
msg='+python require tls_model=global-dynamic')
conflicts('+mpip_library', when='~mpi', msg='+mpip_library requires +mpi')
conflicts('+mpip_library', when='~gotcha',
msg='+mpip_library requires +gotcha')
conflicts('+mpip_library', when='~shared',
msg='+mpip_library requires building shared libraries')
conflicts('+ompt_standalone', when='~ompt',
msg='+ompt_standalone requires +ompt')
conflicts('+ompt_llvm', when='~ompt',
msg='+ompt_llvm requires +ompt')
conflicts('+ompt_library', when='~ompt',
msg='+ompt_library requires +ompt')
conflicts('+ompt_library', when='~shared~static',
msg='+ompt_library requires building shared or static libraries')
conflicts('+ompt_standalone+ompt_llvm',
msg=('+ompt_standalone and +ompt_llvm are not compatible. Use '
'+ompt_llvm~ompt_standalone if building LLVM, use '
'~ompt_llvm+ompt_standalone if ompt.h is not provided by '
'the compiler'))

def cmake_args(self):
spec = self.spec

args = [
'-DTIMEMORY_BUILD_PYTHON=ON',
'-DTIMEMORY_BUILD_TESTING=OFF',
'-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON',
]

cxxstd = spec.variants['cxxstd'].value
args.append('-DCMAKE_CXX_STANDARD={0}'.format(cxxstd))

tls = spec.variants['tls_model'].value
args.append('-DTIMEMORY_TLS_MODEL={0}'.format(tls))

if '+python' in spec:
args.append('-DPYTHON_EXECUTABLE={0}'.format(
spec['python'].command.path))

if '+mpi' in spec:
args.append('-DTIMEMORY_USE_MPI_LINK_FLAGS=OFF')
args.append('-DMPI_C_COMPILER={0}'.format(spec['mpi'].mpicc))
args.append('-DMPI_CXX_COMPILER={0}'.format(spec['mpi'].mpicxx))

if '+cuda' in spec:
targ = spec.variants['cuda_arch'].value
key = '' if spec.satisfies('@:3.0.1') else 'TIMEMORY_'
# newer versions use 'TIMEMORY_CUDA_ARCH'
args.append('-D{0}CUDA_ARCH={1}'.format(key, targ))

cpu_target = spec.variants['cpu_target'].value
if cpu_target == 'auto':
args.append('-DCpuArch_TARGET={0}'.format(cpu_target))

# forced disabling of submodule builds
for dep in ('caliper', 'gotcha', 'ompt'):
args.append('-DTIMEMORY_BUILD_{0}=OFF'.format(dep.upper()))

# spack options which translate to TIMEMORY_<OPTION>
for dep in ('require_packages', 'kokkos_build_config', 'use_arch'):
args.append('-DTIMEMORY_{0}={1}'.format(
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))

# spack options which translate to BUILD_<OPTION>_LIBS
for dep in ('shared', 'static'):
args.append('-DBUILD_{0}_LIBS={1}'.format(
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))

# spack options which translate to TIMEMORY_BUILD_<OPTION>
for dep in ('tools', 'examples', 'kokkos_tools', 'lto',
'extra_optimizations', 'mpip_library', 'ompt_library'):
args.append('-DTIMEMORY_BUILD_{0}={1}'.format(
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))

# spack options which translate to TIMEMORY_USE_<OPTION>
for dep in ('allinea_map', 'python', 'mpi', 'tau', 'papi', 'ompt',
'cuda', 'cupti', 'cupti', 'vtune', 'upcxx', 'gotcha',
'likwid', 'caliper', 'dyninst', 'gperftools',
'statistics'):
args.append('-DTIMEMORY_USE_{0}={1}'.format(
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))

return args
4 changes: 4 additions & 0 deletions .requirements/build.txt
@@ -0,0 +1,4 @@
Cython
scikit-build
cmake
ninja
5 changes: 5 additions & 0 deletions .requirements/runtime.txt
@@ -0,0 +1,5 @@
IPython>=0.13
numpy
matplotlib
pillow
six

0 comments on commit b12de7e

Please sign in to comment.