Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ if((ENABLE_GPERFTOOLS OR ENABLE_TCMALLOC_MINIMAL) AND CMAKE_SYSTEM_NAME MATCHES
set(ENABLE_LIBUNWIND ON)
add_feature_info(Libunwind ENABLE_LIBUNWIND "Libunwind provides stack unwinding")
endif()

option(TA_TENSOR_MEM_PROFILE "Turn on instrumented profiling of TA::Tensor memory use" OFF)
add_feature_info(TENSOR_MEM_PROFILE TA_TENSOR_MEM_PROFILE "instrumented profiling of TA::Tensor memory use")

option(TA_BUILD_UNITTEST "Causes building TiledArray unit tests" ON)
option(TA_EXPERT "TiledArray Expert mode: disables automatically downloading or building dependencies" OFF)

Expand Down Expand Up @@ -264,7 +268,7 @@ check_type_size("long double" TILEDARRAY_HAS_LONG_DOUBLE LANGUAGE CXX)
check_type_size("long long" TILEDARRAY_HAS_LONG_LONG LANGUAGE CXX)

# TA_ASSERT
set (TA_ASSERT_POLICY TA_ASSERT_THROW CACHE STRING "")
set (TA_ASSERT_POLICY TA_ASSERT_THROW CACHE STRING "Controls the behavior of TA_ASSERT; TA_ASSERT_THROW causes TA_ASSERT to throw, TA_ASSERT_ABORT causes TA_ASSERT to abort, TA_ASSERT_IGNORE makes TA_ASSERT a no-op")
set_property(
CACHE TA_ASSERT_POLICY PROPERTY
STRINGS TA_ASSERT_THROW TA_ASSERT_ABORT TA_ASSERT_IGNORE)
Expand Down Expand Up @@ -294,6 +298,7 @@ endif()
include(external/madness.cmake)
detect_MADNESS_configuration()
include(external/eigen.cmake)
include(external/umpire.cmake)

###### discover linear algebra

Expand Down
5 changes: 3 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Both methods are supported. However, for most users we _strongly_ recommend to b
- Boost.Range: header-only, *only used for unit testing*
- [BTAS](https://github.com/ValeevGroup/BTAS), tag d7794799e4510cf66844081dd8f1f5b648112d33 . If usable BTAS installation is not found, TiledArray will download and compile
BTAS from source. *This is the recommended way to compile BTAS for all users*.
- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag 7ce06234c23aa8e0ab3d9e9b87eff9cd85390d80 .
- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag 12bd24c6cb984a639be863fc0e1364226713f7ff .
Only the MADworld runtime and BLAS/LAPACK C API component of MADNESS is used by TiledArray.
If usable MADNESS installation is not found, TiledArray will download and compile
MADNESS from source. *This is the recommended way to compile MADNESS for all users*.
Expand All @@ -65,7 +65,7 @@ Compiling BTAS requires the following prerequisites:
Optional prerequisites:
- [CUDA compiler and runtime](https://developer.nvidia.com/cuda-zone) -- for execution on CUDA-enabled accelerators. CUDA 11 or later is required. Support for CUDA also requires the following additional prerequisites, both of which will be built and installed automatically if missing:
- [cuTT](github.com/ValeevGroup/cutt) -- CUDA transpose library; note that our fork of the [original cuTT repo](github.com/ap-hynninen/cutt) is required to provide thread-safety (tag 0e8685bf82910bc7435835f846e88f1b39f47f09).
- [Umpire](github.com/LLNL/Umpire) -- portable memory manager for heterogeneous platforms (tag f04abd1dd038c84262915a493d8f78576bb80fd0).
- [Umpire](github.com/LLNL/Umpire) -- portable memory manager for heterogeneous platforms (tag 5201a47a35e3844160dcbecd0916f8c96aa7dd07).
- [Doxygen](http://www.doxygen.nl/) -- for building documentation (version 1.8.12 or later).
- [ScaLAPACK](http://www.netlib.org/scalapack/) -- a distributed-memory linear algebra package. If detected, the following C++ components will also be sought and downloaded, if missing:
- [blacspp](https://github.com/wavefunction91/blacspp.git) -- a modern C++ (C++17) wrapper for BLACS (tag 88076f1706be083ead882f6ce0bfc6884a72fc03)
Expand Down Expand Up @@ -405,6 +405,7 @@ support may be added.
* `TA_ENABLE_RANGEV3` -- Set to `ON` to find or fetch the Range-V3 library and enable additional tests of TA components with constructs anticipated to be supported in the future. [Default=OFF].
* `TA_SIGNED_1INDEX_TYPE` -- Set to `OFF` to use unsigned 1-index coordinate type (default for TiledArray 1.0.0-alpha.2 and older). The default is `ON`, which enables the use of negative indices in coordinates.
* `TA_MAX_SOO_RANK_METADATA` -- Specifies the maximum rank for which to use Small Object Optimization (hence, avoid the use of the heap) for metadata. The default is `8`.
* `TA_TENSOR_MEM_PROFILE` -- Set to `ON` to profile memory allocations in TA::Tensor.

# Build TiledArray

Expand Down
9 changes: 0 additions & 9 deletions cmake/modules/FetchBLT.cmake

This file was deleted.

13 changes: 8 additions & 5 deletions external/cutt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ else()
enable_language(C)

# set source and build path for cuTT in the TiledArray project
set(EXTERNAL_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/source/cutt)
set(EXTERNAL_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-src)
# cutt only supports in source build
set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build/cutt)
set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/external/cutt)
set(EXTERNAL_BUILD_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-build)
set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})

if (NOT CUTT_URL)
set(CUTT_URL https://github.com/ValeevGroup/cutt.git)
Expand Down Expand Up @@ -72,6 +72,9 @@ else()
-DCMAKE_CUDA_HOST_COMPILER=${CMAKE_CUDA_HOST_COMPILER}
-DCUDA_TOOLKIT_ROOT_DIR=${CUDAToolkit_ROOT}
)
if (DEFINED CMAKE_CUDA_ARCHITECTURES)
list(APPEND CUTT_CMAKE_ARGS -DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES})
endif(DEFINED CMAKE_CUDA_ARCHITECTURES)
if (CMAKE_TOOLCHAIN_FILE)
set(CUTT_CMAKE_ARGS "${CUTT_CMAKE_ARGS}"
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
Expand All @@ -89,8 +92,8 @@ else()

ExternalProject_Add(cutt
PREFIX ${CMAKE_INSTALL_PREFIX}
STAMP_DIR ${PROJECT_BINARY_DIR}/external/cutt-stamp
TMP_DIR ${PROJECT_BINARY_DIR}/external/tmp
STAMP_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-ep-artifacts
TMP_DIR ${CMAKE_BINARY_DIR}/_deps/cutt-ep-artifacts # needed in case CMAKE_INSTALL_PREFIX is not writable
#--Download step--------------
DOWNLOAD_DIR ${EXTERNAL_SOURCE_DIR}
GIT_REPOSITORY ${CUTT_URL}
Expand Down
6 changes: 2 additions & 4 deletions external/eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,13 @@ else()
include(ExternalProject)

# Set source and build path for Eigen3 in the TiledArray Project
set(EXTERNAL_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/source/eigen)
set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build/eigen)
set(EXTERNAL_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/eigen-src)
set(EXTERNAL_BUILD_DIR ${CMAKE_BINARY_DIR}/_deps/eigen-build)

message("** Will build Eigen from ${EIGEN3_URL}")

ExternalProject_Add(eigen3
PREFIX ${CMAKE_INSTALL_PREFIX}
STAMP_DIR ${EXTERNAL_BUILD_DIR}/stamp
TMP_DIR ${EXTERNAL_BUILD_DIR}/tmp
#--Download step--------------
DOWNLOAD_DIR ${EXTERNAL_SOURCE_DIR}
URL ${EIGEN3_URL}
Expand Down
16 changes: 8 additions & 8 deletions external/madness.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ else()

# Create a cache entry for MADNESS build variables.
# Note: This will not overwrite user specified values.
set(MADNESS_SOURCE_DIR "${PROJECT_BINARY_DIR}/external/madness-src" CACHE PATH
set(MADNESS_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/madness-src" CACHE PATH
"Path to the MADNESS source directory")
set(MADNESS_BINARY_DIR "${PROJECT_BINARY_DIR}/external/madness-build" CACHE PATH
set(MADNESS_BINARY_DIR "${CMAKE_BINARY_DIR}/_deps/madness-build" CACHE PATH
"Path to the MADNESS build directory")
set(MADNESS_URL "https://github.com/m-a-d-n-e-s-s/madness.git" CACHE STRING
"Path to the MADNESS repository")
Expand All @@ -152,16 +152,16 @@ else()
# If the MADNESS source directory is the default location and does not exist,
# MADNESS will be downloaded from git.
message(STATUS "Checking MADNESS source directory: ${MADNESS_SOURCE_DIR}")
if("${MADNESS_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}/external/madness-src")
if("${MADNESS_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}/_deps/madness-src")

# Create the external source directory
if(NOT EXISTS ${PROJECT_BINARY_DIR}/external)
# Create the source directory
if(NOT EXISTS ${CMAKE_BINARY_DIR}/_deps)
set(error_code 1)
execute_process(
COMMAND "${CMAKE_COMMAND}" -E make_directory "${PROJECT_BINARY_DIR}/external"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_BINARY_DIR}/_deps"
RESULT_VARIABLE error_code)
if(error_code)
message(FATAL_ERROR "Failed to create directory \"${PROJECT_BINARY_DIR}/external\"")
message(FATAL_ERROR "Failed to create directory \"${CMAKE_BINARY_DIR}/_deps\"")
endif()
endif()

Expand All @@ -173,7 +173,7 @@ else()
while(error_code AND number_of_tries LESS 3)
execute_process(
COMMAND ${GIT_EXECUTABLE} clone ${MADNESS_URL} madness-src
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/external
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps
RESULT_VARIABLE error_code)
math(EXPR number_of_tries "${number_of_tries} + 1")
endwhile()
Expand Down
42 changes: 24 additions & 18 deletions external/umpire.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
## find Umpire
##

if (NOT TARGET TiledArray_UMPIRE)

find_path(_UMPIRE_INSTALL_DIR NAMES include/umpire/Umpire.hpp HINTS ${UMPIRE_INSTALL_DIR})

# if user provides UMPIRE, use it
Expand All @@ -27,9 +29,9 @@ else()
enable_language(C)

# set source and build path for Umpire in the TiledArray project
set(EXTERNAL_SOURCE_DIR ${PROJECT_BINARY_DIR}/external/source/Umpire)
set(EXTERNAL_BUILD_DIR ${PROJECT_BINARY_DIR}/external/build/Umpire)
set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/external/Umpire)
set(EXTERNAL_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-src)
set(EXTERNAL_BUILD_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-build)
set(EXTERNAL_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})

if (NOT UMPIRE_URL)
set(UMPIRE_URL https://github.com/LLNL/Umpire.git)
Expand All @@ -40,9 +42,6 @@ else()

message("** Will clone Umpire from ${UMPIRE_URL}")

## use patched BLT
include(FetchBLT)

if (TA_ASSERT_POLICY EQUAL TA_ASSERT_IGNORE)
set(enable_umpire_asserts OFF)
else()
Expand All @@ -69,21 +68,27 @@ else()
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}
-DCMAKE_AR=${CMAKE_AR}
-DBLT_SOURCE_DIR=${BLT_SOURCE_DIR}
-DBLT_CXX_STD=c++${CMAKE_CUDA_STANDARD}
-DENABLE_CUDA=ON
-DBLT_CXX_STD=c++${CMAKE_CXX_STANDARD}
-DENABLE_BENCHMARKS=OFF
-DENABLE_OPENMP=OFF
-DENABLE_TESTS=OFF
-DENABLE_EXAMPLES=OFF
-DENABLE_LOGGING=OFF
-DENABLE_ASSERTS=${enable_umpire_asserts}
-DCMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}
-DCMAKE_CUDA_STANDARD=${CMAKE_CUDA_STANDARD}
-DCMAKE_CUDA_EXTENSIONS=${CMAKE_CUDA_EXTENSIONS}
-DCMAKE_CUDA_HOST_COMPILER=${CMAKE_CUDA_HOST_COMPILER}
-DCUDA_TOOLKIT_ROOT_DIR=${CUDAToolkit_ROOT}
)
if (ENABLE_CUDA)
list(APPEND UMPIRE_CMAKE_ARGS
-DENABLE_CUDA=ON
-DCMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}
-DCMAKE_CUDA_STANDARD=${CMAKE_CUDA_STANDARD}
-DCMAKE_CUDA_EXTENSIONS=${CMAKE_CUDA_EXTENSIONS}
-DCMAKE_CUDA_HOST_COMPILER=${CMAKE_CUDA_HOST_COMPILER}
-DCUDA_TOOLKIT_ROOT_DIR=${CUDAToolkit_ROOT}
)
if (DEFINED CMAKE_CUDA_ARCHITECTURES)
list(APPEND UMPIRE_CMAKE_ARGS -DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES})
endif(DEFINED CMAKE_CUDA_ARCHITECTURES)
endif(ENABLE_CUDA)
if (CMAKE_TOOLCHAIN_FILE)
set(UMPIRE_CMAKE_ARGS "${UMPIRE_CMAKE_ARGS}"
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
Expand All @@ -102,13 +107,12 @@ else()

ExternalProject_Add(Umpire
PREFIX ${CMAKE_INSTALL_PREFIX}
STAMP_DIR ${PROJECT_BINARY_DIR}/external/Umpire-stamp
TMP_DIR ${PROJECT_BINARY_DIR}/external/tmp
STAMP_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-ep-artifacts
TMP_DIR ${CMAKE_BINARY_DIR}/_deps/umpire-ep-artifacts # needed in case CMAKE_INSTALL_PREFIX is not writable
#--Download step--------------
DOWNLOAD_DIR ${EXTERNAL_SOURCE_DIR}
GIT_REPOSITORY ${UMPIRE_URL}
GIT_TAG ${UMPIRE_TAG}
GIT_SUBMODULES "" # N.B. do not initialize modules!
#--Configure step-------------
SOURCE_DIR ${EXTERNAL_SOURCE_DIR}
LIST_SEPARATOR ::
Expand Down Expand Up @@ -152,11 +156,13 @@ set_target_properties(
TiledArray_UMPIRE
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
"$<BUILD_INTERFACE:${EXTERNAL_SOURCE_DIR}/src>;$<BUILD_INTERFACE:${EXTERNAL_BUILD_DIR}/include>;$<INSTALL_INTERFACE:${_UMPIRE_INSTALL_DIR}/include>"
"$<BUILD_INTERFACE:${EXTERNAL_SOURCE_DIR}/src>;$<BUILD_INTERFACE:${EXTERNAL_SOURCE_DIR}/src/umpire/tpl/camp/include>;$<BUILD_INTERFACE:${EXTERNAL_BUILD_DIR}/include>;$<INSTALL_INTERFACE:${_UMPIRE_INSTALL_DIR}/include>"
INTERFACE_LINK_LIBRARIES
"$<BUILD_INTERFACE:${UMPIRE_BUILD_BYPRODUCTS}>;$<INSTALL_INTERFACE:${_UMPIRE_INSTALL_DIR}/lib/libumpire.${UMPIRE_DEFAULT_LIBRARY_SUFFIX}>"
)

install(TARGETS TiledArray_UMPIRE EXPORT tiledarray COMPONENT tiledarray)

#TODO test Umpire

endif(NOT TARGET TiledArray_UMPIRE)
6 changes: 3 additions & 3 deletions external/versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ set(TA_INSTALL_EIGEN_PREVIOUS_VERSION 3.3.7)
set(TA_INSTALL_EIGEN_URL_HASH b9e98a200d2455f06db9c661c5610496)
set(TA_INSTALL_EIGEN_PREVIOUS_URL_HASH b9e98a200d2455f06db9c661c5610496)

set(TA_TRACKED_MADNESS_TAG 6694b3adc9204dc86aba9911444aa6737171c9e3)
set(TA_TRACKED_MADNESS_PREVIOUS_TAG f47f962213be0b1e149f5b56826992f27278128e)
set(TA_TRACKED_MADNESS_TAG 12bd24c6cb984a639be863fc0e1364226713f7ff)
set(TA_TRACKED_MADNESS_PREVIOUS_TAG 6694b3adc9204dc86aba9911444aa6737171c9e3)
set(TA_TRACKED_MADNESS_VERSION 0.10.1)
set(TA_TRACKED_MADNESS_PREVIOUS_VERSION 0.10.1)

Expand All @@ -30,7 +30,7 @@ set(TA_TRACKED_BTAS_PREVIOUS_TAG f4c965b778ff7df74f276f7fcf6224ac419e8ee3)
set(TA_TRACKED_CUTT_TAG 0e8685bf82910bc7435835f846e88f1b39f47f09)
set(TA_TRACKED_CUTT_PREVIOUS_TAG 592198b93c93b7ca79e7900b9a9f2e79f9dafec3)

set(TA_TRACKED_UMPIRE_TAG f04abd1dd038c84262915a493d8f78576bb80fd0)
set(TA_TRACKED_UMPIRE_TAG 5201a47a35e3844160dcbecd0916f8c96aa7dd07)
set(TA_TRACKED_UMPIRE_PREVIOUS_TAG f04abd1dd038c84262915a493d8f78576bb80fd0)

#set(TA_TRACKED_BLACSPP_TAG 20cfd414c5b719be1c958f4a2d57abef06df83b6 )
Expand Down
9 changes: 6 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ TiledArray/dense_shape.h
TiledArray/dist_array.h
TiledArray/distributed_storage.h
TiledArray/error.h
TiledArray/external/madness.h
TiledArray/initialize.h
TiledArray/perm_index.h
TiledArray/permutation.h
Expand Down Expand Up @@ -117,6 +116,10 @@ TiledArray/expressions/unary_engine.h
TiledArray/expressions/unary_expr.h
TiledArray/expressions/index_list.h
TiledArray/external/btas.h
TiledArray/external/madness.h
TiledArray/external/umpire.h
TiledArray/host/env.h
TiledArray/host/allocator.h
TiledArray/math/blas.h
TiledArray/math/gemm_helper.h
TiledArray/math/outer.h
Expand Down Expand Up @@ -217,7 +220,7 @@ TiledArray/math/linalg/rank-local.cpp
)

# the list of libraries on which TiledArray depends on, will be cached later
set(_TILEDARRAY_DEPENDENCIES MADworld TiledArray_Eigen BTAS::BTAS blaspp_headers)
set(_TILEDARRAY_DEPENDENCIES MADworld TiledArray_Eigen BTAS::BTAS blaspp_headers TiledArray_UMPIRE)

# TODO better ways to handle tiledarray cuda dependency
if(CUDA_FOUND)
Expand All @@ -234,7 +237,7 @@ if(CUDA_FOUND)
LANGUAGE CUDA)

# the list of libraries on which TiledArray depends on
list(APPEND _TILEDARRAY_DEPENDENCIES CUDA::cublas CUDA::nvToolsExt TiledArray_UMPIRE TiledArray_CUTT)
list(APPEND _TILEDARRAY_DEPENDENCIES CUDA::cublas CUDA::nvToolsExt TiledArray_CUTT)

endif(CUDA_FOUND)

Expand Down
3 changes: 3 additions & 0 deletions src/TiledArray/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
#cmakedefine TILEDARRAY_HAS_CUDA @TILEDARRAY_HAS_CUDA@
#cmakedefine TILEDARRAY_CHECK_CUDA_ERROR @TILEDARRAY_CHECK_CUDA_ERROR@

/* Is TA::Tensor memory profiling enabled? */
#cmakedefine TA_TENSOR_MEM_PROFILE 1

/* Use preprocessor to check if BTAS is available */
#ifndef TILEDARRAY_HAS_BTAS
#ifdef __has_include
Expand Down
Loading