Skip to content

Commit

Permalink
Merge pull request #36 from LLNL/release/0.3.0
Browse files Browse the repository at this point in the history
Release version 0.3.0
  • Loading branch information
davidbeckingsale authored Dec 11, 2018
2 parents f774afa + 2d51eee commit 529004f
Show file tree
Hide file tree
Showing 118 changed files with 4,326 additions and 839 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ matrix:
- IMG=nvcc-9
- CMAKE_EXTRA_FLAGS="-DENABLE_CUDA=On"
- DO_TEST=no
- compiler: hcc
env:
- COMPILER=hcc
- IMG=rocm
- CMAKE_EXTRA_FLAGS="-C ../host-configs/rocm.cmake -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hcc -DENABLE_ROCM=On -DENABLE_OPENMP=Off -DENABLE_CUDA=Off -DENABLE_BENCHMARKS=Off -DENABLE_WARNINGS_AS_ERRORS=Off"
- DO_TEST=no

script:
script:
- docker run --rm --user='root' -v ${TRAVIS_BUILD_DIR}:/home/axom axom/compilers:$IMG chown -R axom /home/axom
- docker run --rm -v ${TRAVIS_BUILD_DIR}:/home/axom -e COMPILER -e DO_BUILD -e DO_TEST -e CMAKE_EXTRA_FLAGS axom/compilers:$IMG ./scripts/travis/build_and_test.sh

Expand Down
21 changes: 19 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,32 @@
# Please also see the LICENSE file for MIT license.
##############################################################################

cmake_policy(SET CMP0025 NEW)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0057 NEW)

project(Umpire
LANGUAGES CXX C
VERSION 0.2.4)
VERSION 0.3.0)

set(ENABLE_OPENMP On CACHE Bool "")
set(ENABLE_CUDA On CACHE Bool "")
set(ENABLE_COPY_HEADERS Off CACHE Bool "")
set(ENABLE_TESTS On CACHE Bool "")
set(ENABLE_BENCHMARKS On CACHE Bool "")
set(ENABLE_GMOCK On CACHE Bool "")
set(ENABLE_DOCS Off CACHE Bool "")
option(ENABLE_FORTRAN_API "Build FORTRAN API" Off)
option(ENABLE_C_API "Build C API" Off)
set(ENABLE_WARNINGS_AS_ERRORS On CACHE Bool "")
option(ENABLE_EXAMPLES "Build Umpire examples" On)
option(ENABLE_LOGGING "Build Umpire with Logging enabled" On)
option(ENABLE_SLIC "Build Umpire with SLIC logging" Off)
option(ENABLE_ASSERTS "Build Umpire with assert() enabled" On)
set(ENABLE_GTEST_DEATH_TESTS ${ENABLE_ASSERTS} CACHE Bool "")
option(ENABLE_STATISTICS "Track statistics for allocations and operations" Off)
option(ENABLE_COVERAGE "Enable code coverage (with GCC)" Off)
option(ENABLE_TOOLS "Enable Umpire Development Tools" On)

if (ENABLE_CUDA)
cmake_minimum_required(VERSION 3.9)
Expand All @@ -42,6 +48,11 @@ endif ()

message(STATUS "Using CMake version ${CMAKE_VERSION}")

if (ENABLE_FORTRAN_API)
set(ENABLE_FORTRAN On)
set(ENABLE_C_API On)
endif()

################################
# BLT
################################
Expand Down Expand Up @@ -93,4 +104,10 @@ if (ENABLE_EXAMPLES)
add_subdirectory(examples)
endif ()

add_subdirectory(docs)
if (ENABLE_TOOLS)
add_subdirectory(tools)
endif ()

if (ENABLE_DOCS)
add_subdirectory(docs)
endif ()
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <img src="https://cdn.rawgit.com/LLNL/Umpire/develop/share/umpire/logo/umpire-logo.png" width="128" valign="middle" alt="Umpire"/> Umpire v0.2.4
# <img src="https://cdn.rawgit.com/LLNL/Umpire/develop/share/umpire/logo/umpire-logo.png" width="128" valign="middle" alt="Umpire"/> Umpire v0.3.0

[![Build Status](https://travis-ci.com/LLNL/Umpire.svg?branch=develop)](https://travis-ci.com/LLNL/Umpire)
[![Documentation Status](https://readthedocs.org/projects/umpire/badge/?version=develop)](https://umpire.readthedocs.io/en/develop/?badge=develop)
Expand Down Expand Up @@ -29,6 +29,28 @@ For more advanced configuration you can use standard CMake variables.

Both user and code documentation is available [here](http://umpire.readthedocs.io/).

The Umpire [tutorial](https://umpire.readthedocs.io/en/develop/tutorial.html) provides a step by step introduction to Umpire features.

If you have build problems, we have comprehensive [build sytem documentation](https://umpire.readthedocs.io/en/develop/advanced_configuration.html) too!

# Getting Involved

Umpire is an open-source project, and we welcome contributions from the community.

## Mailing List

The Umpire mailing list is hosted on Google Groups, and is a great place to ask questions:
- [Umpire Users Google Group](https://groups.google.com/forum/#!forum/umpire-users)

## Contributions

We welcome all kinds of contributions: new features, bug fixes, documentation edits; it's all great!

To contribute, make a [pull request](https://github.com/LLNL/Umpire/compare), with `develop` as the destination branch.
We use Travis to run CI tests, and your branch must pass these tests before being merged.

For more information, see the [contributing guide](https://github.com/LLNL/Umpire/blob/develop/CONTRIBUTING.md).

# Authors

Thanks to all of Umpire's
Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Umpire Version 0.2
Umpire Version 0.3

Copyright (c) 2016-17, Lawrence Livermore National Security, LLC.
Produced at the Lawrence Livermore National Laboratory.
Expand Down
2 changes: 1 addition & 1 deletion blt
Submodule blt updated 40 files
+6 −1 .travis.yml
+9 −16 SetupBLT.cmake
+3 −2 appveyor.yml
+415 −65 cmake/BLTMacros.cmake
+11 −5 cmake/BLTOptions.cmake
+139 −64 cmake/BLTPrivateMacros.cmake
+230 −29 cmake/SetupCodeChecks.cmake
+42 −19 cmake/SetupCompilerOptions.cmake
+0 −2 cmake/SetupDocs.cmake
+69 −0 cmake/WrapAstyle.cmake.in
+0 −50 cmake/copy_headers.cmake
+0 −63 cmake/thirdparty/FindCppcheck.cmake
+0 −68 cmake/thirdparty/FindSphinx.cmake
+0 −63 cmake/thirdparty/FindUncrustify.cmake
+0 −54 cmake/thirdparty/FindValgrind.cmake
+56 −0 cmake/thirdparty/SetupCUDA.cmake
+3 −4 cmake/thirdparty/SetupMPI.cmake
+1 −1 cmake/thirdparty/SetupROCm.cmake
+15 −15 cmake/thirdparty/SetupThirdParty.cmake
+60 −0 host-configs/[email protected]
+4 −3 host-configs/[email protected]
+52 −0 host-configs/[email protected]
+38 −1 tests/internal/CMakeLists.txt
+62 −0 tests/internal/src/combine_static_library_test/CMakeLists.txt
+65 −0 tests/internal/src/combine_static_library_test/Foo1.cpp
+62 −0 tests/internal/src/combine_static_library_test/Foo1.hpp
+63 −0 tests/internal/src/combine_static_library_test/Foo2.cpp
+63 −0 tests/internal/src/combine_static_library_test/Foo2.hpp
+63 −0 tests/internal/src/combine_static_library_test/Foo3.cpp
+63 −0 tests/internal/src/combine_static_library_test/Foo3.hpp
+65 −0 tests/internal/src/combine_static_library_test/blt_combine_static_libraries_shared_smoke.cpp
+65 −0 tests/internal/src/combine_static_library_test/blt_combine_static_libraries_static_smoke.cpp
+1 −0 tests/internal/src/combine_static_library_test/dummy.cpp
+17 −0 tests/internal/src/combine_static_library_test/main.cpp
+37 −0 tests/internal/src/t_example_compile_definitions.cpp
+16 −10 thirdparty_builtin/CMakeLists.txt
+4 −0 thirdparty_builtin/googletest-master-2018-02-01/googletest/CMakeLists.txt
+6 −4 thirdparty_builtin/googletest-master-2018-02-01/googletest/include/gtest/internal/gtest-port.h
+27 −0 thirdparty_builtin/patches/gtest-2018-02-01-avoid-gtest-MACOSX_RPATH-warnings-from-CMP0042.patch
+38 −0 thirdparty_builtin/patches/gtest-2018-02-01-override-GTEST_HAS_CXXABI_H_.patch
18 changes: 16 additions & 2 deletions docs/sphinx/advanced_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ Here is a summary of the configuration options, their default value, and meaning
Variable Default Meaning
=========================== ======== ===============================================================================
``ENABLE_CUDA`` On Enable CUDA support
``ENABLE_ROCM`` Off Enable ROCm support
``ENABLE_STATISTICS`` Off Enable collection of memory statistics
``ENABLE_TESTING`` On Build test executables
``ENABLE_BENCHMARKS`` On Build benchmark programs
``ENABLE_LOGGING`` On Enable Logging within Umpire
``ENABLE_SLIC`` Off Enable SLIC logging
``ENABLE_ASSERTS`` On Enable UMPIRE_ASSERT() within Umpire
``ENABLE_TOOLS`` On Enable tools like replay
``ENABLE_DOCS`` Off Build documentation (requires Sphinx and/or Doxygen)
=========================== ======== ===============================================================================

These arguments are explained in more detail below:

* ``ENABLE_CUDA``
This option enables support for GPUs. If Umpire is built without CUDA support,
then only the ``HOST`` allocator is available for use.
This option enables support for NVIDIA GPUs. If Umpire is built without CUDA
or ROCM support, then only the ``HOST`` allocator is available for use.

* ``ENABLE_ROCM``
This option enables support for AMD GPUs using the ROCm stack and HCC
programming model. If Umpire is built without CUDA or ROCM support, then only
the ``HOST`` allocator is available for use.

* ``ENABLE_STATISTICS``
This option enables collection of memory statistics. If Umpire is built with
Expand All @@ -50,3 +58,9 @@ These arguments are explained in more detail below:

* ``ENABLE_ASSERTS``
Enable assert() within Umpire

* ``ENABLE_TOOLS``
Enable development tools for Umpire (replay, etc.)

* ``ENABLE_DOCS``
Build user documentation (with Sphinx) and code documentation (with Doxygen)
4 changes: 2 additions & 2 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@
# built documents.
#
# The short X.Y version.
version = u'0.2'
version = u'0.3'
# The full version, including alpha/beta/rc tags.
release = u'0.2.4'
release = u'0.3.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 7 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ blt_add_executable(
DEPENDS_ON
umpire)

if (ENABLE_FORTRAN)
if (ENABLE_C_API)
blt_add_executable(
NAME allocator_c
SOURCES allocator.c
Expand All @@ -39,6 +39,12 @@ blt_add_executable(
DEPENDS_ON
umpire)

blt_add_executable(
NAME size_limiter
SOURCES size_limiter.cpp
DEPENDS_ON
umpire)

if (ENABLE_STATISTICS)
blt_add_executable(
NAME statistics_example
Expand Down
17 changes: 10 additions & 7 deletions examples/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ int main(int argc, char* argv[]) {
(void)(argc);
(void)(argv);

UMPIRE_resourcemanager* rm = UMPIRE_resourcemanager_get();
UMPIRE_allocator* allocator = UMPIRE_resourcemanager_get_allocator(rm, "HOST");
umpire_resourcemanager rm;
umpire_resourcemanager_get_instance(&rm);

umpire_allocator allocator;
umpire_resourcemanager_get_allocator_by_name(&rm, "HOST", &allocator);

double* alloc_one;
double* alloc_two;
Expand All @@ -31,14 +34,14 @@ int main(int argc, char* argv[]) {
int i;

printf("Allocating memory on HOST...");
alloc_one = (double*) UMPIRE_allocator_allocate(allocator, sizeof(double)*ELEMS);
alloc_two = (double*) UMPIRE_allocator_allocate(allocator, sizeof(double)*ELEMS);
alloc_one = (double*) umpire_allocator_allocate(&allocator, sizeof(double)*ELEMS);
alloc_two = (double*) umpire_allocator_allocate(&allocator, sizeof(double)*ELEMS);

for (i = 0; i < ELEMS; i++) {
alloc_one[i] = 1.0*i;
}

UMPIRE_resourcemanager_copy(rm, alloc_one, alloc_two);
umpire_resourcemanager_copy_all(&rm, alloc_one, alloc_two);

for (i = 0; i < ELEMS; i++) {
if (alloc_one[i] == alloc_two[i]) {
Expand All @@ -48,8 +51,8 @@ int main(int argc, char* argv[]) {
}

printf("Deallocating memory on HOST...");
UMPIRE_allocator_deallocate(allocator, alloc_one);
UMPIRE_allocator_deallocate(allocator, alloc_two);
umpire_allocator_deallocate(&allocator, alloc_one);
umpire_allocator_deallocate(&allocator, alloc_two);
printf("done.\n");

return 0;
Expand Down
38 changes: 38 additions & 0 deletions examples/size_limiter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2018, Lawrence Livermore National Security, LLC.
// Produced at the Lawrence Livermore National Laboratory
//
// Created by David Beckingsale, [email protected]
// LLNL-CODE-747640
//
// All rights reserved.
//
// This file is part of Umpire.
//
// For details, see https://github.com/LLNL/Umpire
// Please also see the LICENSE file for MIT license.
//////////////////////////////////////////////////////////////////////////////
#include <iostream>

#include "umpire/ResourceManager.hpp"

#include "umpire/strategy/SizeLimiter.hpp"
#include "umpire/strategy/DynamicPool.hpp"

#include "umpire/util/Macros.hpp"

int main(int, char**)
{
auto& rm = umpire::ResourceManager::getInstance();
auto size_limited_alloc = rm.makeAllocator<umpire::strategy::SizeLimiter>(
"size_limited_alloc", rm.getAllocator("HOST"), 1024);

auto pool = rm.makeAllocator<umpire::strategy::DynamicPool>(
"pool", size_limited_alloc, 64, 64);

// This will throw an exception because the pool is limited to 1024 bytes.
void* data = pool.allocate(2048);
UMPIRE_USE_VAR(data);

return 0;
}
48 changes: 48 additions & 0 deletions host-configs/rocm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#cmake \
# -DCMAKE_BUILD_TYPE=Release \
# -DENABLE_ROCM=ON -DBLT_SOURCE_DIR=${BLT_DIR} \
# -DROCM_ARCH=gfx900 \
# -C ${BLT_DIR}/cmake/blt-test/host-configs/rocm.cmake \
# -DCMAKE_INSTALL_PREFIX=../install-rocm-release \


set(ENABLE_ROCM ON CACHE BOOL "")
set(ENABLE_OPENMP OFF CACHE BOOL "")
set(ENABLE_CUDA Off CACHE BOOL "")
set(ENABLE_GMOCK Off CACHE BOOL "")

set(ROCM_ROOT_DIR "/opt/rocm/" CACHE PATH "ROCm ROOT directory path")

set(ROCM_INCLUDE_PATH "${ROCM_ROOT_DIR}/hcc/include" CACHE PATH "")
set(ROCM_CXX_LIBRARIES "-L${ROCM_ROOT_DIR}/hcc/lib -lhc_am" CACHE STRING "")

set(ROCM_ARCH "gfx900" CACHE STRING "")

###########################################################
# specify the target architecture
# Default with ROCm 1.7 is gfx803 (Fiji)
# Other options:
# gfx700 Hawaii
# gfx803 Polaris (RX580)
# gfx900 Vega
# gfx901
###########################################################
set(ROCM_ARCH_FLAG "-amdgpu-target=${ROCM_ARCH}" CACHE STRING "")

###########################################################
# get compile/link flags from hcc-config
###########################################################
execute_process(COMMAND ${ROCM_ROOT_DIR}/hcc/bin/hcc-config --cxxflags OUTPUT_VARIABLE ROCM_CXX_COMPILE_FLAGS)
execute_process(COMMAND ${ROCM_ROOT_DIR}/hcc/bin/hcc-config --ldflags OUTPUT_VARIABLE ROCM_CXX_LINK_FLAGS)

#set(ROCM_CXX_COMPILE_FLAGS "${ROCM_CXX_COMPILE_FLAGS} -Wno-unused-command-line-argument -DHCC_ENABLE_ACCELERATOR_PRINTF" CACHE STRING "")
set(ROCM_CXX_LINK_FLAGS "${ROCM_CXX_LINK_FLAGS} ${ROCM_ARCH_FLAG} ${ROCM_CXX_LIBRARIES}" CACHE STRING "")

###########################################################
# set CMake cache variables
###########################################################
set(CMAKE_CXX_COMPILER "${ROCM_ROOT_DIR}/bin/hcc" CACHE FILEPATH "ROCm HCC compiler")
set(BLT_CXX_FLAGS "${ROCM_CXX_COMPILE_FLAGS}" CACHE STRING "HCC compiler flags")
set(BLT_EXE_LINKER_FLAGS ${ROCM_CXX_LINK_FLAGS} CACHE STRING "")

#set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_COMPILER} ${ROCM_CXX_LINK_FLAGS} <OBJECTS> <LINK_LIBRARIES> -o <TARGET>" CACHE STRING "HCC linker command line")
2 changes: 1 addition & 1 deletion scripts/make_release_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
##############################################################################

TAR_CMD=gtar
VERSION=0.2.4
VERSION=0.3.0

git archive --prefix=umpire-${VERSION}/ -o umpire-${VERSION}.tar HEAD 2> /dev/null

Expand Down
2 changes: 1 addition & 1 deletion scripts/travis/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ "$DO_BUILD" == "yes" ]] ; then
or_die make -j 3 VERBOSE=1
fi
if [[ "${DO_TEST}" == "yes" ]] ; then
or_die ctest -V
or_die ctest --output-on-failure -V
fi
fi

Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
# For details, see https://github.com/LLNL/Umpire
# Please also see the LICENSE file for MIT license.
##############################################################################

add_subdirectory(umpire)
Loading

0 comments on commit 529004f

Please sign in to comment.