diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52691d237e..bdae9bc3ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,8 +11,9 @@ variables: OMPI_MCA_btl_vader_single_copy_mechanism: none before_script: - #- apt-get install -yq ... - - echo 'localhost slots=8' > /etc/openmpi/openmpi-default-hostfile + - echo 'localhost slots=8' > /etc/openmpi/openmpi-default-hostfile + - apt-get install -yq intel-mkl-core-c-2020.4-304 + - ln -s /opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/ /opt/intel/ build: stage: build @@ -20,11 +21,17 @@ build: image: valeevgroup/${IMAGE} variables: CXX: ${CXX} + TA_PYTHON : "TA_PYTHON=OFF" + ENABLE_MKL : "ENABLE_MKL=OFF" + ENABLE_SCALAPACK : "ENABLE_SCALAPACK=OFF" script: - mkdir build - cd build - - cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/gitlab-ci.cmake + - cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/gitlab-ci.cmake + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -D${TA_PYTHON} + -D${ENABLE_MKL} + -D${ENABLE_SCALAPACK} - make tiledarray - make examples - make ta_test @@ -33,7 +40,14 @@ build: matrix: - CXX: [ g++ ] IMAGE : [ "ubuntu:20.04" ] + BUILD_TYPE : [ "Release", "Debug" ] + ENABLE_MKL : [ "ENABLE_MKL=ON", "ENABLE_MKL=OFF" ] + ENABLE_SCALAPACK : [ "ENABLE_SCALAPACK=ON", "ENABLE_SCALAPACK=OFF" ] + - CXX: [ g++ ] + IMAGE : [ "ubuntu:20.04" ] + BUILD_TYPE : [ "Release", "Debug" ] TA_PYTHON : [ "TA_PYTHON=ON" ] - CXX: [ clang++-9 ] IMAGE : [ "ubuntu:20.04" ] - TA_PYTHON : [ "TA_PYTHON=OFF" ] + BUILD_TYPE : [ "Release", "Debug" ] + ENABLE_MKL : [ "ENABLE_MKL=ON", "ENABLE_MKL=OFF" ] diff --git a/cmake/gitlab-ci.cmake b/cmake/gitlab-ci.cmake index e73ca8dec7..bf0e0d0d31 100644 --- a/cmake/gitlab-ci.cmake +++ b/cmake/gitlab-ci.cmake @@ -1,5 +1,4 @@ set(TA_BUILD_UNITTEST TRUE) -set(ENABLE_SCALAPACK ON) set(blacs_LIBRARIES "scalapack-openmpi") set(scalapack_LIBRARIES "scalapack-openmpi") set(lapack_LIBRARIES "lapack") diff --git a/external/eigen.cmake b/external/eigen.cmake index f7499711c1..49d4b91b9e 100644 --- a/external/eigen.cmake +++ b/external/eigen.cmake @@ -151,11 +151,10 @@ if (TARGET TiledArray_Eigen) target_compile_definitions(TiledArray_Eigen INTERFACE ${LAPACK_COMPILE_DEFINITIONS}) target_compile_options(TiledArray_Eigen INTERFACE ${LAPACK_COMPILE_OPTIONS}) set(TiledArray_Eigen_VERSION "${Eigen3_VERSION}" CACHE STRING "Eigen3_VERSION of the library interfaced by TiledArray_Eigen target") + # Eigen's prototypes for BLAS interface libraries do not match MADNESS cblas if (MADNESS_HAS_MKL) - target_compile_definitions(TiledArray_Eigen INTERFACE EIGEN_USE_MKL_ALL) + # target_compile_definitions(TiledArray_Eigen INTERFACE EIGEN_USE_MKL EIGEN_USE_BLAS) 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 # target_compile_definitions(TiledArray_Eigen INTERFACE EIGEN_USE_BLAS) endif(MADNESS_HAS_MKL) install(TARGETS TiledArray_Eigen EXPORT tiledarray COMPONENT tiledarray) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e8d7b01da..92ce5f841b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -123,6 +123,7 @@ TiledArray/math/partial_reduce.h TiledArray/math/transpose.h TiledArray/math/vector_op.h TiledArray/math/scalapack.h +TiledArray/math/linalg/rank-local.h TiledArray/pmap/blocked_pmap.h TiledArray/pmap/cyclic_pmap.h TiledArray/pmap/hash_pmap.h @@ -176,9 +177,6 @@ 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) @@ -203,6 +201,7 @@ if(CUDA_FOUND) endif(CUDA_FOUND) set(TILEDARRAY_SOURCE_FILES +TiledArray/tiledarray.cpp TiledArray/tensor/tensor.cpp TiledArray/sparse_shape.cpp TiledArray/tensor_impl.cpp diff --git a/src/TiledArray/external/eigen.h b/src/TiledArray/external/eigen.h index 8bf9dc031c..bcde7a649a 100644 --- a/src/TiledArray/external/eigen.h +++ b/src/TiledArray/external/eigen.h @@ -37,27 +37,6 @@ TILEDARRAY_PRAGMA_GCC(diagnostic push) TILEDARRAY_PRAGMA_GCC(system_header) -//////////////////////////////////////////////// -// this duplicates TiledArray_Eigen definitions -#if HAVE_INTEL_MKL -#ifndef EIGEN_USE_MKL // strangely, defining EIGEN_USE_MKL_ALL does not imply - // EIGEN_USE_MKL -#define EIGEN_USE_MKL 1 -#endif -#ifndef EIGEN_USE_MKL_ALL -#define EIGEN_USE_MKL_ALL 1 -#endif -#else -//# ifndef EIGEN_USE_BLAS -//# define EIGEN_USE_BLAS 1 -//# endif -#endif // HAVE_INTEL_MKL - -///////////////////////////////////////////////// -// define lapacke types to prevent inclusion of complex.h by -// Eigen/src/misc/lapacke.h -#include - // If EIGEN_USE_LAPACKE_STRICT is defined, Eigen doesn't check if // EIGEN_USE_LAPACKE is defined before setting it, leading to a warning when it // is already set, so we unset here to avoid that warning @@ -70,9 +49,9 @@ TILEDARRAY_PRAGMA_GCC(system_header) #if defined(EIGEN_USE_LAPACKE) || defined(EIGEN_USE_LAPACKE_STRICT) #if !EIGEN_VERSION_AT_LEAST(3, 3, 7) #error "Eigen3 < 3.3.7 with LAPACKE enabled may give wrong eigenvalue results" -#error "Either turn off TILEDARRAY_EIGEN_USE_LAPACKE or use Eigen3 3.3.7" -#endif +#error "Either turn off EIGEN_USE_LAPACKE/EIGEN_USE_LAPACKE_STRICT or use Eigen3 3.3.7" #endif +#endif // EIGEN_USE_LAPACKE || EIGEN_USE_LAPACKE_STRICT TILEDARRAY_PRAGMA_GCC(diagnostic pop) diff --git a/src/TiledArray/initialize.h b/src/TiledArray/initialize.h index f1392aa21f..0f0b288d93 100644 --- a/src/TiledArray/initialize.h +++ b/src/TiledArray/initialize.h @@ -6,68 +6,16 @@ #define TILEDARRAY_INITIALIZE_H__INCLUDED #include - #include -#ifdef TILEDARRAY_HAS_CUDA -#include -#include -#include -#endif -#ifdef HAVE_INTEL_MKL -#include -#endif namespace TiledArray { -#ifdef TILEDARRAY_HAS_CUDA -/// initialize cuda environment -inline void cuda_initialize() { - /// initialize cudaGlobal - cudaEnv::instance(); - // - cuBLASHandlePool::handle(); - // initialize cuTT - cuttInitialize(); -} - -/// finalize cuda environment -inline void cuda_finalize() { - CudaSafeCall(cudaDeviceSynchronize()); - cuttFinalize(); - cublasDestroy(cuBLASHandlePool::handle()); - delete &cuBLASHandlePool::handle(); - cudaEnv::instance().reset(nullptr); -} -#endif - -namespace detail { -inline bool& initialized_madworld_accessor() { - static bool flag = false; - return flag; -} -inline bool initialized_madworld() { return initialized_madworld_accessor(); } -inline bool& initialized_accessor() { - static bool flag = false; - return flag; -} -inline bool& finalized_accessor() { - static bool flag = false; - return flag; -} -#ifdef HAVE_INTEL_MKL -inline int& mklnumthreads_accessor() { - static int value = -1; - return value; -} -#endif -} // namespace detail - /// @return true if TiledArray (and, necessarily, MADWorld runtime) is in an /// initialized state -inline bool initialized() { return detail::initialized_accessor(); } +bool initialized(); /// @return true if TiledArray has been finalized at least once -inline bool finalized() { return detail::finalized_accessor(); } +bool finalized(); /// @name TiledArray initialization. /// These functions initialize TiledArray and (if needed) MADWorld @@ -81,40 +29,11 @@ inline bool finalized() { return detail::finalized_accessor(); } /// @throw TiledArray::Exception if TiledArray initialized MADWorld and /// TiledArray::finalize() had been called -inline World& initialize(int& argc, char**& argv, - const SafeMPI::Intracomm& comm, bool quiet = true) { - if (detail::initialized_madworld() && finalized()) - throw Exception( - "TiledArray finalized MADWorld already, cannot re-initialize MADWorld " - "again"); - if (!initialized()) { - if (!madness::initialized()) - detail::initialized_madworld_accessor() = true; - else { // if MADWorld initialized, we must assume that comm is its default - // World. - if (madness::World::is_default(comm)) - throw Exception( - "MADWorld initialized before TiledArray::initialize(argc, argv, " - "comm), but not initialized with comm"); - } - auto& default_world = detail::initialized_madworld() - ? madness::initialize(argc, argv, comm, quiet) - : *madness::World::find_instance(comm); - TiledArray::set_default_world(default_world); -#ifdef TILEDARRAY_HAS_CUDA - TiledArray::cuda_initialize(); -#endif -#ifdef HAVE_INTEL_MKL - // record number of MKL threads and set to 1 - detail::mklnumthreads_accessor() = mkl_get_max_threads(); - mkl_set_num_threads(1); -#endif - madness::print_meminfo_disable(); - detail::initialized_accessor() = true; - return default_world; - } else - throw Exception("TiledArray already initialized"); -} +World& initialize( + int& argc, char**& argv, + const SafeMPI::Intracomm& comm, + bool quiet = true +); inline World& initialize(int& argc, char**& argv, bool quiet = true) { return TiledArray::initialize(argc, argv, SafeMPI::COMM_WORLD, quiet); @@ -129,23 +48,7 @@ inline World& initialize(int& argc, char**& argv, const MPI_Comm& comm, /// Finalizes TiledArray (and MADWorld runtime, if it had not been initialized /// when TiledArray::initialize was called). -inline void finalize() { -#ifdef HAVE_INTEL_MKL - // reset number of MKL threads - mkl_set_num_threads(detail::mklnumthreads_accessor()); -#endif -#ifdef TILEDARRAY_HAS_CUDA - TiledArray::cuda_finalize(); -#endif - TiledArray::get_default_world() - .gop.fence(); // TODO remove when madness::finalize() fences - if (detail::initialized_madworld()) { - madness::finalize(); - } - TiledArray::reset_default_world(); - detail::initialized_accessor() = false; - detail::finalized_accessor() = true; -} +void finalize(); } // namespace TiledArray diff --git a/src/TiledArray/math/lapack.h b/src/TiledArray/math/lapack.h new file mode 100644 index 0000000000..38b2cb10d0 --- /dev/null +++ b/src/TiledArray/math/lapack.h @@ -0,0 +1,43 @@ +#ifndef TILEDARRAY_MATH_LAPACK_H__INCLUDED +#define TILEDARRAY_MATH_LAPACK_H__INCLUDED + +#include + +#if defined(BTAS_HAS_INTEL_MKL) + +#include +#include // lapack_int + +#elif defined(BTAS_HAS_LAPACKE) + + // see https://github.com/xianyi/OpenBLAS/issues/1992 why this is needed to prevent lapacke.h #define'ing I +# include +# ifndef lapack_complex_float +# define lapack_complex_float std::complex +# else // lapack_complex_float + static_assert(sizeof(std::complex)==sizeof(lapack_complex_float), "sizes of lapack_complex_float and std::complex do not match"); +# endif // lapack_complex_float +# ifndef lapack_complex_double +# define lapack_complex_double std::complex +# else // lapack_complex_double + static_assert(sizeof(std::complex)==sizeof(lapack_complex_double), "sizes of lapack_complex_double and std::complex do not match"); +# endif // lapack_complex_double + +#if defined(BTAS_LAPACKE_HEADER) +#include BTAS_LAPACKE_HEADER +#else +#include +#endif + +#elif defined(__APPLE__) + +#include +using lapack_int = __CLPK_integer; + +#else + +#error "Could not find Lapack/e" + +#endif + +#endif // TILEDARRAY_MATH_LAPACK_H__INCLUDED diff --git a/src/TiledArray/math/linalg/rank-local.cpp b/src/TiledArray/math/linalg/rank-local.cpp index 48f286eb92..752f6d3929 100644 --- a/src/TiledArray/math/linalg/rank-local.cpp +++ b/src/TiledArray/math/linalg/rank-local.cpp @@ -23,26 +23,33 @@ */ #include +#include + +template +inline int ta_lapack_call(F f, Args ... args) { + lapack_int info; + auto ptr = [](auto &&a) { + using T = std::remove_reference_t; + if constexpr (std::is_pointer_v) return a; + else return &a; + }; + f(ptr(args)..., &info); + return info; +} -#include - -#define TA_LAPACKE_THROW(F) throw std::runtime_error("lapacke::" #F " failed") +#define TA_LAPACK_ERROR(F) throw std::runtime_error("lapack::" #F " failed") -#define TA_LAPACKE_CALL(F, ARGS...) \ - (LAPACKE_##F(LAPACK_COL_MAJOR, ARGS) == 0 || (TA_LAPACKE_THROW(F), false)) +#define TA_LAPACK_CALL(F, ARGS...) \ + ((ta_lapack_call(F##_, ARGS) == 0) || (TA_LAPACK_ERROR(F), 0)) -/// TA_LAPACKE(fn,args) can be called only from template context, with `T` +/// TA_LAPACK(fn,args) can be called only from template context, with `T` /// defining the element type -#define TA_LAPACKE(name, args...) { \ +#define TA_LAPACK(name, args...) { \ using numeric_type = T; \ if constexpr (std::is_same_v) \ - TA_LAPACKE_CALL(d##name, args); \ + TA_LAPACK_CALL(d##name, args); \ else if constexpr (std::is_same_v) \ - TA_LAPACKE_CALL(s##name, args); \ - else if constexpr (std::is_same_v>) \ - TA_LAPACKE_CALL(z##name, args); \ - else if constexpr (std::is_same_v>) \ - TA_LAPACKE_CALL(c##name, args); \ + TA_LAPACK_CALL(s##name, args); \ else std::abort(); \ } @@ -54,7 +61,7 @@ void cholesky(Matrix& A) { lapack_int n = A.rows(); auto* a = A.data(); lapack_int lda = n; - TA_LAPACKE(potrf, uplo, n, a, lda); + TA_LAPACK(potrf, uplo, n, a, lda); } template @@ -64,7 +71,7 @@ void cholesky_linv(Matrix& A) { lapack_int n = A.rows(); auto* l = A.data(); lapack_int lda = n; - TA_LAPACKE(trtri, uplo, diag, n, l, lda); + TA_LAPACK(trtri, uplo, diag, n, l, lda); } template @@ -76,7 +83,7 @@ void cholesky_solve(Matrix& A, Matrix& X) { auto* b = X.data(); lapack_int lda = n; lapack_int ldb = n; - TA_LAPACKE(posv, uplo, n, nrhs, a, lda, b, ldb); + TA_LAPACK(posv, uplo, n, nrhs, a, lda, b, ldb); } template @@ -92,7 +99,7 @@ void cholesky_lsolve(TransposeFlag transpose, Matrix& A, Matrix& X) { auto* b = X.data(); lapack_int lda = n; lapack_int ldb = n; - TA_LAPACKE(trtrs, uplo, trans, diag, n, nrhs, a, lda, b, ldb); + TA_LAPACK(trtrs, uplo, trans, diag, n, nrhs, a, lda, b, ldb); } template @@ -106,10 +113,10 @@ void heig(Matrix& A, std::vector& W) { T* w = W.data(); lapack_int lwork = -1; std::vector work(1); - TA_LAPACKE(syev_work, jobz, uplo, n, a, lda, w, work.data(), lwork); + TA_LAPACK(syev, jobz, uplo, n, a, lda, w, work.data(), lwork); lwork = lapack_int(work[0]); work.resize(lwork); - TA_LAPACKE(syev_work, jobz, uplo, n, a, lda, w, work.data(), lwork); + TA_LAPACK(syev, jobz, uplo, n, a, lda, w, work.data(), lwork); } template @@ -126,10 +133,10 @@ void heig(Matrix& A, Matrix& B, std::vector& W) { T* w = W.data(); std::vector work(1); lapack_int lwork = -1; - TA_LAPACKE(sygv_work, itype, jobz, uplo, n, a, lda, b, ldb, w, work.data(), lwork); + TA_LAPACK(sygv, itype, jobz, uplo, n, a, lda, b, ldb, w, work.data(), lwork); lwork = lapack_int(work[0]); work.resize(lwork); - TA_LAPACKE(sygv_work, itype, jobz, uplo, n, a, lda, b, ldb, w, work.data(), lwork); + TA_LAPACK(sygv, itype, jobz, uplo, n, a, lda, b, ldb, w, work.data(), lwork); } template @@ -165,11 +172,11 @@ void svd(Matrix& A, std::vector& S, Matrix* U, Matrix* VT) { std::vector work(1); lapack_int lwork = -1; - TA_LAPACKE(gesvd_work, jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, + TA_LAPACK(gesvd, jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work.data(), lwork); lwork = lapack_int(work[0]); work.resize(lwork); - TA_LAPACKE(gesvd_work, jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, + TA_LAPACK(gesvd, jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work.data(), lwork); } @@ -183,7 +190,7 @@ void lu_solve(Matrix& A, Matrix& B) { T* b = B.data(); lapack_int ldb = B.rows(); std::vector ipiv(n); - TA_LAPACKE(gesv, n, nrhs, a, lda, ipiv.data(), b, ldb); + TA_LAPACK(gesv, n, nrhs, a, lda, ipiv.data(), b, ldb); } template @@ -192,13 +199,13 @@ void lu_inv(Matrix& A) { T* a = A.data(); lapack_int lda = A.rows(); std::vector ipiv(n); - TA_LAPACKE(getrf, n, n, a, lda, ipiv.data()); + TA_LAPACK(getrf, n, n, a, lda, ipiv.data()); std::vector work(1); lapack_int lwork = -1; - TA_LAPACKE(getri_work, n, a, lda, ipiv.data(), work.data(), lwork); + TA_LAPACK(getri, n, a, lda, ipiv.data(), work.data(), lwork); lwork = (lapack_int)work[0]; work.resize(lwork); - TA_LAPACKE(getri_work, n, a, lda, ipiv.data(), work.data(), lwork); + TA_LAPACK(getri, n, a, lda, ipiv.data(), work.data(), lwork); } #define TA_LAPACK_EXPLICIT(MATRIX, VECTOR) \ diff --git a/src/TiledArray/math/linalg/scalapack/block_cyclic.h b/src/TiledArray/math/linalg/scalapack/block_cyclic.h index 55f687f96a..bea4fd5dfa 100644 --- a/src/TiledArray/math/linalg/scalapack/block_cyclic.h +++ b/src/TiledArray/math/linalg/scalapack/block_cyclic.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/src/TiledArray/tiledarray.cpp b/src/TiledArray/tiledarray.cpp new file mode 100644 index 0000000000..bbb6f05533 --- /dev/null +++ b/src/TiledArray/tiledarray.cpp @@ -0,0 +1,136 @@ +#include +#include + +#ifdef TILEDARRAY_HAS_CUDA +#include +#include +#include +#endif + +#ifdef HAVE_INTEL_MKL +#include +#endif + +namespace TiledArray { +namespace { + +#ifdef TILEDARRAY_HAS_CUDA +/// initialize cuda environment +inline void cuda_initialize() { + /// initialize cudaGlobal + cudaEnv::instance(); + // + cuBLASHandlePool::handle(); + // initialize cuTT + cuttInitialize(); +} + +/// finalize cuda environment +inline void cuda_finalize() { + CudaSafeCall(cudaDeviceSynchronize()); + cuttFinalize(); + cublasDestroy(cuBLASHandlePool::handle()); + delete &cuBLASHandlePool::handle(); + cudaEnv::instance().reset(nullptr); +} +#endif + +inline bool& initialized_madworld_accessor() { + static bool flag = false; + return flag; +} +inline bool initialized_madworld() { return initialized_madworld_accessor(); } +inline bool& initialized_accessor() { + static bool flag = false; + return flag; +} +inline bool& finalized_accessor() { + static bool flag = false; + return flag; +} +#ifdef HAVE_INTEL_MKL +inline int& mklnumthreads_accessor() { + static int value = -1; + return value; +} +#endif + +} // namespace detail +} + +/// @return true if TiledArray (and, necessarily, MADWorld runtime) is in an +/// initialized state +bool TiledArray::initialized() { return initialized_accessor(); } + +/// @return true if TiledArray has been finalized at least once +bool TiledArray::finalized() { return finalized_accessor(); } + +/// @name TiledArray initialization. +/// These functions initialize TiledArray and (if needed) MADWorld +/// runtime. +/// @note the default World object is set to the object returned by these. +/// @warning MADWorld can only be initialized/finalized once, hence if +/// TiledArray initializes MADWorld +/// it can also be initialized/finalized only once. + +/// @{ + +/// @throw TiledArray::Exception if TiledArray initialized MADWorld and +/// TiledArray::finalize() had been called +TiledArray::World& TiledArray::initialize( + int& argc, char**& argv, + const SafeMPI::Intracomm& comm, + bool quiet) +{ + if (initialized_madworld() && finalized()) + throw Exception( + "TiledArray finalized MADWorld already, cannot re-initialize MADWorld " + "again"); + if (!initialized()) { + if (!madness::initialized()) + initialized_madworld_accessor() = true; + else { // if MADWorld initialized, we must assume that comm is its default + // World. + if (madness::World::is_default(comm)) + throw Exception( + "MADWorld initialized before TiledArray::initialize(argc, argv, " + "comm), but not initialized with comm"); + } + auto& default_world = initialized_madworld() + ? madness::initialize(argc, argv, comm, quiet) + : *madness::World::find_instance(comm); + TiledArray::set_default_world(default_world); +#ifdef TILEDARRAY_HAS_CUDA + TiledArray::cuda_initialize(); +#endif +#ifdef HAVE_INTEL_MKL + // record number of MKL threads and set to 1 + mklnumthreads_accessor() = mkl_get_max_threads(); + mkl_set_num_threads(1); +#endif + madness::print_meminfo_disable(); + initialized_accessor() = true; + return default_world; + } else + throw Exception("TiledArray already initialized"); +} + +/// Finalizes TiledArray (and MADWorld runtime, if it had not been initialized +/// when TiledArray::initialize was called). +void TiledArray::finalize() { +#ifdef HAVE_INTEL_MKL + // reset number of MKL threads + mkl_set_num_threads(mklnumthreads_accessor()); +#endif +#ifdef TILEDARRAY_HAS_CUDA + TiledArray::cuda_finalize(); +#endif + TiledArray::get_default_world() + .gop.fence(); // TODO remove when madness::finalize() fences + if (initialized_madworld()) { + madness::finalize(); + } + TiledArray::reset_default_world(); + initialized_accessor() = false; + finalized_accessor() = true; +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ed19572691..cb82b27627 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -97,8 +97,8 @@ set(ta_test_src_files ta_test.cpp initializer_list.cpp diagonal_array.cpp retile.cpp - tot_dist_array_part1.cpp - tot_dist_array_part2.cpp + # tot_dist_array_part1.cpp + # tot_dist_array_part2.cpp random.cpp trace.cpp tot_expressions.cpp @@ -108,8 +108,8 @@ set(ta_test_src_files ta_test.cpp s_t_t_contract_.cpp t_t_t_contract_.cpp t_s_t_contract_.cpp - t_tot_tot_contract_.cpp - tot_tot_tot_contract_.cpp + # t_tot_tot_contract_.cpp + # tot_tot_tot_contract_.cpp einsum.cpp linalg.cpp )