Skip to content

Commit

Permalink
Merge branch 'unstable' of github.com:ParaToolsInc/taucmdr into oneapi
Browse files Browse the repository at this point in the history
Fixed typo and whitespace error during conflict resolution
  • Loading branch information
zbeekman committed Mar 8, 2022
2 parents b84057e + 295deeb commit 1b6ba61
Show file tree
Hide file tree
Showing 19 changed files with 320 additions and 61 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-16.04]
os: [ubuntu-18.04] #, ubuntu-20.04
backend: ['tinydb', 'sqlite']
python_version: ['3.7']
env:
Expand Down Expand Up @@ -145,16 +145,17 @@ jobs:

- name: Pylint PR Comment
if: matrix.os == 'ubuntu-18.04'
uses: marocchino/sticky-pull-request-comment@v1
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: pylint-comment
path: ./pylint.md
recreate: true

- name: Upload Coverage info
if: always()
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests,CI
name: codecov-${{ matrix.os }}
fail_ci_if_error: true # optional (default = false)
Expand Down
52 changes: 31 additions & 21 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The last two jobs, unit testing and runnng TAU=full installation wait until the first finishes and re-uses the TAU=minimal install
# Unfortunately, there is a lot of duplicated code that could be simplified/eliminated with YAML anchors and aliases,
# but GitHub Actions does not yet support YAML anchors and aliases.
# Clever use of global environment variables could help eliminate some of it, but the best options would be to just use aliases and anchors
# Clever use of global environment variables could help eliminate some of it, but the best options would be to just use
# aliases and anchors

name: TAU nightly testing

Expand All @@ -20,69 +20,77 @@ env:

jobs:
Install-taucmdr-minimal:
name: Install and Test TAU Commander
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-16.04]
python_version: ['2.7']

os: [ubuntu-18.04] #, ubuntu-20.04
python_version: ['3.7']
env:
OS: ${{ matrix.os }}
PY_VER: ${{ matrix.python_version }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 9999

- name: Install system packages
run: |
# Ensure that we have default system compilers and MPI for testing
sudo apt-get update -qq || true
sudo apt-get install -y --no-install-recommends gcc g++ gfortran mpi-default-bin mpi-default-dev
# - name: Setup Python
# uses: actions/setup-python@v1
# with:
# python-version: '3.6'
# architecture: 'x64'

- name: System info
id: info
run: |
# Get info for debugging and set some environment variables to use later
uname -a
mount
df -h
gcc --version
echo "github.event_name: ${{ github.event_name }}"
echo "github.ref: ${{ github.ref }}"
echo "matrix.os: ${{ matrix.os }}"
echo "Pythons found:"
type -a python
while read -r line ; do "${line##* is }" --version; done <<< $(type -a python)
export INSTALLDIR="${HOME}/${INSTALLDIR}"
echo "::set-output name=install_dir::${INSTALLDIR}"
echo "::set-env name=INSTALLDIR::${INSTALLDIR}"
echo "INSTALLDIR=${INSTALLDIR}" >> "${GITHUB_ENV}"
echo "::set-output name=home_dir::${HOME}"
echo "::set-output name=taucmdr_system::${INSTALLDIR}/${__TAUCMDR_SYSTEM_PREFIX__}"
echo "::set-env name=__TAUCMDR_SYSTEM_PREFIX__::${INSTALLDIR}/${__TAUCMDR_SYSTEM_PREFIX__}"
echo "__TAUCMDR_SYSTEM_PREFIX__=${INSTALLDIR}/${__TAUCMDR_SYSTEM_PREFIX__}" >> "${GITHUB_ENV}"
echo "::set-output name=branch::${GITHUB_REF#refs/*/}"
echo "BRANCH=${GITHUB_REF#refs/*/}" >> "${GITHUB_ENV}"
echo "BRANCH: ${GITHUB_REF#refs/*/}"
# No caching available for cron jobs
# No caching available for cron jobs

- name: Install TAU Commander
run: |
make INSTALLDIR="${INSTALLDIR}" install
echo "::add-path::${INSTALLDIR}/conda/bin"
echo "${INSTALLDIR}/conda/bin" >> $GITHUB_PATH
export PATH="${INSTALLDIR}/conda/bin:${PATH}"
which python
which pip
python -m pip install -U pip
python -m pip install -U --prefix "${INSTALLDIR}/conda" -r requirements-dev.txt
cd "${HOME}"
zip -vr taucmdr-nightly.zip ${INSTALLDIR##*/} -x "taucmdr/system/src/*" -x "taucmdr/conda/*"
type -a python
while read -r line ; do "${line##* is }" --version; done <<< $(type -a python)
- name: Upload TAU Commander install log
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: taucmdr-tau-minimal-debug-log-${{ matrix.os }}
path: ${{ steps.info.outputs.home_dir }}/.local/taucmdr/debug_log

- name: Upload TAU Commander minimal install
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: taucmdr-installation-${{ matrix.os }}
path: ${{ steps.info.outputs.home_dir }}/taucmdr-nightly.zip
Expand All @@ -103,20 +111,22 @@ jobs:
run: |
rm ~/.local/taucmdr/debug_log || true
export __TAUCMDR_DB_BACKEND__=tinydb
rm -f ./coverage.xml || true
coverage run setup.py test
coverage xml
- name: Test TAU Commander with SQLite backend
run: |
export __TAUCMDR_DB_BACKEND__=sqlite
coverage run setup.py test
coverage xml
- name: Build sphinx docs
run: |
python setup.py build_sphinx
run: python setup.py build_sphinx

- name: Upload TAU Commander unit test log
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: taucmdr-unit-test-debug-log-${{ matrix.os }}
path: ${{ steps.info.outputs.home_dir }}/.local/taucmdr/debug_log
Expand All @@ -133,7 +143,7 @@ jobs:
- name: Upload nightly TAU validate
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: taucmdr-full-tau-validate-${{ matrix.os }}-${{ github.sha }}
path: ${{ steps.info.outputs.home_dir }}/tau-tests-validate
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN DEBIAN_FRONTEND=noninteractive set -v && \
rm -rf /var/lib/apt/lists/* && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
useradd -ms /bin/bash tau
ENV LANG=en_US.UTF-8 INSTALLDIR=/home/tau/taucmdr
ENV LANG=en_US.UTF-8 INSTALLDIR=/home/tau/taucmdr __TAUCMDR_DEVELOPER__=1
COPY .gitignore .gitattributes .version.sh LICENSE README.md Makefile setup.py MANIFEST.in requirements-dev.txt /tmp/taucmdr/
COPY scripts /tmp/taucmdr/scripts
COPY packages /tmp/taucmdr/packages
Expand All @@ -15,7 +15,7 @@ COPY examples /tmp/taucmdr/examples
COPY .testfiles /tmp/taucmdr/.testfiles
COPY .git /tmp/taucmdr/.testfiles
WORKDIR /tmp/taucmdr
RUN ls -la ; make clean ; make install ; chown -R tau:tau ${INSTALLDIR}
RUN ls -la ; make clean ; mkdir ${INSTALLDIR}; make install; chown -R tau:tau ${INSTALLDIR}
USER tau
WORKDIR /home/tau/src
ENV PATH="/home/tau/taucmdr/conda/bin:$PATH:/home/tau/taucmdr/bin"
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ endif

# Get build system locations from configuration file or command line
ifneq ("$(wildcard setup.cfg)","")
BUILDDIR = $(shell grep '^build-base =' setup.cfg | sed 's/build-base = //')
INSTALLDIR = $(shell grep '^prefix =' setup.cfg | sed 's/prefix = //')
BUILDDIR ?= $(shell grep '^build-base =' setup.cfg | sed 's/build-base = //')
INSTALLDIR ?= $(shell grep '^prefix =' setup.cfg | sed 's/prefix = //')
endif
ifeq ($(BUILDDIR),)
BUILDDIR=build
Expand Down Expand Up @@ -128,9 +128,9 @@ else
endif
endif

CONDA_VERSION = latest
CONDA_VERSION = v2.2.0

CONDA_REPO = https://github.com/ParaToolsInc/CommanderConda/releases/$(CONDA_VERSION)/download
CONDA_REPO = https://github.com/ParaToolsInc/CommanderConda/releases/download/$(CONDA_VERSION)
CONDA_PKG = CommanderConda3-$(CONDA_OS)-$(CONDA_ARCH).sh
CONDA_URL = $(CONDA_REPO)/$(CONDA_PKG)
CONDA_SRC = system/src/$(CONDA_PKG)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ TAU Commander developers should visit the [developer documentation](http://parat
Acknowledgements
================

This work is supported by the United States Department of Energy under
DoE SBIR grant DE-SC0009593.
Initial development of TAU Commander was supported by the United States
Department of Energy under DOE SBIR award DE-SC0009593. Development of support
for machine learning and artificial intelligence applications is supported by
the United States Department of Energy under DOE SBIR award DE-SC0019700.

The work on extending TAU Commander for OpenSHMEM was supported by the
United States Department of Defense (DoD) and used resources of the
Expand Down
12 changes: 10 additions & 2 deletions packages/taucmdr/cf/compiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class InstalledCompilerCreator(type):
and `icc` would be probed twice. With this metaclass, ``b is a == True`` and `icc` is only invoked once.
"""
def __call__(cls, absolute_path, info, **kwargs):
assert isinstance(absolute_path, str) and os.path.isabs(absolute_path)
assert absolute_path == '' or (isinstance(absolute_path, str) and os.path.isabs(absolute_path))
assert isinstance(info, _CompilerInfo)
# Don't allow unchecked values into the instance cache
if kwargs:
Expand Down Expand Up @@ -636,7 +636,10 @@ def probe(cls, command, family=None, role=None):
assert isinstance(role, _CompilerRole) or role is None
absolute_path = util.which(command)
if not absolute_path:
raise ConfigurationError("Compiler '%s' not found on PATH" % command)
if family is None:
absolute_path = ''
else:
raise ConfigurationError("Compiler '%s' not found on PATH" % command)
command = os.path.basename(absolute_path)
LOGGER.debug("Probe: command='%s', abspath='%s', family='%s', role='%s'",
command, absolute_path, family, role)
Expand Down Expand Up @@ -764,6 +767,11 @@ def __init__(self, family):
LOGGER.warning(err)
continue
self.members.setdefault(role, []).append(installed)
for role, info_list in family.members.items():
for info in info_list:
if family.name == 'None':
installed = InstalledCompiler(info.command, info)
self.members.setdefault(role, []).append(installed)
if not self.members:
cmds = [info.command for info_list in family.members.values() for info in info_list]
raise ConfigurationError(f"{self.family.name} {self.family.kbase.description} not found.",
Expand Down
2 changes: 2 additions & 0 deletions packages/taucmdr/cf/compiler/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@
IBM = CUDA_COMPILERS.add('IBM', family_regex=r'^IBM XL', version_flags=['-qversion'],
FC='xlcuf')

NONE = CUDA_COMPILERS.add('None', CXX='', FC='')

CUDA_CXX = CUDA_COMPILERS.roles['CXX']
CUDA_FC = CUDA_COMPILERS.roles['FC']
4 changes: 4 additions & 0 deletions packages/taucmdr/cf/compiler/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
show_wrapper_flags=['-craype-verbose', '--version', '-E'],
CC='cc', CXX='CC', FC='ftn')

NONE = MPI_COMPILERS.add('None', #family_regex='',
CC='', CXX='', FC='')


MPI_CC = MPI_COMPILERS.roles['CC']
MPI_CXX = MPI_COMPILERS.roles['CXX']
MPI_FC = MPI_COMPILERS.roles['FC']
18 changes: 12 additions & 6 deletions packages/taucmdr/cf/software/tau_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def __init__(self, sources, target_arch, target_os, compilers,
forced_makefile=None,
dyninst=False,
mpit=False,
unwinder='libunwind',
unwind_depth=0):
"""Initialize the TAU installation wrapper class.
Expand Down Expand Up @@ -274,7 +275,7 @@ def __init__(self, sources, target_arch, target_os, compilers,
measure_mpi (bool): If True then measure time spent in MPI calls.
measure_openmp (str): String specifying OpenMP measurement method, one of "ignore", "ompt", or "opari".
measure_cuda (bool): If True then measure time spent in CUDA calls.
meaure_level_zero (bool): If True then use Intel oneAPI level 0 tool iterface
meaure_level_zero (bool): If True then use Intel oneAPI level 0 tool interface
measure_shmem (bool): If True then measure time spent in SHMEM calls.
measure_heap_usage (bool): If True then measure memory usage.
measure_system_load (bool): If True then measure the system load.
Expand All @@ -298,6 +299,7 @@ def __init__(self, sources, target_arch, target_os, compilers,
sampling_period (int): Sampling period in microseconds; set to 0 to use architecture specific defaults.
track_memory_footprint (bool): If True then track memory footprint.
mpit (bool): If True then enable MPI-T profiling interface.
unwinder (str): Tool used to unwind code
forced_makefile (str): Path to external makefile if forcing TAU_MAKEFILE or None.
"""
assert minimal in (True, False)
Expand Down Expand Up @@ -350,6 +352,7 @@ def __init__(self, sources, target_arch, target_os, compilers,
assert isinstance(sampling_period, int)
assert track_memory_footprint in (True, False)
assert isinstance(forced_makefile, str) or forced_makefile is None
assert isinstance(unwinder, str)
super().__init__('tau', 'TAU Performance System',
sources, target_arch, target_os, compilers,
REPOS, COMMANDS, None, None)
Expand Down Expand Up @@ -421,13 +424,14 @@ def __init__(self, sources, target_arch, target_os, compilers,
self.track_memory_footprint = track_memory_footprint
self.tags = tags
self.forced_makefile = forced_makefile
self.unwinder = unwinder
self.dyninst = dyninst
self.unwind_depth = unwind_depth
self.uses_pdt = not minimal and (self.source_inst == 'automatic' or self.shmem_support)
self.uses_binutils = not minimal and (self.target_os is not DARWIN) and 'binutils' in sources
self.uses_libunwind = not minimal and (self.target_os is not DARWIN) and 'libunwind' in sources
self.uses_libdwarf = not minimal and (self.target_os is not DARWIN) and 'libdwarf' in sources
self.uses_libunwind = not minimal and (self.target_os is not DARWIN) and 'libunwind' in sources and self.unwinder == 'libunwind'
self.uses_libelf = not minimal and (self.target_os is not DARWIN) and 'libelf' in sources
self.uses_libdwarf = not minimal and (self.target_os is not DARWIN) and 'libdwarf' in sources and self.uses_libelf
self.uses_papi = not minimal and bool(len([met for met in self.metrics if 'PAPI' in met]))
self.uses_scorep = not minimal and (self.profile == 'cubex')
self.uses_ompt = not minimal and (self.measure_openmp == 'ompt')
Expand All @@ -452,7 +456,7 @@ def __init__(self, sources, target_arch, target_os, compilers,
for met in self.metrics:
mets.extend(met.split(','))
self.metrics = mets
uses = lambda pkg: sources[pkg] if forced_makefile else getattr(self, 'uses_'+pkg)
uses = lambda pkg: sources.get(pkg, False) if forced_makefile else getattr(self, 'uses_'+pkg)
for pkg in 'binutils', 'libunwind', 'libelf', 'libdwarf', 'papi', 'pdt', 'ompt', 'libotf2', 'sqlite3', 'level_zero':
if uses(pkg):
self.add_dependency(pkg, sources)
Expand Down Expand Up @@ -778,7 +782,8 @@ def configure(self):
'-tag=%s' % self.uid,
'-arch=%s' % self.tau_magic.name,
'-bfd=%s' % binutils.install_prefix if binutils else None,
'-unwind=%s' % libunwind.install_prefix if libunwind else None,
'-unwinder=%s' % self.unwinder,
'-unwind=%s' % libunwind.install_prefix if self.unwinder == 'libunwind' and libunwind else None,
] if flag]
if util.create_subprocess(cmd, cwd=self._src_prefix, stdout=False, show_progress=True):
raise SoftwarePackageError('TAU configure failed')
Expand Down Expand Up @@ -862,7 +867,8 @@ def configure(self):
'-fortran=%s' % fortran_magic if fortran_magic else None,
'-bfd=%s' % binutils.install_prefix if binutils else None,
'-papi=%s' % papi.install_prefix if papi else None,
'-unwind=%s' % libunwind.install_prefix if libunwind else None,
'-unwinder=%s' % self.unwinder,
'-unwind=%s' % libunwind.install_prefix if self.unwinder == 'libunwind' and libunwind else None,
'-dwarf=%s' % libdwarf.install_prefix if libdwarf else None,
'-elf=%s' % libelf.install_prefix if libdwarf else None,
'-scorep=%s' % scorep.install_prefix if scorep else None,
Expand Down
1 change: 1 addition & 0 deletions packages/taucmdr/cli/commands/project/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def main(self, argv):
if single:
storage = levels[0]
ctrl = Project.controller(storage)
# pylint: disable=unexpected-keyword-arg
proj = ctrl.one({'name': keys[0]}, context=False)
for cmd, prop in ((target_list_cmd, 'targets'),
(application_list_cmd, 'applications'),
Expand Down
5 changes: 5 additions & 0 deletions packages/taucmdr/cli/commands/target/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from taucmdr.cf.compiler.host import HOST_COMPILERS
from taucmdr.cf.compiler.mpi import MPI_COMPILERS
from taucmdr.cf.compiler.shmem import SHMEM_COMPILERS
from taucmdr.cf.compiler.cuda import CUDA_COMPILERS
from taucmdr.cf.software.tau_installation import TauInstallation


Expand Down Expand Up @@ -96,6 +97,10 @@ def _construct_parser(self):

group = parser.add_argument_group('Symmetric Hierarchical Memory (SHMEM) arguments')
self._configure_argument_group(group, SHMEM_COMPILERS, '--shmem-compilers', 'shmem_family')

group = parser.add_argument_group('CUDA arguments')
self._configure_argument_group(group, CUDA_COMPILERS, '--cuda-compilers', 'cuda_family')

return parser

def main(self, argv):
Expand Down
4 changes: 4 additions & 0 deletions packages/taucmdr/cli/commands/target/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from taucmdr.cf.compiler.host import HOST_COMPILERS
from taucmdr.cf.compiler.mpi import MPI_COMPILERS
from taucmdr.cf.compiler.shmem import SHMEM_COMPILERS
from taucmdr.cf.compiler.cuda import CUDA_COMPILERS
from taucmdr.cf.software.tau_installation import TauInstallation


Expand Down Expand Up @@ -99,6 +100,9 @@ def _construct_parser(self):

group = parser.add_argument_group('Symmetric Hierarchical Memory (SHMEM) arguments')
self._configure_argument_group(group, SHMEM_COMPILERS, '--shmem-compilers', 'shmem_family')

group = parser.add_argument_group('CUDA arguments')
self._configure_argument_group(group, CUDA_COMPILERS, '--cuda-compilers', 'cuda_family')
return parser

def _update_record(self, store, data, key):
Expand Down
Loading

0 comments on commit 1b6ba61

Please sign in to comment.