diff --git a/external/eigen.cmake b/external/eigen.cmake index 8a465f6c64..f2d28076dd 100644 --- a/external/eigen.cmake +++ b/external/eigen.cmake @@ -55,7 +55,11 @@ if (TARGET TiledArray_Eigen) foreach(_def ${LAPACK_COMPILE_DEFINITIONS}) list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D${_def}") endforeach() - list(APPEND CMAKE_REQUIRED_FLAGS ${LAPACK_COMPILE_OPTIONS}) + string(GENEX_STRIP "${LAPACK_COMPILE_OPTIONS}" LAPACK_COMPILE_OPTIONS_GENEXFREE) + list(APPEND CMAKE_REQUIRED_FLAGS ${LAPACK_COMPILE_OPTIONS_GENEXFREE}) + if (DEFINED LAPACK_CXX_COMPILE_OPTIONS) + list(APPEND CMAKE_REQUIRED_FLAGS ${LAPACK_CXX_COMPILE_OPTIONS}) + endif() CHECK_CXX_SOURCE_COMPILES(" #include diff --git a/external/versions.cmake b/external/versions.cmake index 450e4216b5..20c1f7ceea 100644 --- a/external/versions.cmake +++ b/external/versions.cmake @@ -1,7 +1,7 @@ # for each dependency track both current and previous id (the variable for the latter must contain PREVIOUS) # to be able to auto-update them -set(TA_TRACKED_VGCMAKEKIT_TAG f946aa274745da09702a727492f1cabb843dc9e6) +set(TA_TRACKED_VGCMAKEKIT_TAG fe6176e5273feba3a3d0f4ec6e50c18b69d79d29) # Boost explicitly downgraded to 1.59 from 1.68 set(TA_TRACKED_BOOST_VERSION 1.59) diff --git a/src/TiledArray/conversions/eigen.h b/src/TiledArray/conversions/eigen.h index 912801fec4..94f5993c34 100644 --- a/src/TiledArray/conversions/eigen.h +++ b/src/TiledArray/conversions/eigen.h @@ -394,8 +394,8 @@ void counted_tensor_to_eigen_submatrix(const T& tensor, /// TiledArray::TiledRange trange(blocks2.begin(), blocks2.end()); /// /// // Create an Array from an Eigen matrix. -/// TiledArray::Array array = -/// eigen_to_array >(world, trange, m); +/// auto array = +/// eigen_to_array >(world, trange, m); /// \endcode /// \tparam A The array type /// \tparam Derived The Eigen matrix derived type @@ -476,7 +476,7 @@ A eigen_to_array(World& world, const typename A::trange_type& trange, /// object. /// Usage: /// \code -/// TiledArray::Array array(world, trange); +/// TA::TSpArrayD array(world, trange); /// // Set tiles of array ... /// /// Eigen::MatrixXd m = array_to_eigen(array); @@ -572,8 +572,8 @@ array_to_eigen(const DistArray& array) { /// TiledArray::TiledRange trange(blocks2.begin(), blocks2.end()); /// /// // Create an Array from an Eigen matrix. -/// TiledArray::Array array = -/// row_major_buffer_to_array >(world, trange, +/// auto array = +/// row_major_buffer_to_array(world, trange, /// buffer, 100, 100); /// /// delete [] buffer; @@ -641,8 +641,8 @@ inline A row_major_buffer_to_array( /// TiledArray::TiledRange trange(blocks2.begin(), blocks2.end()); /// /// // Create an Array from an Eigen matrix. -/// TiledArray::Array array = -/// column_major_buffer_to_array >(world, +/// auto array = +/// column_major_buffer_to_array(world, /// trange, buffer, 100, 100); /// /// delete [] buffer; diff --git a/src/TiledArray/conversions/vector_of_arrays.h b/src/TiledArray/conversions/vector_of_arrays.h index f79606e99f..909f356dd0 100644 --- a/src/TiledArray/conversions/vector_of_arrays.h +++ b/src/TiledArray/conversions/vector_of_arrays.h @@ -21,11 +21,11 @@ namespace detail { /// @param block_size blocking range for the new dimension, the dimension being /// fused /// @return TiledRange of fused Array object -inline TA::TiledRange prepend_dim_to_trange( +inline TiledArray::TiledRange prepend_dim_to_trange( std::size_t array_rank, const TiledArray::TiledRange& array_trange, std::size_t block_size = 1) { /// make the new TiledRange1 for new dimension - TA::TiledRange1 new_trange1; + TiledArray::TiledRange1 new_trange1; { std::vector new_trange1_v; auto range_size = array_rank; @@ -34,15 +34,17 @@ inline TA::TiledRange prepend_dim_to_trange( new_trange1_v.push_back(i); } new_trange1_v.push_back(range_size); - new_trange1 = TA::TiledRange1(new_trange1_v.begin(), new_trange1_v.end()); + new_trange1 = + TiledArray::TiledRange1(new_trange1_v.begin(), new_trange1_v.end()); } /// make the new range for N+1 Array - TA::TiledRange new_trange; + TiledArray::TiledRange new_trange; { auto old_trange1s = array_trange.data(); old_trange1s.insert(old_trange1s.begin(), new_trange1); - new_trange = TA::TiledRange(old_trange1s.begin(), old_trange1s.end()); + new_trange = + TiledArray::TiledRange(old_trange1s.begin(), old_trange1s.end()); } return new_trange; @@ -68,14 +70,15 @@ inline TA::TiledRange prepend_dim_to_trange( /// @return SparseShape of fused Array object /// TODO rename to fuse_tilewise_vector_of_shapes template -TA::SparseShape fuse_tilewise_vector_of_shapes( +TiledArray::SparseShape fuse_tilewise_vector_of_shapes( madness::World& global_world, - const std::vector>& arrays, - const std::size_t array_rank, const TA::TiledRange& fused_trange) { + const std::vector>& + arrays, + const std::size_t array_rank, const TiledArray::TiledRange& fused_trange) { if (arrays.size() == 0) { - TA::Tensor fused_tile_norms(fused_trange.tiles_range(), 0.f); - return TA::SparseShape(global_world, fused_tile_norms, fused_trange, - true); + TiledArray::Tensor fused_tile_norms(fused_trange.tiles_range(), 0.f); + return TiledArray::SparseShape(global_world, fused_tile_norms, + fused_trange, true); } const std::size_t rank = global_world.rank(); auto size = global_world.size(); @@ -95,7 +98,7 @@ TA::SparseShape fuse_tilewise_vector_of_shapes( } } - TA::Tensor fused_tile_norms( + TiledArray::Tensor fused_tile_norms( fused_trange.tiles_range(), 0.f); // use nonzeroes for local tiles only // compute norms of fused tiles @@ -135,8 +138,8 @@ TA::SparseShape fuse_tilewise_vector_of_shapes( } } - auto fused_shapes = TA::SparseShape(global_world, fused_tile_norms, - fused_trange, true); + auto fused_shapes = TiledArray::SparseShape( + global_world, fused_tile_norms, fused_trange, true); return fused_shapes; } @@ -156,11 +159,12 @@ TA::SparseShape fuse_tilewise_vector_of_shapes( /// @param[in] fused_trange the TiledRange of the fused @c arrays /// @return DenseShape of fused Array object template -TA::DenseShape fuse_tilewise_vector_of_shapes( +TiledArray::DenseShape fuse_tilewise_vector_of_shapes( madness::World&, - const std::vector>& arrays, - const std::size_t array_rank, const TA::TiledRange& fused_trange) { - return TA::DenseShape(1, fused_trange); + const std::vector>& + arrays, + const std::size_t array_rank, const TiledArray::TiledRange& fused_trange) { + return TiledArray::DenseShape(1, fused_trange); } /// @brief extracts the shape of a slice of a fused array created with @@ -177,12 +181,13 @@ TA::DenseShape fuse_tilewise_vector_of_shapes( /// fused array /// @return the Shape of the @c i -th subarray // TODO rename to tilewise_slice_of_fused_shape -inline TA::SparseShape tilewise_slice_of_fused_shape( - const TA::TiledRange& split_trange, - const TA::SparsePolicy::shape_type& shape, const std::size_t tile_idx, - const std::size_t split_ntiles, const std::size_t tile_size) { +inline TiledArray::SparseShape tilewise_slice_of_fused_shape( + const TiledArray::TiledRange& split_trange, + const TiledArray::SparsePolicy::shape_type& shape, + const std::size_t tile_idx, const std::size_t split_ntiles, + const std::size_t tile_size) { TA_ASSERT(split_ntiles == split_trange.tiles_range().volume()); - TA::Tensor split_tile_norms(split_trange.tiles_range()); + TiledArray::Tensor split_tile_norms(split_trange.tiles_range()); // map element i to its tile index std::size_t offset = tile_idx * split_ntiles; @@ -197,7 +202,7 @@ inline TA::SparseShape tilewise_slice_of_fused_shape( [tile_size](const float& elem) { return elem * tile_size; }); auto split_shape = - TA::SparseShape(split_tile_norms, split_trange, true); + TiledArray::SparseShape(split_tile_norms, split_trange, true); return split_shape; } @@ -209,11 +214,12 @@ inline TA::SparseShape tilewise_slice_of_fused_shape( /// the index of the corresponding tile of the leading dimension) /// @param[in] split_trange TiledRange of the target subarray objct /// @return the Shape of the @c i -th subarray -inline TA::DenseShape tilewise_slice_of_fused_shape( - const TA::TiledRange& split_trange, - const TA::DensePolicy::shape_type& shape, const std::size_t tile_idx, - const std::size_t split_ntiles, const std::size_t tile_size) { - return TA::DenseShape(tile_size, split_trange); +inline TiledArray::DenseShape tilewise_slice_of_fused_shape( + const TiledArray::TiledRange& split_trange, + const TiledArray::DensePolicy::shape_type& shape, + const std::size_t tile_idx, const std::size_t split_ntiles, + const std::size_t tile_size) { + return TiledArray::DenseShape(tile_size, split_trange); } } // namespace detail @@ -285,21 +291,22 @@ class dist_subarray_vec /// The result will live in @c global_world. /// @sa detail::fuse_tilewise_vector_of_shapes template -TA::DistArray fuse_tilewise_vector_of_arrays( +TiledArray::DistArray fuse_tilewise_vector_of_arrays( madness::World& global_world, - const std::vector>& array_vec, + const std::vector>& array_vec, const std::size_t fused_dim_extent, - const TiledArray::TiledRange& array_trange, std::size_t target_block_size = 1) { + const TiledArray::TiledRange& array_trange, + std::size_t target_block_size = 1) { auto nproc = global_world.size(); // make instances of array_vec globally accessible - using Array = TA::DistArray; + using Array = TiledArray::DistArray; detail::dist_subarray_vec arrays(global_world, array_vec, fused_dim_extent); - std::size_t nblocks = - (fused_dim_extent + target_block_size - 1) / target_block_size; - std::size_t block_size = (fused_dim_extent + nblocks - 1) / nblocks; + std::size_t nblocks = + (fused_dim_extent + target_block_size - 1) / target_block_size; + std::size_t block_size = (fused_dim_extent + nblocks - 1) / nblocks; // make fused tiledrange auto fused_trange = detail::prepend_dim_to_trange(fused_dim_extent, array_trange, block_size); @@ -310,11 +317,11 @@ TA::DistArray fuse_tilewise_vector_of_arrays( global_world, arrays.array_accessor(), fused_dim_extent, fused_trange); // make fused array - TA::DistArray fused_array(global_world, fused_trange, - fused_shape); + TiledArray::DistArray fused_array(global_world, fused_trange, + fused_shape); /// copy the data from a sequence of tiles - auto make_tile = [](const TA::Range& range, + auto make_tile = [](const TiledArray::Range& range, const std::vector>& tiles) { TA_ASSERT(range.extent(0) == tiles.size()); Tile result(range); @@ -392,10 +399,11 @@ TA::DistArray fuse_tilewise_vector_of_arrays( /// @sa detail::tilewise_slice_of_fused_shape template void split_tilewise_fused_array( - madness::World& local_world, const TA::DistArray& fused_array, + madness::World& local_world, + const TiledArray::DistArray& fused_array, std::size_t tile_idx, - std::vector>& split_arrays, - const TA::TiledRange& split_trange) { + std::vector>& split_arrays, + const TiledArray::TiledRange& split_trange) { TA_ASSERT(tile_idx < fused_array.trange().dim(0).extent()); auto arrays_size = split_arrays.size(); @@ -410,13 +418,13 @@ void split_tilewise_fused_array( auto split_shape = detail::tilewise_slice_of_fused_shape( split_trange, shape, tile_idx, split_ntiles, tile_size); // create split Array object - TA::DistArray split_array(local_world, split_trange, - split_shape); + TiledArray::DistArray split_array(local_world, split_trange, + split_shape); split_arrays.push_back(split_array); } /// copy the data from tile - auto make_tile = [](const TA::Range& range, const Tile& fused_tile, + auto make_tile = [](const TiledArray::Range& range, const Tile& fused_tile, const size_t i_offset_in_tile) { const auto split_tile_volume = range.volume(); return Tile(range, diff --git a/src/TiledArray/dist_array.h b/src/TiledArray/dist_array.h index b60aff3736..76fa88409d 100644 --- a/src/TiledArray/dist_array.h +++ b/src/TiledArray/dist_array.h @@ -209,23 +209,28 @@ class DistArray : public madness::archive::ParallelSerializableObject { } else { // Validate the process map TA_ASSERT(pmap->size() == trange.tiles_range().volume() && - "Array::Array() -- The size of the process map is not " + "TiledArray::DistArray::DistArray() -- The size of the process " + "map is not " "equal to the number of tiles in the TiledRange object."); - TA_ASSERT( - pmap->rank() == typename pmap_interface::size_type(world.rank()) && - "Array::Array() -- The rank of the process map is not equal to that " - "of the world object."); - TA_ASSERT( - pmap->procs() == typename pmap_interface::size_type(world.size()) && - "Array::Array() -- The number of processes in the process map is not " - "equal to that of the world object."); + TA_ASSERT(pmap->rank() == + typename pmap_interface::size_type(world.rank()) && + "TiledArray::DistArray::DistArray() -- The rank of the process " + "map is not equal to that " + "of the world object."); + TA_ASSERT(pmap->procs() == + typename pmap_interface::size_type(world.size()) && + "TiledArray::DistArray::DistArray() -- The number of processes " + "in the process map is not " + "equal to that of the world object."); } // Validate the shape - TA_ASSERT(!shape.empty() && - "Array::Array() -- The shape is not initialized."); + TA_ASSERT( + !shape.empty() && + "TiledArray::DistArray::DistArray() -- The shape is not initialized."); TA_ASSERT(shape.validate(trange.tiles_range()) && - "Array::Array() -- The range of the shape is not equal to " + "TiledArray::DistArray::DistArray() -- The range of the shape is " + "not equal to " "the tiles range."); return std::shared_ptr(new impl_type(world, trange, shape, pmap), diff --git a/src/TiledArray/dist_eval/array_eval.h b/src/TiledArray/dist_eval/array_eval.h index d0398d8a9c..c1cab37079 100644 --- a/src/TiledArray/dist_eval/array_eval.h +++ b/src/TiledArray/dist_eval/array_eval.h @@ -55,9 +55,9 @@ class LazyArrayTile { using eval_t = typename eval_trait::type>::type; public: - using conversion_result_type = decltype( - ((!Op::is_consumable) && consume_ ? op_->consume(tile_) - : (*op_)(tile_))); ///< conversion_type + using conversion_result_type = decltype(( + (!Op::is_consumable) && consume_ ? op_->consume(tile_) + : (*op_)(tile_))); ///< conversion_type #ifdef TILEDARRAY_HAS_CUDA // TODO need a better design on how to manage the lifetime of converted Tile @@ -155,13 +155,13 @@ class LazyArrayTile { }; // LazyArrayTile -/// Distributed evaluator for \c TiledArray::Array objects +/// Distributed evaluator for \c TiledArray::DistArray objects /// This distributed evaluator applies modifications to Array that will be /// used as input to other distributed evaluators. Common operations that /// may be applied to array objects are scaling, permutation, and lazy tile /// evaluation. It also serves as an abstraction layer between -/// \c TiledArray::Array objects and internal evaluation of expressions. The +/// \c TiledArray::DistArray objects and internal evaluation of expressions. The /// main purpose of this evaluator is to do a lazy evaluation of input tiles /// so that the resulting data is only evaluated when the tile is needed by /// subsequent operations. diff --git a/src/TiledArray/expressions/tsr_expr.h b/src/TiledArray/expressions/tsr_expr.h index cd1a29fd4f..9a2e533f66 100644 --- a/src/TiledArray/expressions/tsr_expr.h +++ b/src/TiledArray/expressions/tsr_expr.h @@ -69,7 +69,7 @@ struct ExprTrait>; // <----- This should never /// Expression wrapper for array objects -/// \tparam Array The \c TiledArray::Array type +/// \tparam Array The \c TiledArray::DistArray type /// \tparam Alias If true, the array tiles should be evaluated as /// temporaries before assignment; if false, can reuse the result tiles template @@ -304,7 +304,7 @@ class TsrExpr : public Expr> { /// Expression wrapper for const array objects -/// \tparam A The \c TiledArray::Array type +/// \tparam A The \c TiledArray::DistArray type template class TsrExpr : public Expr> { public: diff --git a/src/TiledArray/fwd.h b/src/TiledArray/fwd.h index 6f2cd33701..94ef77ebda 100644 --- a/src/TiledArray/fwd.h +++ b/src/TiledArray/fwd.h @@ -139,7 +139,9 @@ typedef TSpArray> TSpArrayC; // DistArray is rank-polymorphic template , typename Policy = DensePolicy> -using Array = DistArray; +using Array + [[deprecated("use TiledArray::DistArray or TiledArray::TArray")]] = + DistArray; } // namespace TiledArray