Skip to content
This repository was archived by the owner on Jul 31, 2024. It is now read-only.

Commit b12de7e

Browse files
committed
Merge branch 'release-3.1.0'
2 parents 8df2055 + fd2d617 commit b12de7e

File tree

897 files changed

+138093
-35726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

897 files changed

+138093
-35726
lines changed

.appveyor.yml

+34-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
version: 1.0.{build}
22

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

78
test: on
@@ -15,17 +16,23 @@ platform:
1516
environment:
1617
matrix:
1718
- PYTHON: 36
18-
CPP: 17
19+
CPP: 14
1920
CONFIG: MinSizeRel
21+
- PYTHON: 37
22+
CPP: 17
23+
CONFIG: RelWithDebInfo
2024
- CONDA: 36
25+
CPP: 14
26+
CONFIG: MinSizeRel
27+
- CONDA: 37
2128
CPP: 17
2229
CONFIG: Release
23-
24-
matrix:
25-
exclude:
26-
- image: Visual Studio 2017
30+
- PYTHON: 38
2731
CPP: 17
28-
CONFIG: Debug
32+
CONFIG: MinSizeRel
33+
- CONDA: 38
34+
CPP: 14
35+
CONFIG: MinSizeRel
2936

3037
install:
3138
# Configure environment
@@ -48,56 +55,60 @@ install:
4855
$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"
4956
$env:CMAKE_PREFIX_PATH = "C:\Python$env:PYTHON-x64;C:\Python$env:PYTHON-x64\Scripts"
5057
$env:PYTHON_EXE = "C:\Python$env:PYTHON-x64\python.exe"
51-
$env:TIMEMORY_USE_MPI = "ON"
5258
} else {
5359
$env:PATH = "C:\Python$env:PYTHON;C:\Python$env:PYTHON\Scripts;C:\Users\appveyor\AppData\Roaming\Python\Python$env:PYTHON\Scripts;$env:PATH"
5460
$env:CMAKE_PREFIX_PATH = "C:\Python$env:PYTHON;C:\Python$env:PYTHON\Scripts"
5561
$env:PYTHON_EXE = "C:\Python$env:PYTHON\python.exe"
56-
$env:TIMEMORY_USE_MPI = "ON"
5762
}
5863
python -m pip install --disable-pip-version-check --user --upgrade pip wheel
64+
python -m pip install --disable-pip-version-check --user cython
5965
} elseif ($env:CONDA) {
6066
if ($env:PLATFORM -eq "x64") {
6167
$env:PATH = "C:\Miniconda$env:CONDA-x64;C:\Miniconda$env:CONDA-x64\Scripts;$env:PATH"
6268
$env:CMAKE_PREFIX_PATH = "C:\Miniconda$env:CONDA-x64;C:\Miniconda$env:CONDA-x64\Scripts"
6369
$env:PYTHONHOME = "C:\Miniconda$env:CONDA-x64"
6470
$env:PYTHON_EXE = "C:\Miniconda$env:CONDA-x64\python.exe"
65-
$env:TIMEMORY_USE_MPI = "ON"
6671
} else {
6772
$env:PATH = "C:\Miniconda$env:CONDA;C:\Miniconda$env:CONDA\Scripts;$env:PATH"
6873
$env:CMAKE_PREFIX_PATH = "C:\Miniconda$env:CONDA;C:\Miniconda$env:CONDA\Scripts"
6974
$env:PYTHONHOME = "C:\Miniconda$env:CONDA"
7075
$env:PYTHON_EXE = "C:\Miniconda$env:CONDA\python.exe"
71-
$env:TIMEMORY_USE_MPI = "OFF"
7276
}
7377
conda update -y -q -n base conda
74-
conda config --add channels conda-forge
75-
conda install -y -q pip setuptools scikit-build numpy matplotlib pillow
78+
conda install -y -c defaults -c conda-forge -q pip setuptools scikit-build numpy matplotlib pillow cython
7679
}
77-
# pip installation
78-
$env:TIMEMORY_VERBOSE = 2
80+
$env:TIMEMORY_FILE_OUTPUT = "OFF"
81+
$env:TIMEMORY_AUTO_OUTPUT = "OFF"
7982
mkdir "C:\Users\appveyor\CTestTemp"
8083
$env:TEMP = "C:\Users\appveyor\CTestTemp"
8184
8285
build_script:
8386
- mkdir build-timemory
8487
- cd build-timemory
85-
- cmake
88+
- cmake .. -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
89+
-DBUILD_STATIC_LIBS=ON
90+
-DBUILD_SHARED_LIBS=ON
8691
-DCMAKE_BUILD_TYPE="%CONFIG%"
92+
-DCMAKE_CXX_STANDARD="%CPP%"
8793
-DCMAKE_INSTALL_PREFIX=..\install-timemory
8894
-DPYTHON_EXECUTABLE="%PYTHON_EXE%"
8995
-DTIMEMORY_USE_MPI=OFF
90-
-DTIMEMORY_BUILD_C=OFF
96+
-DTIMEMORY_USE_PYTHON=ON
97+
-DTIMEMORY_BUILD_C=ON
9198
-DTIMEMORY_BUILD_PYTHON=ON
9299
-DTIMEMORY_BUILD_EXAMPLES=ON
93-
-DTIMEMORY_BUILD_GTEST=OFF
94-
.. -G "%CMAKE_GENERATOR%" -A "%CMAKE_ARCH%"
100+
-DTIMEMORY_BUILD_GOOGLE_TEST=OFF
101+
-DTIMEMORY_BUILD_TOOLS=ON
95102
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
96103
- cmake --build . --config "%CONFIG%" --target ALL_BUILD -- /m /v:m /logger:%MSBuildLogger%
97104
- cmake --build . --config "%CONFIG%" --target INSTALL -- /m /v:m /logger:%MSBuildLogger%
98105
- ls
99-
- .\outputs\runtime\%CONFIG%\ex_cxx_basic.exe
100-
#- .\outputs\runtime\%CONFIG%\ex_optional_on.exe
101106
- .\outputs\runtime\%CONFIG%\ex_optional_off.exe
102-
#- .\outputs\runtime\%CONFIG%\ex_cxx_overhead.exe
103-
#- .\outputs\runtime\%CONFIG%\ex_cxx_tuple.exe
107+
- .\outputs\runtime\%CONFIG%\ex_cxx_basic.exe & exit 0
108+
- .\outputs\runtime\%CONFIG%\ex_optional_on.exe & exit 0
109+
- .\outputs\runtime\%CONFIG%\ex_cxx_overhead.exe & exit 0
110+
- .\outputs\runtime\%CONFIG%\ex_cxx_tuple.exe & exit 0
111+
- .\outputs\runtime\%CONFIG%\ex_c_minimal.exe & exit 0
112+
- .\outputs\runtime\%CONFIG%\ex_c_minimal_library.exe & exit 0
113+
- .\outputs\runtime\%CONFIG%\ex_c_timing.exe & exit 0
114+
- cmake -P tests/test-python-install-import.cmake

.github/workflows/python-package.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master, develop ]
9+
pull_request:
10+
branches: [ master, develop ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.6, 3.7, 3.8]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=90 --statistics
37+
#- name: Test with pytest
38+
# run: |
39+
# pytest

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ settings.json
1313
# build directories
1414
/build-*
1515
/build
16+
/install-*
17+
/install
1618
/examples/**/build*
1719
/_skbuild
1820

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@
1313
[submodule "external/gotcha"]
1414
path = external/gotcha
1515
url = https://github.com/jrmadsen/GOTCHA.git
16+
[submodule "external/llvm-ompt"]
17+
path = external/llvm-ompt
18+
url = https://github.com/NERSC/LLVM-openmp.git
19+
[submodule "external/line-profiler"]
20+
path = external/line-profiler
21+
url = https://github.com/jrmadsen/line_profiler.git
File renamed without changes.
File renamed without changes.

.misc/spack/package.py

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
2+
# Spack Project Developers. See the top-level COPYRIGHT file for details.
3+
#
4+
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
5+
#
6+
# ----------------------------------------------------------------------------
7+
8+
from spack import *
9+
from sys import platform
10+
11+
12+
class Timemory(CMakePackage):
13+
"""Timing + Memory + Hardware Counter Utilities for C/C++/CUDA/Python"""
14+
15+
homepage = 'https://timemory.readthedocs.io/en/latest/'
16+
git = 'https://github.com/NERSC/timemory.git'
17+
maintainers = ['jrmadsen']
18+
19+
version('master', branch='master', submodules=True)
20+
version('develop', branch='develop', submodules=True)
21+
version('3.0.1', commit='ef638e1cde90275ce7c0e12fc4902c27bcbdeefd',
22+
submodules=True)
23+
version('3.0.0', commit='b36b1673b2c6b7ff3126d8261bef0f8f176c7beb',
24+
submodules=True)
25+
26+
linux = False if platform == 'darwin' else True
27+
28+
variant('shared', default=True, description='Build shared libraries')
29+
variant('static', default=False, description='Build static libraries')
30+
variant('python', default=True, description='Enable Python support')
31+
variant('mpi', default=True, description='Enable MPI support')
32+
variant('tau', default=False, description='Enable TAU support')
33+
variant('papi', default=linux, description='Enable PAPI support')
34+
variant('cuda', default=linux, description='Enable CUDA support')
35+
variant('cupti', default=linux, description='Enable CUPTI support')
36+
variant('tools', default=True, description='Build/install extra tools')
37+
variant('vtune', default=False, description='Enable VTune support')
38+
variant('upcxx', default=False, description='Enable UPC++ support')
39+
variant('gotcha', default=linux, description='Enable GOTCHA support')
40+
variant('likwid', default=linux, description='Enable LIKWID support')
41+
variant('caliper', default=False, description='Enable Caliper support')
42+
variant('dyninst', default=linux,
43+
description='Build dynamic instrumentation tools')
44+
variant('examples', default=False, description='Build/install examples')
45+
variant('gperftools', default=True,
46+
description='Enable gperftools support')
47+
variant('kokkos_tools', default=True,
48+
description=('Build generic kokkos-tools libraries, e.g. '
49+
'kp_timemory, kp_timemory_filter'))
50+
variant('kokkos_build_config', default=False,
51+
description=('Build pre-configured (i.e. dedicated) kokkos-tools '
52+
'libraries, e.g. kp_timemory_cpu_flops'))
53+
variant('cuda_arch', default='auto', description='CUDA architecture name',
54+
values=('auto', 'kepler', 'tesla', 'maxwell', 'pascal',
55+
'volta', 'turing'), multi=False)
56+
variant('cpu_target', default='auto',
57+
description=('Build for specific cpu architecture (specify '
58+
'cpu-model)'))
59+
variant('use_arch', default=False,
60+
description=('Build all of timemory w/ cpu_target architecture '
61+
'flags (default: roofline toolkit only)'))
62+
variant('tls_model', default='global-dynamic',
63+
description='Thread-local static model', multi=False,
64+
values=('global-dynamic', 'local-dynamic', 'initial-exec',
65+
'local-exec'))
66+
variant('lto', default=False,
67+
description='Build w/ link-time optimization')
68+
variant('statistics', default=True,
69+
description=('Build components w/ support for statistics '
70+
'(min/max/stddev)'))
71+
variant('extra_optimizations', default=True,
72+
description='Build timemory with extra optimization flags')
73+
variant('cxxstd', default='14', description='C++ language standard',
74+
values=('14', '17', '20'), multi=False)
75+
variant('mpip_library', default=linux,
76+
description='Build stand-alone timemory-mpip GOTCHA library')
77+
variant('ompt', default=True, description=('Enable OpenMP tools support'))
78+
variant('ompt_standalone', default=True,
79+
description=('Enable OpenMP tools support via drop-in '
80+
'replacement of libomp/libgomp/libiomp5'))
81+
variant('ompt_llvm', default=False,
82+
description='Enable OpenMP tools support as part of llvm build')
83+
variant('ompt_library', default=True,
84+
description='Build stand-alone timemory-ompt library')
85+
variant('allinea_map', default=False,
86+
description='Enable Allinea ARM-MAP support')
87+
variant('require_packages', default=False,
88+
description=('find_package(...) resulting in NOTFOUND '
89+
'generates error'))
90+
91+
depends_on('[email protected]:', type='build')
92+
93+
extends('python', when='+python')
94+
depends_on('python@3:', when='+python', type=('build', 'run'))
95+
depends_on('py-numpy', when='+python', type=('run'))
96+
depends_on('py-pillow', when='+python', type=('run'))
97+
depends_on('py-matplotlib', when='+python', type=('run'))
98+
depends_on('mpi', when='+mpi')
99+
depends_on('tau', when='+tau')
100+
depends_on('papi', when='+papi')
101+
depends_on('cuda', when='+cuda')
102+
depends_on('cuda', when='+cupti')
103+
depends_on('upcxx', when='+upcxx')
104+
depends_on('likwid', when='+likwid')
105+
depends_on('gotcha', when='+gotcha')
106+
depends_on('caliper', when='+caliper')
107+
depends_on('dyninst', when='+dyninst')
108+
depends_on('gperftools', when='+gperftools')
109+
depends_on('intel-parallel-studio', when='+vtune')
110+
depends_on('llvm-openmp-ompt+standalone', when='+ompt_standalone')
111+
depends_on('llvm-openmp-ompt~standalone', when='+ompt_llvm')
112+
depends_on('arm-forge', when='+allinea_map')
113+
114+
conflicts('+python', when='~shared',
115+
msg='+python requires building shared libraries')
116+
conflicts('+cupti', when='~cuda', msg='CUPTI requires CUDA')
117+
conflicts('+kokkos_tools', when='~tools',
118+
msg='+kokkos_tools requires +tools')
119+
conflicts('+kokkos_build_config', when='~tools',
120+
msg='+kokkos_build_config requires +tools')
121+
conflicts('+kokkos_build_config', when='~kokkos_tools',
122+
msg='+kokkos_build_config requires +kokkos_tools')
123+
conflicts('tls_model=local-dynamic', when='+python',
124+
msg='+python require tls_model=global-dynamic')
125+
conflicts('tls_model=initial-exec', when='+python',
126+
msg='+python require tls_model=global-dynamic')
127+
conflicts('tls_model=local-exec', when='+python',
128+
msg='+python require tls_model=global-dynamic')
129+
conflicts('+mpip_library', when='~mpi', msg='+mpip_library requires +mpi')
130+
conflicts('+mpip_library', when='~gotcha',
131+
msg='+mpip_library requires +gotcha')
132+
conflicts('+mpip_library', when='~shared',
133+
msg='+mpip_library requires building shared libraries')
134+
conflicts('+ompt_standalone', when='~ompt',
135+
msg='+ompt_standalone requires +ompt')
136+
conflicts('+ompt_llvm', when='~ompt',
137+
msg='+ompt_llvm requires +ompt')
138+
conflicts('+ompt_library', when='~ompt',
139+
msg='+ompt_library requires +ompt')
140+
conflicts('+ompt_library', when='~shared~static',
141+
msg='+ompt_library requires building shared or static libraries')
142+
conflicts('+ompt_standalone+ompt_llvm',
143+
msg=('+ompt_standalone and +ompt_llvm are not compatible. Use '
144+
'+ompt_llvm~ompt_standalone if building LLVM, use '
145+
'~ompt_llvm+ompt_standalone if ompt.h is not provided by '
146+
'the compiler'))
147+
148+
def cmake_args(self):
149+
spec = self.spec
150+
151+
args = [
152+
'-DTIMEMORY_BUILD_PYTHON=ON',
153+
'-DTIMEMORY_BUILD_TESTING=OFF',
154+
'-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON',
155+
]
156+
157+
cxxstd = spec.variants['cxxstd'].value
158+
args.append('-DCMAKE_CXX_STANDARD={0}'.format(cxxstd))
159+
160+
tls = spec.variants['tls_model'].value
161+
args.append('-DTIMEMORY_TLS_MODEL={0}'.format(tls))
162+
163+
if '+python' in spec:
164+
args.append('-DPYTHON_EXECUTABLE={0}'.format(
165+
spec['python'].command.path))
166+
167+
if '+mpi' in spec:
168+
args.append('-DTIMEMORY_USE_MPI_LINK_FLAGS=OFF')
169+
args.append('-DMPI_C_COMPILER={0}'.format(spec['mpi'].mpicc))
170+
args.append('-DMPI_CXX_COMPILER={0}'.format(spec['mpi'].mpicxx))
171+
172+
if '+cuda' in spec:
173+
targ = spec.variants['cuda_arch'].value
174+
key = '' if spec.satisfies('@:3.0.1') else 'TIMEMORY_'
175+
# newer versions use 'TIMEMORY_CUDA_ARCH'
176+
args.append('-D{0}CUDA_ARCH={1}'.format(key, targ))
177+
178+
cpu_target = spec.variants['cpu_target'].value
179+
if cpu_target == 'auto':
180+
args.append('-DCpuArch_TARGET={0}'.format(cpu_target))
181+
182+
# forced disabling of submodule builds
183+
for dep in ('caliper', 'gotcha', 'ompt'):
184+
args.append('-DTIMEMORY_BUILD_{0}=OFF'.format(dep.upper()))
185+
186+
# spack options which translate to TIMEMORY_<OPTION>
187+
for dep in ('require_packages', 'kokkos_build_config', 'use_arch'):
188+
args.append('-DTIMEMORY_{0}={1}'.format(
189+
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))
190+
191+
# spack options which translate to BUILD_<OPTION>_LIBS
192+
for dep in ('shared', 'static'):
193+
args.append('-DBUILD_{0}_LIBS={1}'.format(
194+
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))
195+
196+
# spack options which translate to TIMEMORY_BUILD_<OPTION>
197+
for dep in ('tools', 'examples', 'kokkos_tools', 'lto',
198+
'extra_optimizations', 'mpip_library', 'ompt_library'):
199+
args.append('-DTIMEMORY_BUILD_{0}={1}'.format(
200+
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))
201+
202+
# spack options which translate to TIMEMORY_USE_<OPTION>
203+
for dep in ('allinea_map', 'python', 'mpi', 'tau', 'papi', 'ompt',
204+
'cuda', 'cupti', 'cupti', 'vtune', 'upcxx', 'gotcha',
205+
'likwid', 'caliper', 'dyninst', 'gperftools',
206+
'statistics'):
207+
args.append('-DTIMEMORY_USE_{0}={1}'.format(
208+
dep.upper(), 'ON' if '+{0}'.format(dep) in spec else 'OFF'))
209+
210+
return args

.requirements/build.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Cython
2+
scikit-build
3+
cmake
4+
ninja

.requirements/runtime.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
IPython>=0.13
2+
numpy
3+
matplotlib
4+
pillow
5+
six

0 commit comments

Comments
 (0)