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 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](http://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 a3f3dce8c9d81262cf9fd7b29f97fcdafc7372a5 .
- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag ce21aa7723c5c94ecc2e459c22891053eddd5a95 .
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
4 changes: 2 additions & 2 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 a3f3dce8c9d81262cf9fd7b29f97fcdafc7372a5)
set(TA_TRACKED_MADNESS_PREVIOUS_TAG b22ee85059e6ccc9a6e803ba0550652ece8d9df1)
set(TA_TRACKED_MADNESS_TAG ce21aa7723c5c94ecc2e459c22891053eddd5a95)
set(TA_TRACKED_MADNESS_PREVIOUS_TAG 56fbd23b809aa77408201b093ca5593f048d1ec8)
set(TA_TRACKED_MADNESS_VERSION 0.10.1)
set(TA_TRACKED_MADNESS_PREVIOUS_VERSION 0.10.1)

Expand Down
8 changes: 2 additions & 6 deletions src/TiledArray/cuda/cpu_cuda_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <TiledArray/cuda/platform.h>
#include <TiledArray/cuda/thrust.h>

#include <madness/world/archive.h>

namespace TiledArray {

/// \brief a vector that lives on either host or device side, or both
Expand Down Expand Up @@ -204,12 +206,6 @@ const T* device_data(const cpu_cuda_vector<T>& storage) {
namespace madness {
namespace archive {

// forward decls
template <class Archive, typename T>
struct ArchiveLoadImpl;
template <class Archive, typename T>
struct ArchiveStoreImpl;

template <class Archive, typename T>
struct ArchiveLoadImpl<Archive, TiledArray::cpu_cuda_vector<T>> {
static inline void load(const Archive& ar,
Expand Down
4 changes: 1 addition & 3 deletions src/TiledArray/cuda/cuda_task_fn.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct cudaTaskFn : public TaskInterface {

private:
static void CUDART_CB cuda_callback(void* userData) {
TA_ASSERT(!madness::is_madness_thread());
const auto t0 = TiledArray::now();
// convert void * to AsyncTaskInterface*
auto* callback = static_cast<cudaTaskFn_*>(userData);
Expand All @@ -131,9 +132,6 @@ struct cudaTaskFn : public TaskInterface {
// std::string message = "callback on cudaTaskFn: " + address.str() +
// '\n'; std::cout << message;
callback->notify();
// must flush the prebuf (if any) to make sure this cleanup task will be
// actually submitted
ThreadPool::instance()->flush_prebuf();
const auto t1 = TiledArray::now();

TiledArray::detail::cuda_taskfn_callback_duration_ns() +=
Expand Down
8 changes: 2 additions & 6 deletions src/TiledArray/cuda/um_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <TiledArray/cuda/platform.h>
#include <TiledArray/utility.h>

#include <madness/world/archive.h>

namespace TiledArray {

template <typename T>
Expand Down Expand Up @@ -124,12 +126,6 @@ const typename Storage::value_type* device_data(const Storage& storage) {
namespace madness {
namespace archive {

// forward decls
template <class Archive, typename T>
struct ArchiveLoadImpl;
template <class Archive, typename T>
struct ArchiveStoreImpl;

template <class Archive, typename T>
struct ArchiveLoadImpl<Archive, TiledArray::cuda_um_thrust_vector<T>> {
static inline void load(const Archive& ar,
Expand Down
4 changes: 2 additions & 2 deletions src/TiledArray/dist_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ class DistArray : public madness::archive::ParallelSerializableObject {
template <typename Archive,
typename = std::enable_if_t<
!Archive::is_parallel_archive &&
madness::archive::is_output_archive<Archive>::value>>
madness::is_output_archive_v<Archive>>>
void serialize(const Archive& ar) const {
// serialize array type, world size, rank, and pmap type to be able
// to ensure same data type and same data distribution expected
Expand All @@ -1234,7 +1234,7 @@ class DistArray : public madness::archive::ParallelSerializableObject {
template <typename Archive,
typename = std::enable_if_t<
!Archive::is_parallel_archive &&
madness::archive::is_input_archive<Archive>::value>>
madness::is_input_archive_v<Archive>>>
void serialize(const Archive& ar) {
auto& world = TiledArray::get_default_world();

Expand Down
10 changes: 1 addition & 9 deletions src/TiledArray/external/eigen.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include <TiledArray/config.h>
#include <madness/config.h>
#include <madness/world/archive.h>

TILEDARRAY_PRAGMA_GCC(diagnostic push)
TILEDARRAY_PRAGMA_GCC(system_header)
Expand All @@ -58,15 +59,6 @@ TILEDARRAY_PRAGMA_GCC(diagnostic pop)
namespace madness {
namespace archive {

template <class>
class archive_array;
template <class T>
inline archive_array<T> wrap(const T*, unsigned int);
template <class Archive, typename Data>
struct ArchiveStoreImpl;
template <class Archive, typename Data>
struct ArchiveLoadImpl;

template <class Archive, typename Scalar, int RowsAtCompileTime,
int ColsAtCompileTime, int Options, int MaxRowsAtCompileTime,
int MaxColsAtCompileTime>
Expand Down
18 changes: 9 additions & 9 deletions src/TiledArray/math/linalg/scalapack/block_cyclic.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ class BlockCyclicMatrix : public madness::WorldObject<BlockCyclicMatrix<T>> {
auto tile_map = eigen_map(tile);

// Extract distribution information
const auto mb = bc_dist_.mb();
const auto nb = bc_dist_.nb();
const size_t mb = bc_dist_.mb();
const size_t nb = bc_dist_.nb();

const auto m = dims_.first;
const auto n = dims_.second;
decltype(mb) m = dims_.first;
decltype(mb) n = dims_.second;

// Loop over 2D BC compatible blocks
size_t i_extent, j_extent;
Expand All @@ -239,16 +239,16 @@ class BlockCyclicMatrix : public madness::WorldObject<BlockCyclicMatrix<T>> {
for (size_t j = lo[1], j_t = 0ul; j < up[1];
j += j_extent, j_t += j_extent) {
// Determine indices of start of BC owning block
const decltype(m) i_block_begin = (i / mb) * mb;
const decltype(n) j_block_begin = (j / nb) * nb;
decltype(m) i_block_begin = (i / mb) * mb;
decltype(m) j_block_begin = (j / nb) * nb;

// Determine indices of end of BC owning block
const auto i_block_end = std::min(m, i_block_begin + mb);
const auto j_block_end = std::min(n, j_block_begin + nb);

// Cut block if necessacary to adhere to tile dimensions
const auto i_last = std::min(i_block_end, static_cast<size_t>(up[0]));
const auto j_last = std::min(j_block_end, static_cast<size_t>(up[1]));
// Cut block if necessary to adhere to tile dimensions
const auto i_last = std::min(i_block_end, static_cast<decltype(m)>(up[0]));
const auto j_last = std::min(j_block_end, static_cast<decltype(m)>(up[1]));

// Calculate extents of the block to be copied
i_extent = i_last - i;
Expand Down
2 changes: 1 addition & 1 deletion src/TiledArray/permutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ class BipartitePermutation {
template <typename Archive>
void serialize(Archive& ar) {
ar& base_& second_size_;
if constexpr (madness::archive::is_input_archive<Archive>::value) {
if constexpr (madness::is_input_archive_v<Archive>) {
first_ = {};
second_ = {};
}
Expand Down
4 changes: 2 additions & 2 deletions src/TiledArray/range.h
Original file line number Diff line number Diff line change
Expand Up @@ -1123,10 +1123,10 @@ class Range {
// read via madness::archive::wrap to be able to
// - avoid having to serialize datavec_'s size
// - read old archives that represented datavec_ by bare ptr
if constexpr (madness::archive::is_input_archive<Archive>::value) {
if constexpr (madness::is_input_archive_v<Archive>) {
datavec_.resize(four_x_rank);
ar >> madness::archive::wrap(datavec_.data(), four_x_rank);
} else if constexpr (madness::archive::is_output_archive<Archive>::value) {
} else if constexpr (madness::is_output_archive_v<Archive>) {
ar << madness::archive::wrap(datavec_.data(), four_x_rank);
} else
abort(); // unreachable
Expand Down
8 changes: 8 additions & 0 deletions src/TiledArray/reduce_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ class ReduceTask {
#ifdef TILEDARRAY_HAS_CUDA

static void CUDART_CB cuda_reduceobject_delete_callback(void* userData) {
TA_ASSERT(!madness::is_madness_thread());

const auto t0 = TiledArray::now();

std::vector<void*>* objects = static_cast<std::vector<void*>*>(userData);
Expand Down Expand Up @@ -341,6 +343,8 @@ class ReduceTask {
}

static void CUDART_CB cuda_dependency_dec_callback(void* userData) {
TA_ASSERT(!madness::is_madness_thread());

const auto t0 = TiledArray::now();

std::vector<void*>* objects = static_cast<std::vector<void*>*>(userData);
Expand All @@ -363,6 +367,8 @@ class ReduceTask {

static void CUDART_CB
cuda_dependency_dec_reduceobject_delete_callback(void* userData) {
TA_ASSERT(!madness::is_madness_thread());

const auto t0 = TiledArray::now();

std::vector<void*>* objects = static_cast<std::vector<void*>*>(userData);
Expand Down Expand Up @@ -398,6 +404,8 @@ class ReduceTask {
}

static void CUDART_CB cuda_readyresult_reset_callback(void* userData) {
TA_ASSERT(!madness::is_madness_thread());

const auto t0 = TiledArray::now();

std::vector<void*>* objects = static_cast<std::vector<void*>*>(userData);
Expand Down
8 changes: 4 additions & 4 deletions src/TiledArray/sparse_shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -1565,8 +1565,8 @@ class SparseShape {
}

template <typename Archive,
typename std::enable_if<madness::archive::is_input_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_input_archive_v<
Archive>>::type* = nullptr>
void serialize(const Archive& ar) {
ar& tile_norms_;
const unsigned int dim = tile_norms_.range().rank();
Expand All @@ -1578,8 +1578,8 @@ class SparseShape {
}

template <typename Archive,
typename std::enable_if<madness::archive::is_output_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_output_archive_v<
Archive>>::type* = nullptr>
void serialize(const Archive& ar) const {
ar& tile_norms_;
const unsigned int dim = tile_norms_.range().rank();
Expand Down
8 changes: 4 additions & 4 deletions src/TiledArray/tensor/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ class Tensor {
/// \tparam Archive The output archive type
/// \param[out] ar The output archive
template <typename Archive,
typename std::enable_if<madness::archive::is_output_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_output_archive_v<
Archive>>::type* = nullptr>
void serialize(Archive& ar) {
if (pimpl_) {
ar & pimpl_->range_.volume();
Expand All @@ -643,8 +643,8 @@ class Tensor {
/// \tparam Archive The input archive type
/// \param[out] ar The input archive
template <typename Archive,
typename std::enable_if<madness::archive::is_input_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_input_archive_v<
Archive>>::type* = nullptr>
void serialize(Archive& ar) {
ordinal_type n = 0ul;
ar& n;
Expand Down
20 changes: 4 additions & 16 deletions src/TiledArray/tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@
#include <TiledArray/tile_interface/trace.h>
#include <memory>

// Forward declaration of MADNESS archive type traits
namespace madness {
namespace archive {

template <typename>
struct is_output_archive;
template <typename>
struct is_input_archive;

} // namespace archive
} // namespace madness

namespace TiledArray {

/**
Expand Down Expand Up @@ -569,8 +557,8 @@ class Tile {
// Serialization -----------------------------------------------------------

template <typename Archive,
typename std::enable_if<madness::archive::is_output_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_output_archive_v<
Archive>>::type* = nullptr>
void serialize(Archive& ar) const {
// Serialize data for empty tile check
bool empty = !static_cast<bool>(pimpl_);
Expand All @@ -582,8 +570,8 @@ class Tile {
}

template <typename Archive,
typename std::enable_if<madness::archive::is_input_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_input_archive_v<
Archive>>::type* = nullptr>
void serialize(Archive& ar) {
// Check for empty tile
bool empty = false;
Expand Down
8 changes: 4 additions & 4 deletions src/TiledArray/tiled_range.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ class TiledRange {
}

template <typename Archive,
typename std::enable_if<madness::archive::is_input_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_input_archive_v<
Archive>>::type* = nullptr>
void serialize(const Archive& ar) {
ar& range_& elements_range_& ranges_;
}

template <typename Archive,
typename std::enable_if<madness::archive::is_output_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_output_archive_v<
Archive>>::type* = nullptr>
void serialize(const Archive& ar) const {
ar& range_& elements_range_& ranges_;
}
Expand Down
21 changes: 5 additions & 16 deletions src/TiledArray/tiled_range1.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,12 @@
#include <TiledArray/error.h>
#include <TiledArray/type_traits.h>
#include <TiledArray/utility.h>
#include <madness/world/archive.h>
#include <cassert>
#include <initializer_list>
#include <mutex>
#include <vector>

// Forward declaration of MADNESS archive type traits
namespace madness {
namespace archive {

template <typename>
struct is_output_archive;
template <typename>
struct is_input_archive;

} // namespace archive
} // namespace madness

namespace TiledArray {

/// TiledRange1 class defines a non-uniformly-tiled, contiguous, one-dimensional
Expand Down Expand Up @@ -216,15 +205,15 @@ class TiledRange1 {
}

template <typename Archive,
typename std::enable_if<madness::archive::is_input_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_input_archive_v<
Archive>>::type* = nullptr>
void serialize(const Archive& ar) {
ar& range_& elements_range_& tiles_ranges_& elem2tile_;
}

template <typename Archive,
typename std::enable_if<madness::archive::is_output_archive<
Archive>::value>::type* = nullptr>
typename std::enable_if<madness::is_output_archive_v<
Archive>>::type* = nullptr>
void serialize(const Archive& ar) const {
ar& range_& elements_range_& tiles_ranges_& elem2tile_;
}
Expand Down
4 changes: 2 additions & 2 deletions src/TiledArray/val_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class ValArray : private SizeArray<T> {
/// \param[out] ar an Archive object
template <typename Archive,
typename = std::enable_if_t<
madness::archive::is_output_archive<Archive>::value>>
madness::is_output_archive_v<Archive>>>
void serialize(Archive& ar) const {
// need to write size first to be able to init when deserializing
ar& size() & madness::archive::wrap(data(), size());
Expand All @@ -466,7 +466,7 @@ class ValArray : private SizeArray<T> {
/// \param[out] ar an Archive object
template <typename Archive,
typename = std::enable_if_t<
madness::archive::is_input_archive<Archive>::value>>
madness::is_input_archive_v<Archive>>>
void serialize(Archive& ar) {
size_t sz = 0;
ar& sz;
Expand Down
2 changes: 1 addition & 1 deletion tests/cutt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,4 +693,4 @@ BOOST_AUTO_TEST_CASE(cutt_um_tensor_rank_six) {
}

BOOST_AUTO_TEST_SUITE_END()
#endif
#endif // TILEDARRAY_HAS_CUDA
Loading