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: 0 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ build:
- CXX: [ clang++-9 ]
IMAGE : [ "ubuntu:20.04" ]
TA_PYTHON : [ "TA_PYTHON=OFF" ]


2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ include(FeatureSummary)
# Preload versions/tags of all dependencies ====================================
include(external/versions.cmake)

set(MPI_CXX_SKIP_MPICXX TRUE CACHE BOOL "MPI_CXX_SKIP_MPICXX")

# Configure options =======================================================
option(ENABLE_MPI "Enable MPI" ON)
add_feature_info(MPI ENABLE_MPI "Message-Passing Interface supports distributed-memory parallel programs")
Expand Down
5 changes: 4 additions & 1 deletion cmake/gitlab-ci.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
set(TA_BUILD_UNITTEST TRUE)

set(ENABLE_SCALAPACK ON)
set(blacs_LIBRARIES "scalapack-openmpi")
set(scalapack_LIBRARIES "scalapack-openmpi")
set(lapack_LIBRARIES "lapack")
6 changes: 0 additions & 6 deletions cmake/toolchains/travis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wall" CACHE STRING "Inital C++ relea
set(BLAS_LINKER_FLAGS "-L/usr/lib/libblas" "-lblas" "-L/usr/lib/lapack" "-llapack" "-L/usr/lib" "-llapacke" CACHE STRING "BLAS linker flags")
set(LAPACK_LIBRARIES ${BLAS_LINKER_FLAGS} CACHE STRING "LAPACK linker flags")
set(LAPACK_INCLUDE_DIRS "/usr/include" CACHE STRING "LAPACK include directories")
set(
LAPACK_COMPILE_DEFINITIONS
MADNESS_LINALG_USE_LAPACKE
TILEDARRAY_EIGEN_USE_LAPACKE
CACHE STRING "LAPACK preprocessor definitions"
)
set(INTEGER4 TRUE CACHE BOOL "Set Fortran integer size to 4 bytes")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries")

Expand Down
9 changes: 6 additions & 3 deletions examples/scalapack/conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
*/

#include <tiledarray.h>
#include <TiledArray/math/linalg/scalapack/block_cyclic.h>
#include <random>

namespace scalapack = TiledArray::math::linalg::scalapack;

template <typename Integral1, typename Integral2>
int64_t div_ceil(Integral1 x, Integral2 y) {
int64_t x_ll = x;
Expand Down Expand Up @@ -66,7 +69,7 @@ int main(int argc, char** argv) {

// Create Test Matrix
blacspp::Grid grid = blacspp::Grid::square_grid(MPI_COMM_WORLD);
TA::scalapack::BlockCyclicMatrix<double> ref_matrix(world, grid, N, N, NB, NB);
scalapack::BlockCyclicMatrix<double> ref_matrix(world, grid, N, N, NB, NB);

for (size_t i = 0; i < N; ++i)
for (size_t j = 0; j < N; ++j)
Expand Down Expand Up @@ -125,7 +128,7 @@ int main(int argc, char** argv) {
TA::make_array<TA::TArray<double> >(world, trange, make_ta_reference);

world.gop.fence();
TA::scalapack::BlockCyclicMatrix<double> test_matrix(ref_ta, grid, NB, NB);
scalapack::BlockCyclicMatrix<double> test_matrix(ref_ta, grid, NB, NB);
world.gop.fence();

double local_norm_diff =
Expand Down Expand Up @@ -172,7 +175,7 @@ int main(int argc, char** argv) {
TA::make_array<TA::TArray<double> >(world, trange, make_ta_reference);

world.gop.fence();
TA::scalapack::BlockCyclicMatrix<double> test_matrix(ref_ta, grid, NB, NB);
scalapack::BlockCyclicMatrix<double> test_matrix(ref_ta, grid, NB, NB);
world.gop.fence();

double local_norm_diff =
Expand Down
5 changes: 3 additions & 2 deletions examples/scalapack/evp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
#include <scalapackpp/eigenvalue_problem/sevp.hpp>
#include <scalapackpp/pblas/gemm.hpp>

#include <TiledArray/algebra/scalapack/heig.h>
#include <TiledArray/math/linalg/scalapack/heig.h>

using Array = TA::TArray<double>;
// using Array = TA::TSpArray<double>;
namespace scalapack = TiledArray::math::linalg::scalapack;

TA::TiledRange gen_trange(size_t N, const std::vector<size_t>& TA_NBs) {
assert(TA_NBs.size() > 0);
Expand Down Expand Up @@ -93,7 +94,7 @@ int main(int argc, char** argv) {
tensor_symm("i,j") = 0.5 * (tensor("i,j") + tensor("j,i"));
tensor("i,j") = tensor_symm("i,j");

auto [evals, evecs_ta] = TA::scalapack::heig(tensor);
auto [evals, evecs_ta] = scalapack::heig(tensor);

//// Check EVP with TA
Array tmp =
Expand Down
2 changes: 1 addition & 1 deletion examples/vector_tests/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ int main(int argc, char** argv) {

start = madness::wall_time();
for (std::size_t r = 0ul; r < repeat; ++r) {
madness::cblas::scal(n, 3.0, c, 1);
TiledArray::blas::scale(n, 3.0, c);
}
stop = madness::wall_time();

Expand Down
18 changes: 1 addition & 17 deletions external/eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ else(ENABLE_CUDA)
set(_tiledarray_required_eigen_version ${TA_TRACKED_EIGEN_VERSION})
endif(ENABLE_CUDA)

set(_tiledarray_eigen_use_lapacke FALSE)
if ("${LAPACK_COMPILE_DEFINITIONS}" MATCHES "TILEDARRAY_EIGEN_USE_LAPACKE")
set(_tiledarray_eigen_use_lapacke TRUE)
if (_tiledarray_required_eigen_version VERSION_LESS 3.3.7)
message(
WARNING
"Eigen3 version => 3.3.7 is required if TILEDARRAY_EIGEN_USE_LAPACKE is set. "
"Prior Eigen3 with LAPACKE enabled may give incorrect eigenvalue results"
)
set(_tiledarray_required_eigen_version 3.3.7)
endif()
endif ()

# Check for existing Eigen
# prefer CMake-configured-and-installed instance
# re:NO_CMAKE_PACKAGE_REGISTRY: eigen3 registers its *build* tree with the user package registry ...
Expand Down Expand Up @@ -168,11 +155,8 @@ if (TARGET TiledArray_Eigen)
target_compile_definitions(TiledArray_Eigen INTERFACE EIGEN_USE_MKL_ALL)
else(MADNESS_HAS_MKL)
# Eigen's prototypes for non-MKL (i.e. F77) BLAS interface libraries do not match those in MADNESS (and are not const correct)
# thus can't use non-MKL BLAS, only LAPACK
# thus can't use non-MKL BLAS
# target_compile_definitions(TiledArray_Eigen INTERFACE EIGEN_USE_BLAS)
if (_tiledarray_eigen_use_lapacke)
target_compile_definitions(TiledArray_Eigen INTERFACE EIGEN_USE_LAPACKE EIGEN_USE_LAPACKE_STRICT)
endif ()
endif(MADNESS_HAS_MKL)
install(TARGETS TiledArray_Eigen EXPORT tiledarray COMPONENT tiledarray)
endif(TARGET TiledArray_Eigen)
4 changes: 4 additions & 0 deletions external/scalapack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ else()
add_subdirectory( ${blacspp_SOURCE_DIR} ${blacspp_BINARY_DIR} )
add_subdirectory( ${scalapackpp_SOURCE_DIR} ${scalapackpp_BINARY_DIR} )

# propagate MPI_CXX_SKIP_MPICXX=ON
target_compile_definitions( blacspp PRIVATE ${MPI_CXX_COMPILE_DEFINITIONS} )
target_compile_definitions( scalapackpp PRIVATE ${MPI_CXX_COMPILE_DEFINITIONS} )

install( TARGETS blacspp scalapackpp EXPORT tiledarray COMPONENT tiledarray )
# Add these dependencies to External
add_dependencies(External-tiledarray scalapackpp blacspp)
Expand Down
65 changes: 32 additions & 33 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,20 @@ TiledArray/utility.h
TiledArray/val_array.h
TiledArray/version.h
TiledArray/zero_tensor.h
TiledArray/algebra/conjgrad.h
TiledArray/algebra/diis.h
TiledArray/algebra/utils.h
TiledArray/algebra/cholesky.h
TiledArray/algebra/heig.h
TiledArray/algebra/lu.h
TiledArray/algebra/svd.h
TiledArray/algebra/types.h
TiledArray/algebra/lapack/cholesky.h
TiledArray/algebra/lapack/heig.h
TiledArray/algebra/lapack/util.h
TiledArray/algebra/lapack/lu.h
TiledArray/algebra/lapack/svd.h
TiledArray/algebra/scalapack/cholesky.h
TiledArray/algebra/scalapack/heig.h
TiledArray/algebra/scalapack/lu.h
TiledArray/algebra/scalapack/svd.h
TiledArray/math/linalg/forward.h
TiledArray/math/linalg/conjgrad.h
TiledArray/math/linalg/diis.h
TiledArray/math/linalg/util.h
TiledArray/math/linalg/cholesky.h
TiledArray/math/linalg/heig.h
TiledArray/math/linalg/lu.h
TiledArray/math/linalg/svd.h
TiledArray/math/linalg/scalapack/util.h
TiledArray/math/linalg/scalapack/block_cyclic.h
TiledArray/math/linalg/scalapack/cholesky.h
TiledArray/math/linalg/scalapack/heig.h
TiledArray/math/linalg/scalapack/lu.h
TiledArray/math/linalg/scalapack/svd.h
TiledArray/conversions/btas.h
TiledArray/conversions/clone.h
TiledArray/conversions/dense_to_sparse.h
Expand All @@ -82,7 +79,6 @@ TiledArray/conversions/foreach.h
TiledArray/conversions/vector_of_arrays.h
TiledArray/conversions/make_array.h
TiledArray/conversions/sparse_to_dense.h
TiledArray/conversions/block_cyclic.h
TiledArray/conversions/to_new_tile_type.h
TiledArray/conversions/truncate.h
TiledArray/conversions/retile.h
Expand Down Expand Up @@ -120,7 +116,6 @@ TiledArray/expressions/unary_expr.h
TiledArray/expressions/index_list.h
TiledArray/external/btas.h
TiledArray/math/blas.h
TiledArray/math/eigen.h
TiledArray/math/gemm_helper.h
TiledArray/math/outer.h
TiledArray/math/parallel_gemm.h
Expand Down Expand Up @@ -180,26 +175,30 @@ TiledArray/util/random.h
TiledArray/util/singleton.h
TiledArray/util/time.h
TiledArray/util/vector.h

TiledArray/math/linalg/rank-local.h
TiledArray/math/linalg/rank-local.cpp

)

if(CUDA_FOUND)

list(APPEND TILEDARRAY_HEADER_FILES
TiledArray/external/cuda.h
TiledArray/external/cutt.h
TiledArray/math/cublas.h
TiledArray/cuda/btas_cublas.h
TiledArray/cuda/btas_um_tensor.h
TiledArray/cuda/cpu_cuda_vector.h
TiledArray/cuda/cuda_task_fn.h
TiledArray/cuda/kernel/mult_kernel.h
TiledArray/cuda/kernel/mult_kernel_impl.h
TiledArray/cuda/kernel/reduce_kernel.h
TiledArray/cuda/kernel/reduce_kernel_impl.h
TiledArray/cuda/platform.h
TiledArray/cuda/thrust.h
TiledArray/cuda/um_allocator.h
TiledArray/cuda/um_storage.h)
TiledArray/cuda/cublas.h
TiledArray/cuda/btas_cublas.h
TiledArray/cuda/btas_um_tensor.h
TiledArray/cuda/cpu_cuda_vector.h
TiledArray/cuda/cuda_task_fn.h
TiledArray/cuda/kernel/mult_kernel.h
TiledArray/cuda/kernel/mult_kernel_impl.h
TiledArray/cuda/kernel/reduce_kernel.h
TiledArray/cuda/kernel/reduce_kernel_impl.h
TiledArray/cuda/platform.h
TiledArray/cuda/thrust.h
TiledArray/cuda/um_allocator.h
TiledArray/cuda/um_storage.h)

endif(CUDA_FOUND)

Expand All @@ -211,7 +210,7 @@ TiledArray/array_impl.cpp
TiledArray/dist_array.cpp
TiledArray/util/backtrace.cpp
TiledArray/util/bug.cpp
TiledArray/algebra/lapack/lapack.cpp
TiledArray/math/linalg/rank-local.cpp
)

# the list of libraries on which TiledArray depends on, will be cached later
Expand Down
Empty file.
Loading