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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
run: |
source ${{github.workspace}}/ci/openmpi.env
cmake --build . --target ta_test
cmake --build . --target check
cmake --build . --target check-tiledarray
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default:

variables:
MAD_NUM_THREADS : 2
TA_TARGETS : "tiledarray examples ta_test check"
TA_TARGETS : "tiledarray examples ta_test check-tiledarray"
TA_CONFIG : >
CMAKE_BUILD_TYPE=${BUILD_TYPE}
TA_ASSERT_POLICY=TA_ASSERT_THROW
Expand Down
30 changes: 17 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ include(external/versions.cmake)
# Bring ValeevGroup cmake toolkit
###############################################################################
include(FetchContent)
if (DEFINED PROJECT_BINARY_DIR)
set(VG_CMAKE_KIT_PREFIX_DIR PROJECT_BINARY_DIR)
else ()
set(VG_CMAKE_KIT_PREFIX_DIR CMAKE_CURRENT_BINARY_DIR)
endif()
FetchContent_Declare(
vg_cmake_kit
QUIET
GIT_REPOSITORY https://github.com/ValeevGroup/kit-cmake.git
GIT_TAG ${TA_TRACKED_VGCMAKEKIT_TAG}
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/cmake/vg
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/cmake/vg-build
SUBBUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/cmake/vg-subbuild
SOURCE_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg
BINARY_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg-build
SUBBUILD_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg-subbuild
)
FetchContent_GetProperties(vg_cmake_kit)
if (NOT vg_cmake_kit_POPULATED)
Expand Down Expand Up @@ -136,7 +141,6 @@ 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)

option(TA_SIGNED_1INDEX_TYPE "Enables the use of signed 1-index coordinate type (OFF in 1.0.0-alpha.2 and older)" ON)
Expand Down Expand Up @@ -261,7 +265,7 @@ if (CMAKE_CXX_STANDARD EQUAL 20 AND CMAKE_VERSION VERSION_LESS 3.12.0)
cmake_minimum_required (VERSION 3.12.0)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Whether to use extensions of C++ ISO Standard version")
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Whether to use extensions of C++ ISO Standard version")
# Check type support
include(CheckTypeSize)
check_type_size("long double" TILEDARRAY_HAS_LONG_DOUBLE LANGUAGE CXX)
Expand All @@ -281,9 +285,9 @@ set_property(

# if building unit tests default to throw to be able to test TA_ASSERT statements
if (NOT (TA_ASSERT_POLICY STREQUAL TA_ASSERT_THROW))
if (TA_BUILD_UNITTEST)
message(FATAL_ERROR "TA_ASSERT_POLICY=${TA_ASSERT_POLICY} requires TA_BUILD_UNITTEST=OFF")
endif(TA_BUILD_UNITTEST)
if (BUILD_TESTING)
message(FATAL_ERROR "TA_ASSERT_POLICY=${TA_ASSERT_POLICY} requires BUILD_TESTING=OFF")
endif(BUILD_TESTING)
endif()

##########################
Expand All @@ -301,7 +305,7 @@ add_custom_target(External-tiledarray)
if(ENABLE_CUDA)
include(external/cuda.cmake)
endif()
include(external/madness.cmake)
include(FindOrFetchMADWorld)
detect_MADNESS_configuration()
include(external/eigen.cmake)
include(external/umpire.cmake)
Expand Down Expand Up @@ -366,12 +370,12 @@ add_subdirectory(doc)
##########################
# checking/testing
##########################
enable_testing()
if (TA_BUILD_UNITTEST)
add_custom_target_subproject(tiledarray check USES_TERMINAL COMMAND ${CMAKE_CTEST_COMMAND} -V)
include(CTest)
if (BUILD_TESTING)
add_custom_target_subproject(tiledarray check USES_TERMINAL COMMAND ${CMAKE_CTEST_COMMAND} -V -R "tiledarray/unit")
add_subdirectory(tests)
else()
add_custom_target_subproject(tiledarray check USES_TERMINAL COMMAND echo "WARNING: unit testing disabled. To enable, add --unittest to configure, or give -DTA_BUILD_UNITTEST=TRUE to cmake")
add_custom_target_subproject(tiledarray check USES_TERMINAL COMMAND echo "WARNING: unit testing disabled. To enable, give -DBUILD_TESTING=ON to cmake")
endif()

##########################
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Both methods are supported. However, for most users we _strongly_ recommend to b
- Boost.Container: header-only
- Boost.Test: header-only or (optionally) as a compiled library, *only used for unit testing*
- Boost.Range: header-only, *only used for unit testing*
- [BTAS](http://github.com/ValeevGroup/BTAS), tag b7bddfcef89612652878854a447bacf4d3f6a5b0 . If usable BTAS installation is not found, TiledArray will download and compile
- [BTAS](http://github.com/ValeevGroup/BTAS), tag 0dc805fd7f2dea5e56eff94ab1c44b2b2397edd7 . 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 3cebcd2adadb8365dd46629143d1915ff45fa3be .
- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag 34ef8e6d6c61098d44ca559a530b4096e40b9a01 .
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 Down Expand Up @@ -400,7 +400,7 @@ support may be added.

* `TA_EXPERT` -- Set to `ON` to disable automatic installation of prerequisites. Useful for experts, hence the name. [Default=OFF].
* `TA_ASSERT_POLICY` -- Set to `TA_ASSERT_IGNORE` to disable `TA_ASSERT` assertions, `TA_ASSERT_THROW` to cause `TA_ASSERT` assertions to throw, `TA_ASSERT_ABORT` to cause `TA_ASSERT` assertions to abort. The default is `TA_ASSERT_IGNORE` if CMake uses a single-configuration generator and`CMAKE_BUILD_TYPE` is set to `Release` or `MinSizeRel`, else the default is `TA_ASSERT_THROW`.
* `TA_BUILD_UNITTEST` -- Set of `OFF` to disable building unit tests. The default is `ON`.
* `BUILD_TESTING` -- Set of `OFF` to disable building unit tests. The default is `ON`.
* `TA_TRACE_TASKS` -- Set to `ON` to enable tracing of MADNESS tasks using custom task tracer. Note that standard profilers/tracers are generally useless (except in the trivial cases) with MADWorld-based programs since the submission context of tasks is not captured by standard tracing tools; this makes it impossible in a nontrivial program to attribute tasks to source code. WARNING: task tracing his will greatly increase the memory requirements. [Default=OFF].
* `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.
Expand Down
2 changes: 1 addition & 1 deletion bin/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ make -j1 ta_test VERBOSE=1
export MAD_NUM_THREADS=2
# to find dep shared libs (do we need this since El is gone?)
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/TA/lib:${INSTALL_PREFIX}/madness/lib:${LD_LIBRARY_PATH}
make check
make check-tiledarray

# Build examples
make -j2 examples VERBOSE=1
4 changes: 2 additions & 2 deletions bin/build-madness-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ if [ "$BUILD_TYPE" = "Debug" ]; then
-DASSERTION_TYPE=throw \
-DDISABLE_WORLD_GET_DEFAULT=ON

# Build MADworld + LAPACK/BLAS interface
make -j2 install-madness-world install-madness-common install-madness-config VERBOSE=1
# Build+install MADworld interface
make -j2 install VERBOSE=1
fi

fi
17 changes: 12 additions & 5 deletions cmake/modules/FindOrFetchBTAS.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
find_package(BTAS 1.0.0 QUIET CONFIG)
# try find_package
if (NOT TARGET BTAS::BTAS)
include (FindPackageRegimport)
find_package_regimport(BTAS 1.0.0 QUIET CONFIG)
if (TARGET BTAS::BTAS)
message(STATUS "Found BTAS CONFIG at ${BTAS_CONFIG}")
endif (TARGET BTAS::BTAS)
endif (NOT TARGET BTAS::BTAS)

if (TARGET BTAS::BTAS)
message(STATUS "Found BTAS CONFIG at ${BTAS_CONFIG}")
else (TARGET BTAS::BTAS)
# if not found, build via FetchContent
if (NOT TARGET BTAS::BTAS)

if (NOT TILEDARRAY_HAS_CUDA)
# tell BLAS++/LAPACK++ to ignore CUDA
set(use_cuda FALSE CACHE BOOL "Whether to look for CUDA-enabled libs in BLAS++/LAPACK++")
endif()

include(FetchContent)
FetchContent_Declare(
BTAS
GIT_REPOSITORY https://github.com/BTAS/btas.git
Expand All @@ -28,7 +35,7 @@ else (TARGET BTAS::BTAS)
# set BTAS_CONFIG to the install location so that we know where to find it
set(BTAS_CONFIG ${CMAKE_INSTALL_PREFIX}/${BTAS_INSTALL_CMAKEDIR}/btas-config.cmake)

endif(TARGET BTAS::BTAS)
endif(NOT TARGET BTAS::BTAS)

# postcond check
if (NOT TARGET BTAS::BTAS)
Expand Down
17 changes: 11 additions & 6 deletions cmake/modules/FindOrFetchBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ if (BOOST_ROOT OR BOOST_INCLUDEDIR)
set(Boost_NO_SYSTEM_PATHS TRUE)
endif()

# Check for Boost
find_package(Boost ${TA_TRACKED_BOOST_VERSION} QUIET)
# try find_package
if (NOT TARGET Boost::boost)
include(FindPackageRegimport)
find_package_regimport(Boost ${TA_TRACKED_BOOST_VERSION} QUIET)
if (TARGET Boost::boost)
message(STATUS "Found Boost ${Boost_VERSION}: ${Boost_INCLUDE_DIRS}")
endif(TARGET Boost::boost)
endif (NOT TARGET Boost::boost)

if (TARGET Boost::boost)
message(STATUS "Found Boost ${Boost_VERSION}: ${Boost_INCLUDE_DIRS}")
else (TARGET Boost::boost)
# if not found, build via FetchContent
if (NOT TARGET Boost::boost)
include (FetchContent)
cmake_minimum_required (VERSION 3.14.0) # for FetchContent_MakeAvailable

Expand All @@ -32,7 +37,7 @@ else (TARGET Boost::boost)
DESTINATION "${TILEDARRAY_INSTALL_CMAKEDIR}"
COMPONENT boost-libs)

endif(TARGET Boost::boost)
endif(NOT TARGET Boost::boost)

# postcond check
if (NOT TARGET Boost::boost)
Expand Down
59 changes: 59 additions & 0 deletions cmake/modules/FindOrFetchMADWorld.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# first try find_package
if (NOT TARGET MADworld)
include (FindPackageRegimport)
find_package_regimport(MADNESS ${TA_TRACKED_MADNESS_VERSION} CONFIG QUIET COMPONENTS world HINTS "${MADNESS_ROOT_DIR}")
if (TARGET MADworld)
message(STATUS "Found MADNESS CONFIG at ${MADNESS_CONFIG}")
endif (TARGET MADworld)
endif (NOT TARGET MADworld)

# if not found, build via FetchContent
if (NOT TARGET MADworld)

# TA-specific configuration
set(MADNESS_BUILD_MADWORLD_ONLY ON CACHE BOOL "Whether to build MADNESS runtime only")
set(ENABLE_PARSEC OFF CACHE BOOL "Whether to use PaRSEC as the task backend of MADWorld")
set(MPI_THREAD "multiple" CACHE INTERNAL "MADNESS requires MPI_THREAD_MULTIPLE")
set(MADNESS_ASSUMES_ASLR_DISABLED ${TA_ASSUMES_ASLR_DISABLED} CACHE BOOL "Whether MADNESS assumes ASLR to be disabled")
set(MPI_CXX_SKIP_MPICXX ON CACHE BOOL "Whether to disable search for C++ MPI-2 bindings")
set(DISABLE_WORLD_GET_DEFAULT ON CACHE INTERNAL "Whether to disable madness::World::get_default()")
set(ENABLE_MEM_PROFILE ON CACHE INTERNAL "Whether to enable instrumented memory profiling in MADNESS")
set(ENABLE_TASK_DEBUG_TRACE ${TILEDARRAY_ENABLE_TASK_DEBUG_TRACE} CACHE INTERNAL "Whether to enable task profiling in MADNESS")

# Set error handling method (for TA_ASSERT_POLICY allowed values see top-level CMakeLists.txt)
if(TA_ASSERT_POLICY STREQUAL TA_ASSERT_IGNORE)
set(_MAD_ASSERT_TYPE disable)
elseif(TA_ASSERT_POLICY STREQUAL TA_ASSERT_THROW)
set(_MAD_ASSERT_TYPE throw)
elseif(TA_ASSERT_POLICY STREQUAL TA_ASSERT_ABORT)
set(_MAD_ASSERT_TYPE abort)
endif()
set(MAD_ASSERT_TYPE ${_MAD_ASSERT_TYPE} CACHE INTERNAL "MADNESS assert type")
set(ASSERTION_TYPE "${MAD_ASSERT_TYPE}" CACHE INTERNAL "MADNESS assert type")

# look for C and MPI here to make troubleshooting easier and be able to override defaults for MADNESS
enable_language(C)
find_package(MPI REQUIRED COMPONENTS C CXX)

include(FetchContent)
FetchContent_Declare(
MADNESS
GIT_REPOSITORY https://github.com/m-a-d-n-e-s-s/madness.git
GIT_TAG ${TA_TRACKED_MADNESS_TAG}
)
FetchContent_MakeAvailable(MADNESS)
FetchContent_GetProperties(MADNESS
SOURCE_DIR MADNESS_SOURCE_DIR
BINARY_DIR MADNESS_BINARY_DIR
)
set_property(DIRECTORY ${MADNESS_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
# making madness targets EXCLUDE_FROM_ALL via the above makes its install statement "UB": https://cmake.org/cmake/help/latest/command/install.html#installing-targets
# force 'all' target to build madness and MADworld using this dummy target
add_custom_target(tiledarray-force-all-to-build-madness-target ALL DEPENDS madness MADworld)

endif(NOT TARGET MADworld)

# postcond check
if (NOT TARGET MADworld)
message(FATAL_ERROR "FindOrFetchMADNESS could not make MADworld target available")
endif(NOT TARGET MADworld)
16 changes: 11 additions & 5 deletions cmake/modules/FindOrFetchRangeV3.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
find_package(range-v3 QUIET CONFIG)

if (TARGET range-v3::range-v3)
# try find_package
if (NOT TARGET range-v3::range-v3)
include (FindPackageRegimport)
find_package_regimport(range-v3 QUIET CONFIG)
if (TARGET range-v3::range-v3)
message(STATUS "Found Range-V3 CONFIG at ${range-v3_CONFIG}")
else (TARGET range-v3::range-v3)
endif (TARGET range-v3::range-v3)
endif (NOT TARGET range-v3::range-v3)

# if not found, build via FetchContent
if (NOT TARGET range-v3::range-v3)

include(FetchContent)
FetchContent_Declare(
Expand All @@ -19,7 +25,7 @@ else (TARGET range-v3::range-v3)
# set range-v3_CONFIG to the install location so that we know where to find it
set(range-v3_CONFIG ${CMAKE_INSTALL_PREFIX}/lib/cmake/range-v3/range-v3-config.cmake)

endif(TARGET range-v3::range-v3)
endif(NOT TARGET range-v3::range-v3)

# postcond check
if (NOT TARGET range-v3::range-v3)
Expand Down
6 changes: 3 additions & 3 deletions examples/mpi_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ if(NOT DISABLE_MPI)
enable_language(C)

# Add the mpi_bandwidth executable
add_ta_executable(mpi_bandwidth "mpi_bandwidth.c" "${MADNESS_LIBRARIES}")
add_ta_executable(mpi_bandwidth "mpi_bandwidth.c" MADworld)
add_dependencies(examples-tiledarray mpi_bandwidth)

# Add the mpi_latency executable
add_ta_executable(mpi_latency "mpi_latency.c" "${MADNESS_LIBRARIES}")
add_ta_executable(mpi_latency "mpi_latency.c" MADworld)
add_dependencies(examples-tiledarray mpi_latency)


if(CUDA_FOUND)
add_ta_executable(mpi_cuda "mpi_cuda.cpp" "${MADNESS_LIBRARIES}")
add_ta_executable(mpi_cuda "mpi_cuda.cpp" MADworld)
set_source_files_properties(mpi_cuda.cpp
PROPERTIES
LANGUAGE CUDA)
Expand Down
3 changes: 2 additions & 1 deletion examples/mpi_tests/mpi_bandwidth.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
* AUTHOR: Blaise Barney
* LAST REVISED: 04/13/05
****************************************************************************/
#include <madness/madness_config.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include "mpi.h"
#include MADNESS_MPI_HEADER

#define MAXTASKS 8192
/* Change the next four parameters to suit your case */
Expand Down
3 changes: 2 additions & 1 deletion examples/mpi_tests/mpi_latency.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
* AUTHOR: Blaise Barney
* LAST REVISED: 04/13/05
******************************************************************************/
#include <madness/madness_config.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include "mpi.h"
#include MADNESS_MPI_HEADER
#define NUMBER_REPS 1000

int main(int argc, char *argv[]) {
Expand Down
Loading