From 69bc0538f59d72ca1ceceb2bf47556dfbc4701e5 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 26 Oct 2021 08:53:12 -0500 Subject: [PATCH 01/73] feat: add memoryspace template param to Array --- src/axom/core/Array.hpp | 205 +++++++++++++++++------------ src/axom/core/ArrayBase.hpp | 84 +++++++++++- src/axom/core/tests/core_array.hpp | 60 ++++++++- 3 files changed, 255 insertions(+), 94 deletions(-) diff --git a/src/axom/core/Array.hpp b/src/axom/core/Array.hpp index b92edfa727..be2d395ac7 100644 --- a/src/axom/core/Array.hpp +++ b/src/axom/core/Array.hpp @@ -37,7 +37,7 @@ namespace axom // }; // Forward declare the templated classes and operator function(s) -template +template class Array; /*! @@ -81,14 +81,14 @@ class Array; * \see https://en.cppreference.com/w/cpp/named_req * */ -template -class Array : public ArrayBase> +template +class Array : public ArrayBase> { public: static constexpr double DEFAULT_RESIZE_RATIO = 2.0; static constexpr IndexType MIN_DEFAULT_CAPACITY = 32; using value_type = T; - using ArrayIterator = ArrayIteratorBase>; + using ArrayIterator = ArrayIteratorBase>; public: /// \name Native Storage Array Constructors @@ -120,10 +120,20 @@ class Array : public ArrayBase> * \post size() == num_elements * \post getResizeRatio() == DEFAULT_RESIZE_RATIO */ - template ::type* = nullptr> + template ::type* = nullptr> Array(IndexType num_elements, IndexType capacity = 0, - int allocator_id = axom::getDefaultAllocatorID()); + int allocator_id = axom::detail::getAllocatorID()); + + /// \overload + template ::type* = nullptr> + Array(IndexType num_elements, IndexType capacity = 0); /*! * \brief Generic constructor for an Array of arbitrary dimension @@ -145,7 +155,8 @@ class Array : public ArrayBase> * * \param [in] allocator_id the ID of the allocator to use (optional) */ - Array(const Array& other, int allocator_id = axom::getDefaultAllocatorID()); + Array(const Array& other, + int allocator_id = axom::detail::getAllocatorID()); /*! * \brief Move constructor for an Array instance @@ -358,7 +369,7 @@ class Array : public ArrayBase> ArrayIterator insert(ArrayIterator pos, IndexType n, const T& value); // Make the overload "visible" - using ArrayBase>::insert; + using ArrayBase>::insert; /*! * \brief Appends an Array to the end of the calling object @@ -371,7 +382,7 @@ class Array : public ArrayBase> template void append(const ArrayBase& other) { - ArrayBase>::insert(size(), other); + ArrayBase>::insert(size(), other); } /*! @@ -494,7 +505,7 @@ class Array : public ArrayBase> /*! * \brief Exchanges the contents of this Array with the other. */ - void swap(Array& other); + void swap(Array& other); /*! * \brief Get the ratio by which the capacity increases upon dynamic resize. @@ -587,15 +598,16 @@ using MCArray = Array; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -template -Array::Array() : m_allocator_id(axom::getDefaultAllocatorID()) +template +Array::Array() + : m_allocator_id(axom::detail::getAllocatorID()) { } -template +template template -Array::Array(Args... args) - : ArrayBase>(args...) - , m_allocator_id(axom::getDefaultAllocatorID()) +Array::Array(Args... args) + : ArrayBase>(args...) + , m_allocator_id(axom::detail::getAllocatorID()) { static_assert(sizeof...(Args) == DIM, "Array size must match number of dimensions"); @@ -606,32 +618,62 @@ Array::Array(Args... args) } //------------------------------------------------------------------------------ -template -template ::type*> -Array::Array(IndexType num_elements, IndexType capacity, int allocator_id) +template +template ::type*> +Array::Array(IndexType num_elements, + IndexType capacity, + int allocator_id) : m_allocator_id(allocator_id) { initialize(num_elements, capacity); } //------------------------------------------------------------------------------ -template -Array::Array(const Array& other, int allocator_id) - : ArrayBase>( - static_cast>&>(other)) - , m_allocator_id(allocator_id) +template +template ::type*> +Array::Array(IndexType num_elements, IndexType capacity) + : m_allocator_id(axom::detail::getAllocatorID()) +{ + initialize(num_elements, capacity); +} + +//------------------------------------------------------------------------------ +template +Array::Array(const Array& other, int allocator_id) + : ArrayBase>( + static_cast>&>(other)) + , m_allocator_id(SPACE == MemorySpace::Dynamic + ? allocator_id + : axom::detail::getAllocatorID()) { +// We can't template/SFINAE away the allocator_id parameter since this is a copy +// constructor, so we just ignore the allocator ID if the memory space isn't Dynamic. +// We can warn the user that their input is being ignored, though. +#ifdef AXOM_DEBUG + if(SPACE != MemorySpace::Dynamic && + allocator_id != axom::detail::getAllocatorID()) + { + std::cerr << "Incorrect allocator ID was provided for an Array object with " + "explicit memory space\n"; + } +#endif initialize(other.size(), other.capacity()); axom::copy(m_data, other.data(), m_num_elements * sizeof(T)); } //------------------------------------------------------------------------------ -template -Array::Array(Array&& other) - : ArrayBase>( - static_cast>&&>(std::move(other))) +template +Array::Array(Array&& other) + : ArrayBase>( + static_cast>&&>(std::move(other))) , m_resize_ratio(0.0) - , m_allocator_id(axom::getDefaultAllocatorID()) + , m_allocator_id(axom::detail::getAllocatorID()) { m_data = other.m_data; m_num_elements = other.m_num_elements; @@ -646,8 +688,8 @@ Array::Array(Array&& other) } //------------------------------------------------------------------------------ -template -Array::~Array() +template +Array::~Array() { if(m_data != nullptr) { @@ -658,8 +700,8 @@ Array::~Array() } //------------------------------------------------------------------------------ -template -inline void Array::fill(const T& value) +template +inline void Array::fill(const T& value) { for(IndexType i = 0; i < m_num_elements; i++) { @@ -668,8 +710,8 @@ inline void Array::fill(const T& value) } //------------------------------------------------------------------------------ -template -inline void Array::set(const T* elements, IndexType n, IndexType pos) +template +inline void Array::set(const T* elements, IndexType n, IndexType pos) { assert(elements != nullptr); assert(pos >= 0); @@ -682,8 +724,8 @@ inline void Array::set(const T* elements, IndexType n, IndexType pos) } //------------------------------------------------------------------------------ -template -inline void Array::clear() +template +inline void Array::clear() { // This most likely needs to be a call to erase() instead. for(IndexType i = 0; i < m_num_elements; ++i) @@ -695,19 +737,19 @@ inline void Array::clear() } //------------------------------------------------------------------------------ -template +template template ::type*> -inline void Array::insert(IndexType pos, const T& value) +inline void Array::insert(IndexType pos, const T& value) { reserveForInsert(1, pos); m_data[pos] = value; } //------------------------------------------------------------------------------ -template +template template ::type*> -inline typename Array::ArrayIterator Array::insert( - Array::ArrayIterator pos, +inline typename Array::ArrayIterator Array::insert( + Array::ArrayIterator pos, const T& value) { assert(pos >= begin() && pos <= end()); @@ -716,8 +758,8 @@ inline typename Array::ArrayIterator Array::insert( } //------------------------------------------------------------------------------ -template -inline void Array::insert(IndexType pos, IndexType n, const T* values) +template +inline void Array::insert(IndexType pos, IndexType n, const T* values) { assert(values != nullptr); reserveForInsert(n, pos); @@ -728,10 +770,10 @@ inline void Array::insert(IndexType pos, IndexType n, const T* values) } //------------------------------------------------------------------------------ -template +template template ::type*> -inline typename Array::ArrayIterator Array::insert( - Array::ArrayIterator pos, +inline typename Array::ArrayIterator Array::insert( + Array::ArrayIterator pos, IndexType n, const T* values) { @@ -741,9 +783,9 @@ inline typename Array::ArrayIterator Array::insert( } //------------------------------------------------------------------------------ -template +template template ::type*> -inline void Array::insert(IndexType pos, IndexType n, const T& value) +inline void Array::insert(IndexType pos, IndexType n, const T& value) { reserveForInsert(n, pos); for(IndexType i = 0; i < n; ++i) @@ -753,10 +795,10 @@ inline void Array::insert(IndexType pos, IndexType n, const T& value) } //------------------------------------------------------------------------------ -template +template template ::type*> -inline typename Array::ArrayIterator Array::insert( - Array::ArrayIterator pos, +inline typename Array::ArrayIterator Array::insert( + Array::ArrayIterator pos, IndexType n, const T& value) { @@ -766,9 +808,9 @@ inline typename Array::ArrayIterator Array::insert( } //------------------------------------------------------------------------------ -template -inline typename Array::ArrayIterator Array::erase( - Array::ArrayIterator pos) +template +inline typename Array::ArrayIterator Array::erase( + Array::ArrayIterator pos) { assert(pos >= begin() && pos < end()); int counter = 0; @@ -786,10 +828,10 @@ inline typename Array::ArrayIterator Array::erase( } //------------------------------------------------------------------------------ -template -inline typename Array::ArrayIterator Array::erase( - Array::ArrayIterator first, - Array::ArrayIterator last) +template +inline typename Array::ArrayIterator Array::erase( + Array::ArrayIterator first, + Array::ArrayIterator last) { assert(first >= begin() && first < end()); assert(last >= first && last <= end()); @@ -827,19 +869,19 @@ inline typename Array::ArrayIterator Array::erase( } //------------------------------------------------------------------------------ -template +template template -inline void Array::emplace(IndexType pos, Args&&... args) +inline void Array::emplace(IndexType pos, Args&&... args) { reserveForInsert(1, pos); m_data[pos] = std::move(T(std::forward(args)...)); } //------------------------------------------------------------------------------ -template +template template -inline typename Array::ArrayIterator Array::emplace( - Array::ArrayIterator pos, +inline typename Array::ArrayIterator Array::emplace( + Array::ArrayIterator pos, Args&&... args) { assert(pos >= begin() && pos <= end()); @@ -848,9 +890,9 @@ inline typename Array::ArrayIterator Array::emplace( } //------------------------------------------------------------------------------ -template +template template -inline void Array::resize(Args... args) +inline void Array::resize(Args... args) { static_assert(sizeof...(Args) == DIM, "Array size must match number of dimensions"); @@ -859,8 +901,8 @@ inline void Array::resize(Args... args) assert(detail::allNonNegative(tmp_args)); const auto new_num_elements = detail::packProduct(tmp_args); - static_cast>&>(*this) = - ArrayBase> {static_cast(args)...}; + static_cast>&>(*this) = + ArrayBase> {static_cast(args)...}; if(new_num_elements > m_capacity) { @@ -871,10 +913,10 @@ inline void Array::resize(Args... args) } //------------------------------------------------------------------------------ -template -inline void Array::swap(Array& other) +template +inline void Array::swap(Array& other) { - ArrayBase>::swap(other); + ArrayBase>::swap(other); T* temp_data = m_data; IndexType temp_num_elements = m_num_elements; IndexType temp_capacity = m_capacity; @@ -892,8 +934,9 @@ inline void Array::swap(Array& other) } //------------------------------------------------------------------------------ -template -inline void Array::initialize(IndexType num_elements, IndexType capacity) +template +inline void Array::initialize(IndexType num_elements, + IndexType capacity) { assert(num_elements >= 0); @@ -917,8 +960,8 @@ inline void Array::initialize(IndexType num_elements, IndexType capacity } //------------------------------------------------------------------------------ -template -inline T* Array::reserveForInsert(IndexType n, IndexType pos) +template +inline T* Array::reserveForInsert(IndexType n, IndexType pos) { assert(n >= 0); assert(pos >= 0); @@ -947,8 +990,8 @@ inline T* Array::reserveForInsert(IndexType n, IndexType pos) } //------------------------------------------------------------------------------ -template -inline void Array::updateNumElements(IndexType new_num_elements) +template +inline void Array::updateNumElements(IndexType new_num_elements) { assert(new_num_elements >= 0); assert(new_num_elements <= m_capacity); @@ -956,8 +999,8 @@ inline void Array::updateNumElements(IndexType new_num_elements) } //------------------------------------------------------------------------------ -template -inline void Array::setCapacity(IndexType new_capacity) +template +inline void Array::setCapacity(IndexType new_capacity) { assert(new_capacity >= 0); @@ -973,8 +1016,8 @@ inline void Array::setCapacity(IndexType new_capacity) } //------------------------------------------------------------------------------ -template -inline void Array::dynamicRealloc(IndexType new_num_elements) +template +inline void Array::dynamicRealloc(IndexType new_num_elements) { assert(m_resize_ratio >= 1.0); IndexType new_capacity = new_num_elements * m_resize_ratio + 0.5; diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index 0a8edf783d..d629d46524 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -16,8 +16,31 @@ #include // for std::cerr and std::ostream #include // for std::inner_product +#ifdef AXOM_USE_UMPIRE + #include "umpire/resource/MemoryResourceTypes.hpp" +#endif + namespace axom { +/*! + * \brief Memory spaces supported by Array-like types + * + * This abstraction is implemented on top of Umpire's MemoryResourceType enum + * in order to also include a "Dynamic" option as a default template parameter + * for Array-like types + */ +enum class MemorySpace +{ + Dynamic, +#ifdef AXOM_USE_UMPIRE + Host, + Device, + Unified, + Pinned, + Constant +#endif +}; + // Forward declare the templated classes and operator function(s) template class ArrayBase; @@ -366,12 +389,13 @@ template inline std::ostream& print(std::ostream& os, const ArrayBase& array) { -#if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) - // FIXME: Re-add check for umpire::resource::Constant as well, but this will crash - // if there exists no allocator for Constant memory. Is there a more fine-grained - // approach we can use to see what allocators are available before trying to get their IDs? - if(static_cast(array).getAllocatorID() == - axom::getUmpireResourceAllocatorID(umpire::resource::Device)) +#if defined(AXOM_USE_UMPIRE) && defined(UMPIRE_ENABLE_DEVICE) + const int alloc_id = static_cast(array).getAllocatorID(); + if(alloc_id == axom::getUmpireResourceAllocatorID(umpire::resource::Device) + #ifdef UMPIRE_ENABLE_CONST + || alloc_id == axom::getUmpireResourceAllocatorID(umpire::resource::Constant) + #endif + ) { std::cerr << "Cannot print Array allocated on the GPU" << std::endl; utilities::processAbort(); @@ -475,6 +499,54 @@ bool allNonNegative(const T (&arr)[N]) return true; } +template +inline int getAllocatorID(); + +template <> +inline int getAllocatorID() +{ + return axom::getDefaultAllocatorID(); +} + +#ifdef AXOM_USE_UMPIRE + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Host); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Device); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Unified); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Pinned); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Constant); +} + +#endif + } // namespace detail } /* namespace axom */ diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 1bb85ade2a..403f28d95c 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -679,8 +679,8 @@ void check_swap(Array& v) EXPECT_EQ(v_two, v_two_copy); } -template -void check_alloc(Array& v, const int& id) +template +void check_alloc(Array& v, const int id) { // Verify allocation EXPECT_EQ(v.getAllocatorID(), id); @@ -913,18 +913,64 @@ TEST(core_array, checkAlloc) #endif }; - for(int id : memory_locations) + for(double ratio = 1.0; ratio <= 2.0; ratio += 0.5) { - for(double ratio = 1.0; ratio <= 2.0; ratio += 0.5) + for(IndexType capacity = 4; capacity <= 512; capacity *= 2) { - for(IndexType capacity = 4; capacity <= 512; capacity *= 2) + // First use the dynamic option + for(int id : memory_locations) { - Array v_int(capacity, capacity, id); + Array v_int(capacity, capacity, id); internal::check_alloc(v_int, id); - Array v_double(capacity, capacity, id); + Array v_double(capacity, + capacity, + id); internal::check_alloc(v_double, id); } +// Then, if Umpire is available, we can use the space as an explicit template parameter +#ifdef AXOM_USE_UMPIRE + #ifdef UMPIRE_ENABLE_DEVICE + Array v_int_device(capacity); + internal::check_alloc( + v_int_device, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + Array v_double_device(capacity); + internal::check_alloc( + v_double_device, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + #endif + #ifdef UMPIRE_ENABLE_UM + Array v_int_unified(capacity); + internal::check_alloc( + v_int_unified, + axom::getUmpireResourceAllocatorID(umpire::resource::Unified)); + Array v_double_unified(capacity); + internal::check_alloc( + v_double_unified, + axom::getUmpireResourceAllocatorID(umpire::resource::Unified)); + #endif + #ifdef UMPIRE_ENABLE_CONST + Array v_int_const(capacity); + internal::check_alloc( + v_int_const, + axom::getUmpireResourceAllocatorID(umpire::resource::Constant)); + Array v_double_const(capacity); + internal::check_alloc( + v_double_const, + axom::getUmpireResourceAllocatorID(umpire::resource::Constant)); + #endif + #ifdef UMPIRE_ENABLE_PINNED + Array v_int_pinned(capacity); + internal::check_alloc( + v_int_const, + axom::getUmpireResourceAllocatorID(umpire::resource::Pinned)); + Array v_double_pinned(capacity); + internal::check_alloc( + v_double_pinned, + axom::getUmpireResourceAllocatorID(umpire::resource::Pinned)); + #endif +#endif } } } From 0539d423a9e06de84147fa63aa10bfb9be850a89 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 26 Oct 2021 07:05:14 -0700 Subject: [PATCH 02/73] fix: typo in unified memory test, set capacity == size --- src/axom/core/tests/core_array.hpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 403f28d95c..9a9d8e7eac 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -931,41 +931,45 @@ TEST(core_array, checkAlloc) // Then, if Umpire is available, we can use the space as an explicit template parameter #ifdef AXOM_USE_UMPIRE #ifdef UMPIRE_ENABLE_DEVICE - Array v_int_device(capacity); + Array v_int_device(capacity, capacity); internal::check_alloc( v_int_device, axom::getUmpireResourceAllocatorID(umpire::resource::Device)); - Array v_double_device(capacity); + Array v_double_device(capacity, + capacity); internal::check_alloc( v_double_device, axom::getUmpireResourceAllocatorID(umpire::resource::Device)); #endif #ifdef UMPIRE_ENABLE_UM - Array v_int_unified(capacity); + Array v_int_unified(capacity, capacity); internal::check_alloc( v_int_unified, axom::getUmpireResourceAllocatorID(umpire::resource::Unified)); - Array v_double_unified(capacity); + Array v_double_unified(capacity, + capacity); internal::check_alloc( v_double_unified, axom::getUmpireResourceAllocatorID(umpire::resource::Unified)); #endif #ifdef UMPIRE_ENABLE_CONST - Array v_int_const(capacity); + Array v_int_const(capacity, capacity); internal::check_alloc( v_int_const, axom::getUmpireResourceAllocatorID(umpire::resource::Constant)); - Array v_double_const(capacity); + Array v_double_const(capacity, + capacity); internal::check_alloc( v_double_const, axom::getUmpireResourceAllocatorID(umpire::resource::Constant)); #endif #ifdef UMPIRE_ENABLE_PINNED - Array v_int_pinned(capacity); + Array v_int_pinned(capacity, capacity); internal::check_alloc( - v_int_const, + v_int_pinned, axom::getUmpireResourceAllocatorID(umpire::resource::Pinned)); - Array v_double_pinned(capacity); + Array v_double_pinned(capacity, + capacity); internal::check_alloc( v_double_pinned, axom::getUmpireResourceAllocatorID(umpire::resource::Pinned)); From 054dea7f1e79d2e6accb2c5bd0bcc169f38166ee Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 26 Oct 2021 08:13:28 -0700 Subject: [PATCH 03/73] tests: add initial tests of Array on a device --- src/axom/core/Array.hpp | 51 ++++++++++++------ src/axom/core/ArrayBase.hpp | 18 +++++++ src/axom/core/tests/core_array.hpp | 84 ++++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+), 16 deletions(-) diff --git a/src/axom/core/Array.hpp b/src/axom/core/Array.hpp index be2d395ac7..ab990ef03b 100644 --- a/src/axom/core/Array.hpp +++ b/src/axom/core/Array.hpp @@ -20,22 +20,6 @@ namespace axom { -// TODO: Add this as a non-type template parameter to Array/View -// The intent is that there will also be a "Dynamic" or "Polymorphic" -// resource type -// enum MemoryResourceType -// { -// Host, -// Device, -// Unified, -// Pinned, -// Constant, -// File, -// NoOp, -// Shared, -// Unknown -// }; - // Forward declare the templated classes and operator function(s) template class Array; @@ -163,6 +147,25 @@ class Array : public ArrayBase> */ Array(Array&& other); + /*! + * \brief Constructor for transferring between memory spaces + * + * \param [in] other The array in a different memory space to copy from + */ + template + Array(const ArrayBase& other); + + /*! + * \brief Constructor for transferring between memory spaces + * + * \param [in] other The array in a different memory space to copy from + */ + template + Array(const Array& other) + : Array( + static_cast>&>(other)) + { } + /// @} /// \name Array copy and move operators @@ -687,6 +690,22 @@ Array::Array(Array&& other) other.m_allocator_id = INVALID_ALLOCATOR_ID; } +//------------------------------------------------------------------------------ +template +template +Array::Array(const ArrayBase& other) + : ArrayBase>(other) + , m_allocator_id(axom::detail::getAllocatorID()) +{ + initialize(static_cast(other).size(), + static_cast(other).size()); + // axom::copy is aware of pointers registered in Umpire, so this will handle + // the transfer between memory spaces + axom::copy(m_data, + static_cast(other).data(), + m_num_elements * sizeof(T)); +} + //------------------------------------------------------------------------------ template Array::~Array() diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index d629d46524..c8256f92a7 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -117,6 +117,19 @@ class ArrayBase updateStrides(); } + /*! + * \brief Copy constructor for arrays of different type + * Because the element type (T) and dimension (DIM) are still locked down, + * this function is nominally used for copying ArrayBase metadata from + * Array <-> ArrayView and/or Array-like objects whose data are in different + * memory spaces + */ + template + ArrayBase(const ArrayBase& other) + : m_dims(other.m_dims) + , m_strides(other.m_strides) + { } + /*! * \brief Dimension-aware accessor, returns a reference to the given value. * @@ -274,6 +287,11 @@ class ArrayBase public: ArrayBase(IndexType = 0) { } + // Empy implementation because no member data + template + ArrayBase(const ArrayBase&) + { } + /*! * \brief Push a value to the back of the array. * diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 9a9d8e7eac..9a20e511c3 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -733,6 +733,60 @@ void check_external_view(ArrayView& v) EXPECT_EQ(data_ptr, v.data()); } +#ifdef __CUDACC__ + +template +__global__ void assign_raw(T* data, int N) +{ + for(int i = 0; i < N; i++) + { + data[i] = i; + } +} + +// template +// __global__ void assign_view(ArrayView& view) +// { +// for(int i = 0; i < view.size(); i++) +// { +// view[i] = i * 2; +// } +// } + +/*! + * \brief Check that an array can be modified/accessed from device code + * \param [in] v the array to check. + */ +template +void check_device(Array& v) +{ + const IndexType size = v.size(); + // Then assign to it via a raw device pointer + assign_raw<<<1, 1>>>(v.data(), size); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_raw_array_dynamic = v; + EXPECT_EQ(check_raw_array_dynamic.size(), size); + for(int i = 0; i < check_raw_array_dynamic.size(); i++) + { + EXPECT_EQ(check_raw_array_dynamic[i], i); + } + + // Then check the contents by assigning to an explicitly Host array + Array check_raw_array_host = v; + EXPECT_EQ(check_raw_array_host.size(), size); + for(int i = 0; i < check_raw_array_host.size(); i++) + { + EXPECT_EQ(check_raw_array_host[i], i); + } + + // Then modify the underlying data via a view + // assign_view<<<1, 1>>>(v); +} + +#endif // __CUDACC__ + } /* end namespace internal */ //------------------------------------------------------------------------------ @@ -1281,4 +1335,34 @@ TEST(core_array, check_multidimensional_view) } } +//------------------------------------------------------------------------------ +TEST(core_array, checkDevice) +{ +// FIXME: HIP +#if !defined(__CUDACC__) || !defined(AXOM_USE_UMPIRE) || \ + !defined(UMPIRE_ENABLE_DEVICE) + GTEST_SKIP() + << "CUDA is not available, skipping tests that use Array in device code"; +#else + for(IndexType capacity = 2; capacity < 512; capacity *= 2) + { + std::cout << "testing cap " << capacity << std::endl; + // First allocate a Dynamic array in Device memory + Array v_int_dynamic( + capacity, + capacity, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + + internal::check_device(v_int_dynamic); + + Array v_double_dynamic( + capacity, + capacity, + axom::getUmpireResourceAllocatorID(umpire::resource::Device)); + + internal::check_device(v_double_dynamic); + } +#endif +} + } /* end namespace axom */ From e2c6d0cfa0179bf5e6ef004b5cd4be101f738625 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 26 Oct 2021 09:30:28 -0700 Subject: [PATCH 04/73] feat: device-compatible ArrayView --- src/axom/core/Array.hpp | 25 ++++------ src/axom/core/ArrayBase.hpp | 32 ++++++++---- src/axom/core/ArrayView.hpp | 79 +++++++++++++++++++++++++----- src/axom/core/tests/core_array.hpp | 47 +++++++++++++----- 4 files changed, 134 insertions(+), 49 deletions(-) diff --git a/src/axom/core/Array.hpp b/src/axom/core/Array.hpp index ab990ef03b..2598633903 100644 --- a/src/axom/core/Array.hpp +++ b/src/axom/core/Array.hpp @@ -72,6 +72,7 @@ class Array : public ArrayBase> static constexpr double DEFAULT_RESIZE_RATIO = 2.0; static constexpr IndexType MIN_DEFAULT_CAPACITY = 32; using value_type = T; + static constexpr MemorySpace space = SPACE; using ArrayIterator = ArrayIteratorBase>; public: @@ -131,7 +132,9 @@ class Array : public ArrayBase> * \post size() == num_elements * \post getResizeRatio() == DEFAULT_RESIZE_RATIO */ - template + template ::value>::type* = nullptr> Array(Args... args); /*! @@ -155,17 +158,6 @@ class Array : public ArrayBase> template Array(const ArrayBase& other); - /*! - * \brief Constructor for transferring between memory spaces - * - * \param [in] other The array in a different memory space to copy from - */ - template - Array(const Array& other) - : Array( - static_cast>&>(other)) - { } - /// @} /// \name Array copy and move operators @@ -236,8 +228,8 @@ class Array : public ArrayBase> */ /// @{ - inline T* data() { return m_data; } - inline const T* data() const { return m_data; } + AXOM_HOST_DEVICE inline T* data() { return m_data; } + AXOM_HOST_DEVICE inline const T* data() const { return m_data; } /// @} @@ -495,7 +487,7 @@ class Array : public ArrayBase> /*! * \brief Return the number of elements stored in the data array. */ - inline IndexType size() const { return m_num_elements; } + AXOM_HOST_DEVICE inline IndexType size() const { return m_num_elements; } /*! * \brief Update the number of elements stored in the data array. @@ -607,7 +599,8 @@ Array::Array() { } template -template +template ::value>::type*> Array::Array(Args... args) : ArrayBase>(args...) , m_allocator_id(axom::detail::getAllocatorID()) diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index c8256f92a7..f9584c6f17 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -173,13 +173,13 @@ class ArrayBase * \pre 0 <= idx < m_num_elements */ /// @{ - T& operator[](const IndexType idx) + AXOM_HOST_DEVICE T& operator[](const IndexType idx) { assert(inBounds(idx)); return asDerived().data()[idx]; } /// \overload - const T& operator[](const IndexType idx) const + AXOM_HOST_DEVICE const T& operator[](const IndexType idx) const { assert(inBounds(idx)); return asDerived().data()[idx]; @@ -256,9 +256,12 @@ class ArrayBase private: /// \brief Returns a reference to the Derived CRTP object - see https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/ - ArrayType& asDerived() { return static_cast(*this); } + AXOM_HOST_DEVICE ArrayType& asDerived() + { + return static_cast(*this); + } /// \overload - const ArrayType& asDerived() const + AXOM_HOST_DEVICE const ArrayType& asDerived() const { return static_cast(*this); } @@ -267,7 +270,7 @@ class ArrayBase /// @{ /*! \brief Test if idx is within bounds */ - inline bool inBounds(IndexType idx) const + AXOM_HOST_DEVICE inline bool inBounds(IndexType idx) const { return idx >= 0 && idx < asDerived().size(); } @@ -337,13 +340,13 @@ class ArrayBase * \pre 0 <= idx < m_num_elements */ /// @{ - T& operator[](const IndexType idx) + AXOM_HOST_DEVICE T& operator[](const IndexType idx) { assert(inBounds(idx)); return asDerived().data()[idx]; } /// \overload - const T& operator[](const IndexType idx) const + AXOM_HOST_DEVICE const T& operator[](const IndexType idx) const { assert(inBounds(idx)); return asDerived().data()[idx]; @@ -376,9 +379,12 @@ class ArrayBase private: /// \brief Returns a reference to the Derived CRTP object - see https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/ - ArrayType& asDerived() { return static_cast(*this); } + AXOM_HOST_DEVICE ArrayType& asDerived() + { + return static_cast(*this); + } /// \overload - const ArrayType& asDerived() const + AXOM_HOST_DEVICE const ArrayType& asDerived() const { return static_cast(*this); } @@ -387,7 +393,7 @@ class ArrayBase /// @{ /*! \brief Test if idx is within bounds */ - inline bool inBounds(IndexType idx) const + AXOM_HOST_DEVICE inline bool inBounds(IndexType idx) const { return idx >= 0 && idx < asDerived().size(); } @@ -563,6 +569,12 @@ inline int getAllocatorID() umpire::resource::MemoryResourceType::Constant); } +template +struct first_type_is_integral +{ + static constexpr bool value = std::is_integral::value; +}; + #endif } // namespace detail diff --git a/src/axom/core/ArrayView.hpp b/src/axom/core/ArrayView.hpp index 9f709a0d39..9ec85d0b30 100644 --- a/src/axom/core/ArrayView.hpp +++ b/src/axom/core/ArrayView.hpp @@ -13,7 +13,7 @@ namespace axom { // Forward declare the templated classes and operator function(s) -template +template class ArrayView; /// \name ArrayView to wrap a pointer and provide indexing semantics @@ -30,16 +30,17 @@ class ArrayView; * \tparam DIM The dimension of the array. * */ -template -class ArrayView : public ArrayBase> +template +class ArrayView : public ArrayBase> { public: using value_type = T; static constexpr int dimension = DIM; - using ArrayViewIterator = ArrayIteratorBase>; + static constexpr MemorySpace space = SPACE; + using ArrayViewIterator = ArrayIteratorBase>; /// \brief Default constructor - ArrayView() = default; + ArrayView() : m_allocator_id(axom::detail::getAllocatorID()) { } /*! * \brief Generic constructor for an ArrayView of arbitrary dimension with external data @@ -54,10 +55,20 @@ class ArrayView : public ArrayBase> template ArrayView(T* data, Args... args); + /*! + * \brief Constructor for transferring between memory spaces + * + * \param [in] other The array in a different memory space to copy from + * + * \note The parameter is non-const because \a other can be modified through the constructed View + */ + template + ArrayView(ArrayBase& other); + /*! * \brief Return the number of elements stored in the data array. */ - inline IndexType size() const { return m_num_elements; } + inline AXOM_HOST_DEVICE IndexType size() const { return m_num_elements; } /*! * \brief Returns an ArrayViewIterator to the first element of the Array @@ -83,8 +94,8 @@ class ArrayView : public ArrayBase> */ /// @{ - inline T* data() { return m_data; } - inline const T* data() const { return m_data; } + AXOM_HOST_DEVICE inline T* data() { return m_data; } + AXOM_HOST_DEVICE inline const T* data() const { return m_data; } /// @} @@ -93,13 +104,15 @@ class ArrayView : public ArrayBase> * * FIXME: This is just a stand-in impl, extend this class to support wrapping of GPU pointers */ - int getAllocatorID() const { return axom::getDefaultAllocatorID(); } + int getAllocatorID() const { return m_allocator_id; } private: T* m_data = nullptr; /// \brief The full number of elements in the array /// i.e., 3 for a 1D Array of size 3, 9 for a 3x3 2D array, etc IndexType m_num_elements = 0; + /// \brief The allocator ID for the memory space in which m_data was allocated + int m_allocator_id; }; /// \brief Helper alias for multi-component arrays @@ -111,17 +124,59 @@ using MCArrayView = ArrayView; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -template +template template -ArrayView::ArrayView(T* data, Args... args) - : ArrayBase>(args...) +ArrayView::ArrayView(T* data, Args... args) + : ArrayBase>(args...) , m_data(data) + , m_allocator_id(axom::detail::getAllocatorID()) { static_assert(sizeof...(Args) == DIM, "Array size must match number of dimensions"); // Intel hits internal compiler error when casting as part of function call IndexType tmp_args[] = {args...}; m_num_elements = detail::packProduct(tmp_args); + +#ifdef AXOM_USE_UMPIRE + // If we have Umpire, we can try and see what space the pointer is allocated in + // Probably not worth checking this if SPACE != Dynamic, we *could* error out + // if e.g., the user gives a host pointer to ArrayView, but even + // Thrust doesn't guard against this. + + // FIXME: Is it worth trying to get rid of this at compile time? + // (using a workaround since we don't have "if constexpr") + if(SPACE == MemorySpace::Dynamic) + { + auto& rm = umpire::ResourceManager::getInstance(); + if(rm.hasAllocator(data)) + { + auto alloc = rm.getAllocator(data); + m_allocator_id = alloc.getId(); + } + } +#endif +} + +//------------------------------------------------------------------------------ +template +template +ArrayView::ArrayView(ArrayBase& other) + : ArrayBase>(other) + , m_data(static_cast(other).data()) + , m_num_elements(static_cast(other).size()) + , m_allocator_id(static_cast(other).getAllocatorID()) +{ +#ifdef AXOM_DEBUG + // If it's not dynamic, the allocator ID from the argument array has to match the template param. + // If that's not the case then things have gone horribly wrong somewhere. + if(SPACE != MemorySpace::Dynamic && + m_allocator_id != axom::detail::getAllocatorID()) + { + std::cerr << "Input argument allocator does not match the explicitly " + "provided memory space\n"; + utilities::processAbort(); + } +#endif } } /* namespace axom */ diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 9a20e511c3..c0a1bd0b3f 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -744,14 +744,14 @@ __global__ void assign_raw(T* data, int N) } } -// template -// __global__ void assign_view(ArrayView& view) -// { -// for(int i = 0; i < view.size(); i++) -// { -// view[i] = i * 2; -// } -// } +template +__global__ void assign_view(ArrayView& view) +{ + for(int i = 0; i < view.size(); i++) + { + view[i] = i * 2; + } +} /*! * \brief Check that an array can be modified/accessed from device code @@ -782,7 +782,25 @@ void check_device(Array& v) } // Then modify the underlying data via a view - // assign_view<<<1, 1>>>(v); + ArrayView view(v); + assign_view<<<1, 1>>>(view); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_view_array_dynamic = view; + EXPECT_EQ(check_view_array_dynamic.size(), size); + for(int i = 0; i < check_view_array_dynamic.size(); i++) + { + EXPECT_EQ(check_view_array_dynamic[i], i * 2); + } + + // Then check the contents by assigning to an explicitly Host array + Array check_view_array_host = view; + EXPECT_EQ(check_view_array_host.size(), size); + for(int i = 0; i < check_view_array_host.size(); i++) + { + EXPECT_EQ(check_view_array_host[i], i * 2); + } } #endif // __CUDACC__ @@ -1346,8 +1364,7 @@ TEST(core_array, checkDevice) #else for(IndexType capacity = 2; capacity < 512; capacity *= 2) { - std::cout << "testing cap " << capacity << std::endl; - // First allocate a Dynamic array in Device memory + // Allocate a Dynamic array in Device memory Array v_int_dynamic( capacity, capacity, @@ -1361,6 +1378,14 @@ TEST(core_array, checkDevice) axom::getUmpireResourceAllocatorID(umpire::resource::Device)); internal::check_device(v_double_dynamic); + + // Then allocate an explicitly Device array + Array v_int_device(capacity, capacity); + internal::check_device(v_int_device); + + Array v_double_device(capacity, + capacity); + internal::check_device(v_double_device); } #endif } From f84b7da72f9094c1a264939353d2df130f16ba8c Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 26 Oct 2021 09:51:37 -0700 Subject: [PATCH 05/73] fix: move type trait out of ifdef --- src/axom/core/ArrayBase.hpp | 13 +++++++------ src/axom/core/tests/core_array.hpp | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index f9584c6f17..9282da0946 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -523,6 +523,13 @@ bool allNonNegative(const T (&arr)[N]) return true; } +/// \brief Checks if the first type in a parameter pack is integral +template +struct first_type_is_integral +{ + static constexpr bool value = std::is_integral::value; +}; + template inline int getAllocatorID(); @@ -569,12 +576,6 @@ inline int getAllocatorID() umpire::resource::MemoryResourceType::Constant); } -template -struct first_type_is_integral -{ - static constexpr bool value = std::is_integral::value; -}; - #endif } // namespace detail diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index c0a1bd0b3f..30f1b9c31a 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -745,7 +745,7 @@ __global__ void assign_raw(T* data, int N) } template -__global__ void assign_view(ArrayView& view) +__global__ void assign_view(ArrayView view) { for(int i = 0; i < view.size(); i++) { From 4c45008ed0b4db48b18472bcd9276b4ca2889462 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Wed, 27 Oct 2021 10:27:16 -0500 Subject: [PATCH 06/73] fix: try to dodge MSVC compiler bug --- src/axom/core/ArrayBase.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index f122f61dc9..cfd1d49bd2 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -525,13 +525,24 @@ bool allNonNegative(const T (&arr)[N]) return true; } -/// \brief Checks if the first type in a parameter pack is integral +/// \brief Indirection needed to dodge an MSVC compiler bug +template +struct first_type_is_integral_impl : std::false_type +{ }; + template -struct first_type_is_integral +struct first_type_is_integral_impl { static constexpr bool value = std::is_integral::value; }; +/// \brief Checks if the first type in a parameter pack is integral +template +struct first_type_is_integral +{ + static constexpr bool value = first_type_is_integral_impl::value; +}; + template inline int getAllocatorID(); From 6aaf7ad4f5b76618d2246fac918f203a28193f7d Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Wed, 27 Oct 2021 10:20:57 -0700 Subject: [PATCH 07/73] refactor: add support (and tests) for multidimensional indexing on GPU --- src/axom/core/ArrayBase.hpp | 43 ++++++---- src/axom/core/StackArray.hpp | 46 ++++++++++ src/axom/core/tests/core_array.hpp | 130 +++++++++++++++++++++++++++-- 3 files changed, 195 insertions(+), 24 deletions(-) diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index cfd1d49bd2..2a95aa589c 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -10,11 +10,11 @@ #include "axom/core/Macros.hpp" // for axom macros #include "axom/core/utilities/Utilities.hpp" // for processAbort() #include "axom/core/Types.hpp" // for IndexType definition +#include "axom/core/StackArray.hpp" +#include "axom/core/numerics/matvecops.hpp" // for dot_product // C/C++ includes -#include // for std::array #include // for std::cerr and std::ostream -#include // for std::inner_product #ifdef AXOM_USE_UMPIRE #include "umpire/resource/MemoryResourceTypes.hpp" @@ -126,8 +126,8 @@ class ArrayBase */ template ArrayBase(const ArrayBase& other) - : m_dims(other.m_dims) - , m_strides(other.m_strides) + : m_dims(other.shape()) + , m_strides(other.strides()) { } /*! @@ -142,22 +142,20 @@ class ArrayBase */ template ::type> - T& operator()(Args... args) + AXOM_HOST_DEVICE T& operator()(Args... args) { - IndexType indices[] = {static_cast(args)...}; - IndexType idx = - std::inner_product(indices, indices + DIM, m_strides.begin(), 0); + const IndexType indices[] = {static_cast(args)...}; + const IndexType idx = numerics::dot_product(indices, m_strides.begin(), DIM); assert(inBounds(idx)); return asDerived().data()[idx]; } /// \overload template ::type> - const T& operator()(Args... args) const + AXOM_HOST_DEVICE const T& operator()(Args... args) const { - IndexType indices[] = {static_cast(args)...}; - IndexType idx = - std::inner_product(indices, indices + DIM, m_strides.begin(), 0); + const IndexType indices[] = {static_cast(args)...}; + const IndexType idx = numerics::dot_product(indices, m_strides.begin(), DIM); assert(inBounds(idx)); return asDerived().data()[idx]; } @@ -195,10 +193,16 @@ class ArrayBase } /// \brief Returns the dimensions of the Array - const std::array& shape() const { return m_dims; } + AXOM_HOST_DEVICE const StackArray& shape() const + { + return m_dims; + } /// \brief Returns the strides of the Array - const std::array& strides() const { return m_strides; } + AXOM_HOST_DEVICE const StackArray& strides() const + { + return m_strides; + } /*! * \brief Appends an Array to the end of the calling object @@ -279,9 +283,9 @@ class ArrayBase protected: /// \brief The sizes (extents?) in each dimension - std::array m_dims; + StackArray m_dims; /// \brief The strides in each dimension - std::array m_strides; + StackArray m_strides; }; /// \brief Array implementation specific to 1D Arrays @@ -326,9 +330,12 @@ class ArrayBase void emplace_back(Args&&... args); /// \brief Returns the dimensions of the Array - // FIXME: std::array is used for consistency with multidim case, should we just return the scalar? + // FIXME: StackArray is used for consistency with multidim case, should we just return the scalar? // Double curly braces needed for C++11 prior to resolution of CWG issue 1720 - std::array shape() const { return {{asDerived().size()}}; } + AXOM_HOST_DEVICE StackArray shape() const + { + return {{asDerived().size()}}; + } /*! * \brief Accessor, returns a reference to the given value. diff --git a/src/axom/core/StackArray.hpp b/src/axom/core/StackArray.hpp index 5d23b1cfad..422ecc852d 100644 --- a/src/axom/core/StackArray.hpp +++ b/src/axom/core/StackArray.hpp @@ -57,9 +57,55 @@ struct StackArray /// @} + /*! + * \brief Begin/end iterators + */ + /// @{ + + AXOM_HOST_DEVICE T* begin() noexcept { return &m_data[0]; } + + AXOM_HOST_DEVICE T* end() noexcept { return &m_data[0] + N; } + + /// @} + T m_data[N]; }; +/*! + * \brief Equality comparison operator for Array-likes + * + * \param [in] lhs left StackArray to compare + * \param [in] rhs right StackArray to compare + * \return true if the StackArrays have the same element values + */ +template +AXOM_HOST_DEVICE bool operator==(const StackArray& lhs, + const StackArray& rhs) +{ + for(int i = 0; i < N; i++) + { + if(lhs[i] != rhs[i]) + { + return false; + } + } + return true; +} + +/*! + * \brief Inequality comparison operator for StackArray + * + * \param [in] lhs left StackArray to compare + * \param [in] rhs right StackArray to compare + * \return true if the StackArrays have different element values + */ +template +AXOM_HOST_DEVICE bool operator!=(const StackArray& lhs, + const StackArray& rhs) +{ + return !(lhs == rhs); +} + } /* namespace axom */ #endif /* AXOM_STACKARRAY_HPP_ */ diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 30f1b9c31a..b948b62b16 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -803,6 +803,102 @@ void check_device(Array& v) } } +template +__global__ void assign_raw_2d(T* data, int M, int N) +{ + for(int i = 0; i < N; i++) + { + for(int j = 0; j < N; j++) + { + data[i * N + j] = i * N + j; + } + } +} + +template +__global__ void assign_view_2d(ArrayView view) +{ + for(int i = 0; i < view.shape()[0]; i++) + { + for(int j = 0; j < view.shape()[1]; j++) + { + view(i, j) = (i * view.shape()[1] + j) * 2; + } + } +} + +/*! + * \brief Check that a 2D array can be modified/accessed from device code + * \param [in] v the array to check. + */ +template +void check_device_2D(Array& v) +{ + const IndexType size = v.size(); + const IndexType M = v.shape()[0]; + const IndexType N = v.shape()[1]; + // Then assign to it via a raw device pointer + assign_raw_2d<<<1, 1>>>(v.data(), M, N); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_raw_array_dynamic = v; + EXPECT_EQ(check_raw_array_dynamic.size(), size); + EXPECT_EQ(check_raw_array_dynamic.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_raw_array_dynamic(i, j), i * N + j); + } + } + + // Then check the contents by assigning to an explicitly Host array + Array check_raw_array_host = v; + EXPECT_EQ(check_raw_array_host.size(), size); + EXPECT_EQ(check_raw_array_host.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_raw_array_host(i, j), i * N + j); + } + } + + // Then modify the underlying data via a view + ArrayView view(v); + assign_view_2d<<<1, 1>>>(view); + + // Check the contents of the array by assigning to a Dynamic array + // The default Umpire allocator should be Host, so we can access it from the CPU + Array check_view_array_dynamic = view; + EXPECT_EQ(check_view_array_dynamic.size(), size); + EXPECT_EQ(check_view_array_dynamic.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_view_array_dynamic(i, j), 2 * (i * N + j)); + } + } + + // Then check the contents by assigning to an explicitly Host array + Array check_view_array_host = view; + EXPECT_EQ(check_view_array_host.size(), size); + EXPECT_EQ(check_view_array_host.shape(), v.shape()); + + for(int i = 0; i < M; i++) + { + for(int j = 0; j < N; j++) + { + EXPECT_EQ(check_view_array_host(i, j), 2 * (i * N + j)); + } + } +} + #endif // __CUDACC__ } /* end namespace internal */ @@ -1227,7 +1323,7 @@ TEST(core_array, check_multidimensional) v_int.fill(MAGIC_INT); // Make sure the number of elements and contents are correct EXPECT_EQ(v_int.size(), 2 * 2); - std::array expected_shape = {2, 2}; + StackArray expected_shape = {2, 2}; EXPECT_EQ(v_int.shape(), expected_shape); for(const auto val : v_int) { @@ -1245,7 +1341,7 @@ TEST(core_array, check_multidimensional) v_int_flat[1] = 2; v_int_flat[2] = 3; v_int_flat[3] = 4; - std::array expected_flat_shape = {4}; + StackArray expected_flat_shape = {4}; EXPECT_EQ(v_int_flat.shape(), expected_flat_shape); for(int i = 0; i < v_int_flat.size(); i++) @@ -1257,7 +1353,7 @@ TEST(core_array, check_multidimensional) Array v_double(4, 3, 2); v_double.fill(MAGIC_DOUBLE); EXPECT_EQ(v_double.size(), 4 * 3 * 2); - std::array expected_double_shape = {4, 3, 2}; + StackArray expected_double_shape = {4, 3, 2}; EXPECT_EQ(v_double.shape(), expected_double_shape); for(const auto val : v_double) { @@ -1296,7 +1392,7 @@ TEST(core_array, check_multidimensional_view) ArrayView v_int_view(v_int_arr, 2, 2); // Make sure the number of elements and contents are correct EXPECT_EQ(v_int_view.size(), 2 * 2); - std::array expected_shape = {2, 2}; + StackArray expected_shape = {2, 2}; EXPECT_EQ(v_int_view.shape(), expected_shape); for(const auto val : v_int_view) { @@ -1311,7 +1407,7 @@ TEST(core_array, check_multidimensional_view) // FIXME: Should we add a std::initializer_list ctor? int v_int_flat_arr[] = {1, 2, 3, 4}; ArrayView v_int_flat_view(v_int_flat_arr, 4); - std::array expected_flat_shape = {4}; + StackArray expected_flat_shape = {4}; EXPECT_EQ(v_int_flat_view.shape(), expected_flat_shape); for(int i = 0; i < v_int_flat_view.size(); i++) @@ -1324,7 +1420,7 @@ TEST(core_array, check_multidimensional_view) std::fill_n(v_double_arr, 4 * 3 * 2, MAGIC_DOUBLE); ArrayView v_double_view(v_double_arr, 4, 3, 2); EXPECT_EQ(v_double_view.size(), 4 * 3 * 2); - std::array expected_double_shape = {4, 3, 2}; + StackArray expected_double_shape = {4, 3, 2}; EXPECT_EQ(v_double_view.shape(), expected_double_shape); for(const auto val : v_double_view) { @@ -1390,4 +1486,26 @@ TEST(core_array, checkDevice) #endif } +//------------------------------------------------------------------------------ +TEST(core_array, checkDevice2D) +{ +// FIXME: HIP +#if !defined(__CUDACC__) || !defined(AXOM_USE_UMPIRE) || \ + !defined(UMPIRE_ENABLE_DEVICE) + GTEST_SKIP() + << "CUDA is not available, skipping tests that use Array in device code"; +#else + for(IndexType capacity = 2; capacity < 512; capacity *= 2) + { + // Allocate an explicitly Device array + Array v_int_device(capacity, capacity); + internal::check_device_2D(v_int_device); + + Array v_double_device(capacity, + capacity); + internal::check_device_2D(v_double_device); + } +#endif +} + } /* end namespace axom */ From 93a4dab3db741cb1fd93c8c1226a6c9011f68de8 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Thu, 28 Oct 2021 11:53:18 -0700 Subject: [PATCH 08/73] fix: const overloads for StackArray iterators --- src/axom/core/StackArray.hpp | 2 ++ src/axom/core/tests/core_array.hpp | 12 ++++++------ src/axom/sidre/core/Array.hpp | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/axom/core/StackArray.hpp b/src/axom/core/StackArray.hpp index 422ecc852d..f378a057ee 100644 --- a/src/axom/core/StackArray.hpp +++ b/src/axom/core/StackArray.hpp @@ -63,8 +63,10 @@ struct StackArray /// @{ AXOM_HOST_DEVICE T* begin() noexcept { return &m_data[0]; } + AXOM_HOST_DEVICE const T* begin() const noexcept { return &m_data[0]; } AXOM_HOST_DEVICE T* end() noexcept { return &m_data[0] + N; } + AXOM_HOST_DEVICE const T* end() const noexcept { return &m_data[0] + N; } /// @} diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index b948b62b16..288ce60248 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -810,7 +810,7 @@ __global__ void assign_raw_2d(T* data, int M, int N) { for(int j = 0; j < N; j++) { - data[i * N + j] = i * N + j; + data[i * N + j] = i * i + j; } } } @@ -822,7 +822,7 @@ __global__ void assign_view_2d(ArrayView view) { for(int j = 0; j < view.shape()[1]; j++) { - view(i, j) = (i * view.shape()[1] + j) * 2; + view(i, j) = j * j + i; } } } @@ -850,7 +850,7 @@ void check_device_2D(Array& v) { for(int j = 0; j < N; j++) { - EXPECT_EQ(check_raw_array_dynamic(i, j), i * N + j); + EXPECT_EQ(check_raw_array_dynamic(i, j), i * i + j); } } @@ -863,7 +863,7 @@ void check_device_2D(Array& v) { for(int j = 0; j < N; j++) { - EXPECT_EQ(check_raw_array_host(i, j), i * N + j); + EXPECT_EQ(check_raw_array_host(i, j), i * i + j); } } @@ -881,7 +881,7 @@ void check_device_2D(Array& v) { for(int j = 0; j < N; j++) { - EXPECT_EQ(check_view_array_dynamic(i, j), 2 * (i * N + j)); + EXPECT_EQ(check_view_array_dynamic(i, j), j * j + i); } } @@ -894,7 +894,7 @@ void check_device_2D(Array& v) { for(int j = 0; j < N; j++) { - EXPECT_EQ(check_view_array_host(i, j), 2 * (i * N + j)); + EXPECT_EQ(check_view_array_host(i, j), j * j + i); } } } diff --git a/src/axom/sidre/core/Array.hpp b/src/axom/sidre/core/Array.hpp index 29254250dc..5d8f5b3920 100644 --- a/src/axom/sidre/core/Array.hpp +++ b/src/axom/sidre/core/Array.hpp @@ -32,7 +32,7 @@ constexpr axom::IndexType ZERO = 0; namespace detail { inline void describeViewImpl(TypeID T_type, - const std::array& shape, + const StackArray& shape, View* view) { SLIC_ASSERT(view != nullptr); @@ -43,7 +43,7 @@ inline void describeViewImpl(TypeID T_type, } inline void describeViewImpl(TypeID T_type, - const std::array& shape, + const StackArray& shape, View* view) { SLIC_ASSERT(view != nullptr); From 21bdb08e73d7c5b3b2e87ab5f7750330a7dc301d Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Thu, 28 Oct 2021 12:25:17 -0700 Subject: [PATCH 09/73] fix: yet another msvc fix --- src/axom/core/ArrayBase.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index 2a95aa589c..670d674773 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -15,6 +15,7 @@ // C/C++ includes #include // for std::cerr and std::ostream +#include // for std::accumulate #ifdef AXOM_USE_UMPIRE #include "umpire/resource/MemoryResourceTypes.hpp" From b42ebad472e021906cbd0befd736fe866a788c1d Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Mon, 1 Nov 2021 13:42:01 -0700 Subject: [PATCH 10/73] examples: add examples of axom::Array usage in device code --- src/axom/core/examples/CMakeLists.txt | 11 ++- src/axom/core/examples/core_containers.cpp | 103 +++++++++++++++++++-- 2 files changed, 103 insertions(+), 11 deletions(-) diff --git a/src/axom/core/examples/CMakeLists.txt b/src/axom/core/examples/CMakeLists.txt index c9a7945890..9100cb8c87 100644 --- a/src/axom/core/examples/CMakeLists.txt +++ b/src/axom/core/examples/CMakeLists.txt @@ -34,12 +34,19 @@ foreach(example_source ${example_sources}) endforeach() if(ENABLE_CUDA) - blt_add_executable( - NAME ${exe_name}_cuda_on_ex + blt_add_executable( + NAME core_acceleration_cuda_on_ex SOURCES core_acceleration.cpp OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} DEPENDS_ON axom cuda FOLDER axom/core/examples ) + + blt_add_executable( + NAME core_containers_cuda_on_ex + SOURCES core_containers.cpp + OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY} + DEPENDS_ON axom cuda + FOLDER axom/core/examples ) endif() blt_add_executable( diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index 19ae70b310..d7b3ca2c79 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -22,15 +22,9 @@ #include "axom/core/Macros.hpp" #include "axom/core/memory_management.hpp" -#ifdef WIN32 - #include "windows.h" -void sleep(int numSeconds) -{ - int numMilliSecs = numSeconds * 1000; - Sleep(numMilliSecs); -} -#else - #include // for sleep() +#ifdef AXOM_USE_RAJA + #include "axom/core/execution/execution_space.hpp" + #include "axom/core/execution/for_all.hpp" #endif // C/C++ includes @@ -176,8 +170,99 @@ void demoArrayBasic() // _iteration_end } +#ifdef __CUDACC__ + +// Aliases used for convenience +using UnifiedIntArrayView = axom::ArrayView; +using DeviceIntArrayView = axom::ArrayView; + +__global__ void add(const UnifiedIntArrayView A, + const UnifiedIntArrayView B, + DeviceIntArrayView C) +{ + for(int i = 0; i < A.size(); i++) + { + C[i] = A[i] + B[i]; + } +} + +#endif + +void demoArrayDevice() +{ + //This example requires Umpire +#if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) && defined(__CUDACC__) + // _cuda_array_start + constexpr int N = 10; + const int allocator_id = axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Unified); + + // By default the memory space can be specified at runtime. + // If this argument is not provided host memory will be allocated. + axom::Array A_dynamic(N, N, allocator_id); + + // We also have the option to "lock down" the memory space to allow for + // compile-time guarantees against dereferencing pointers in the wrong memory space. + axom::Array B_unified(N); + + // Despite having different types, both of these arrays are in unified memory. + for(int i = 0; i < N; i++) + { + A_dynamic[i] = i * 5; + B_unified[i] = i * 2; + } + + // Since our kernel requires at compile time that its arguments to be in unified memory, + // we lock down the dynamic array. In the general case this will result in a transfer, + // but because the dynamic array happens to be in unified memory a direct copy is possible. + axom::Array A_unified = A_dynamic; + + // The result array is allocated in device memory + axom::Array C_device(N); + + // Passing by reference is not possible for CUDA kernels, so the three arrays + // are converted to corresponding ArrayViews that are "shallow copies" of the + // original Array. + add<<<1, 1>>>(A_unified, B_unified, C_device); + + // Since our result array is in device memory, we copy it to host memory so we can view it. + axom::Array C_host = C_device; + std::cout << "Array C_host = " << C_host << std::endl; + + // Since by default allocations happen in host memory, we could have also used a dynamic array (the default) + axom::Array C_dynamic = C_device; + std::cout << "Array C_dynamic = " << C_dynamic << std::endl; + + // _cuda_array_end + + #ifdef AXOM_USE_RAJA + // _array_w_raja_begin + // To use a lambda as a kernel, we create the ArrayViews explicitly. + const UnifiedIntArrayView A_view = A_unified; + const UnifiedIntArrayView B_view = B_unified; + // Create a new array for our RAJA result + axom::Array C_device_raja(N); + DeviceIntArrayView C_view = C_device_raja; + + // Declare the lambda mutable so our copy of C_view (captured by value) is mutable + axom::for_all>( + 0, + N, + [=] AXOM_HOST_DEVICE(axom::IndexType i) mutable { + C_view[i] = A_view[i] + B_view[i] + 1; + }); + + // Finally, copy things over to host mmemory so we can display the data + axom::Array C_host_raja = C_view; + std::cout << "Array C_host_raja = " << C_host_raja << std::endl; + // _array_w_raja_end + #endif +#endif +} + int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) { demoArrayBasic(); + demoArrayDevice(); return 0; } From 724be2632328fbe1a117b0d9715ccfc8d68fe11a Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 2 Nov 2021 08:27:05 -0700 Subject: [PATCH 11/73] docs: document new example code --- RELEASE-NOTES.md | 2 + src/axom/core/docs/sphinx/core_containers.rst | 71 +++++++++++++++++++ src/axom/core/examples/core_containers.cpp | 12 ++-- 3 files changed, 81 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index bf93cbc699..0c02562261 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -61,6 +61,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ - Added Sidre function `View::clear()`. - Core now provides an `axom::ArrayView` that provides view/indexing semantics over a raw pointer. This replaces the external buffer logic previously provided by `axom::Array`. +- `axom::Array` is now GPU-compatible, in particular via a memory space template parameter and via + extensions to `axom::ArrayView` that allow for copying into kernels and transfers between memory spaces. ### Changed - `MFEMSidreDataCollection` now reuses FESpace/QSpace objects with the same basis diff --git a/src/axom/core/docs/sphinx/core_containers.rst b/src/axom/core/docs/sphinx/core_containers.rst index bc32d9b794..0db512c00b 100644 --- a/src/axom/core/docs/sphinx/core_containers.rst +++ b/src/axom/core/docs/sphinx/core_containers.rst @@ -17,6 +17,10 @@ Axom Core contains the ``Array``, ``ArrayView``, and ``StackArray`` classes. Among other things, these data containers facilitate porting code that uses ``std::vector`` to GPUs. +##### +Array +##### + ``Array`` is a multidimensional contiguous container template. In the 1-dimensional case, this class behaves similar to ``std::vector``. In higher dimensions, some vector-like functionality, such as ``push_back``, are not @@ -79,6 +83,10 @@ The output of this example is:: [8, 0, -1] ] +######### +ArrayView +######### + It is also often useful to wrap an external, user-supplied buffer without taking ownership of the data. For this purpose Axom provides the ``ArrayView`` class, which is a lightweight wrapper over a buffer that provides one- or multi-dimensional indexing/reshaping semantics. @@ -137,6 +145,69 @@ The output of this example is:: Range-based for loop over ArrayView c yields: 1 5 6 9 1 4 Standard for loop over ArrayView c yields: 1 5 6 9 1 4 +######################## +Using Arrays in GPU Code +######################## + +Instead of writing kernels and device functions that operate on raw pointers, we can use ``ArrayView`` +in device code. The basic "workflow" for this process is as follows: + + 1. Create an ``Array`` allocated in device-accessible memory via either specifying an allocator ID + or using a class template parameter for the desired memory space. + 2. Write a kernel that accepts an ``ArrayView`` parameter **by value**. + 3. Create an ``ArrayView`` from the ``Array`` to call the function. For non-templated kernels + an implicit conversion is provided. + + +The full template signature for ``Array`` (``ArrayView`` has an analogous signature) is +``Array``. Of particular interest +is the last parameter, which specifies the memory space in which the array's data are allocated. +The default, ``Dynamic``, means that the memory space is set via an allocator ID at runtime. + +.. note:: Allocating ``Array``s in different memory spaces is only possible when Umpire is available. + +Setting the ``MemorySpace`` to an option other than ``Dynamic`` - e.g., ``MemorySpace::Device`` provides +a compile-time guarantee that data can always be accessed from a GPU. "Locking down" the memory space at +compile time can help to prevent illegal memory accesses and segmentation faults when pointers are dereferenced +from the wrong execution space. + +For example, a GPU kernel can require that its argument arrays be allocated in a specific memory space. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _cuda_kernel_start + :end-before: _cuda_kernel_end + :language: C++ + +To illustrate how different memory spaces can be required, the inputs happen to be in unified memory and the output in +device memory. + +The following snippet illustrates how one would create and initialize the inputs/outputs to this kernel. Note +how a "Dynamic" ``Array`` can be converted into an ``Array`` whose memory space is locked down. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _cuda_array_create_start + :end-before: _cuda_array_create_end + :language: C++ + +We can now launch the kernel and display the results via a transfer back to host-accessible memory: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _cuda_array_call_start + :end-before: _cuda_array_call_end + :language: C++ + +If RAJA is available, we can also use Axom's acceleration utilities to perform an operation on the GPU +via a lambda: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _array_w_raja_start + :end-before: _array_w_raja_end + :language: C++ + +########## +StackArray +########## + The ``StackArray`` class is a work-around for a limitation in older versions of the nvcc compiler, which do not capture arrays on the stack in device lambdas. More details are in the API documentation and in the tests. diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index d7b3ca2c79..3156b984d6 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -172,6 +172,7 @@ void demoArrayBasic() #ifdef __CUDACC__ +// _cuda_kernel_start // Aliases used for convenience using UnifiedIntArrayView = axom::ArrayView; using DeviceIntArrayView = axom::ArrayView; @@ -185,6 +186,7 @@ __global__ void add(const UnifiedIntArrayView A, C[i] = A[i] + B[i]; } } +// _cuda_kernel_end #endif @@ -192,7 +194,7 @@ void demoArrayDevice() { //This example requires Umpire #if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) && defined(__CUDACC__) - // _cuda_array_start + // _cuda_array_create_start constexpr int N = 10; const int allocator_id = axom::getUmpireResourceAllocatorID( umpire::resource::MemoryResourceType::Unified); @@ -220,6 +222,9 @@ void demoArrayDevice() // The result array is allocated in device memory axom::Array C_device(N); + // _cuda_array_create_end + // _cuda_array_call_start + // Passing by reference is not possible for CUDA kernels, so the three arrays // are converted to corresponding ArrayViews that are "shallow copies" of the // original Array. @@ -232,11 +237,10 @@ void demoArrayDevice() // Since by default allocations happen in host memory, we could have also used a dynamic array (the default) axom::Array C_dynamic = C_device; std::cout << "Array C_dynamic = " << C_dynamic << std::endl; - - // _cuda_array_end + // _cuda_array_call_end #ifdef AXOM_USE_RAJA - // _array_w_raja_begin + // _array_w_raja_start // To use a lambda as a kernel, we create the ArrayViews explicitly. const UnifiedIntArrayView A_view = A_unified; const UnifiedIntArrayView B_view = B_unified; From 6644fd6526506489e9f18962253875ba5af1d696 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 2 Nov 2021 11:22:46 -0500 Subject: [PATCH 12/73] docs: final cleanup --- src/axom/core/ArrayBase.hpp | 4 ++-- src/axom/core/ArrayView.hpp | 2 -- src/axom/core/StackArray.hpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index 670d674773..b7f5808750 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -26,7 +26,7 @@ namespace axom /*! * \brief Memory spaces supported by Array-like types * - * This abstraction is implemented on top of Umpire's MemoryResourceType enum + * This abstraction is not implemented using Umpire's MemoryResourceType enum * in order to also include a "Dynamic" option as a default template parameter * for Array-like types */ @@ -331,7 +331,6 @@ class ArrayBase void emplace_back(Args&&... args); /// \brief Returns the dimensions of the Array - // FIXME: StackArray is used for consistency with multidim case, should we just return the scalar? // Double curly braces needed for C++11 prior to resolution of CWG issue 1720 AXOM_HOST_DEVICE StackArray shape() const { @@ -551,6 +550,7 @@ struct first_type_is_integral static constexpr bool value = first_type_is_integral_impl::value; }; +/// \brief Translates between the MemorySpace enum and Umpire allocator IDs template inline int getAllocatorID(); diff --git a/src/axom/core/ArrayView.hpp b/src/axom/core/ArrayView.hpp index 9ec85d0b30..a4f2779565 100644 --- a/src/axom/core/ArrayView.hpp +++ b/src/axom/core/ArrayView.hpp @@ -101,8 +101,6 @@ class ArrayView : public ArrayBase> /*! * \brief Get the ID for the umpire allocator - * - * FIXME: This is just a stand-in impl, extend this class to support wrapping of GPU pointers */ int getAllocatorID() const { return m_allocator_id; } diff --git a/src/axom/core/StackArray.hpp b/src/axom/core/StackArray.hpp index f378a057ee..780dd9de1a 100644 --- a/src/axom/core/StackArray.hpp +++ b/src/axom/core/StackArray.hpp @@ -74,7 +74,7 @@ struct StackArray }; /*! - * \brief Equality comparison operator for Array-likes + * \brief Equality comparison operator for StackArray * * \param [in] lhs left StackArray to compare * \param [in] rhs right StackArray to compare From 3c0b3e15785d852983c36af2a6266705892f54d4 Mon Sep 17 00:00:00 2001 From: Josh Essman <68349992+joshessman-llnl@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:02:20 -0500 Subject: [PATCH 13/73] docs: apply suggestions from @agcapps Co-authored-by: Arlie Capps <48997041+agcapps@users.noreply.github.com> --- src/axom/core/docs/sphinx/core_containers.rst | 4 ++-- src/axom/core/examples/core_containers.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/axom/core/docs/sphinx/core_containers.rst b/src/axom/core/docs/sphinx/core_containers.rst index 0db512c00b..775bd34369 100644 --- a/src/axom/core/docs/sphinx/core_containers.rst +++ b/src/axom/core/docs/sphinx/core_containers.rst @@ -154,7 +154,7 @@ in device code. The basic "workflow" for this process is as follows: 1. Create an ``Array`` allocated in device-accessible memory via either specifying an allocator ID or using a class template parameter for the desired memory space. - 2. Write a kernel that accepts an ``ArrayView`` parameter **by value**. + 2. Write a kernel that accepts an ``ArrayView`` parameter **by value**, not by reference or pointer. 3. Create an ``ArrayView`` from the ``Array`` to call the function. For non-templated kernels an implicit conversion is provided. @@ -166,7 +166,7 @@ The default, ``Dynamic``, means that the memory space is set via an allocator ID .. note:: Allocating ``Array``s in different memory spaces is only possible when Umpire is available. -Setting the ``MemorySpace`` to an option other than ``Dynamic`` - e.g., ``MemorySpace::Device`` provides +Setting the ``MemorySpace`` to an option other than ``Dynamic`` (for example, ``MemorySpace::Device``) provides a compile-time guarantee that data can always be accessed from a GPU. "Locking down" the memory space at compile time can help to prevent illegal memory accesses and segmentation faults when pointers are dereferenced from the wrong execution space. diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index 3156b984d6..55a42e7f34 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -199,7 +199,10 @@ void demoArrayDevice() const int allocator_id = axom::getUmpireResourceAllocatorID( umpire::resource::MemoryResourceType::Unified); - // By default the memory space can be specified at runtime. + // The last template parameter specifies a memory space. + // Its default value is Dynamic, which lets the user specify the + // memory space at runtime with a memory allocator ID. The + // third constructor parameter specifies the allocator. // If this argument is not provided host memory will be allocated. axom::Array A_dynamic(N, N, allocator_id); From a61552cc748ec96e33099e8512b9d5b2a9504d72 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Thu, 4 Nov 2021 03:59:04 -0700 Subject: [PATCH 14/73] cleanup: apply feedback regarding SFINAE and docs --- src/axom/core/Array.hpp | 19 +++++++------------ src/axom/core/ArrayBase.hpp | 11 ++++++----- src/axom/core/docs/sphinx/core_containers.rst | 13 ++++++++----- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/axom/core/Array.hpp b/src/axom/core/Array.hpp index 2598633903..2e6941cf50 100644 --- a/src/axom/core/Array.hpp +++ b/src/axom/core/Array.hpp @@ -134,7 +134,7 @@ class Array : public ArrayBase> */ template ::value>::type* = nullptr> + detail::all_types_are_integral::value>::type* = nullptr> Array(Args... args); /*! @@ -277,7 +277,6 @@ class Array : public ArrayBase> * \note The size increases by 1. * */ - template ::type* = nullptr> void insert(IndexType pos, const T& value); /*! @@ -291,7 +290,6 @@ class Array : public ArrayBase> * * \return ArrayIterator to inserted value */ - template ::type* = nullptr> ArrayIterator insert(ArrayIterator pos, const T& value); /*! @@ -324,7 +322,6 @@ class Array : public ArrayBase> * * \return ArrayIterator to first element inserted (pos if n == 0) */ - template ::type* = nullptr> ArrayIterator insert(ArrayIterator pos, IndexType n, const T* values); /*! @@ -341,7 +338,6 @@ class Array : public ArrayBase> * * \pre pos <= m_num_elements. */ - template ::type* = nullptr> void insert(IndexType pos, IndexType n, const T& value); /*! @@ -360,7 +356,6 @@ class Array : public ArrayBase> * * \return ArrayIterator to first element inserted (pos if n == 0) */ - template ::type* = nullptr> ArrayIterator insert(ArrayIterator pos, IndexType n, const T& value); // Make the overload "visible" @@ -600,7 +595,7 @@ Array::Array() template template ::value>::type*> + typename std::enable_if::value>::type*> Array::Array(Args... args) : ArrayBase>(args...) , m_allocator_id(axom::detail::getAllocatorID()) @@ -750,20 +745,20 @@ inline void Array::clear() //------------------------------------------------------------------------------ template -template ::type*> inline void Array::insert(IndexType pos, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); reserveForInsert(1, pos); m_data[pos] = value; } //------------------------------------------------------------------------------ template -template ::type*> inline typename Array::ArrayIterator Array::insert( Array::ArrayIterator pos, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); assert(pos >= begin() && pos <= end()); insert(pos - begin(), value); return pos; @@ -783,12 +778,12 @@ inline void Array::insert(IndexType pos, IndexType n, const T* va //------------------------------------------------------------------------------ template -template ::type*> inline typename Array::ArrayIterator Array::insert( Array::ArrayIterator pos, IndexType n, const T* values) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); assert(pos >= begin() && pos <= end()); insert(pos - begin(), n, values); return pos; @@ -796,9 +791,9 @@ inline typename Array::ArrayIterator Array::insert //------------------------------------------------------------------------------ template -template ::type*> inline void Array::insert(IndexType pos, IndexType n, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); reserveForInsert(n, pos); for(IndexType i = 0; i < n; ++i) { @@ -808,12 +803,12 @@ inline void Array::insert(IndexType pos, IndexType n, const T& va //------------------------------------------------------------------------------ template -template ::type*> inline typename Array::ArrayIterator Array::insert( Array::ArrayIterator pos, IndexType n, const T& value) { + static_assert(DIM == 1, "Insertion not supported for multidimensional Arrays"); assert(pos >= begin() && pos <= end()); insert(pos - begin(), n, value); return pos; diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index b7f5808750..1b339db7b7 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -534,20 +534,21 @@ bool allNonNegative(const T (&arr)[N]) /// \brief Indirection needed to dodge an MSVC compiler bug template -struct first_type_is_integral_impl : std::false_type +struct all_types_are_integral_impl : std::true_type { }; template -struct first_type_is_integral_impl +struct all_types_are_integral_impl { - static constexpr bool value = std::is_integral::value; + static constexpr bool value = std::is_integral::value && + all_types_are_integral_impl::value; }; /// \brief Checks if the first type in a parameter pack is integral template -struct first_type_is_integral +struct all_types_are_integral { - static constexpr bool value = first_type_is_integral_impl::value; + static constexpr bool value = all_types_are_integral_impl::value; }; /// \brief Translates between the MemorySpace enum and Umpire allocator IDs diff --git a/src/axom/core/docs/sphinx/core_containers.rst b/src/axom/core/docs/sphinx/core_containers.rst index 775bd34369..49932bfaac 100644 --- a/src/axom/core/docs/sphinx/core_containers.rst +++ b/src/axom/core/docs/sphinx/core_containers.rst @@ -41,7 +41,7 @@ by default. To return all extra memory, an application can call Use ``reserve()`` when the number of nodes is known a priori, or use a constructor that takes an actual size and capacity when possible. -.. note:: The Array destructor deallocates and returns all memory associated +.. note:: The ``Array`` destructor deallocates and returns all memory associated with it to the system. Here's an example showing how to use ``Array`` instead of ``std::vector``. @@ -164,7 +164,7 @@ The full template signature for ``Array`` (``ArrayView`` has an analogous signat is the last parameter, which specifies the memory space in which the array's data are allocated. The default, ``Dynamic``, means that the memory space is set via an allocator ID at runtime. -.. note:: Allocating ``Array``s in different memory spaces is only possible when Umpire is available. +.. note:: Allocating ``Array`` s in different memory spaces is only possible when Umpire is available. Setting the ``MemorySpace`` to an option other than ``Dynamic`` (for example, ``MemorySpace::Device``) provides a compile-time guarantee that data can always be accessed from a GPU. "Locking down" the memory space at @@ -172,15 +172,14 @@ compile time can help to prevent illegal memory accesses and segmentation faults from the wrong execution space. For example, a GPU kernel can require that its argument arrays be allocated in a specific memory space. +To illustrate how different memory spaces can be required, the following kernel requires that its +input arrays ``A`` and ``B`` are in unified memory and its output array ``C`` is in device memory. .. literalinclude:: ../../examples/core_containers.cpp :start-after: _cuda_kernel_start :end-before: _cuda_kernel_end :language: C++ -To illustrate how different memory spaces can be required, the inputs happen to be in unified memory and the output in -device memory. - The following snippet illustrates how one would create and initialize the inputs/outputs to this kernel. Note how a "Dynamic" ``Array`` can be converted into an ``Array`` whose memory space is locked down. @@ -189,6 +188,10 @@ how a "Dynamic" ``Array`` can be converted into an ``Array`` whose memory space :end-before: _cuda_array_create_end :language: C++ +.. note:: Unless the Dynamic memory space is in use, the ``Array`` constructor will + ignore an allocator ID that doesn't match its memory space, and in debug + builds will print a warning at runtime. + We can now launch the kernel and display the results via a transfer back to host-accessible memory: .. literalinclude:: ../../examples/core_containers.cpp From 8c68272542f16cdbb05d4a042e72143ee54ce750 Mon Sep 17 00:00:00 2001 From: Chris White Date: Thu, 4 Nov 2021 15:21:30 -0700 Subject: [PATCH 15/73] guard AXOM_VERSION_EXTRA --- src/axom/core/tests/utils_about.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/axom/core/tests/utils_about.hpp b/src/axom/core/tests/utils_about.hpp index a8932b2ff5..b5d627cf45 100644 --- a/src/axom/core/tests/utils_about.hpp +++ b/src/axom/core/tests/utils_about.hpp @@ -17,8 +17,11 @@ TEST(core_about, print_about) { axom::about(); } TEST(core_about, get_version) { std::ostringstream EXPECTED_VERSION_STRING; - EXPECTED_VERSION_STRING << AXOM_VERSION_FULL << "-"; - EXPECTED_VERSION_STRING << AXOM_VERSION_EXTRA; + EXPECTED_VERSION_STRING << AXOM_VERSION_FULL; + +#ifdef AXOM_VERSION_EXTRA + EXPECTED_VERSION_STRING << "-" << AXOM_VERSION_EXTRA; +#endif std::string axom_version = axom::getVersion(); EXPECT_EQ(EXPECTED_VERSION_STRING.str(), axom_version); From a3770c866c94b0a433de4ff8e86db19def5d8a96 Mon Sep 17 00:00:00 2001 From: Chris White Date: Thu, 4 Nov 2021 16:08:22 -0700 Subject: [PATCH 16/73] style --- src/axom/core/tests/utils_about.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/axom/core/tests/utils_about.hpp b/src/axom/core/tests/utils_about.hpp index b5d627cf45..87b2dfcf54 100644 --- a/src/axom/core/tests/utils_about.hpp +++ b/src/axom/core/tests/utils_about.hpp @@ -18,10 +18,9 @@ TEST(core_about, get_version) { std::ostringstream EXPECTED_VERSION_STRING; EXPECTED_VERSION_STRING << AXOM_VERSION_FULL; - #ifdef AXOM_VERSION_EXTRA EXPECTED_VERSION_STRING << "-" << AXOM_VERSION_EXTRA; -#endif +#endif std::string axom_version = axom::getVersion(); EXPECT_EQ(EXPECTED_VERSION_STRING.str(), axom_version); From 5abb252c02f38541c5b40b2423b0c4974e02d2dd Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 12:25:13 -0700 Subject: [PATCH 17/73] Adds a config option `AXOM_DEBUG_DEFINE` to control if AXOM_DEBUG define is enabled Options are: ON, OFF and DEFAULT. DEFAULT matches the previous behavior: `AXOM_DEBUG` is defined in `Debug` and `RelWithDebInfo` configurations. --- src/cmake/AxomOptions.cmake | 9 ++++++++ src/cmake/CMakeBasics.cmake | 42 ++++++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/cmake/AxomOptions.cmake b/src/cmake/AxomOptions.cmake index 5583a19cf3..c2d0e4da8c 100644 --- a/src/cmake/AxomOptions.cmake +++ b/src/cmake/AxomOptions.cmake @@ -27,3 +27,12 @@ option(AXOM_ENABLE_TOOLS "Enables Axom Tools" ON) cmake_dependent_option(AXOM_ENABLE_MPI3 "Enables use of MPI-3 features" OFF "ENABLE_MPI" OFF) mark_as_advanced(AXOM_ENABLE_MPI3) + +#-------------------------------------------------------------------------- +# Option to control if AXOM_DEFINE compiler define is enabled +# +# Possible values are "ON", "OFF" and "DEFAULT" +# By default AXOM_DEBUG is defined in Debug and RelWithDebInfo configurations +#-------------------------------------------------------------------------- +set(AXOM_DEBUG_DEFINE "DEFAULT" CACHE STRING "Determines if AXOM_DEBUG is defined.") +set_property(CACHE AXOM_DEBUG_DEFINE PROPERTY STRINGS "DEFAULT" "ON" "OFF") diff --git a/src/cmake/CMakeBasics.cmake b/src/cmake/CMakeBasics.cmake index c821989197..80694f746a 100644 --- a/src/cmake/CMakeBasics.cmake +++ b/src/cmake/CMakeBasics.cmake @@ -19,20 +19,38 @@ include(cmake/AxomMacros.cmake) #------------------------------------------------------------------------------ include(cmake/thirdparty/SetupAxomThirdParty.cmake) -if(NOT CMAKE_CONFIGURATION_TYPES) - #-------------------------------------------------------------------------- - # Add define we can use when debug builds are enabled - #-------------------------------------------------------------------------- - if( CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)" ) - add_definitions(-DAXOM_DEBUG) - endif() -else () - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS - $<$:AXOM_DEBUG> - $<$:AXOM_DEBUG> - ) +#------------------------------------------------------------------------------ +# Set up AXOM_DEBUG, as appropriate, based on config type. +# Result is stored in AXOM_DEBUG_DEFINE_STRING variable +#------------------------------------------------------------------------------ +set(AXOM_DEBUG_DEFINE_STRING) + +# Handle the three valid values for AXOM_DEBUG_DEFINE: {on, off, default} +string(TOUPPER "${AXOM_DEBUG_DEFINE}" _axom_debug_define_upper) +if("${_axom_debug_define_upper}" MATCHES "ON|TRUE") + set(AXOM_DEBUG_DEFINE_STRING "AXOM_DEBUG") +elseif("${_axom_debug_define_upper}" MATCHES "OFF|FALSE") + # no-op +elseif("${_axom_debug_define_upper}" MATCHES "DEFAULT") + # Default behavior is to be on for Debug and RelWithDebInfo configurations and off otherwise + if(NOT CMAKE_CONFIGURATION_TYPES) + if( CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)" ) + set(AXOM_DEBUG_DEFINE_STRING "AXOM_DEBUG") + endif() + else () + set(AXOM_DEBUG_DEFINE_STRING "$<$:AXOM_DEBUG>") + endif() +else() # Handle bad value for AXOM_DEBUG_DEFINE variable + message(FATAL_ERROR + "Invalid value for AXOM_DEBUG_DEFINE. Must be 'DEFAULT', 'ON' or 'OFF'; was '${AXOM_DEBUG_DEFINE}'") endif() +# Add the AXOM_DEBUG compile definition, if non-empty +if(AXOM_DEBUG_DEFINE_STRING) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "${AXOM_DEBUG_DEFINE_STRING}") +endif() + + #------------------------------------------------------------------------------ # Fortran Configuration #------------------------------------------------------------------------------ From e509a93792238dab35ae12c87c5f822a2b0f0376 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 12:44:00 -0700 Subject: [PATCH 18/73] Attach AXOM_DEBUG define to core rather than to everything in the axom build system This will allow it to be inherited by axom's users. --- src/axom/core/CMakeLists.txt | 6 ++++++ src/cmake/CMakeBasics.cmake | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/axom/core/CMakeLists.txt b/src/axom/core/CMakeLists.txt index da509ac69e..e3c55b3ce0 100644 --- a/src/axom/core/CMakeLists.txt +++ b/src/axom/core/CMakeLists.txt @@ -107,6 +107,12 @@ blt_add_library( NAME core OBJECT TRUE ) +# Add the AXOM_DEBUG compile definition, if non-empty +if(AXOM_DEBUG_DEFINE_STRING) + blt_add_target_definitions(TO core SCOPE PUBLIC TARGET_DEFINITIONS "${AXOM_DEBUG_DEFINE_STRING}") +endif() + + axom_write_unified_header( NAME core HEADERS ${core_headers} ) diff --git a/src/cmake/CMakeBasics.cmake b/src/cmake/CMakeBasics.cmake index 80694f746a..75bd401661 100644 --- a/src/cmake/CMakeBasics.cmake +++ b/src/cmake/CMakeBasics.cmake @@ -45,12 +45,6 @@ else() # Handle bad value for AXOM_DEBUG_DEFINE variable "Invalid value for AXOM_DEBUG_DEFINE. Must be 'DEFAULT', 'ON' or 'OFF'; was '${AXOM_DEBUG_DEFINE}'") endif() -# Add the AXOM_DEBUG compile definition, if non-empty -if(AXOM_DEBUG_DEFINE_STRING) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "${AXOM_DEBUG_DEFINE_STRING}") -endif() - - #------------------------------------------------------------------------------ # Fortran Configuration #------------------------------------------------------------------------------ From 35f0e66f3e685a01269e9639d17d205d89948b3c Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 14:31:04 -0700 Subject: [PATCH 19/73] Converts AXOM_DEBUG_DEFINE_STRING to a CACHE variable and exports it in axom-config.cmake --- src/cmake/AxomOptions.cmake | 8 ++++---- src/cmake/CMakeBasics.cmake | 11 +++++++---- src/cmake/axom-config.cmake.in | 18 +++++++++++------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/cmake/AxomOptions.cmake b/src/cmake/AxomOptions.cmake index c2d0e4da8c..c0a9cbf4c1 100644 --- a/src/cmake/AxomOptions.cmake +++ b/src/cmake/AxomOptions.cmake @@ -29,10 +29,10 @@ cmake_dependent_option(AXOM_ENABLE_MPI3 "Enables use of MPI-3 features" OFF "ENA mark_as_advanced(AXOM_ENABLE_MPI3) #-------------------------------------------------------------------------- -# Option to control if AXOM_DEFINE compiler define is enabled +# Option to control whether AXOM_DEFINE compiler define is enabled # -# Possible values are "ON", "OFF" and "DEFAULT" -# By default AXOM_DEBUG is defined in Debug and RelWithDebInfo configurations +# Possible values are: "ON", "OFF" and "DEFAULT" +# By default, AXOM_DEBUG is defined in Debug and RelWithDebInfo configurations #-------------------------------------------------------------------------- -set(AXOM_DEBUG_DEFINE "DEFAULT" CACHE STRING "Determines if AXOM_DEBUG is defined.") +set(AXOM_DEBUG_DEFINE "DEFAULT" CACHE STRING "Controls whether AXOM_DEBUG compiler define is enabled") set_property(CACHE AXOM_DEBUG_DEFINE PROPERTY STRINGS "DEFAULT" "ON" "OFF") diff --git a/src/cmake/CMakeBasics.cmake b/src/cmake/CMakeBasics.cmake index 75bd401661..10da537309 100644 --- a/src/cmake/CMakeBasics.cmake +++ b/src/cmake/CMakeBasics.cmake @@ -20,10 +20,10 @@ include(cmake/AxomMacros.cmake) include(cmake/thirdparty/SetupAxomThirdParty.cmake) #------------------------------------------------------------------------------ -# Set up AXOM_DEBUG, as appropriate, based on config type. -# Result is stored in AXOM_DEBUG_DEFINE_STRING variable +# Set up AXOM_DEBUG compiler define string, as appropriate, based on config type. +# Result is stored in AXOM_DEBUG_DEFINE_STRING cache variable #------------------------------------------------------------------------------ -set(AXOM_DEBUG_DEFINE_STRING) +set(AXOM_DEBUG_DEFINE_STRING "") # Handle the three valid values for AXOM_DEBUG_DEFINE: {on, off, default} string(TOUPPER "${AXOM_DEBUG_DEFINE}" _axom_debug_define_upper) @@ -40,11 +40,14 @@ elseif("${_axom_debug_define_upper}" MATCHES "DEFAULT") else () set(AXOM_DEBUG_DEFINE_STRING "$<$:AXOM_DEBUG>") endif() -else() # Handle bad value for AXOM_DEBUG_DEFINE variable +else() # Handle bad value for AXOM_DEBUG_DEFINE config variable message(FATAL_ERROR "Invalid value for AXOM_DEBUG_DEFINE. Must be 'DEFAULT', 'ON' or 'OFF'; was '${AXOM_DEBUG_DEFINE}'") endif() +set(AXOM_DEBUG_DEFINE_STRING "${AXOM_DEBUG_DEFINE_STRING}" CACHE STRING "" FORCE) +mark_as_advanced(AXOM_DEBUG_DEFINE_STRING) + #------------------------------------------------------------------------------ # Fortran Configuration #------------------------------------------------------------------------------ diff --git a/src/cmake/axom-config.cmake.in b/src/cmake/axom-config.cmake.in index 2b3db3accb..e5e34059e9 100644 --- a/src/cmake/axom-config.cmake.in +++ b/src/cmake/axom-config.cmake.in @@ -14,14 +14,14 @@ if(NOT AXOM_FOUND) # Set version and paths #---------------------------------------------------------------------------- - set(AXOM_VERSION "@AXOM_VERSION_FULL@") - set(AXOM_VERSION_MAJOR "@AXOM_VERSION_MAJOR@") - set(AXOM_VERSION_MINOR "@AXOM_VERSION_MINOR@") - set(AXOM_VERSION_PATCH "@AXOM_VERSION_PATCH@") + set(AXOM_VERSION "@AXOM_VERSION_FULL@") + set(AXOM_VERSION_MAJOR "@AXOM_VERSION_MAJOR@") + set(AXOM_VERSION_MINOR "@AXOM_VERSION_MINOR@") + set(AXOM_VERSION_PATCH "@AXOM_VERSION_PATCH@") + + set(AXOM_INSTALL_PREFIX "@AXOM_INSTALL_PREFIX@") + set(AXOM_INCLUDE_DIRS "${AXOM_INSTALL_PREFIX}/include") - set(AXOM_INSTALL_PREFIX "@AXOM_INSTALL_PREFIX@") - set(AXOM_INCLUDE_DIRS "${AXOM_INSTALL_PREFIX}/include") - #---------------------------------------------------------------------------- # Set user configuration options and features #---------------------------------------------------------------------------- @@ -60,6 +60,10 @@ if(NOT AXOM_FOUND) set(AXOM_USE_SCR "@AXOM_USE_SCR@") set(AXOM_USE_UMPIRE "@AXOM_USE_UMPIRE@") + # Configration for Axom compiler defines + set(AXOM_DEBUG_DEFINE "@AXOM_DEBUG_DEFINE@") + set(AXOM_DEBUG_DEFINE_STRING "@AXOM_DEBUG_DEFINE_STRING@") + #---------------------------------------------------------------------------- # Bring in required dependencies for this axom configuration #---------------------------------------------------------------------------- From 3f2720f26f6158fc28cfade275ee7c9fe75091d3 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 14:58:41 -0700 Subject: [PATCH 20/73] Adds AXOM_DEBUG_DEFINE option to user docs --- .../sphinx/quickstart_guide/config_build.rst | 85 ++++++++++--------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/src/docs/sphinx/quickstart_guide/config_build.rst b/src/docs/sphinx/quickstart_guide/config_build.rst index 0e1e4c98bb..3f8790fb70 100644 --- a/src/docs/sphinx/quickstart_guide/config_build.rst +++ b/src/docs/sphinx/quickstart_guide/config_build.rst @@ -280,46 +280,51 @@ CMake Configuration Options Here are the key build system options in Axom: -+------------------------------+---------+--------------------------------+ -| OPTION | Default | Description | -+==============================+=========+================================+ -| AXOM_ENABLE_ALL_COMPONENTS | ON | Enable all components | -| | | by default | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_ | ON | Enables the axom component | -| | | named 'foo' | -| | | | -| | | (e.g. AXOM_ENABLE_SIDRE) | -| | | for the sidre component | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_DOCS | ON | Builds documentation | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_EXAMPLES | ON | Builds examples | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_TESTS | ON | Builds unit tests | -+------------------------------+---------+--------------------------------+ -| AXOM_ENABLE_TOOLS | ON | Builds tools | -+------------------------------+---------+--------------------------------+ -| BUILD_SHARED_LIBS | OFF | Build shared libraries. | -| | | Default is Static libraries | -+------------------------------+---------+--------------------------------+ -| ENABLE_ALL_WARNINGS | ON | Enable extra compiler warnings | -| | | in all build targets | -+------------------------------+---------+--------------------------------+ -| ENABLE_BENCHMARKS | OFF | Enable google benchmark | -+------------------------------+---------+--------------------------------+ -| ENABLE_CODECOV | ON | Enable code coverage via gcov | -+------------------------------+---------+--------------------------------+ -| ENABLE_FORTRAN | ON | Enable Fortran compiler | -| | | support | -+------------------------------+---------+--------------------------------+ -| ENABLE_MPI | OFF | Enable MPI | -+------------------------------+---------+--------------------------------+ -| ENABLE_OPENMP | OFF | Enable OpenMP | -+------------------------------+---------+--------------------------------+ -| ENABLE_WARNINGS_AS_ERRORS | OFF | Compiler warnings treated as | -| | | errors. | -+------------------------------+---------+--------------------------------+ ++------------------------------+---------+----------------------------------------+ +| OPTION | Default | Description | ++==============================+=========+========================================+ +| AXOM_DEBUG_DEFINE | DEFAULT | Controls whether the `AXOM_DEBUG` | +| | | compiler define is enabled | +| | | | +| | | By DEFAULT, it is enabled for | +| | | `Debug` and `RelWithDebInfo` configs | +| | | but this can be overridden by setting | +| | | `AXOM_DEBUG_DEFINE` to `ON` or `OFF` | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_ALL_COMPONENTS | ON | Enable all components by default | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_ | ON | Enables the axom component named 'foo' | +| | | | +| | | (e.g. AXOM_ENABLE_SIDRE) | +| | | for the sidre component | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_DOCS | ON | Builds documentation | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_EXAMPLES | ON | Builds examples | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_TESTS | ON | Builds unit tests | ++------------------------------+---------+----------------------------------------+ +| AXOM_ENABLE_TOOLS | ON | Builds tools | ++------------------------------+---------+----------------------------------------+ +| BUILD_SHARED_LIBS | OFF | Build shared libraries. | +| | | Default is Static libraries | ++------------------------------+---------+----------------------------------------+ +| ENABLE_ALL_WARNINGS | ON | Enable extra compiler warnings | +| | | in all build targets | ++------------------------------+---------+----------------------------------------+ +| ENABLE_BENCHMARKS | OFF | Enable google benchmark | ++------------------------------+---------+----------------------------------------+ +| ENABLE_CODECOV | ON | Enable code coverage via gcov | ++------------------------------+---------+----------------------------------------+ +| ENABLE_FORTRAN | ON | Enable Fortran compiler support | ++------------------------------+---------+----------------------------------------+ +| ENABLE_MPI | OFF | Enable MPI | ++------------------------------+---------+----------------------------------------+ +| ENABLE_OPENMP | OFF | Enable OpenMP | ++------------------------------+---------+----------------------------------------+ +| ENABLE_WARNINGS_AS_ERRORS | OFF | Compiler warnings treated as errors | +| | | errors. | ++------------------------------+---------+----------------------------------------+ If ``AXOM_ENABLE_ALL_COMPONENTS`` is OFF, you must explicitly enable the desired components (other than 'core', which is always enabled). From 105651562ea3aaa1e02adb75c32fbedaba7d71f4 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 15:13:35 -0700 Subject: [PATCH 21/73] Updates comments in `core` and `slic`'s Macros related to `AXOM_DEBUG` --- src/axom/core/Macros.hpp | 2 +- src/axom/slic/interface/slic_macros.hpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/axom/core/Macros.hpp b/src/axom/core/Macros.hpp index 156987dc28..e8d431965d 100644 --- a/src/axom/core/Macros.hpp +++ b/src/axom/core/Macros.hpp @@ -165,7 +165,7 @@ /*! * \def AXOM_DEBUG_PARAM(x) * \brief Macro used to silence compiler warnings about parameters - * that are used in debug code but not in release code. + * that are only used when AXOM_DEBUG is defined * \note Default values are ok * \code * diff --git a/src/axom/slic/interface/slic_macros.hpp b/src/axom/slic/interface/slic_macros.hpp index 88c60023b0..459c91d9f1 100644 --- a/src/axom/slic/interface/slic_macros.hpp +++ b/src/axom/slic/interface/slic_macros.hpp @@ -7,7 +7,7 @@ #define AXOM_SLIC_MACROS_HPP_ #include "axom/config.hpp" -#include "axom/core/Macros.hpp" // for AXOM_HOST_DEVICE macros +#include "axom/core/Macros.hpp" /*! * \file slic_macros.hpp @@ -125,7 +125,7 @@ * \brief Asserts that a given expression is true. If the expression is not true * an error will be logged and the application will be aborted. * \param [in] EXP user-supplied boolean expression. - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * \warning This macro calls processAbort() if EXP is false. * * Usage: @@ -150,7 +150,7 @@ * \brief Same as SLIC_ASSERT, but with a custom error message. * \param [in] EXP user-supplied boolean expression. * \param [in] msg user-supplied message - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * \warning This macro calls processAbort() if EXP is false. * \see SLIC_ASSERT( EXP ) * @@ -183,7 +183,7 @@ * a warning is logged, but, in contrast to the similar SLIC_ASSERT macro the * application is not aborted. * \param [in] EXP user-supplied boolean expression. - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * * Usage: * \code @@ -214,7 +214,7 @@ * \brief Same as SLIC_CHECK, but with a custom error message. * \param [in] EXP user-supplied boolean expression. * \param [in] msg user-supplied message - * \note This macro is only active when debugging is turned on. + * \note This macro is only active when AXOM_DEBUG is defined. * \see SLIC_DEBUG( EXP ) * * Usage: @@ -316,7 +316,7 @@ * \def SLIC_DEBUG( msg ) * \brief Logs a Debug message. * \param [in] msg user-supplied message - * \note The SLIC_Debug macro is active in debug mode. + * \note The SLIC_Debug macro is active when AXOM_DEBUG is defined. * * Usage: * \code @@ -340,7 +340,7 @@ * \brief Logs an Debug message iff EXP is true * \param [in] EXP user-supplied boolean expression. * \param [in] msg user-supplied message. - * \note The SLIC_DEBUG_IF macro is active in debug mode. + * \note The SLIC_DEBUG_IF macro is active when AXOM_DEBUG is defined. * * Usage: * \code From d2daa8cc0dc9cfba481284948b2e77679de75d21 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 15:44:21 -0700 Subject: [PATCH 22/73] Renames AXOM_NOT_USED macro to AXOM_UNUSED_PARAM This is more consistent with the `AXOM_UNUSED_VAR` and the `AXOM_DEBUG_PARAM` macros. --- src/axom/core/Macros.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/axom/core/Macros.hpp b/src/axom/core/Macros.hpp index e8d431965d..e7ae1b7dde 100644 --- a/src/axom/core/Macros.hpp +++ b/src/axom/core/Macros.hpp @@ -114,20 +114,19 @@ /*! * - * \def AXOM_NOT_USED(x) - * \brief Macro used to silence compiler warnings in methods with unused - * arguments. + * \def AXOM_UNUSED_PARAM(x) + * \brief Macro used to silence compiler warnings in methods with unused arguments. * \note The intent is to use this macro in the function signature. For example: * \code * - * void my_function(int x, int AXOM_NOT_USED(y)) + * void my_function(int x, int AXOM_UNUSED_PARAM(y)) * { * // my implementation * } * * \endcode */ -#define AXOM_NOT_USED(x) +#define AXOM_UNUSED_PARAM(x) /*! * From a817162a117fea785069f33318b1df4d48ac84f2 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 15:47:37 -0700 Subject: [PATCH 23/73] Replaces `AXOM_NOT_USED` with `AXOM_UNUSED_PARAM` throughout axom --- src/axom/core/examples/core_acceleration.cpp | 2 +- src/axom/core/examples/core_containers.cpp | 2 +- src/axom/core/examples/core_numerics.cpp | 2 +- .../mint/docs/sphinx/sections/tutorial.rst | 4 +- .../mint/examples/mint_curvilinear_mesh.cpp | 2 +- src/axom/mint/examples/mint_particle_mesh.cpp | 2 +- .../mint/examples/mint_rectilinear_mesh.cpp | 2 +- .../mint_unstructured_mixed_topology_mesh.cpp | 2 +- ...mint_unstructured_single_topology_mesh.cpp | 2 +- .../examples/user_guide/mint_tutorial.cpp | 8 ++-- .../mint/execution/internal/for_all_cells.hpp | 8 ++-- .../mint/execution/internal/for_all_faces.hpp | 16 ++++---- .../mint/fem/shape_functions/Lagrange.hpp | 14 +++---- .../lagrange/lagrange_tetra_4.hpp | 3 +- .../lagrange/lagrange_tri_3.hpp | 3 +- src/axom/mint/mesh/ConnectivityArray.hpp | 25 ++++++------ src/axom/mint/mesh/Mesh.hpp | 25 ++++++------ src/axom/mint/mesh/ParticleMesh.hpp | 24 ++++++------ src/axom/mint/mesh/StructuredMesh.cpp | 2 +- src/axom/mint/mesh/StructuredMesh.hpp | 10 ++--- src/axom/mint/mesh/UniformMesh.hpp | 12 +++--- .../ConnectivityArray_indirection.hpp | 10 ++--- src/axom/mint/mesh/internal/MeshHelpers.hpp | 4 +- src/axom/quest/MeshTester.hpp | 39 ++++++++++--------- src/axom/quest/SamplingShaper.hpp | 2 +- src/axom/slam/Map.hpp | 2 +- src/axom/slam/NullSet.hpp | 5 ++- .../slam/policies/CardinalityPolicies.hpp | 4 +- .../tests/slam_relation_StaticConstant.cpp | 2 +- .../docs/sphinx/sections/architecture.rst | 2 +- src/axom/slic/examples/basic/logging.cpp | 2 +- src/axom/slic/streams/GenericOutputStream.cpp | 2 +- src/axom/slic/streams/LumberjackStream.cpp | 2 +- src/axom/slic/streams/SynchronizedStream.cpp | 2 +- src/axom/spin/BVH.hpp | 2 +- src/axom/spin/policy/LinearBVH.hpp | 4 +- src/axom/spin/tests/spin_bvh.cpp | 4 +- 37 files changed, 133 insertions(+), 125 deletions(-) diff --git a/src/axom/core/examples/core_acceleration.cpp b/src/axom/core/examples/core_acceleration.cpp index eadd6f0300..8040f5a8e9 100644 --- a/src/axom/core/examples/core_acceleration.cpp +++ b/src/axom/core/examples/core_acceleration.cpp @@ -144,7 +144,7 @@ void demoAxomExecution() #endif } -int main(int AXOM_NOT_USED(argc), char **AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char **AXOM_UNUSED_PARAM(argv)) { demoMemoryManageBasic(); demoAxomExecution(); diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index 19ae70b310..95e10e8d68 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -176,7 +176,7 @@ void demoArrayBasic() // _iteration_end } -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { demoArrayBasic(); return 0; diff --git a/src/axom/core/examples/core_numerics.cpp b/src/axom/core/examples/core_numerics.cpp index 581345c61e..69c3db7e22 100644 --- a/src/axom/core/examples/core_numerics.cpp +++ b/src/axom/core/examples/core_numerics.cpp @@ -277,7 +277,7 @@ void demoMatrix() // _solve_end } -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { // _timer_start axom::utilities::Timer t; diff --git a/src/axom/mint/docs/sphinx/sections/tutorial.rst b/src/axom/mint/docs/sphinx/sections/tutorial.rst index 5416c186a4..609f1a1f01 100644 --- a/src/axom/mint/docs/sphinx/sections/tutorial.rst +++ b/src/axom/mint/docs/sphinx/sections/tutorial.rst @@ -774,7 +774,7 @@ the cell centroid by averaging the coordinates of the constituent cell .. note:: Since this kernel does not use the node IDs, the argument to the kernel - is annotated using the ``AXOM_NOT_USED`` macro to silence compiler + is annotated using the ``AXOM_UNUSED_PARAM`` macro to silence compiler warnings. .. literalinclude:: ../../../examples/user_guide/mint_tutorial.cpp @@ -937,7 +937,7 @@ the face centroid by averaging the coordinates of the constituent face .. note:: Since this kernel does not use the node IDs, the argument to the kernel - is annotated using the ``AXOM_NOT_USED`` macro to silence compiler + is annotated using the ``AXOM_UNUSED_PARAM`` macro to silence compiler warnings. .. literalinclude:: ../../../examples/user_guide/mint_tutorial.cpp diff --git a/src/axom/mint/examples/mint_curvilinear_mesh.cpp b/src/axom/mint/examples/mint_curvilinear_mesh.cpp index 0c9f07e7c7..161bc06c1d 100644 --- a/src/axom/mint/examples/mint_curvilinear_mesh.cpp +++ b/src/axom/mint/examples/mint_curvilinear_mesh.cpp @@ -24,7 +24,7 @@ constexpr double M = (2 * M_PI) / 50.0; * \brief Illustrates how to construct and use a mint::CurvilinearMesh object. */ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { constexpr int N = 100; constexpr double h = 0.5; diff --git a/src/axom/mint/examples/mint_particle_mesh.cpp b/src/axom/mint/examples/mint_particle_mesh.cpp index f11f899772..18d001277c 100644 --- a/src/axom/mint/examples/mint_particle_mesh.cpp +++ b/src/axom/mint/examples/mint_particle_mesh.cpp @@ -19,7 +19,7 @@ namespace mint = axom::mint; namespace utilities = axom::utilities; //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { using int64 = axom::IndexType; const axom::IndexType NUM_PARTICLES = 100; diff --git a/src/axom/mint/examples/mint_rectilinear_mesh.cpp b/src/axom/mint/examples/mint_rectilinear_mesh.cpp index f125f9f5ff..8182b8dbf9 100644 --- a/src/axom/mint/examples/mint_rectilinear_mesh.cpp +++ b/src/axom/mint/examples/mint_rectilinear_mesh.cpp @@ -39,7 +39,7 @@ void exponential_distribution(double origin, IndexType N, double* x) } //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { constexpr int N = 100; diff --git a/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp b/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp index 08b545d038..5e7b972b74 100644 --- a/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp +++ b/src/axom/mint/examples/mint_unstructured_mixed_topology_mesh.cpp @@ -27,7 +27,7 @@ inline bool appendQuad(axom::IndexType i, axom::IndexType j) } //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { SimpleLogger logger; // create & initialize test logger, diff --git a/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp b/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp index 41b2cbf158..01b3d2e618 100644 --- a/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp +++ b/src/axom/mint/examples/mint_unstructured_single_topology_mesh.cpp @@ -19,7 +19,7 @@ using namespace axom; using axom::slic::SimpleLogger; //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { SimpleLogger logger; // create & initialize test logger, diff --git a/src/axom/mint/examples/user_guide/mint_tutorial.cpp b/src/axom/mint/examples/user_guide/mint_tutorial.cpp index bd2082de93..8482e4045a 100644 --- a/src/axom/mint/examples/user_guide/mint_tutorial.cpp +++ b/src/axom/mint/examples/user_guide/mint_tutorial.cpp @@ -218,7 +218,7 @@ void cell_traversals() &mesh, AXOM_LAMBDA(IndexType cellIdx, const numerics::Matrix& coords, - const IndexType* AXOM_NOT_USED(nodeIdx)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIdx)) { // sum nodal coordinates double xsum = 0.0; double ysum = 0.0; @@ -349,7 +349,7 @@ void face_traversals() &mesh, AXOM_LAMBDA(IndexType faceIdx, const numerics::Matrix& coords, - const IndexType* AXOM_NOT_USED(nodeIdx)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIdx)) { // sum nodal coordinates double xsum = 0.0; double ysum = 0.0; @@ -382,7 +382,7 @@ void face_traversals() mint::for_all_faces( &mesh, - AXOM_LAMBDA(IndexType faceIdx, IndexType AXOM_NOT_USED(c1), IndexType c2) { + AXOM_LAMBDA(IndexType faceIdx, IndexType AXOM_UNUSED_PARAM(c1), IndexType c2) { boundary[faceIdx] = (c2 == -1) ? ON_BOUNDARY : INTERIOR; }); @@ -823,7 +823,7 @@ void using_sidre() /*! * \brief Tutorial main */ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { // Native construction of various mesh types construct_uniform(); diff --git a/src/axom/mint/execution/internal/for_all_cells.hpp b/src/axom/mint/execution/internal/for_all_cells.hpp index 61ae3bca2b..343a42a7e0 100644 --- a/src/axom/mint/execution/internal/for_all_cells.hpp +++ b/src/axom/mint/execution/internal/for_all_cells.hpp @@ -314,7 +314,7 @@ inline void for_all_cells_impl(xargs::faceids, for_all_cells_impl( xargs::ij(), m, - AXOM_LAMBDA(IndexType cellID, IndexType AXOM_NOT_USED(i), IndexType j) { + AXOM_LAMBDA(IndexType cellID, IndexType AXOM_UNUSED_PARAM(i), IndexType j) { IndexType faces[4]; /* The I_DIRECTION faces */ @@ -340,7 +340,7 @@ inline void for_all_cells_impl(xargs::faceids, xargs::ijk(), m, AXOM_LAMBDA(IndexType cellID, - IndexType AXOM_NOT_USED(i), + IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { IndexType faces[6]; @@ -599,7 +599,7 @@ inline void for_all_cells_impl(xargs::coords, struct for_all_cell_nodes_functor { template - inline void operator()(ExecPolicy AXOM_NOT_USED(policy), + inline void operator()(ExecPolicy AXOM_UNUSED_PARAM(policy), const MeshType& m, KernelType&& kernel) const { @@ -657,7 +657,7 @@ inline void for_all_cells_impl(xargs::coords, m, AXOM_LAMBDA(IndexType cellID, const IndexType* nodeIDs, - IndexType AXOM_NOT_USED(numNodes)) { + IndexType AXOM_UNUSED_PARAM(numNodes)) { double coords[2] = {x[nodeIDs[0]], x[nodeIDs[1]]}; numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); diff --git a/src/axom/mint/execution/internal/for_all_faces.hpp b/src/axom/mint/execution/internal/for_all_faces.hpp index f241c46588..d2664dc46a 100644 --- a/src/axom/mint/execution/internal/for_all_faces.hpp +++ b/src/axom/mint/execution/internal/for_all_faces.hpp @@ -309,8 +309,8 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ij(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), - IndexType AXOM_NOT_USED(j)) { + IndexType AXOM_UNUSED_PARAM(i), + IndexType AXOM_UNUSED_PARAM(j)) { IndexType nodes[2]; nodes[0] = faceID; nodes[1] = nodes[0] + cellNodeOffset3; @@ -320,7 +320,7 @@ inline void for_all_faces_impl(xargs::nodeids, helpers::for_all_J_faces( xargs::ij(), m, - AXOM_LAMBDA(IndexType faceID, IndexType AXOM_NOT_USED(i), IndexType j) { + AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j) { const IndexType shiftedID = faceID - numIFaces; IndexType nodes[2]; nodes[0] = shiftedID + j; @@ -349,8 +349,8 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ijk(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), - IndexType AXOM_NOT_USED(j), + IndexType AXOM_UNUSED_PARAM(i), + IndexType AXOM_UNUSED_PARAM(j), IndexType k) { IndexType nodes[4]; nodes[0] = faceID + k * INodeResolution; @@ -364,7 +364,7 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ijk(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), + IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { const IndexType shiftedID = faceID - numIFaces; @@ -380,7 +380,7 @@ inline void for_all_faces_impl(xargs::nodeids, xargs::ijk(), m, AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_NOT_USED(i), + IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { const IndexType shiftedID = faceID - numIJFaces; @@ -904,7 +904,7 @@ inline void for_all_faces_impl(xargs::coords, struct for_all_face_nodes_functor { template - inline void operator()(ExecPolicy AXOM_NOT_USED(policy), + inline void operator()(ExecPolicy AXOM_UNUSED_PARAM(policy), const MeshType& m, KernelType&& kernel) const { diff --git a/src/axom/mint/fem/shape_functions/Lagrange.hpp b/src/axom/mint/fem/shape_functions/Lagrange.hpp index 6f68d5374d..8abea98408 100644 --- a/src/axom/mint/fem/shape_functions/Lagrange.hpp +++ b/src/axom/mint/fem/shape_functions/Lagrange.hpp @@ -7,7 +7,7 @@ #define MINT_LAGRANGE_SHAPEFUNCTION_HPP_ // Axom includes -#include "axom/core/Macros.hpp" // For AXOM_STATIC_ASSERT(), AXOM_NOT_USED() +#include "axom/core/Macros.hpp" // Mint includes #include "axom/mint/mesh/CellTypes.hpp" @@ -143,7 +143,7 @@ class Lagrange : public ShapeFunction> * * \note This method is implemented in specialized instances. */ - static void getCenter(double* AXOM_NOT_USED(center)) + static void getCenter(double* AXOM_UNUSED_PARAM(center)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); @@ -159,7 +159,7 @@ class Lagrange : public ShapeFunction> * \note The coordinates are arranged in column-major flat array layout. * \note This method is implemented in specialized instances. */ - static void getCoords(double* AXOM_NOT_USED(coords)) + static void getCoords(double* AXOM_UNUSED_PARAM(coords)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); @@ -178,8 +178,8 @@ class Lagrange : public ShapeFunction> * * \note This method is implemented in specialized instances. */ - static void computeShape(const double* AXOM_NOT_USED(nc), - double* AXOM_NOT_USED(phi)) + static void computeShape(const double* AXOM_UNUSED_PARAM(nc), + double* AXOM_UNUSED_PARAM(phi)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); @@ -198,8 +198,8 @@ class Lagrange : public ShapeFunction> * * \note This method is implemented in specialized instances. */ - static void computeDerivatives(const double* AXOM_NOT_USED(nc), - double* AXOM_NOT_USED(phidot)) + static void computeDerivatives(const double* AXOM_UNUSED_PARAM(nc), + double* AXOM_UNUSED_PARAM(phidot)) { constexpr int cell_value = mint::cellTypeToInt(CELLTYPE); AXOM_STATIC_ASSERT(cell_value >= 0 && cell_value < mint::NUM_CELL_TYPES); diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp index 3d48401546..b485347098 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tetra_4.hpp @@ -106,7 +106,8 @@ class Lagrange : public ShapeFunction> phi[3] = t; } - static void computeDerivatives(const double* AXOM_NOT_USED(xr), double* phidot) + static void computeDerivatives(const double* AXOM_UNUSED_PARAM(xr), + double* phidot) { SLIC_ASSERT(phidot != nullptr); diff --git a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp index e23fa622c8..2c06614342 100644 --- a/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp +++ b/src/axom/mint/fem/shape_functions/lagrange/lagrange_tri_3.hpp @@ -93,7 +93,8 @@ class Lagrange : public ShapeFunction> phi[2] = s; } - static void computeDerivatives(const double* AXOM_NOT_USED(xr), double* phidot) + static void computeDerivatives(const double* AXOM_UNUSED_PARAM(xr), + double* phidot) { SLIC_ASSERT(phidot != nullptr); diff --git a/src/axom/mint/mesh/ConnectivityArray.hpp b/src/axom/mint/mesh/ConnectivityArray.hpp index 53126ffe1f..f34a395afd 100644 --- a/src/axom/mint/mesh/ConnectivityArray.hpp +++ b/src/axom/mint/mesh/ConnectivityArray.hpp @@ -430,7 +430,8 @@ class ConnectivityArray * * \post getIDCapacity() >= n_IDs */ - void reserve(IndexType ID_capacity, IndexType AXOM_NOT_USED(value_capacity) = 0) + void reserve(IndexType ID_capacity, + IndexType AXOM_UNUSED_PARAM(value_capacity) = 0) { SLIC_ERROR_IF(isExternal() && ID_capacity > m_values->capacity(), "cannot exceed initial capacity of external buffer!"); @@ -446,7 +447,7 @@ class ConnectivityArray * * \post getNumberOfIDs() == newIDSize */ - void resize(IndexType ID_size, IndexType AXOM_NOT_USED(value_size) = 0) + void resize(IndexType ID_size, IndexType AXOM_UNUSED_PARAM(value_size) = 0) { m_values->resize(ID_size); } @@ -523,7 +524,7 @@ class ConnectivityArray * * \param [in] ID not used, does not need to be specified. */ - IndexType getNumberOfValuesForID(IndexType AXOM_NOT_USED(ID) = 0) const + IndexType getNumberOfValuesForID(IndexType AXOM_UNUSED_PARAM(ID) = 0) const { return m_stride; } @@ -533,7 +534,7 @@ class ConnectivityArray * * \param [in] ID not used, does not need to be specified. */ - CellType getIDType(IndexType AXOM_NOT_USED(ID) = 0) const + CellType getIDType(IndexType AXOM_UNUSED_PARAM(ID) = 0) const { return m_cell_type; } @@ -614,8 +615,8 @@ class ConnectivityArray * \pre values != nullptr */ void append(const IndexType* values, - IndexType AXOM_NOT_USED(n_values) = 0, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + IndexType AXOM_UNUSED_PARAM(n_values) = 0, + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { appendM(values, 1); } @@ -634,8 +635,8 @@ class ConnectivityArray */ void appendM(const IndexType* values, IndexType n_IDs, - const IndexType* AXOM_NOT_USED(offsets) = nullptr, - const CellType* AXOM_NOT_USED(types) = nullptr) + const IndexType* AXOM_UNUSED_PARAM(offsets) = nullptr, + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { SLIC_ASSERT(values != nullptr); SLIC_ASSERT(n_IDs >= 0); @@ -693,8 +694,8 @@ class ConnectivityArray */ void insert(const IndexType* values, IndexType start_ID, - IndexType AXOM_NOT_USED(n_values) = 0, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + IndexType AXOM_UNUSED_PARAM(n_values) = 0, + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { insertM(values, start_ID, 1); } @@ -716,8 +717,8 @@ class ConnectivityArray void insertM(const IndexType* values, IndexType start_ID, IndexType n_IDs, - const IndexType* AXOM_NOT_USED(offsets) = nullptr, - const CellType* AXOM_NOT_USED(types) = nullptr) + const IndexType* AXOM_UNUSED_PARAM(offsets) = nullptr, + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { SLIC_ASSERT(start_ID >= 0); SLIC_ASSERT(start_ID <= getNumberOfIDs()); diff --git a/src/axom/mint/mesh/Mesh.hpp b/src/axom/mint/mesh/Mesh.hpp index e17894aa7d..f86e33b1e4 100644 --- a/src/axom/mint/mesh/Mesh.hpp +++ b/src/axom/mint/mesh/Mesh.hpp @@ -267,8 +267,8 @@ class Mesh * \pre nodes != nullptr * \pre 0 <= cellID < getNumberOfCells() */ - virtual IndexType getCellNodeIDs(IndexType AXOM_NOT_USED(cellID), - IndexType* AXOM_NOT_USED(nodes)) const = 0; + virtual IndexType getCellNodeIDs(IndexType AXOM_UNUSED_PARAM(cellID), + IndexType* AXOM_UNUSED_PARAM(nodes)) const = 0; /*! * \brief Return the number of faces associated with the given cell. @@ -276,7 +276,7 @@ class Mesh * \param [in] cellID the ID of the cell in question. */ virtual IndexType getNumberOfCellFaces( - IndexType AXOM_NOT_USED(cellID) = 0) const = 0; + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const = 0; /*! * \brief Populates the given buffer with the IDs of the faces of the given @@ -289,8 +289,8 @@ class Mesh * \pre faces != nullptr * \pre 0 <= cellID < getNumberOfCells() */ - virtual IndexType getCellFaceIDs(IndexType AXOM_NOT_USED(cellID), - IndexType* AXOM_NOT_USED(faces)) const = 0; + virtual IndexType getCellFaceIDs(IndexType AXOM_UNUSED_PARAM(cellID), + IndexType* AXOM_UNUSED_PARAM(faces)) const = 0; /// @} @@ -367,14 +367,15 @@ class Mesh * * \param [in] faceID the ID of the face in question. */ - virtual CellType getFaceType(IndexType AXOM_NOT_USED(faceID)) const = 0; + virtual CellType getFaceType(IndexType AXOM_UNUSED_PARAM(faceID)) const = 0; /*! * \brief Return the number of nodes associated with the given face. * * \param [in] faceID the ID of the face in question. */ - virtual IndexType getNumberOfFaceNodes(IndexType AXOM_NOT_USED(faceID)) const = 0; + virtual IndexType getNumberOfFaceNodes( + IndexType AXOM_UNUSED_PARAM(faceID)) const = 0; /*! * \brief Copy the IDs of the nodes that compose the given face into the @@ -389,8 +390,8 @@ class Mesh * \pre nodes != nullptr * \pre 0 <= faceID < getNumberOfFaces() */ - virtual IndexType getFaceNodeIDs(IndexType AXOM_NOT_USED(faceID), - IndexType* AXOM_NOT_USED(nodes)) const = 0; + virtual IndexType getFaceNodeIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType* AXOM_UNUSED_PARAM(nodes)) const = 0; /*! * \brief Copy the IDs of the cells adjacent to the given face into the @@ -405,9 +406,9 @@ class Mesh * * \pre 0 <= faceID < getNumberOfFaces() */ - virtual void getFaceCellIDs(IndexType AXOM_NOT_USED(faceID), - IndexType& AXOM_NOT_USED(cellIDOne), - IndexType& AXOM_NOT_USED(cellIDTwo)) const = 0; + virtual void getFaceCellIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType& AXOM_UNUSED_PARAM(cellIDOne), + IndexType& AXOM_UNUSED_PARAM(cellIDTwo)) const = 0; /// @} diff --git a/src/axom/mint/mesh/ParticleMesh.hpp b/src/axom/mint/mesh/ParticleMesh.hpp index 24135d1d9f..1809afb47a 100644 --- a/src/axom/mint/mesh/ParticleMesh.hpp +++ b/src/axom/mint/mesh/ParticleMesh.hpp @@ -235,12 +235,12 @@ class ParticleMesh : public Mesh } virtual IndexType getNumberOfCellNodes( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return 1; } - virtual CellType getCellType(IndexType AXOM_NOT_USED(cellID) = 0) const final override + virtual CellType getCellType(IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return VERTEX; } @@ -255,7 +255,7 @@ class ParticleMesh : public Mesh * \param [in] cellID the ID of the cell in question. */ virtual IndexType getNumberOfCellFaces( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return 0; } @@ -269,8 +269,8 @@ class ParticleMesh : public Mesh * \param [out] faces buffer to populate with the face IDs. Must be of length * at least getNumberOfCellFaces( cellID ). */ - virtual IndexType getCellFaceIDs(IndexType AXOM_NOT_USED(cellID), - IndexType* AXOM_NOT_USED(faces)) const final override + virtual IndexType getCellFaceIDs(IndexType AXOM_UNUSED_PARAM(cellID), + IndexType* AXOM_UNUSED_PARAM(faces)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return 0; @@ -352,7 +352,7 @@ class ParticleMesh : public Mesh * * \note The particle mesh does not have any faces so this call errors out. */ - virtual CellType getFaceType(IndexType AXOM_NOT_USED(faceID)) const final override + virtual CellType getFaceType(IndexType AXOM_UNUSED_PARAM(faceID)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return UNDEFINED_CELL; @@ -366,7 +366,7 @@ class ParticleMesh : public Mesh * \note The particle mesh does not have any faces so this call errors out. */ virtual IndexType getNumberOfFaceNodes( - IndexType AXOM_NOT_USED(faceID)) const final override + IndexType AXOM_UNUSED_PARAM(faceID)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return -1; @@ -385,8 +385,8 @@ class ParticleMesh : public Mesh * * \note The particle mesh does not have any faces so this call errors out. */ - virtual IndexType getFaceNodeIDs(IndexType AXOM_NOT_USED(faceID), - IndexType* AXOM_NOT_USED(nodes)) const final override + virtual IndexType getFaceNodeIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType* AXOM_UNUSED_PARAM(nodes)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); return -1; @@ -402,9 +402,9 @@ class ParticleMesh : public Mesh * * \note The particle mesh does not have any faces so this call errors out. */ - virtual void getFaceCellIDs(IndexType AXOM_NOT_USED(faceID), - IndexType& AXOM_NOT_USED(cellIDOne), - IndexType& AXOM_NOT_USED(cellIDTwo)) const final override + virtual void getFaceCellIDs(IndexType AXOM_UNUSED_PARAM(faceID), + IndexType& AXOM_UNUSED_PARAM(cellIDOne), + IndexType& AXOM_UNUSED_PARAM(cellIDTwo)) const final override { SLIC_ERROR("ParticleMesh does not implement this method."); } diff --git a/src/axom/mint/mesh/StructuredMesh.cpp b/src/axom/mint/mesh/StructuredMesh.cpp index 588349cd2f..c84e9bad8e 100644 --- a/src/axom/mint/mesh/StructuredMesh.cpp +++ b/src/axom/mint/mesh/StructuredMesh.cpp @@ -25,7 +25,7 @@ bool validStructuredMeshType(int type) (type == STRUCTURED_UNIFORM_MESH)); } -inline int dim(const IndexType& AXOM_NOT_USED(Ni), +inline int dim(const IndexType& AXOM_UNUSED_PARAM(Ni), const IndexType& Nj, const IndexType& Nk) { diff --git a/src/axom/mint/mesh/StructuredMesh.hpp b/src/axom/mint/mesh/StructuredMesh.hpp index a6e0b41022..2854eeee16 100644 --- a/src/axom/mint/mesh/StructuredMesh.hpp +++ b/src/axom/mint/mesh/StructuredMesh.hpp @@ -80,7 +80,7 @@ class StructuredMesh : public Mesh * \param [in] cellID the ID of the cell in question, this parameter is * ignored. */ - virtual CellType getCellType(IndexType AXOM_NOT_USED(cellID) = 0) const final override + virtual CellType getCellType(IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return (m_ndims == 1) ? SEGMENT : (m_ndims == 2) ? QUAD : HEX; } @@ -92,7 +92,7 @@ class StructuredMesh : public Mesh * ignored. */ virtual IndexType getNumberOfCellNodes( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { return (m_ndims == 1) ? 2 : (m_ndims == 2) ? 4 : 8; } @@ -120,7 +120,7 @@ class StructuredMesh : public Mesh * ignored. */ virtual IndexType getNumberOfCellFaces( - IndexType AXOM_NOT_USED(cellID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(cellID) = 0) const final override { CellType cell_type = getCellType(); return getCellInfo(cell_type).num_faces; @@ -218,7 +218,7 @@ class StructuredMesh : public Mesh * \param [in] faceID the ID of the face in question, this parameter is * ignored. */ - virtual CellType getFaceType(IndexType AXOM_NOT_USED(faceID) = 0) const final override + virtual CellType getFaceType(IndexType AXOM_UNUSED_PARAM(faceID) = 0) const final override { return (m_ndims == 2) ? SEGMENT : (m_ndims == 3) ? QUAD : UNDEFINED_CELL; } @@ -230,7 +230,7 @@ class StructuredMesh : public Mesh * ignored. */ virtual IndexType getNumberOfFaceNodes( - IndexType AXOM_NOT_USED(faceID) = 0) const final override + IndexType AXOM_UNUSED_PARAM(faceID) = 0) const final override { return (m_ndims == 2) ? 2 : (m_ndims == 3) ? 4 : 0; } diff --git a/src/axom/mint/mesh/UniformMesh.hpp b/src/axom/mint/mesh/UniformMesh.hpp index e38e41142d..9e84e379e6 100644 --- a/src/axom/mint/mesh/UniformMesh.hpp +++ b/src/axom/mint/mesh/UniformMesh.hpp @@ -6,11 +6,11 @@ #ifndef MINT_UNIFORMMESH_HPP_ #define MINT_UNIFORMMESH_HPP_ -#include "axom/core/StackArray.hpp" // for StackArray -#include "axom/mint/config.hpp" // for IndexType, int64 -#include "axom/mint/mesh/StructuredMesh.hpp" // for StructuredMesh +#include "axom/core/StackArray.hpp" +#include "axom/mint/config.hpp" +#include "axom/mint/mesh/StructuredMesh.hpp" -#include "axom/slic/interface/slic.hpp" // for SLIC macros +#include "axom/slic/interface/slic.hpp" namespace axom { @@ -221,13 +221,13 @@ class UniformMesh : public StructuredMesh */ /// @{ - virtual double* getCoordinateArray(int AXOM_NOT_USED(dim)) final override + virtual double* getCoordinateArray(int AXOM_UNUSED_PARAM(dim)) final override { SLIC_ERROR("getCoordinateArray() is not supported for UniformMesh"); return nullptr; } - virtual const double* getCoordinateArray(int AXOM_NOT_USED(dim)) const final override + virtual const double* getCoordinateArray(int AXOM_UNUSED_PARAM(dim)) const final override { SLIC_ERROR("getCoordinateArray() is not supported for UniformMesh"); return nullptr; diff --git a/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp b/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp index dc5b5fa424..b40e6a0e72 100644 --- a/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp +++ b/src/axom/mint/mesh/internal/ConnectivityArray_indirection.hpp @@ -437,7 +437,7 @@ class ConnectivityArray * * \param [in] ID not used, does not need to be specified. */ - CellType getIDType(IndexType AXOM_NOT_USED(id) = 0) const + CellType getIDType(IndexType AXOM_UNUSED_PARAM(id) = 0) const { return m_cell_type; } @@ -518,7 +518,7 @@ class ConnectivityArray */ void append(const IndexType* values, IndexType n_values, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { SLIC_ASSERT(values != nullptr); m_values->append(values, n_values); @@ -544,7 +544,7 @@ class ConnectivityArray void appendM(const IndexType* values, IndexType n_IDs, const IndexType* offsets, - const CellType* AXOM_NOT_USED(types) = nullptr) + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { internal::append(n_IDs, values, offsets, m_values, m_offsets); } @@ -600,7 +600,7 @@ class ConnectivityArray void insert(const IndexType* values, IndexType start_ID, IndexType n_values, - CellType AXOM_NOT_USED(type) = UNDEFINED_CELL) + CellType AXOM_UNUSED_PARAM(type) = UNDEFINED_CELL) { IndexType offsets[2]; offsets[0] = 0; @@ -630,7 +630,7 @@ class ConnectivityArray IndexType start_ID, IndexType n_IDs, const IndexType* offsets, - const CellType* AXOM_NOT_USED(types) = nullptr) + const CellType* AXOM_UNUSED_PARAM(types) = nullptr) { internal::insert(start_ID, n_IDs, values, offsets, m_values, m_offsets); } diff --git a/src/axom/mint/mesh/internal/MeshHelpers.hpp b/src/axom/mint/mesh/internal/MeshHelpers.hpp index f2e533c6ef..8d85bb0340 100644 --- a/src/axom/mint/mesh/internal/MeshHelpers.hpp +++ b/src/axom/mint/mesh/internal/MeshHelpers.hpp @@ -5,7 +5,7 @@ #ifndef MINT_MESH_HELPERS_HPP_ #define MINT_MESH_HELPERS_HPP_ -#include "axom/core/Macros.hpp" // for AXOM_NOT_USED +#include "axom/core/Macros.hpp" // for AXOM_UNUSED_PARAM #include "axom/core/Types.hpp" // for nullptr #include "axom/mint/config.hpp" // for mint compile-time type #include "axom/mint/mesh/CellTypes.hpp" // for CellType @@ -20,7 +20,7 @@ class Mesh; // forward declaration namespace internal { -inline int dim(const double* AXOM_NOT_USED(x), const double* y, const double* z) +inline int dim(const double* AXOM_UNUSED_PARAM(x), const double* y, const double* z) { return ((z != nullptr) ? 3 : ((y != nullptr) ? 2 : 1)); } diff --git a/src/axom/quest/MeshTester.hpp b/src/axom/quest/MeshTester.hpp index 5fbedf101a..24a2287a57 100644 --- a/src/axom/quest/MeshTester.hpp +++ b/src/axom/quest/MeshTester.hpp @@ -159,28 +159,29 @@ void findTriMeshIntersectionsBVH( // Initialize the bounding box for each Triangle and marks // if the Triangle is degenerate. - AXOM_PERF_MARK_SECTION("init_tri_bb", - mint::for_all_cells( - surface_mesh, - AXOM_LAMBDA(IndexType cellIdx, - numerics::Matrix & coords, - const IndexType* AXOM_NOT_USED(nodeIds)) { - detail::Triangle3 tri; - - for(IndexType inode = 0; inode < 3; ++inode) - { - const double* node = coords.getColumn(inode); - tri[inode][0] = node[mint::X_COORDINATE]; - tri[inode][1] = node[mint::Y_COORDINATE]; - tri[inode][2] = node[mint::Z_COORDINATE]; - } // END for all cells nodes + AXOM_PERF_MARK_SECTION( + "init_tri_bb", + mint::for_all_cells( + surface_mesh, + AXOM_LAMBDA(IndexType cellIdx, + numerics::Matrix & coords, + const IndexType* AXOM_UNUSED_PARAM(nodeIds)) { + detail::Triangle3 tri; + + for(IndexType inode = 0; inode < 3; ++inode) + { + const double* node = coords.getColumn(inode); + tri[inode][0] = node[mint::X_COORDINATE]; + tri[inode][1] = node[mint::Y_COORDINATE]; + tri[inode][2] = node[mint::Z_COORDINATE]; + } // END for all cells nodes - degenerate[cellIdx] = (tri.degenerate() ? 1 : 0); + degenerate[cellIdx] = (tri.degenerate() ? 1 : 0); - tris[cellIdx] = tri; + tris[cellIdx] = tri; - aabbs[cellIdx] = compute_bounding_box(tri); - });); + aabbs[cellIdx] = compute_bounding_box(tri); + });); // Copy degenerate data back to host int* host_degenerate = diff --git a/src/axom/quest/SamplingShaper.hpp b/src/axom/quest/SamplingShaper.hpp index f648a084a1..6bcf214888 100644 --- a/src/axom/quest/SamplingShaper.hpp +++ b/src/axom/quest/SamplingShaper.hpp @@ -169,7 +169,7 @@ class InOutSampler * in region defined by bounding box \a queryBounds */ void computeVolumeFractionsBaseline(mfem::DataCollection* dc, - int AXOM_NOT_USED(sampleRes), + int AXOM_UNUSED_PARAM(sampleRes), int outputOrder) { // Step 1 -- generate a QField w/ the spatial coordinates diff --git a/src/axom/slam/Map.hpp b/src/axom/slam/Map.hpp index e440047ddb..3d49bb2bcd 100644 --- a/src/axom/slam/Map.hpp +++ b/src/axom/slam/Map.hpp @@ -394,7 +394,7 @@ class Map : public MapBase, public StridePolicy // setStride function should not be called after constructor is called. // This (should) override the StridePolicy setStride(s) function. - void setStride(SetPosition AXOM_NOT_USED(str)) + void setStride(SetPosition AXOM_UNUSED_PARAM(str)) { SLIC_ASSERT_MSG(false, "Stride should not be changed after construction of map."); diff --git a/src/axom/slam/NullSet.hpp b/src/axom/slam/NullSet.hpp index e203070af2..45090f7b3e 100644 --- a/src/axom/slam/NullSet.hpp +++ b/src/axom/slam/NullSet.hpp @@ -50,7 +50,10 @@ class NullSet : public Set inline bool isSubset() const { return false; } const ParentSet* parentSet() const { return this; } - bool isValid(bool AXOM_NOT_USED(verboseOutput) = false) const { return true; } + bool isValid(bool AXOM_UNUSED_PARAM(verboseOutput) = false) const + { + return true; + } bool empty() const { return true; } diff --git a/src/axom/slam/policies/CardinalityPolicies.hpp b/src/axom/slam/policies/CardinalityPolicies.hpp index ce7bb98ceb..7944ffc65a 100644 --- a/src/axom/slam/policies/CardinalityPolicies.hpp +++ b/src/axom/slam/policies/CardinalityPolicies.hpp @@ -92,7 +92,7 @@ struct ConstantCardinality m_begins = builder; } - const ElementType size(ElementType AXOM_NOT_USED(fromPos)) const + const ElementType size(ElementType AXOM_UNUSED_PARAM(fromPos)) const { return m_begins.stride(); } @@ -111,7 +111,7 @@ struct ConstantCardinality template bool isValid(const FromSetType* fromSet, - bool AXOM_NOT_USED(vertboseOutput) = false) const + bool AXOM_UNUSED_PARAM(verboseOutput) = false) const { return m_begins.size() == fromSet->size(); } diff --git a/src/axom/slam/tests/slam_relation_StaticConstant.cpp b/src/axom/slam/tests/slam_relation_StaticConstant.cpp index 6d154aafcf..0d9463eca9 100644 --- a/src/axom/slam/tests/slam_relation_StaticConstant.cpp +++ b/src/axom/slam/tests/slam_relation_StaticConstant.cpp @@ -85,7 +85,7 @@ void printVector(StrType const& msg, VecType const& vec) SLIC_INFO(msg << ": " << sstr.str()); } -SetPosition elementCardinality(SetPosition AXOM_NOT_USED(fromPos)) +SetPosition elementCardinality(SetPosition AXOM_UNUSED_PARAM(fromPos)) { return ELEM_STRIDE; } diff --git a/src/axom/slic/docs/sphinx/sections/architecture.rst b/src/axom/slic/docs/sphinx/sections/architecture.rst index 6e661e53f0..d403e5718b 100644 --- a/src/axom/slic/docs/sphinx/sections/architecture.rst +++ b/src/axom/slic/docs/sphinx/sections/architecture.rst @@ -400,7 +400,7 @@ The ``MyStream`` class implements the ``LogStream::append()`` method of the const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filtered_duplicates) ) + bool AXOM_UNUSED_PARAM(filtered_duplicates) ) { assert( m_stream != nillptr ); diff --git a/src/axom/slic/examples/basic/logging.cpp b/src/axom/slic/examples/basic/logging.cpp index 234b8c8ea2..bbc45a1b2b 100644 --- a/src/axom/slic/examples/basic/logging.cpp +++ b/src/axom/slic/examples/basic/logging.cpp @@ -13,7 +13,7 @@ using namespace axom; //------------------------------------------------------------------------------ -int main(int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { // SPHINX_SLIC_INIT_BEGIN diff --git a/src/axom/slic/streams/GenericOutputStream.cpp b/src/axom/slic/streams/GenericOutputStream.cpp index fe753adf39..60dc86d05b 100644 --- a/src/axom/slic/streams/GenericOutputStream.cpp +++ b/src/axom/slic/streams/GenericOutputStream.cpp @@ -30,7 +30,7 @@ void GenericOutputStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filtered_duplicates)) + bool AXOM_UNUSED_PARAM(filtered_duplicates)) { if(m_stream == nullptr) { diff --git a/src/axom/slic/streams/LumberjackStream.cpp b/src/axom/slic/streams/LumberjackStream.cpp index 1d703b1b29..6c86496a8d 100644 --- a/src/axom/slic/streams/LumberjackStream.cpp +++ b/src/axom/slic/streams/LumberjackStream.cpp @@ -72,7 +72,7 @@ void LumberjackStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filter_duplicates)) + bool AXOM_UNUSED_PARAM(filter_duplicates)) { if(m_lj == nullptr) { diff --git a/src/axom/slic/streams/SynchronizedStream.cpp b/src/axom/slic/streams/SynchronizedStream.cpp index 7c89e7e9c7..4bfb6d12fc 100644 --- a/src/axom/slic/streams/SynchronizedStream.cpp +++ b/src/axom/slic/streams/SynchronizedStream.cpp @@ -73,7 +73,7 @@ void SynchronizedStream::append(message::Level msgLevel, const std::string& tagName, const std::string& fileName, int line, - bool AXOM_NOT_USED(filter_duplicates)) + bool AXOM_UNUSED_PARAM(filter_duplicates)) { if(m_cache == nullptr) { diff --git a/src/axom/spin/BVH.hpp b/src/axom/spin/BVH.hpp index 7484ab2a6e..55dbb97b41 100644 --- a/src/axom/spin/BVH.hpp +++ b/src/axom/spin/BVH.hpp @@ -148,7 +148,7 @@ class BVH { private: template ()[0])> - static Ret array_operator_type(U AXOM_NOT_USED(obj)) + static Ret array_operator_type(U AXOM_UNUSED_PARAM(obj)) { } static std::false_type array_operator_type(...) diff --git a/src/axom/spin/policy/LinearBVH.hpp b/src/axom/spin/policy/LinearBVH.hpp index 31fbc4a2f4..c4e7a8ecdd 100644 --- a/src/axom/spin/policy/LinearBVH.hpp +++ b/src/axom/spin/policy/LinearBVH.hpp @@ -294,8 +294,8 @@ void LinearBVH::findCandidatesImpl( int32 count = 0; PrimitiveType primitive {objs[i]}; - auto leafAction = [&count](int32 AXOM_NOT_USED(current_node), - const int32* AXOM_NOT_USED(leaf_nodes)) { + auto leafAction = [&count](int32 AXOM_UNUSED_PARAM(current_node), + const int32* AXOM_UNUSED_PARAM(leaf_nodes)) { count++; }; diff --git a/src/axom/spin/tests/spin_bvh.cpp b/src/axom/spin/tests/spin_bvh.cpp index f621c89a2d..c268af3da6 100644 --- a/src/axom/spin/tests/spin_bvh.cpp +++ b/src/axom/spin/tests/spin_bvh.cpp @@ -125,7 +125,7 @@ void generate_aabbs(const mint::Mesh* mesh, mesh, AXOM_LAMBDA(IndexType cellIdx, numerics::Matrix & coords, - const IndexType* AXOM_NOT_USED(nodeIds)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIds)) { primal::BoundingBox range; for(IndexType inode = 0; inode < nodes_per_dim; ++inode) @@ -191,7 +191,7 @@ void generate_aabbs_and_centroids(const mint::Mesh* mesh, mesh, AXOM_LAMBDA(IndexType cellIdx, numerics::Matrix & coords, - const IndexType* AXOM_NOT_USED(nodeIds)) { + const IndexType* AXOM_UNUSED_PARAM(nodeIds)) { BoxType range; PointType sum(0.0); From 6c93d243eb0729415aada5039667a04ee47d228b Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 4 Nov 2021 14:35:19 -0700 Subject: [PATCH 24/73] Adds some comments, per PR suggestions --- src/cmake/CMakeBasics.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmake/CMakeBasics.cmake b/src/cmake/CMakeBasics.cmake index 10da537309..0faad02aef 100644 --- a/src/cmake/CMakeBasics.cmake +++ b/src/cmake/CMakeBasics.cmake @@ -33,11 +33,11 @@ elseif("${_axom_debug_define_upper}" MATCHES "OFF|FALSE") # no-op elseif("${_axom_debug_define_upper}" MATCHES "DEFAULT") # Default behavior is to be on for Debug and RelWithDebInfo configurations and off otherwise - if(NOT CMAKE_CONFIGURATION_TYPES) + if(NOT CMAKE_CONFIGURATION_TYPES) # This case handles single-config generators, e.g. make if( CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)" ) set(AXOM_DEBUG_DEFINE_STRING "AXOM_DEBUG") endif() - else () + else () # This case handles multi-config generators, e.g. MSVC set(AXOM_DEBUG_DEFINE_STRING "$<$:AXOM_DEBUG>") endif() else() # Handle bad value for AXOM_DEBUG_DEFINE config variable From 17c8c05f18d3eb35de74a868dab5e70d27afd838 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 4 Nov 2021 14:42:53 -0700 Subject: [PATCH 25/73] Updates RELEASE-NOTES --- RELEASE-NOTES.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 083e762c36..53aacf0a54 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -19,6 +19,17 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ## [Unreleased] - Release date yyyy-mm-dd +### Added +- Added a config variable, `AXOM_DEBUG_DEFINE` to control whether the `AXOM_DEBUG` compiler define is enabled. + By `DEFAULT`, it is enabled for `Debug` and `RelWithDebInfo` configurations, but this can be overriden + by setting `AXOM_DEBUG_DEFINE` to `ON` or `OFF`. +### Changed +- Renamed `AXOM_NOT_USED` macro to `AXOM_UNUSED_PARAM` for better consistency with other Axom macros + +### Fixed +- The `AXOM_DEBUG` compiler define is now properly exported via the `axom` CMake target when it is enabled + + ## [Version 0.6.0] - Release date 2021-11-04 ### Added From a6e9beef9bfe72a114a0f14b352f5d515c299f54 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Mon, 8 Nov 2021 08:38:48 -0800 Subject: [PATCH 26/73] cleanup: incorporate suggestions from @kennyweiss --- src/axom/core/Array.hpp | 1 - src/axom/core/ArrayBase.hpp | 73 +--------------------- src/axom/core/examples/core_containers.cpp | 15 +++-- src/axom/core/memory_management.hpp | 73 ++++++++++++++++++++++ src/axom/core/tests/core_array.hpp | 4 +- 5 files changed, 86 insertions(+), 80 deletions(-) diff --git a/src/axom/core/Array.hpp b/src/axom/core/Array.hpp index 2e6941cf50..79c887dded 100644 --- a/src/axom/core/Array.hpp +++ b/src/axom/core/Array.hpp @@ -8,7 +8,6 @@ #include "axom/config.hpp" // for compile-time defines #include "axom/core/Macros.hpp" // for axom macros -#include "axom/core/memory_management.hpp" // for memory allocation functions #include "axom/core/utilities/Utilities.hpp" // for processAbort() #include "axom/core/Types.hpp" // for IndexType definition #include "axom/core/ArrayBase.hpp" diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index 1b339db7b7..02470cf3fb 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -8,6 +8,7 @@ #include "axom/config.hpp" // for compile-time defines #include "axom/core/Macros.hpp" // for axom macros +#include "axom/core/memory_management.hpp" // for memory allocation functions #include "axom/core/utilities/Utilities.hpp" // for processAbort() #include "axom/core/Types.hpp" // for IndexType definition #include "axom/core/StackArray.hpp" @@ -17,31 +18,8 @@ #include // for std::cerr and std::ostream #include // for std::accumulate -#ifdef AXOM_USE_UMPIRE - #include "umpire/resource/MemoryResourceTypes.hpp" -#endif - namespace axom { -/*! - * \brief Memory spaces supported by Array-like types - * - * This abstraction is not implemented using Umpire's MemoryResourceType enum - * in order to also include a "Dynamic" option as a default template parameter - * for Array-like types - */ -enum class MemorySpace -{ - Dynamic, -#ifdef AXOM_USE_UMPIRE - Host, - Device, - Unified, - Pinned, - Constant -#endif -}; - // Forward declare the templated classes and operator function(s) template class ArrayBase; @@ -551,55 +529,6 @@ struct all_types_are_integral static constexpr bool value = all_types_are_integral_impl::value; }; -/// \brief Translates between the MemorySpace enum and Umpire allocator IDs -template -inline int getAllocatorID(); - -template <> -inline int getAllocatorID() -{ - return axom::getDefaultAllocatorID(); -} - -#ifdef AXOM_USE_UMPIRE - -template <> -inline int getAllocatorID() -{ - return axom::getUmpireResourceAllocatorID( - umpire::resource::MemoryResourceType::Host); -} - -template <> -inline int getAllocatorID() -{ - return axom::getUmpireResourceAllocatorID( - umpire::resource::MemoryResourceType::Device); -} - -template <> -inline int getAllocatorID() -{ - return axom::getUmpireResourceAllocatorID( - umpire::resource::MemoryResourceType::Unified); -} - -template <> -inline int getAllocatorID() -{ - return axom::getUmpireResourceAllocatorID( - umpire::resource::MemoryResourceType::Pinned); -} - -template <> -inline int getAllocatorID() -{ - return axom::getUmpireResourceAllocatorID( - umpire::resource::MemoryResourceType::Constant); -} - -#endif - } // namespace detail } /* namespace axom */ diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index a953446e24..f2c0865dcc 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -170,7 +170,13 @@ void demoArrayBasic() // _iteration_end } -#ifdef __CUDACC__ +// The following example requires CUDA + Umpire + unified memory +#if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) && \ + defined(__CUDACC__) && defined(UMPIRE_ENABLE_UM) + #define AXOM_CONTAINERS_EXAMPLE_ON_DEVICE +#endif + +#ifdef AXOM_CONTAINERS_EXAMPLE_ON_DEVICE // _cuda_kernel_start // Aliases used for convenience @@ -192,8 +198,7 @@ __global__ void add(const UnifiedIntArrayView A, void demoArrayDevice() { - //This example requires Umpire -#if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) && defined(__CUDACC__) +#ifdef AXOM_CONTAINERS_EXAMPLE_ON_DEVICE // _cuda_array_create_start constexpr int N = 10; const int allocator_id = axom::getUmpireResourceAllocatorID( @@ -217,7 +222,7 @@ void demoArrayDevice() B_unified[i] = i * 2; } - // Since our kernel requires at compile time that its arguments to be in unified memory, + // Since our kernel requires that its arguments to be in unified memory at compile time, // we lock down the dynamic array. In the general case this will result in a transfer, // but because the dynamic array happens to be in unified memory a direct copy is possible. axom::Array A_unified = A_dynamic; @@ -259,7 +264,7 @@ void demoArrayDevice() C_view[i] = A_view[i] + B_view[i] + 1; }); - // Finally, copy things over to host mmemory so we can display the data + // Finally, copy things over to host memory so we can display the data axom::Array C_host_raja = C_view; std::cout << "Array C_host_raja = " << C_host_raja << std::endl; // _array_w_raja_end diff --git a/src/axom/core/memory_management.hpp b/src/axom/core/memory_management.hpp index 00f3a1fecf..761b2b3784 100644 --- a/src/axom/core/memory_management.hpp +++ b/src/axom/core/memory_management.hpp @@ -15,6 +15,7 @@ #include "umpire/config.hpp" #include "umpire/ResourceManager.hpp" #include "umpire/op/MemoryOperationRegistry.hpp" + #include "umpire/resource/MemoryResourceTypes.hpp" #include "umpire/strategy/QuickPool.hpp" #else #include // for std::memcpy @@ -25,6 +26,25 @@ namespace axom { constexpr int INVALID_ALLOCATOR_ID = -1; +/*! + * \brief Memory spaces supported by Array-like types + * + * This abstraction is not implemented using Umpire's MemoryResourceType enum + * in order to also include a "Dynamic" option as a default template parameter + * for Array-like types + */ +enum class MemorySpace +{ + Dynamic, +#ifdef AXOM_USE_UMPIRE + Host, + Device, + Unified, + Pinned, + Constant +#endif +}; + /// \name Memory Management Routines /// @{ @@ -251,6 +271,59 @@ inline void copy(void* dst, const void* src, std::size_t numbytes) noexcept #endif } +namespace detail +{ +/// \brief Translates between the MemorySpace enum and Umpire allocator IDs +template +inline int getAllocatorID(); + +template <> +inline int getAllocatorID() +{ + return axom::getDefaultAllocatorID(); +} + +#ifdef AXOM_USE_UMPIRE + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Host); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Device); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Unified); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Pinned); +} + +template <> +inline int getAllocatorID() +{ + return axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Constant); +} + +#endif + +} // namespace detail + } // namespace axom #endif /* AXOM_MEMORYMANAGEMENT_HPP_ */ diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 288ce60248..475f643ff8 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -733,7 +733,7 @@ void check_external_view(ArrayView& v) EXPECT_EQ(data_ptr, v.data()); } -#ifdef __CUDACC__ +#if defined(__CUDACC__) && defined(AXOM_USE_UMPIRE) template __global__ void assign_raw(T* data, int N) @@ -899,7 +899,7 @@ void check_device_2D(Array& v) } } -#endif // __CUDACC__ +#endif // defined(__CUDACC__) && defined(AXOM_USE_UMPIRE) } /* end namespace internal */ From 23dee6782efd5e6352055eaa868a8785f6a5c3f2 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Mon, 8 Nov 2021 09:32:19 -0800 Subject: [PATCH 27/73] docs: add simplified example demonstrating implicit/explicit conversions to ArrayView --- src/axom/core/ArrayView.hpp | 13 +++++- src/axom/core/docs/sphinx/core_containers.rst | 40 ++++++++++++++++-- src/axom/core/examples/core_containers.cpp | 41 +++++++++++++++---- 3 files changed, 82 insertions(+), 12 deletions(-) diff --git a/src/axom/core/ArrayView.hpp b/src/axom/core/ArrayView.hpp index a4f2779565..c92fbf16c6 100644 --- a/src/axom/core/ArrayView.hpp +++ b/src/axom/core/ArrayView.hpp @@ -61,6 +61,10 @@ class ArrayView : public ArrayBase> * \param [in] other The array in a different memory space to copy from * * \note The parameter is non-const because \a other can be modified through the constructed View + * + * \note This constructor is left implicit to allow for convenient function calls that convert + * from \p Array -> \p ArrayView or from dynamic memory spaces to an \p ArrayView of explicitly specified + * space. */ template ArrayView(ArrayBase& other); @@ -94,7 +98,14 @@ class ArrayView : public ArrayBase> */ /// @{ - AXOM_HOST_DEVICE inline T* data() { return m_data; } + AXOM_HOST_DEVICE inline T* data() + { +#ifdef AXOM_DEVICE_CODE + static_assert(SPACE != MemorySpace::Constant, + "Cannot modify Constant memory from device code"); +#endif + return m_data; + } AXOM_HOST_DEVICE inline const T* data() const { return m_data; } /// @} diff --git a/src/axom/core/docs/sphinx/core_containers.rst b/src/axom/core/docs/sphinx/core_containers.rst index 49932bfaac..e4d96b822e 100644 --- a/src/axom/core/docs/sphinx/core_containers.rst +++ b/src/axom/core/docs/sphinx/core_containers.rst @@ -165,13 +165,48 @@ is the last parameter, which specifies the memory space in which the array's dat The default, ``Dynamic``, means that the memory space is set via an allocator ID at runtime. .. note:: Allocating ``Array`` s in different memory spaces is only possible when Umpire is available. + To learn more about Umpire, see the `Umpire documentation `_ Setting the ``MemorySpace`` to an option other than ``Dynamic`` (for example, ``MemorySpace::Device``) provides a compile-time guarantee that data can always be accessed from a GPU. "Locking down" the memory space at compile time can help to prevent illegal memory accesses and segmentation faults when pointers are dereferenced from the wrong execution space. -For example, a GPU kernel can require that its argument arrays be allocated in a specific memory space. +To summarize, there are a couple different options for creating an ``ArrayView``. +Consider a function that takes as an argument an ``ArrayView`` on the device: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_function_start + :end-before: _basic_array_function_end + :language: C++ + +To create an argument to this function we can select the space either at runtime or at compile-time as follows: + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_device_create_start + :end-before: _basic_array_device_create_end + :language: C++ + +The first way we can create the required ``ArrayView`` is by implicit conversion, which also simplifies +the process of "locking down" a ``MemorySpace::Dynamic`` array to an explicit memory space - ``MemorySpace:Device`` in this case. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_device_implicit_start + :end-before: _basic_array_device_implicit_end + :language: C++ + +.. warning:: If we had attempted to convert from a ``MemorySpace::Dynamic`` array that had been allocated in host memory, + for example, an error would be produced at runtime. + +We can also explicitly construct the ``ArrayView`` before calling the function. + +.. literalinclude:: ../../examples/core_containers.cpp + :start-after: _basic_array_device_explicit_start + :end-before: _basic_array_device_explicit_end + :language: C++ + +A more realistic example of this functionality involves a GPU kernel requiring +that its argument arrays be allocated in a specific memory space. To illustrate how different memory spaces can be required, the following kernel requires that its input arrays ``A`` and ``B`` are in unified memory and its output array ``C`` is in device memory. @@ -180,8 +215,7 @@ input arrays ``A`` and ``B`` are in unified memory and its output array ``C`` is :end-before: _cuda_kernel_end :language: C++ -The following snippet illustrates how one would create and initialize the inputs/outputs to this kernel. Note -how a "Dynamic" ``Array`` can be converted into an ``Array`` whose memory space is locked down. +The following snippet illustrates how one would create and initialize the inputs/outputs to this kernel. .. literalinclude:: ../../examples/core_containers.cpp :start-after: _cuda_array_create_start diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index f2c0865dcc..158d5c41bf 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -194,13 +194,39 @@ __global__ void add(const UnifiedIntArrayView A, } // _cuda_kernel_end +// _basic_array_function_start +void takesDeviceArrayView(axom::ArrayView) { } +// _basic_array_function_end #endif void demoArrayDevice() { #ifdef AXOM_CONTAINERS_EXAMPLE_ON_DEVICE - // _cuda_array_create_start + // _basic_array_device_create_start constexpr int N = 10; + // An device array can be constructed by either specifying the corresponding allocator ID... + const int device_allocator_id = axom::getUmpireResourceAllocatorID( + umpire::resource::MemoryResourceType::Device); + axom::Array device_array_dynamic(N, N, device_allocator_id); + // ...or by providing the memory space via template parameter: + axom::Array device_array_template(N); + // _basic_array_device_create_end + + // _basic_array_device_implicit_start + takesDeviceArrayView(device_array_dynamic); + takesDeviceArrayView(device_array_template); + // _basic_array_device_implicit_end + + // _basic_array_device_explicit_start + axom::ArrayView view_of_dynamic_array( + device_array_dynamic); + takesDeviceArrayView(view_of_dynamic_array); + axom::ArrayView view_of_template_array( + device_array_template); + takesDeviceArrayView(view_of_template_array); + // _basic_array_device_explicit_end + + // _cuda_array_create_start const int allocator_id = axom::getUmpireResourceAllocatorID( umpire::resource::MemoryResourceType::Unified); @@ -222,11 +248,6 @@ void demoArrayDevice() B_unified[i] = i * 2; } - // Since our kernel requires that its arguments to be in unified memory at compile time, - // we lock down the dynamic array. In the general case this will result in a transfer, - // but because the dynamic array happens to be in unified memory a direct copy is possible. - axom::Array A_unified = A_dynamic; - // The result array is allocated in device memory axom::Array C_device(N); @@ -236,7 +257,11 @@ void demoArrayDevice() // Passing by reference is not possible for CUDA kernels, so the three arrays // are converted to corresponding ArrayViews that are "shallow copies" of the // original Array. - add<<<1, 1>>>(A_unified, B_unified, C_device); + // Note that even though A's memory space has not been locked down at compile time, + // we are able to pass it as an argument - it will be implicitly converted to an ArrayView + // of the correct type. Also note that if we had not constructed A with the UM allocator ID, + // this conversion would fail and produce an error at runtime. + add<<<1, 1>>>(A_dynamic, B_unified, C_device); // Since our result array is in device memory, we copy it to host memory so we can view it. axom::Array C_host = C_device; @@ -250,7 +275,7 @@ void demoArrayDevice() #ifdef AXOM_USE_RAJA // _array_w_raja_start // To use a lambda as a kernel, we create the ArrayViews explicitly. - const UnifiedIntArrayView A_view = A_unified; + const UnifiedIntArrayView A_view = A_dynamic; const UnifiedIntArrayView B_view = B_unified; // Create a new array for our RAJA result axom::Array C_device_raja(N); From f39b02aac029929f7858040c6d6eb387a3822076 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Mon, 8 Nov 2021 15:08:03 -0800 Subject: [PATCH 28/73] fix: update docstring for type trait --- src/axom/core/ArrayBase.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/axom/core/ArrayBase.hpp b/src/axom/core/ArrayBase.hpp index 02470cf3fb..04cc0d0b3c 100644 --- a/src/axom/core/ArrayBase.hpp +++ b/src/axom/core/ArrayBase.hpp @@ -522,7 +522,7 @@ struct all_types_are_integral_impl all_types_are_integral_impl::value; }; -/// \brief Checks if the first type in a parameter pack is integral +/// \brief Checks if all types in a parameter pack are integral template struct all_types_are_integral { From 564d97741959e239541c6f235ccf23be9b5b0bae Mon Sep 17 00:00:00 2001 From: Brian Han Date: Mon, 8 Nov 2021 16:25:22 -0800 Subject: [PATCH 29/73] Initialize array in Polyhedron before use (#707) --- src/axom/primal/geometry/Polyhedron.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/axom/primal/geometry/Polyhedron.hpp b/src/axom/primal/geometry/Polyhedron.hpp index 801ff17d21..f54526afbb 100644 --- a/src/axom/primal/geometry/Polyhedron.hpp +++ b/src/axom/primal/geometry/Polyhedron.hpp @@ -405,7 +405,7 @@ class Polyhedron axom::int8 checkedSize = 0; axom::int8 facesAdded = 0; // # edges * (# vertices per edge) * (# orientation per edge) - axom::int8 checkedEdges[MAX_VERTS * 2 * 2]; + axom::int8 checkedEdges[MAX_VERTS * 2 * 2] = {0}; // Check each vertex for(int i = 0; i < numVertices(); i++) From 37f6409fa2eb598c8576afe4c69455d42116845e Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Tue, 9 Nov 2021 02:13:55 -0800 Subject: [PATCH 30/73] docs: mostly no-op to retrigger CI --- src/axom/core/examples/core_containers.cpp | 1 + src/axom/core/tests/core_array.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/axom/core/examples/core_containers.cpp b/src/axom/core/examples/core_containers.cpp index 158d5c41bf..fb7f84c6b5 100644 --- a/src/axom/core/examples/core_containers.cpp +++ b/src/axom/core/examples/core_containers.cpp @@ -171,6 +171,7 @@ void demoArrayBasic() } // The following example requires CUDA + Umpire + unified memory +// FIXME: HIP #if defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) && \ defined(__CUDACC__) && defined(UMPIRE_ENABLE_UM) #define AXOM_CONTAINERS_EXAMPLE_ON_DEVICE diff --git a/src/axom/core/tests/core_array.hpp b/src/axom/core/tests/core_array.hpp index 475f643ff8..2909e82b93 100644 --- a/src/axom/core/tests/core_array.hpp +++ b/src/axom/core/tests/core_array.hpp @@ -733,6 +733,7 @@ void check_external_view(ArrayView& v) EXPECT_EQ(data_ptr, v.data()); } +// FIXME: HIP #if defined(__CUDACC__) && defined(AXOM_USE_UMPIRE) template From 475aacf9eb4a764b3756c94d4e6335c2b57debea Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Thu, 11 Nov 2021 08:53:22 -0600 Subject: [PATCH 31/73] refactor: add InletVector ptr constructor --- src/axom/inlet/InletVector.hpp | 13 +++++++++++++ src/axom/inlet/LuaReader.cpp | 8 +++----- src/axom/inlet/examples/mfem_coefficient.cpp | 2 +- src/axom/inlet/examples/nested_structs.cpp | 4 +--- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/axom/inlet/InletVector.hpp b/src/axom/inlet/InletVector.hpp index 6a67143781..775398b43a 100644 --- a/src/axom/inlet/InletVector.hpp +++ b/src/axom/inlet/InletVector.hpp @@ -68,6 +68,19 @@ struct InletVector */ InletVector(primal::Vector3D&& v, int d = 3) : vec(std::move(v)), dim(d) { } + /*! + ******************************************************************************* + * \brief Constructs a vector with a pointer and a dimension + * + * \param [in] values The pointer to the vector data + * \param [in] d The dimension of the vector (length of the data) + * + * \note Data is copied from the pointer - lifetime of the constructed InletVector + * is not dependent on the lifetime of the pointer. + ******************************************************************************* + */ + InletVector(const double* values, int d = 3) : vec(values, d), dim(d) { } + /*! ******************************************************************************* * \brief Retrieves an element of the vector diff --git a/src/axom/inlet/LuaReader.cpp b/src/axom/inlet/LuaReader.cpp index 9ffd2ee9c9..986c6c2298 100644 --- a/src/axom/inlet/LuaReader.cpp +++ b/src/axom/inlet/LuaReader.cpp @@ -113,15 +113,13 @@ LuaReader::LuaReader() "new", axom::sol::factories( [](double x, double y, double z) { - return FunctionType::Vector {primal::Vector3D {x, y, z}, 3}; + return FunctionType::Vector {x, y, z}; }, [](double x, double y) { - return FunctionType::Vector {primal::Vector3D {x, y}, 2}; + return FunctionType::Vector {x, y}; }, // Assume three for a default constructor - [] { - return FunctionType::Vector {primal::Vector3D {}, 3}; - }), + [] { return FunctionType::Vector {}; }), // Add vector addition operation axom::sol::meta_function::addition, [](const FunctionType::Vector& u, const FunctionType::Vector& v) { diff --git a/src/axom/inlet/examples/mfem_coefficient.cpp b/src/axom/inlet/examples/mfem_coefficient.cpp index 81075f2826..1133c167f9 100644 --- a/src/axom/inlet/examples/mfem_coefficient.cpp +++ b/src/axom/inlet/examples/mfem_coefficient.cpp @@ -100,7 +100,7 @@ struct BoundaryCondition inlet::InletVector toInletVector(const mfem::Vector& vec) { - return {axom::primal::Vector3D {vec.GetData(), vec.Size()}, vec.Size()}; + return {vec.GetData(), vec.Size()}; } // Uses out-params to match MFEM semantics diff --git a/src/axom/inlet/examples/nested_structs.cpp b/src/axom/inlet/examples/nested_structs.cpp index 05cb80735e..5c6cb70991 100644 --- a/src/axom/inlet/examples/nested_structs.cpp +++ b/src/axom/inlet/examples/nested_structs.cpp @@ -20,9 +20,7 @@ using Vector = inlet::FunctionType::Vector; // to a geometric vector type Vector toVector(const std::vector& vec) { - // Narrow from std::size_t to int - const int size = vec.size(); - return {axom::primal::Vector3D {vec.data(), size}, size}; + return {vec.data(), static_cast(vec.size())}; } // A union of the members required for each of the operations is stored for simplicity From c2b8dee53a15392bb09cbfaa919afa1525f7c7d5 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Thu, 11 Nov 2021 09:06:24 -0600 Subject: [PATCH 32/73] refactor: explicit ctors for InletVector --- RELEASE-NOTES.md | 1 + src/axom/inlet/InletVector.hpp | 8 ++++++-- src/axom/inlet/examples/mfem_coefficient.cpp | 2 +- src/axom/inlet/examples/nested_structs.cpp | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 936ad6a3f6..cdc0c62ea9 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -25,6 +25,7 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ by setting `AXOM_DEBUG_DEFINE` to `ON` or `OFF`. ### Changed - Renamed `AXOM_NOT_USED` macro to `AXOM_UNUSED_PARAM` for better consistency with other Axom macros +- Added `explicit` to `axom::Inlet::InletVector` constructors and added a constructor that accepts a `double*` ### Fixed - The `AXOM_DEBUG` compiler define is now properly exported via the `axom` CMake target when it is enabled diff --git a/src/axom/inlet/InletVector.hpp b/src/axom/inlet/InletVector.hpp index 775398b43a..29243b6faa 100644 --- a/src/axom/inlet/InletVector.hpp +++ b/src/axom/inlet/InletVector.hpp @@ -66,7 +66,10 @@ struct InletVector * \param [in] d The dimension of the vector ******************************************************************************* */ - InletVector(primal::Vector3D&& v, int d = 3) : vec(std::move(v)), dim(d) { } + explicit InletVector(primal::Vector3D&& v, int d = 3) + : vec(std::move(v)) + , dim(d) + { } /*! ******************************************************************************* @@ -79,7 +82,8 @@ struct InletVector * is not dependent on the lifetime of the pointer. ******************************************************************************* */ - InletVector(const double* values, int d = 3) : vec(values, d), dim(d) { } + explicit InletVector(const double* values, int d = 3) : vec(values, d), dim(d) + { } /*! ******************************************************************************* diff --git a/src/axom/inlet/examples/mfem_coefficient.cpp b/src/axom/inlet/examples/mfem_coefficient.cpp index 1133c167f9..94cd7d5aa9 100644 --- a/src/axom/inlet/examples/mfem_coefficient.cpp +++ b/src/axom/inlet/examples/mfem_coefficient.cpp @@ -100,7 +100,7 @@ struct BoundaryCondition inlet::InletVector toInletVector(const mfem::Vector& vec) { - return {vec.GetData(), vec.Size()}; + return inlet::InletVector {vec.GetData(), vec.Size()}; } // Uses out-params to match MFEM semantics diff --git a/src/axom/inlet/examples/nested_structs.cpp b/src/axom/inlet/examples/nested_structs.cpp index 5c6cb70991..0dff9f65a1 100644 --- a/src/axom/inlet/examples/nested_structs.cpp +++ b/src/axom/inlet/examples/nested_structs.cpp @@ -20,7 +20,7 @@ using Vector = inlet::FunctionType::Vector; // to a geometric vector type Vector toVector(const std::vector& vec) { - return {vec.data(), static_cast(vec.size())}; + return Vector {vec.data(), static_cast(vec.size())}; } // A union of the members required for each of the operations is stored for simplicity From 8bf4e491a552f19e31a5ce04201a71973ff6db38 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 15:16:16 -0800 Subject: [PATCH 33/73] Use a parallel mfem in our toss3 spack specs * Uses fixed versions -- mfem@4.2.0 and hypre@2.20.0 * Disable mfem in our `gcc@8.1_no_fortran` spec since `hypre` seems to require a Fortran compiler --- scripts/spack/configs/toss_3_x86_64_ib/packages.yaml | 8 +++++--- scripts/spack/specs.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml b/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml index e8c347bae5..ee461e2a36 100644 --- a/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml +++ b/scripts/spack/configs/toss_3_x86_64_ib/packages.yaml @@ -24,7 +24,7 @@ packages: lapack: [netlib-lapack] mpi: [mvapich2] -# LLNL toss3 CUDA +# LLNL toss3 CUDA cuda: buildable: false externals: @@ -132,7 +132,7 @@ packages: buildable: false externals: - spec: pdsh@2.33 - prefix: /usr + prefix: /usr # Globally lock version of third party libraries conduit: @@ -140,8 +140,10 @@ packages: variants: ~shared~test hdf5: variants: ~shared~mpi + hypre: + version: [2.20.0] mfem: - variants: ~mpi~metis~zlib + version: [4.2.0] raja: variants: ~shared~examples~exercises scr: diff --git a/scripts/spack/specs.json b/scripts/spack/specs.json index b4ce4d41d7..a05c2ce8e0 100644 --- a/scripts/spack/specs.json +++ b/scripts/spack/specs.json @@ -17,7 +17,7 @@ [ "clang@9.0.0~cpp14+devtools+mfem+c2c", "clang@10.0.0~cpp14+devtools+mfem+c2c", "gcc@8.1.0~cpp14+devtools+mfem+c2c", - "gcc@8.1_no_fortran~cpp14~fortran+devtools+mfem+c2c", + "gcc@8.1_no_fortran~cpp14~fortran+devtools~mfem+c2c", "intel@18.0.2~cpp14~openmp+devtools+mfem+c2c", "intel@19.0.4~cpp14~openmp+devtools+mfem+c2c" ], From bbf944521afae8d673a649cd0fd183b3543d56d6 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 15:22:03 -0800 Subject: [PATCH 34/73] Use a parallel mfem in our blueos spack specs * Uses fixed versions: mfem@4.2.0 and hypre@2.20.0 * Disables mfem in our `gcc@7.3.1.` spec due to trouble linking against lapack/blas --- .../spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml | 8 +++++++- scripts/spack/specs.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml b/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml index f171775d65..835a1a8cb2 100644 --- a/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml +++ b/scripts/spack/configs/blueos_3_ppc64le_ib_p9/packages.yaml @@ -52,6 +52,12 @@ packages: externals: - spec: netlib-lapack@3.8.0 %clang@8.0.1_nvcc_xlf prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ + - spec: netlib-lapack@3.8.0 %clang@9.0.0_upstream_xlf + prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ + - spec: netlib-lapack@3.8.0 %xl@16.1.1_coral + prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ + - spec: netlib-lapack@3.8.0 %xl@16.1.1_nvcc + prefix: /usr/tcetmp/packages/lapack/lapack-3.8.0-xl-2019.08.20/ # System level packages to not build autoconf: @@ -119,7 +125,7 @@ packages: hypre: version: [2.20.0] mfem: - variants: ~mpi~metis~zlib + version: [4.2.0] raja: variants: ~shared~examples~exercises scr: diff --git a/scripts/spack/specs.json b/scripts/spack/specs.json index a05c2ce8e0..065b34e5a9 100644 --- a/scripts/spack/specs.json +++ b/scripts/spack/specs.json @@ -31,7 +31,7 @@ "blueos_3_ppc64le_ib_p9": [ "clang@9.0.0_upstream_xlf~cpp14~openmp+devtools+mfem+c2c", "clang@8.0.1_nvcc_xlf~cpp14~openmp+devtools+mfem+cuda+c2c cuda_arch=70", - "gcc@7.3.1~cpp14+devtools+mfem+c2c", + "gcc@7.3.1~cpp14+devtools~mfem+c2c", "xl@16.1.1_coral~cpp14~openmp+devtools+mfem+c2c", "xl@16.1.1_nvcc~cpp14~openmp+devtools+mfem+cuda+c2c cuda_arch=70" ], From ab814e89ea32bcd030d096c572b238b97bb95ff7 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 15:35:24 -0800 Subject: [PATCH 35/73] Updates host-configs on LLNL's toss3 RZ platforms --- .../rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake | 10 +++++----- .../rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake | 10 +++++----- host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake | 10 +++++----- .../rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake | 10 +++++----- .../rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake | 10 +++++----- .../rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake index fc20f7e296..cb3209f3ac 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-clang@10.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/clang-10.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/clang-10.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake index 75dacd0325..81c399729e 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-clang@9.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/clang-9.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/clang-9.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake index 80d7f91e99..15a5fc9cbe 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/gcc-8.1.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/gcc-8.1.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake index b634682241..8f5bc3fba2 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake @@ -11,9 +11,9 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/gcc/g++" CACHE PATH "") # No Fortran compiler defined in spec else() @@ -61,13 +61,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/gcc-8.1_no_fortran" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/gcc-8.1_no_fortran" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake index 73f01243b9..870669c9c8 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-intel@18.0.2.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/intel-18.0.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/intel-18.0.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake b/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake index 8febb65695..5a3724ac0e 100644 --- a/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake +++ b/host-configs/rzgenie-toss_3_x86_64_ib-intel@19.0.4.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_18_14_58_23/intel-19.0.4" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_26_21_05_39/intel-19.0.4" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") From c2134b21275c4f113a8225c15fd950393b373f02 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 15:37:36 -0800 Subject: [PATCH 36/73] Updates host-configs on LLNL's blueos RZ platforms --- ...blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake | 10 +++++----- ...os_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake | 10 +++++----- .../rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake | 12 ++++++------ ...nsel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake | 10 +++++----- ...ansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake | 10 +++++----- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake index 1961951064..3d13f00775 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/clang-8.0.1_nvcc_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/clang-8.0.1_nvcc_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake index 709bfa7d7c..01aa32816b 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/clang-9.0.0_upstream_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/clang-9.0.0_upstream_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake index ca455525ca..89cb4525ba 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -65,13 +65,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/gcc-7.3.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/gcc-7.3.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake index 554ba44d47..7eb4797858 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/xl-16.1.1_coral" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/xl-16.1.1_coral" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake index 9cfad45921..dddb492cf3 100644 --- a/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake +++ b/host-configs/rzansel-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_18_15_00_01/xl-16.1.1_nvcc" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_13_32_32/xl-16.1.1_nvcc" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") From 768e134ce3a003bd78d204b0a64afe8c13163234 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 15:48:33 -0800 Subject: [PATCH 37/73] Enables `AXOM_ENABLE_MFEM_SIDRE_DATA_COLLECTION` configuration option by default This option was previously `OFF` by default. This option should not be enabled if mfem was configured with `MFEM_USE_SIDRE`. --- RELEASE-NOTES.md | 2 ++ src/cmake/AxomOptions.cmake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index cdc0c62ea9..1c97c91a28 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -26,6 +26,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ### Changed - Renamed `AXOM_NOT_USED` macro to `AXOM_UNUSED_PARAM` for better consistency with other Axom macros - Added `explicit` to `axom::Inlet::InletVector` constructors and added a constructor that accepts a `double*` +- `AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION` configuration option is now `ON` by default (rather than `OFF`). + This option should be disabled if `mfem` was configured with `MFEM_USE_SIDRE`. ### Fixed - The `AXOM_DEBUG` compiler define is now properly exported via the `axom` CMake target when it is enabled diff --git a/src/cmake/AxomOptions.cmake b/src/cmake/AxomOptions.cmake index c0a9cbf4c1..29fc22498f 100644 --- a/src/cmake/AxomOptions.cmake +++ b/src/cmake/AxomOptions.cmake @@ -10,7 +10,7 @@ option(AXOM_ENABLE_ANNOTATIONS "Enables code annotations to facilitate performan option(AXOM_ENABLE_SPARSEHASH "Enables Sparsehash." ON) option(AXOM_ENABLE_ALL_COMPONENTS "Enables all components by default" ON) option(AXOM_USE_64BIT_INDEXTYPE "Use 64-bit integers for axom::IndexType" OFF) -option(AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION "Enable Axom's version of the MFEM SidreDataCollection" OFF) +option(AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION "Enable Axom's version of the MFEM SidreDataCollection" ON) if(NOT CMAKE_CONFIGURATION_TYPES) if(CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)") From 3c06c5a8ddf59d4c691d0f790b6a44a212375314 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 15:56:55 -0800 Subject: [PATCH 38/73] Removes `klee` host-configs These were customized configurations that built with a parallel mfem and are no longer necessary --- .../rzansel-klee-clang@8.0.1_nvcc_xlf.cmake | 130 ------------------ host-configs/rzgenie-klee-clang@10.0.0.cmake | 126 ----------------- 2 files changed, 256 deletions(-) delete mode 100644 host-configs/rzansel-klee-clang@8.0.1_nvcc_xlf.cmake delete mode 100644 host-configs/rzgenie-klee-clang@10.0.0.cmake diff --git a/host-configs/rzansel-klee-clang@8.0.1_nvcc_xlf.cmake b/host-configs/rzansel-klee-clang@8.0.1_nvcc_xlf.cmake deleted file mode 100644 index d446a7732d..0000000000 --- a/host-configs/rzansel-klee-clang@8.0.1_nvcc_xlf.cmake +++ /dev/null @@ -1,130 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.14.5/bin/cmake -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@8.0.1_nvcc_xlf -#------------------------------------------------------------------------------ -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/spack/lib/spack/env/clang/flang" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/clang/clang-8.0.1/bin/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-8.0.1/bin/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/xl/xl-2019.12.23/bin/xlf2003" CACHE PATH "") - -endif() - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -set(BLT_CXX_STD "c++14" CACHE STRING "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpif90" CACHE PATH "") - -set(MPIEXEC_EXECUTABLE "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-8.0.1/bin/mpirun" CACHE PATH "") - -set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "") - -set(ENABLE_MPI ON CACHE BOOL "") - -set(BLT_MPI_COMMAND_APPEND "mpibind" CACHE STRING "") - -#------------------------------------------------------------------------------ -# Hardware -#------------------------------------------------------------------------------ - -#------------------------------------------------ -# Cuda -#------------------------------------------------ - -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-10.1.243" CACHE PATH "") - -set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") - -set(CMAKE_CUDA_HOST_COMPILER "${MPI_CXX_COMPILER}" CACHE PATH "") - -set(ENABLE_CUDA ON CACHE BOOL "") - -set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "") - -set(AXOM_ENABLE_ANNOTATIONS ON CACHE BOOL "") - -set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") - -set(CMAKE_CUDA_FLAGS "-restrict --expt-extended-lambda -arch sm_${CMAKE_CUDA_ARCHITECTURES} -std=c++14" CACHE STRING "") - -# nvcc does not like gtest's 'pthreads' flag - -set(gtest_disable_pthreads ON CACHE BOOL "") - -#------------------------------------------------ -# Hardware Specifics -#------------------------------------------------ - -set(ENABLE_OPENMP OFF CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS OFF CACHE BOOL "") - -set(BLT_EXE_LINKER_FLAGS "${BLT_EXE_LINKER_FLAGS} -Wl,-rpath,/usr/tce/packages/xl/xl-2019.12.23/lib" CACHE STRING "Adds a missing rpath for libraries associated with the fortran compiler") - -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,/usr/tce/packages/xl/xl-2019.12.23/lib" CACHE STRING "Adds a missing rpath for libraries associated with the fortran compiler") - -set(BLT_FORTRAN_FLAGS "-WF,-C! -qxlf2003=polymorphic" CACHE STRING "Converts C-style comments to Fortran style in preprocessed files") - -set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3/lib64;/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64;/usr/tce/packages/gcc/gcc-4.9.3/gnu/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3" CACHE STRING "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -# Root directory for generated TPLs - -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_20_23_46/clang-8.0.1_nvcc_xlf" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.3.5" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-0.14.0" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-6.0.0" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -# ClangFormat disabled due to disabled devtools - -set(ENABLE_CLANGFORMAT OFF CACHE BOOL "") - -set(ENABLE_DOCS OFF CACHE BOOL "") - - diff --git a/host-configs/rzgenie-klee-clang@10.0.0.cmake b/host-configs/rzgenie-klee-clang@10.0.0.cmake deleted file mode 100644 index 82fe8608da..0000000000 --- a/host-configs/rzgenie-klee-clang@10.0.0.cmake +++ /dev/null @@ -1,126 +0,0 @@ -#------------------------------------------------------------------------------ -# !!!! This is a generated file, edit at own risk !!!! -#------------------------------------------------------------------------------ -# CMake executable path: /usr/tce/packages/cmake/cmake-3.14.5/bin/cmake -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# Compilers -#------------------------------------------------------------------------------ -# Compiler Spec: clang@10.0.0 -#------------------------------------------------------------------------------ -# Note: -# Contains a parallel build of MFEM generated using: -# >./scripts/llnl_scripts/build_tpls.py --spec "%clang@10.0.0+devtools+mfem+c2c ^mfem+mpi+metis+zlib" -# and adds a flag to use the axom version of mfem sidre data collection (see bottom of file) -#------------------------------------------------------------------------------ - -if(DEFINED ENV{SPACK_CC}) - - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/spack/lib/spack/env/clang/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/spack/lib/spack/env/clang/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/spack/lib/spack/env/clang/gfortran" CACHE PATH "") - -else() - - set(CMAKE_C_COMPILER "/usr/tce/packages/clang/clang-10.0.0/bin/clang" CACHE PATH "") - - set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-10.0.0/bin/clang++" CACHE PATH "") - - set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran" CACHE PATH "") - -endif() - -set(CMAKE_C_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0" CACHE STRING "") - -set(CMAKE_CXX_FLAGS "--gcc-toolchain=/usr/tce/packages/gcc/gcc-8.1.0" CACHE STRING "") - -set(ENABLE_FORTRAN ON CACHE BOOL "") - -set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,/usr/tce/packages/clang/clang-10.0.0/lib" CACHE STRING "Adds a missing libstdc++ rpath") - -set(BLT_CXX_STD "c++14" CACHE STRING "") - -#------------------------------------------------------------------------------ -# MPI -#------------------------------------------------------------------------------ - -set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3-clang-10.0.0/bin/mpif90" CACHE PATH "") - -set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") - -set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") - -set(ENABLE_MPI ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# Hardware -#------------------------------------------------------------------------------ - -#------------------------------------------------ -# Hardware Specifics -#------------------------------------------------ - -set(ENABLE_OPENMP ON CACHE BOOL "") - -set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") - -#------------------------------------------------------------------------------ -# TPLs -#------------------------------------------------------------------------------ - -# Root directory for generated TPLs - -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_19_10_21_07/clang-10.0.0" CACHE PATH "") - -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") - -set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") - -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") - -set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") - -set(LUA_DIR "${TPL_ROOT}/lua-5.3.5" CACHE PATH "") - -set(RAJA_DIR "${TPL_ROOT}/raja-0.14.0" CACHE PATH "") - -set(UMPIRE_DIR "${TPL_ROOT}/umpire-6.0.0" CACHE PATH "") - -# scr not built - -#------------------------------------------------------------------------------ -# Devtools -#------------------------------------------------------------------------------ - -# Root directory for generated developer tools - -set(DEVTOOLS_ROOT "/collab/usr/gapps/axom/devtools/toss_3_x86_64_ib/2020_08_21_22_18_57/gcc-8.1.0" CACHE PATH "") - -set(CLANGFORMAT_EXECUTABLE "/usr/tce/packages/clang/clang-10.0.0/bin/clang-format" CACHE PATH "") - -set(PYTHON_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.7.7/bin/python3.7" CACHE PATH "") - -set(ENABLE_DOCS ON CACHE BOOL "") - -set(SPHINX_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.7.7/bin/sphinx-build" CACHE PATH "") - -set(SHROUD_EXECUTABLE "${DEVTOOLS_ROOT}/python-3.7.7/bin/shroud" CACHE PATH "") - -set(CPPCHECK_EXECUTABLE "${DEVTOOLS_ROOT}/cppcheck-1.87/bin/cppcheck" CACHE PATH "") - -set(DOXYGEN_EXECUTABLE "${DEVTOOLS_ROOT}/doxygen-1.8.14/bin/doxygen" CACHE PATH "") - - - -#------------------------------------------------------------------------------ -# Additional setup for Klee examples -#------------------------------------------------------------------------------ -set(AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION ON CACHE STRING "") - From 38645f0ae93ca90c6d3c6379003a21a124894d33 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 17:40:32 -0800 Subject: [PATCH 39/73] Updates host-configs on LLNL's blueos CZ platforms --- ...blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake | 10 +++++----- ...os_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake | 10 +++++----- .../lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake | 12 ++++++------ ...ssen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake | 10 +++++----- ...assen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake | 10 +++++----- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake index 02234011b5..9b0b51f290 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@8.0.1_nvcc_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/clang-8.0.1_nvcc_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/clang-8.0.1_nvcc_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake index 76a4641c3e..746c3cdcc9 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-clang@9.0.0_upstream_xlf.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/clang/flang" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/clang/flang" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/clang-9.0.0_upstream_xlf" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/clang-9.0.0_upstream_xlf" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake index c9462ad102..152654d181 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-gcc@7.3.1.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -65,13 +65,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/gcc-7.3.1" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/gcc-7.3.1" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake index 70667f8c4c..e33715a398 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_coral.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -73,9 +73,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/xl-16.1.1_coral" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/xl-16.1.1_coral" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake index eff031cdf8..9f3e4200eb 100644 --- a/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake +++ b/host-configs/lassen-blueos_3_ppc64le_ib_p9-xl@16.1.1_nvcc.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlc++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlc++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/spack/lib/spack/env/xl/xlf90" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/spack/lib/spack/env/xl/xlf90" CACHE PATH "") else() @@ -97,9 +97,9 @@ set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3 # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_10_19_21_01_46/xl-16.1.1_nvcc" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/blueos_3_ppc64le_ib_p9/2021_11_10_16_10_30/xl-16.1.1_nvcc" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") From 3bc0bd4b9830b73d5c07feda18d2a6ed31b68f03 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 17:49:18 -0800 Subject: [PATCH 40/73] Use parallel mfem in docker spack specs --- scripts/spack/configs/docker/ubuntu18/packages.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/spack/configs/docker/ubuntu18/packages.yaml b/scripts/spack/configs/docker/ubuntu18/packages.yaml index 965c7b4b7e..34c8043c8c 100644 --- a/scripts/spack/configs/docker/ubuntu18/packages.yaml +++ b/scripts/spack/configs/docker/ubuntu18/packages.yaml @@ -101,8 +101,11 @@ packages: hdf5: variants: ~shared~mpi # do shared mfem to allow PIC flag in mfem + hypre: + version: [2.20.0] mfem: - variants: +shared~static~mpi~metis~zlib + version: [4.2.0] + variants: +shared~static raja: variants: ~shared~examples~exercises scr: From 681c988f6ab1e349a164ec077d80290a20239cff Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Wed, 10 Nov 2021 18:31:43 -0800 Subject: [PATCH 41/73] Updates docker images to use parallel mfem --- azure-pipelines.yml | 4 ++-- .../docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake | 2 +- .../docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 907824ce12..7a2872cad9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,8 +9,8 @@ variables: DO_BUILD: 'yes' DO_TEST: 'yes' DO_CLEAN: 'no' - CLANG10_IMAGENAME: 'axom/tpls:clang-10_10-21-21_21h-28m' - GCC8_IMAGENAME: 'axom/tpls:gcc-8_10-21-21_21h-28m' + CLANG10_IMAGENAME: 'axom/tpls:clang-10_11-11-21_01h-52m' + GCC8_IMAGENAME: 'axom/tpls:gcc-8_11-11-21_01h-52m' jobs: - job: Build_and_Test diff --git a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake index e50c2b8783..3254cfb8d7 100644 --- a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake +++ b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-clang@10.0.0.cmake @@ -69,7 +69,7 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") set(TPL_ROOT "/home/axom/axom_tpls/clang-10.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") # C2C not built diff --git a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake index 8ea4fad90e..2bcf6cb1ed 100644 --- a/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake +++ b/host-configs/docker/docker-linux-ubuntu18.04-x86_64-gcc@8.4.0.cmake @@ -71,7 +71,7 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") set(TPL_ROOT "/home/axom/axom_tpls/gcc-8.4.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") # C2C not built From 69b25d7b012defdd64a4fe386e8eeb3b6ffc2650 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 11 Nov 2021 09:57:03 -0800 Subject: [PATCH 42/73] Updates host-configs on LLNL's toss3 CZ platforms --- host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake | 10 +++++----- host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake | 10 +++++----- host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake | 10 +++++----- .../ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake | 10 +++++----- host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake | 10 +++++----- host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake b/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake index ceed86efa2..cc18ecc4e0 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-clang@10.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/clang-10.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/clang-10.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake b/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake index 56d914b48b..545cac4834 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-clang@9.0.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/clang++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/clang++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/clang/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/clang/gfortran" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/clang-9.0.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/clang-9.0.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake index 67c42edab3..3b324c6275 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1.0.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/g++" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/gfortran" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/gcc-8.1.0" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/gcc-8.1.0" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake index 77f282e0b4..d8722e7ae8 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-gcc@8.1_no_fortran.cmake @@ -11,9 +11,9 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/gcc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/gcc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/gcc/g++" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/gcc/g++" CACHE PATH "") # No Fortran compiler defined in spec else() @@ -61,13 +61,13 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/gcc-8.1_no_fortran" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/gcc-8.1_no_fortran" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") -set(MFEM_DIR "${TPL_ROOT}/mfem-4.2.0" CACHE PATH "") +# MFEM not built set(HDF5_DIR "${TPL_ROOT}/hdf5-1.8.22" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake b/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake index f902554753..bcdbc3e7cc 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-intel@18.0.2.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -63,9 +63,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/intel-18.0.2" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/intel-18.0.2" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") diff --git a/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake b/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake index 8ccc140b84..07148cd0be 100644 --- a/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake +++ b/host-configs/ruby-toss_3_x86_64_ib-intel@19.0.4.cmake @@ -11,11 +11,11 @@ #------------------------------------------------------------------------------ if(DEFINED ENV{SPACK_CC}) - set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icc" CACHE PATH "") + set(CMAKE_C_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icc" CACHE PATH "") - set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/icpc" CACHE PATH "") + set(CMAKE_CXX_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/icpc" CACHE PATH "") - set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/spack/lib/spack/env/intel/ifort" CACHE PATH "") + set(CMAKE_Fortran_COMPILER "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/spack/lib/spack/env/intel/ifort" CACHE PATH "") else() @@ -69,9 +69,9 @@ set(ENABLE_GTEST_DEATH_TESTS ON CACHE BOOL "") # Root directory for generated TPLs -set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_10_20_15_53_57/intel-19.0.4" CACHE PATH "") +set(TPL_ROOT "/usr/WS1/axom/libs/toss_3_x86_64_ib/2021_11_10_20_53_55/intel-19.0.4" CACHE PATH "") -set(CONDUIT_DIR "${TPL_ROOT}/conduit-develop" CACHE PATH "") +set(CONDUIT_DIR "${TPL_ROOT}/conduit-0.7.2axom" CACHE PATH "") set(C2C_DIR "${TPL_ROOT}/c2c-1.3.0" CACHE PATH "") From 8338e6ba413e642469c71b4dc1019d230d571ac9 Mon Sep 17 00:00:00 2001 From: Kenny Weiss Date: Thu, 11 Nov 2021 10:05:23 -0800 Subject: [PATCH 43/73] Apply PR suggestion Co-authored-by: Arlie Capps <48997041+agcapps@users.noreply.github.com> --- scripts/spack/configs/docker/ubuntu18/packages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spack/configs/docker/ubuntu18/packages.yaml b/scripts/spack/configs/docker/ubuntu18/packages.yaml index 34c8043c8c..b0acb98a9a 100644 --- a/scripts/spack/configs/docker/ubuntu18/packages.yaml +++ b/scripts/spack/configs/docker/ubuntu18/packages.yaml @@ -100,9 +100,9 @@ packages: variants: ~shared~test hdf5: variants: ~shared~mpi - # do shared mfem to allow PIC flag in mfem hypre: version: [2.20.0] + # do shared mfem to allow PIC flag in mfem mfem: version: [4.2.0] variants: +shared~static From d0224e51ef8114bfd9d63c232b9890f34b096b60 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 11 Nov 2021 16:19:06 -0800 Subject: [PATCH 44/73] Fix build system logic guarding shaping example Also updates shaping code now that it is once again included in the build. --- src/axom/quest/CMakeLists.txt | 2 +- src/axom/quest/IntersectionShaper.hpp | 102 ++++++++++-------- src/axom/quest/SamplingShaper.hpp | 60 ++++++----- src/axom/quest/Shaper.cpp | 21 ++-- src/axom/quest/Shaper.hpp | 2 +- .../quest/detail/shaping/shaping_helpers.cpp | 54 +++++----- src/axom/quest/examples/CMakeLists.txt | 4 +- src/axom/quest/examples/shaping_driver.cpp | 52 ++++----- 8 files changed, 157 insertions(+), 140 deletions(-) diff --git a/src/axom/quest/CMakeLists.txt b/src/axom/quest/CMakeLists.txt index 5b84e9d51e..a465f79567 100644 --- a/src/axom/quest/CMakeLists.txt +++ b/src/axom/quest/CMakeLists.txt @@ -94,7 +94,7 @@ blt_list_append(TO quest_depends_on IF ENABLE_OPENMP ELEMENTS openmp) blt_list_append(TO quest_depends_on IF SPARSEHASH_FOUND ELEMENTS sparsehash) blt_list_append(TO quest_depends_on IF MFEM_FOUND ELEMENTS mfem) -if(MFEM_FOUND AND AXOM_USE_KLEE AND AXOM_USE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION) +if(MFEM_FOUND AND AXOM_ENABLE_KLEE AND AXOM_ENABLE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION) list(APPEND quest_headers Shaper.hpp SamplingShaper.hpp IntersectionShaper.hpp diff --git a/src/axom/quest/IntersectionShaper.hpp b/src/axom/quest/IntersectionShaper.hpp index 600b558d2b..fc33817564 100644 --- a/src/axom/quest/IntersectionShaper.hpp +++ b/src/axom/quest/IntersectionShaper.hpp @@ -33,8 +33,8 @@ #include "mfem.hpp" -#include "fmt/fmt.hpp" -#include "fmt/locale.h" +#include "axom/fmt.hpp" +#include "axom/fmt/locale.h" // RAJA #if defined(AXOM_USE_RAJA) @@ -204,10 +204,11 @@ class IntersectionShaper : public Shaper void prepareShapeQueryImpl(klee::Dimensions shapeDimension, const klee::Shape& shape) { - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format("Running intersection-based shaper in execution Space: {}", - axom::execution_space::name()))); + axom::fmt::format( + "Running intersection-based shaper in execution Space: {}", + axom::execution_space::name()))); umpire::ResourceManager& rm = umpire::ResourceManager::getInstance(); @@ -225,20 +226,22 @@ class IntersectionShaper : public Shaper AXOM_UNUSED_VAR(shapeDimension); AXOM_UNUSED_VAR(shapeName); - SLIC_INFO(fmt::format("Current shape is {}", shapeName)); + SLIC_INFO(axom::fmt::format("Current shape is {}", shapeName)); // Number of points in polyline int pointcount = getSurfaceMesh()->getNumberOfNodes(); Point2D* polyline = axom::allocate(pointcount); - SLIC_INFO(fmt::format("{:-^80}", - fmt::format(" Refinement level set to {} ", m_level))); + SLIC_INFO(axom::fmt::format( + "{:-^80}", + axom::fmt::format(" Refinement level set to {} ", m_level))); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Checking contour with {} points for degenerate segments ", - pointcount))); + axom::fmt::format( + " Checking contour with {} points for degenerate segments ", + pointcount))); enum { @@ -299,9 +302,9 @@ class IntersectionShaper : public Shaper } } - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Discretizing contour with {} points ", polyline_size))); + axom::fmt::format(" Discretizing contour with {} points ", polyline_size))); // Flip point order if(flip) @@ -327,8 +330,9 @@ class IntersectionShaper : public Shaper disc_status, "Discretization of contour has failed. Check that contour is valid"); - SLIC_INFO(fmt::format("Contour has been discretized into {} octahedra ", - m_octcount)); + SLIC_INFO( + axom::fmt::format("Contour has been discretized into {} octahedra ", + m_octcount)); if(this->isVerbose()) { @@ -338,10 +342,10 @@ class IntersectionShaper : public Shaper { all_oct_bb.addBox(primal::compute_bounding_box(m_octs[i])); } - SLIC_INFO( - fmt::format("DEBUG: Bounding box containing all generated octahedra " - "has dimensions:\n\t{}", - all_oct_bb)); + SLIC_INFO(axom::fmt::format( + "DEBUG: Bounding box containing all generated octahedra " + "has dimensions:\n\t{}", + all_oct_bb)); // Print out the total volume of all the octahedra using REDUCE_POL = typename axom::execution_space::reduce_policy; @@ -378,9 +382,9 @@ class IntersectionShaper : public Shaper total_oct_vol += octVolume; }); - SLIC_INFO( - fmt::format("DEBUG: Total volume of all generated octahedra is {}", - total_oct_vol.get())); + SLIC_INFO(axom::fmt::format( + "DEBUG: Total volume of all generated octahedra is {}", + total_oct_vol.get())); // Check if any Octahedron are degenerate with all points {0,0,0} RAJA::ReduceSum num_degenerate(0); @@ -395,8 +399,8 @@ class IntersectionShaper : public Shaper }); SLIC_INFO( - fmt::format("DEBUG: {} Octahedron found with all points (0,0,0)", - num_degenerate.get())); + axom::fmt::format("DEBUG: {} Octahedron found with all points (0,0,0)", + num_degenerate.get())); // Dump discretized octs as a tet mesh axom::mint::Mesh* tetmesh; @@ -441,7 +445,8 @@ class IntersectionShaper : public Shaper ZERO[0] = 0; SLIC_INFO( - fmt::format("{:-^80}", " Inserting Octahedra bounding boxes into BVH ")); + axom::fmt::format("{:-^80}", + " Inserting Octahedra bounding boxes into BVH ")); // Generate the BVH tree over the octahedra // Access-aligned bounding boxes @@ -459,7 +464,7 @@ class IntersectionShaper : public Shaper spin::BVH<3, ExecSpace, double> bvh; bvh.initialize(m_aabbs, m_octcount); - SLIC_INFO(fmt::format("{:-^80}", " Querying the BVH tree ")); + SLIC_INFO(axom::fmt::format("{:-^80}", " Querying the BVH tree ")); mfem::Mesh* mesh = getDC()->GetMesh(); @@ -470,10 +475,11 @@ class IntersectionShaper : public Shaper if(this->isVerbose()) { - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Initializing {} hexahedral elements from given mesh ", - m_num_elements))); + axom::fmt::format( + " Initializing {} hexahedral elements from given mesh ", + m_num_elements))); } if(NE > 0) @@ -485,7 +491,7 @@ class IntersectionShaper : public Shaper // Create and register a scalar field for this shape's volume fractions // The Degrees of Freedom will be in correspondence with the elements auto* volFrac = this->newVolFracGridFunction(); - auto volFracName = fmt::format("shape_vol_frac_{}", shape.getName()); + auto volFracName = axom::fmt::format("shape_vol_frac_{}", shape.getName()); this->getDC()->RegisterField(volFracName, volFrac); // Initialize hexahedral elements @@ -583,7 +589,7 @@ class IntersectionShaper : public Shaper }); // Find which octahedra bounding boxes intersect hexahedron bounding boxes - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", " Finding octahedra candidates for each hexahedral element ")); @@ -626,7 +632,7 @@ class IntersectionShaper : public Shaper int* newTotalCandidates = axom::allocate(1); axom::copy(newTotalCandidates, ZERO, sizeof(int)); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", " Decomposing each hexahedron element into 24 tetrahedrons ")); @@ -643,9 +649,9 @@ class IntersectionShaper : public Shaper } });); - SLIC_INFO( - fmt::format("{:-^80}", - " Linearizing each tetrahedron, octahedron candidate pair ")); + SLIC_INFO(axom::fmt::format( + "{:-^80}", + " Linearizing each tetrahedron, octahedron candidate pair ")); AXOM_PERF_MARK_SECTION( "init_candidates", @@ -682,7 +688,8 @@ class IntersectionShaper : public Shaper m_overlap_volumes[i] = 0; }); - SLIC_INFO(fmt::format("{:-^80}", " Calculating hexahedron element volume ")); + SLIC_INFO( + axom::fmt::format("{:-^80}", " Calculating hexahedron element volume ")); AXOM_PERF_MARK_SECTION("hex_volume", axom::for_all( @@ -694,7 +701,7 @@ class IntersectionShaper : public Shaper tet_volume); });); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", " Calculating element overlap volume from each tet-oct pair ")); @@ -731,10 +738,10 @@ class IntersectionShaper : public Shaper totalHex += m_hex_volumes[i]; }); - SLIC_INFO(fmt::format("Total overlap volume with shape is {}", - this->allReduceSum(totalOverlap))); - SLIC_INFO( - fmt::format("Total mesh volume is {}", this->allReduceSum(totalHex))); + SLIC_INFO(axom::fmt::format("Total overlap volume with shape is {}", + this->allReduceSum(totalOverlap))); + SLIC_INFO(axom::fmt::format("Total mesh volume is {}", + this->allReduceSum(totalHex))); // Deallocate no longer needed variables axom::deallocate(ZERO); @@ -758,14 +765,15 @@ class IntersectionShaper : public Shaper { const auto& shapeName = shape.getName(); const auto& materialName = shape.getMaterial(); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format("Applying replacement rules for shape '{}' of material {}", - shapeName, - materialName))); + axom::fmt::format( + "Applying replacement rules for shape '{}' of material {}", + shapeName, + materialName))); - auto shapeVolFracName = fmt::format("shape_vol_frac_{}", shapeName); - auto materialVolFracName = fmt::format("vol_frac_{}", materialName); + auto shapeVolFracName = axom::fmt::format("shape_vol_frac_{}", shapeName); + auto materialVolFracName = axom::fmt::format("vol_frac_{}", materialName); auto* shapeVolFrac = this->getDC()->GetField(shapeVolFracName); SLIC_ASSERT(shapeVolFrac != nullptr); diff --git a/src/axom/quest/SamplingShaper.hpp b/src/axom/quest/SamplingShaper.hpp index 6bcf214888..5042f81236 100644 --- a/src/axom/quest/SamplingShaper.hpp +++ b/src/axom/quest/SamplingShaper.hpp @@ -33,8 +33,8 @@ #include "mfem.hpp" -#include "fmt/fmt.hpp" -#include "fmt/locale.h" +#include "axom/fmt.hpp" +#include "axom/fmt/locale.h" namespace axom { @@ -131,7 +131,7 @@ class InOutSampler // Sample the in/out field at each point // store in QField which we register with the QFunc collection - const std::string inoutName = fmt::format("inout_{}", m_shapeName); + const std::string inoutName = axom::fmt::format("inout_{}", m_shapeName); const int vdim = 1; auto* inout = new mfem::QuadratureFunction(sp, vdim); inoutQFuncs.Register(inoutName, inout, true); @@ -151,17 +151,18 @@ class InOutSampler const bool in = m_octree->within(pt); res(p) = in ? 1. : 0.; - // SLIC_INFO(fmt::format("[{},{}] Pt: {}, In: {}", i,p,pt, (in? "yes" : "no") )); + // SLIC_INFO(axom::fmt::format("[{},{}] Pt: {}, In: {}", i,p,pt, (in? "yes" : "no") )); } } timer.stop(); - SLIC_INFO(fmt::format(std::locale("en_US.UTF-8"), - "\t Sampling inout field '{}' took {} seconds (@ " - "{:L} queries per second)", - inoutName, - timer.elapsed(), - static_cast((NE * nq) / timer.elapsed()))); + SLIC_INFO( + axom::fmt::format(std::locale("en_US.UTF-8"), + "\t Sampling inout field '{}' took {} seconds (@ " + "{:L} queries per second)", + inoutName, + timer.elapsed(), + static_cast((NE * nq) / timer.elapsed()))); } /** @@ -188,7 +189,7 @@ class InOutSampler mfem::FiniteElementSpace* fes = new mfem::FiniteElementSpace(mesh, coll); mfem::GridFunction* volFrac = new mfem::GridFunction(fes); volFrac->MakeOwner(coll); - auto volFracName = fmt::format("vol_frac_{}", m_shapeName); + auto volFracName = axom::fmt::format("vol_frac_{}", m_shapeName); dc->RegisterField(volFracName, volFrac); auto* fe = fes->GetFE(0); @@ -298,7 +299,7 @@ class SamplingShaper : public Shaper { const auto& shapeName = shape.getName(); - SLIC_INFO(fmt::format("{:-^80}", " Generating the octree ")); + SLIC_INFO(axom::fmt::format("{:-^80}", " Generating the octree ")); internal::ScopedLogLevelChanger logLevelChanger( this->isVerbose() ? slic::message::Debug : slic::message::Warning); @@ -336,20 +337,20 @@ class SamplingShaper : public Shaper const int nVerts = m_surfaceMesh->getNumberOfNodes(); const int nCells = m_surfaceMesh->getNumberOfCells(); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "After welding, surface mesh has {} vertices and {} triangles.", nVerts, nCells)); mint::write_vtk(m_surfaceMesh, - fmt::format("meldedTriMesh_{}.vtk", shapeName)); + axom::fmt::format("meldedTriMesh_{}.vtk", shapeName)); } } void runShapeQuery(const klee::Shape& shape) override { - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format(" Querying the octree for shape '{}'", shape.getName()))); + axom::fmt::format(" Querying the octree for shape '{}'", shape.getName()))); internal::ScopedLogLevelChanger logLevelChanger( this->isVerbose() ? slic::message::Debug : slic::message::Warning); @@ -367,21 +368,23 @@ class SamplingShaper : public Shaper void applyReplacementRules(const klee::Shape& shape) override { - using axom::utilities::string::splitLastNTokens; + using axom::utilities::string::rsplitN; const auto& shapeName = shape.getName(); - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{:-^80}", - fmt::format("Applying replacement rules over for shape '{}'", shapeName))); + axom::fmt::format("Applying replacement rules over for shape '{}'", + shapeName))); internal::ScopedLogLevelChanger logLevelChanger( this->isVerbose() ? slic::message::Debug : slic::message::Warning); // Get inout qfunc for this shape - auto* shapeQFunc = m_inoutShapeQFuncs.Get(fmt::format("inout_{}", shapeName)); + auto* shapeQFunc = + m_inoutShapeQFuncs.Get(axom::fmt::format("inout_{}", shapeName)); SLIC_ASSERT_MSG( shapeQFunc != nullptr, - fmt::format("Missing inout samples for shape '{}'", shapeName)); + axom::fmt::format("Missing inout samples for shape '{}'", shapeName)); // Create a copy of the inout samples for this shape // Replacements will be applied to this and then copied into our shape's material @@ -391,7 +394,7 @@ class SamplingShaper : public Shaper const auto& thisMatName = shape.getMaterial(); for(auto& mat : m_inoutMaterialQFuncs) { - const std::string otherMatName = splitLastNTokens(mat.first, 2, '_')[1]; + const std::string otherMatName = rsplitN(mat.first, 2, '_')[1]; // We'll handle the current shape's material at the end if(otherMatName == thisMatName) @@ -400,7 +403,7 @@ class SamplingShaper : public Shaper } const bool shouldReplace = shape.replaces(otherMatName); - SLIC_DEBUG(fmt::format( + SLIC_DEBUG(axom::fmt::format( "Should we replace material '{}' with shape '{}' of material '{}'? {}", otherMatName, shapeName, @@ -410,14 +413,15 @@ class SamplingShaper : public Shaper auto* otherMatQFunc = mat.second; SLIC_ASSERT_MSG( otherMatQFunc != nullptr, - fmt::format("Missing inout samples for material '{}'", otherMatName)); + axom::fmt::format("Missing inout samples for material '{}'", + otherMatName)); quest::shaping::replaceMaterial(shapeQFuncCopy, otherMatQFunc, shouldReplace); } // Get inout qfunc for the current material const std::string materialQFuncName = - fmt::format("mat_inout_{}", thisMatName); + axom::fmt::format("mat_inout_{}", thisMatName); if(!m_inoutMaterialQFuncs.Has(materialQFuncName)) { // initialize material from shape inout, the QFunc registry takes ownership @@ -429,7 +433,7 @@ class SamplingShaper : public Shaper auto* matQFunc = m_inoutMaterialQFuncs.Get(materialQFuncName); SLIC_ASSERT_MSG( matQFunc != nullptr, - fmt::format("Missing inout samples for material '{}'", thisMatName)); + axom::fmt::format("Missing inout samples for material '{}'", thisMatName)); quest::shaping::copyShapeIntoMaterial(shapeQFuncCopy, matQFunc); @@ -462,8 +466,8 @@ class SamplingShaper : public Shaper { const std::string matName = mat.first; SLIC_INFO( - fmt::format("Generating volume fraction fields for '{}' material", - matName)); + axom::fmt::format("Generating volume fraction fields for '{}' material", + matName)); // Sample the InOut field at the mesh quadrature points switch(m_vfSampling) diff --git a/src/axom/quest/Shaper.cpp b/src/axom/quest/Shaper.cpp index bd053e7e40..6f963c6223 100644 --- a/src/axom/quest/Shaper.cpp +++ b/src/axom/quest/Shaper.cpp @@ -9,7 +9,7 @@ #include "axom/core.hpp" #include "axom/quest/interface/internal/QuestHelpers.hpp" -#include "fmt/fmt.hpp" +#include "axom/fmt.hpp" #ifndef AXOM_USE_MFEM #error Shaping functionality requires Axom to be configured with MFEM and the AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION option @@ -90,7 +90,7 @@ void Shaper::setSamplesPerKnotSpan(int nSamples) using axom::utilities::clampLower; SLIC_WARNING_IF( nSamples < 1, - fmt::format( + axom::fmt::format( "Samples per knot span must be at least 1. Provided value was {}", nSamples)); @@ -101,7 +101,7 @@ void Shaper::setVertexWeldThreshold(double threshold) { SLIC_WARNING_IF( threshold <= 0., - fmt::format( + axom::fmt::format( "Vertex weld threshold should be positive Provided value was {}", threshold)); @@ -117,12 +117,13 @@ void Shaper::loadShape(const klee::Shape& shape) { using axom::utilities::string::endsWith; - SLIC_INFO(fmt::format("{:-^80}", - fmt::format(" Loading shape '{}' ", shape.getName()))); + SLIC_INFO(axom::fmt::format( + "{:-^80}", + axom::fmt::format(" Loading shape '{}' ", shape.getName()))); SLIC_ASSERT_MSG(this->isValidFormat(shape.getGeometry().getFormat()), - fmt::format("Shape has unsupported format: '{}", - shape.getGeometry().getFormat())); + axom::fmt::format("Shape has unsupported format: '{}", + shape.getGeometry().getFormat())); std::string shapePath = m_shapeSet.resolvePath(shape.getGeometry().getPath()); SLIC_INFO("Reading file: " << shapePath << "..."); @@ -144,9 +145,9 @@ void Shaper::loadShape(const klee::Shape& shape) else { SLIC_ERROR( - fmt::format("Unsupported filetype for this Axom configuration. " - "Provided file was '{}'", - shapePath)); + axom::fmt::format("Unsupported filetype for this Axom configuration. " + "Provided file was '{}'", + shapePath)); } } diff --git a/src/axom/quest/Shaper.hpp b/src/axom/quest/Shaper.hpp index 4f85565ba8..c909ee10aa 100644 --- a/src/axom/quest/Shaper.hpp +++ b/src/axom/quest/Shaper.hpp @@ -13,7 +13,7 @@ #define AXOM_QUEST_SHAPER__HPP_ #include "axom/config.hpp" -#ifndef AXOM_ENABLE_KLEE +#ifndef AXOM_USE_KLEE #error Shaping functionality requires Axom to be configured with the Klee component #endif #ifndef AXOM_USE_MFEM diff --git a/src/axom/quest/detail/shaping/shaping_helpers.cpp b/src/axom/quest/detail/shaping/shaping_helpers.cpp index 2676aecaa5..a05831c380 100644 --- a/src/axom/quest/detail/shaping/shaping_helpers.cpp +++ b/src/axom/quest/detail/shaping/shaping_helpers.cpp @@ -4,8 +4,8 @@ #include "axom/core.hpp" #include "axom/slic.hpp" -#include "fmt/fmt.hpp" -#include "fmt/locale.h" +#include "axom/fmt.hpp" +#include "axom/fmt/locale.h" #ifndef AXOM_USE_MFEM #error Shaping functionality requires Axom to be configured with MFEM and the AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION option @@ -132,10 +132,10 @@ void computeVolumeFractions(const std::string& matField, QFunctionCollection& inoutQFuncs, int outputOrder) { - using axom::utilities::string::splitLastNTokens; + using axom::utilities::string::rsplitN; - auto matName = splitLastNTokens(matField, 2, '_')[1]; - auto volFracName = fmt::format("vol_frac_{}", matName); + auto matName = rsplitN(matField, 2, '_')[1]; + auto volFracName = axom::fmt::format("vol_frac_{}", matName); // Grab a pointer to the inout samples QFunc mfem::QuadratureFunction* inout = inoutQFuncs.Get(matField); @@ -143,21 +143,21 @@ void computeVolumeFractions(const std::string& matField, const int sampleOrder = inout->GetSpace()->GetElementIntRule(0).GetOrder(); const int sampleNQ = inout->GetSpace()->GetElementIntRule(0).GetNPoints(); const int sampleSZ = inout->GetSpace()->GetSize(); - SLIC_INFO(fmt::format(std::locale("en_US.UTF-8"), - "In computeVolumeFractions(): sample order {} | " - "sample num qpts {} | total samples {:L}", - sampleOrder, - sampleNQ, - sampleSZ)); + SLIC_INFO(axom::fmt::format(std::locale("en_US.UTF-8"), + "In computeVolumeFractions(): sample order {} | " + "sample num qpts {} | total samples {:L}", + sampleOrder, + sampleNQ, + sampleSZ)); mfem::Mesh* mesh = dc->GetMesh(); const int dim = mesh->Dimension(); const int NE = mesh->GetNE(); - SLIC_INFO(fmt::format(std::locale("en_US.UTF-8"), - "Mesh has dim {} and {:L} elements", - dim, - NE)); + SLIC_INFO(axom::fmt::format(std::locale("en_US.UTF-8"), + "Mesh has dim {} and {:L} elements", + dim, + NE)); // Project QField onto volume fractions field @@ -211,13 +211,13 @@ void computeVolumeFractions(const std::string& matField, } } timer.stop(); - SLIC_INFO( - fmt::format(std::locale("en_US.UTF-8"), - "\t Generating volume fractions '{}' took {:.3f} seconds (@ " - "{:L} dofs processed per second)", - volFracName, - timer.elapsed(), - static_cast(fes->GetNDofs() / timer.elapsed()))); + SLIC_INFO(axom::fmt::format( + std::locale("en_US.UTF-8"), + "\t Generating volume fractions '{}' took {:.3f} seconds (@ " + "{:L} dofs processed per second)", + volFracName, + timer.elapsed(), + static_cast(fes->GetNDofs() / timer.elapsed()))); } /** @@ -266,10 +266,10 @@ void FCT_project(mfem::DenseMatrix& M, #ifdef AXOM_DEBUG SLIC_WARNING_IF(!(y_min < y_avg + 1e-12 && y_avg < y_max + 1e-12), - fmt::format("Average ({}) is out of bounds [{},{}]: ", - y_avg, - y_min - 1e-12, - y_max + 1e-12)); + axom::fmt::format("Average ({}) is out of bounds [{},{}]: ", + y_avg, + y_min - 1e-12, + y_max + 1e-12)); #endif Vector z(s); @@ -372,7 +372,7 @@ void computeVolumeFractionsIdentity(mfem::DataCollection* dc, const int dim = mesh->Dimension(); const int NE = mesh->GetNE(); - std::cout << fmt::format("Mesh has dim {} and {} elements", dim, NE) + std::cout << axom::fmt::format("Mesh has dim {} and {} elements", dim, NE) << std::endl; mfem::L2_FECollection* fec = diff --git a/src/axom/quest/examples/CMakeLists.txt b/src/axom/quest/examples/CMakeLists.txt index a67648f85e..1300cacee1 100644 --- a/src/axom/quest/examples/CMakeLists.txt +++ b/src/axom/quest/examples/CMakeLists.txt @@ -20,8 +20,8 @@ blt_add_executable( ) if(ENABLE_MPI AND MFEM_FOUND AND MFEM_USE_MPI - AND AXOM_USE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION - AND AXOM_USE_KLEE) + AND AXOM_ENABLE_SIDRE AND AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION + AND AXOM_ENABLE_KLEE) blt_add_executable( NAME quest_shaping_driver_ex SOURCES shaping_driver.cpp diff --git a/src/axom/quest/examples/shaping_driver.cpp b/src/axom/quest/examples/shaping_driver.cpp index ec1c37d622..c2a1b994dc 100644 --- a/src/axom/quest/examples/shaping_driver.cpp +++ b/src/axom/quest/examples/shaping_driver.cpp @@ -17,8 +17,8 @@ #include "axom/klee.hpp" #include "axom/quest.hpp" -#include "fmt/fmt.hpp" -#include "CLI11/CLI11.hpp" +#include "axom/fmt.hpp" +#include "axom/CLI11.hpp" // NOTE: The shaping driver requires Axom to be configured with mfem as well as // the AXOM_ENABLE_MFEM_SIDRE_DATACOLLECTION CMake option @@ -115,17 +115,17 @@ struct Input return name; } - void parse(int argc, char** argv, CLI::App& app) + void parse(int argc, char** argv, axom::CLI::App& app) { app.add_option("-m,--mesh-file", meshFile) ->description( "Path to computational mesh (generated by MFEMSidreDataCollection)") - ->check(CLI::ExistingFile) + ->check(axom::CLI::ExistingFile) ->required(); app.add_option("-i,--shape-file", shapeFile) ->description("Path to input shape file") - ->check(CLI::ExistingFile) + ->check(axom::CLI::ExistingFile) ->required(); app.add_flag("-v,--verbose,!--no-verbose", m_verboseOutput) @@ -136,11 +136,11 @@ struct Input ->description( "(2D only) Number of linear segments to generate per NURBS knot span") ->capture_default_str() - ->check(CLI::PositiveNumber); + ->check(axom::CLI::PositiveNumber); app.add_option("-t,--weld-threshold", weldThresh) ->description("Threshold for welding") - ->check(CLI::NonNegativeNumber) + ->check(axom::CLI::NonNegativeNumber) ->capture_default_str(); // Parameter to determine if we're using a file or a box mesh @@ -151,7 +151,8 @@ struct Input ->description( "Determines the shaping method -- either sampling or intersection") ->capture_default_str() - ->transform(CLI::CheckedTransformer(methodMap, CLI::ignore_case)); + ->transform( + axom::CLI::CheckedTransformer(methodMap, axom::CLI::ignore_case)); // parameters that only apply to the sampling method auto* sampling_options = @@ -161,7 +162,7 @@ struct Input sampling_options->add_option("-o,--order", outputOrder) ->description("order of the output grid function") ->capture_default_str() - ->check(CLI::NonNegativeNumber); + ->check(axom::CLI::NonNegativeNumber); sampling_options->add_option("-q,--quadrature-order", quadratureOrder) ->description( @@ -169,7 +170,7 @@ struct Input "Determines number of samples per element in determining " "volume fraction field") ->capture_default_str() - ->check(CLI::PositiveNumber); + ->check(axom::CLI::PositiveNumber); std::map vfsamplingMap { {"qpts", VolFracSampling::SAMPLE_AT_QPTS}, @@ -180,7 +181,8 @@ struct Input "Sampling either at quadrature points or collocated with " "degrees of freedom") ->capture_default_str() - ->transform(CLI::CheckedTransformer(vfsamplingMap, CLI::ignore_case)); + ->transform( + axom::CLI::CheckedTransformer(vfsamplingMap, axom::CLI::ignore_case)); // parameters that only apply to the intersection method auto* intersection_options = @@ -190,7 +192,7 @@ struct Input intersection_options->add_option("-r, --refinements", refinementLevel) ->description("Number of refinements to perform for revolved contour") ->capture_default_str() - ->check(CLI::NonNegativeNumber); + ->check(axom::CLI::NonNegativeNumber); std::stringstream pol_sstr; pol_sstr << "Set runtime policy for intersection-based sampling method."; @@ -206,7 +208,7 @@ struct Input intersection_options->add_option("-p, --policy", policy, pol_sstr.str()) ->capture_default_str() - ->transform(CLI::CheckedTransformer(s_validPolicies)); + ->transform(axom::CLI::CheckedTransformer(s_validPolicies)); app.get_formatter()->column_width(50); @@ -254,7 +256,7 @@ void printMeshInfo(mfem::Mesh* mesh, const std::string& prefixMessage = "") switch(mesh->Dimension()) { case 2: - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{} mesh has {} elements and (approximate) bounding box {}", prefixMessage, numElements, @@ -262,7 +264,7 @@ void printMeshInfo(mfem::Mesh* mesh, const std::string& prefixMessage = "") primal::Point(maxs.GetData())))); break; case 3: - SLIC_INFO(fmt::format( + SLIC_INFO(axom::fmt::format( "{} mesh has {} elements and (approximate) bounding box {}", prefixMessage, numElements, @@ -337,13 +339,13 @@ int main(int argc, char** argv) // Set up and parse command line arguments //--------------------------------------------------------------------------- Input params; - CLI::App app {"Driver for Klee shaping query"}; + axom::CLI::App app {"Driver for Klee shaping query"}; try { params.parse(argc, argv, app); } - catch(const CLI::ParseError& e) + catch(const axom::CLI::ParseError& e) { int retval = -1; if(my_rank == 0) @@ -371,14 +373,15 @@ int main(int argc, char** argv) std::vector errs; for(auto verificationError : error.getErrors()) { - errs.push_back(fmt::format(" - '{}': {}", - static_cast(verificationError.path), - verificationError.message)); + errs.push_back( + axom::fmt::format(" - '{}': {}", + static_cast(verificationError.path), + verificationError.message)); } - SLIC_WARNING(fmt::format( + SLIC_WARNING(axom::fmt::format( "Error during parsing klee input. Found the following errors:\n{}", - fmt::join(errs, "\n"))); + axom::fmt::join(errs, "\n"))); finalizeLogger(); @@ -464,7 +467,7 @@ int main(int argc, char** argv) //--------------------------------------------------------------------------- // Process each of the shapes //--------------------------------------------------------------------------- - SLIC_INFO(fmt::format("{:=^80}", "Sampling InOut fields for shapes")); + SLIC_INFO(axom::fmt::format("{:=^80}", "Sampling InOut fields for shapes")); for(const auto& shape : params.shapeSet.getShapes()) { // Load the shape from file @@ -496,7 +499,8 @@ int main(int argc, char** argv) // After shaping in all shapes, generate/adjust the material volume fractions //--------------------------------------------------------------------------- SLIC_INFO( - fmt::format("{:=^80}", "Generating volume fraction fields for materials")); + axom::fmt::format("{:=^80}", + "Generating volume fraction fields for materials")); shaper->adjustVolumeFractions(); From c34d6ffd442be66da257a33b4a3dc5dd6627cb5b Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 11 Nov 2021 19:11:46 -0800 Subject: [PATCH 45/73] Fixes incorrect ordering of axom components Quest optionally depends on Klee, so needs to be added after Klee. --- src/axom/CMakeLists.txt | 2 +- src/axom/mint/CMakeLists.txt | 2 ++ src/axom/quest/CMakeLists.txt | 2 ++ src/docs/dependencies.dot | 1 + src/index.rst | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/axom/CMakeLists.txt b/src/axom/CMakeLists.txt index 3a5c997b96..4687f51ae8 100644 --- a/src/axom/CMakeLists.txt +++ b/src/axom/CMakeLists.txt @@ -31,8 +31,8 @@ axom_add_component(COMPONENT_NAME sidre DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONE axom_add_component(COMPONENT_NAME mint DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) axom_add_component(COMPONENT_NAME spin DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) axom_add_component(COMPONENT_NAME inlet DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) -axom_add_component(COMPONENT_NAME quest DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) axom_add_component(COMPONENT_NAME klee DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) +axom_add_component(COMPONENT_NAME quest DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) if(ENABLE_CUDA) # Force "early" device linking to avoid propagating an NVCC link dependency diff --git a/src/axom/mint/CMakeLists.txt b/src/axom/mint/CMakeLists.txt index d410bffd41..36f5fdc6aa 100644 --- a/src/axom/mint/CMakeLists.txt +++ b/src/axom/mint/CMakeLists.txt @@ -8,6 +8,8 @@ #------------------------------------------------------------------------------ # Check necessary dependencies +# +# Note: Mint also optionally depends on Sidre when AXOM_MINT_USE_SIDRE=ON #------------------------------------------------------------------------------ axom_component_requires(NAME Mint COMPONENTS SLIC) diff --git a/src/axom/quest/CMakeLists.txt b/src/axom/quest/CMakeLists.txt index a465f79567..bea6131b4b 100644 --- a/src/axom/quest/CMakeLists.txt +++ b/src/axom/quest/CMakeLists.txt @@ -8,6 +8,8 @@ #------------------------------------------------------------------------------ # Check necessary dependencies +# +# Note: Quest also optionally depends on Klee, when Klee is enabled #------------------------------------------------------------------------------ axom_component_requires(NAME QUEST COMPONENTS MINT PRIMAL SLAM SLIC SPIN) diff --git a/src/docs/dependencies.dot b/src/docs/dependencies.dot index f03afe36af..a6616d5632 100644 --- a/src/docs/dependencies.dot +++ b/src/docs/dependencies.dot @@ -1,5 +1,6 @@ digraph dependencies { quest -> {slam primal mint spin}; + quest -> klee [style="dashed"]; {inlet klee mint primal quest slam spin} -> {slic core}; mint -> sidre [style="dashed"]; spin -> {slam primal}; diff --git a/src/index.rst b/src/index.rst index 9d77783a62..528799c045 100644 --- a/src/index.rst +++ b/src/index.rst @@ -115,9 +115,9 @@ Axom has the following inter-component dependencies: - Slic optionally depends on Lumberjack - Slam, Spin, Primal, Mint, Quest, and Sidre depend on Slic - Mint optionally depends on Sidre -- Quest depends on Slam, Spin, Primal, and Mint - Inlet depends on Sidre, Slic, and Primal - Klee depends on Sidre, Slic, Inlet and Primal +- Quest depends on Slam, Spin, Primal, Mint, and, optionally, Klee The figure below summarizes these dependencies. Solid links indicate hard dependencies; dashed links indicate optional dependencies. From ede816cd57df74a10f37174db75cba68cde3b5b3 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 11 Nov 2021 19:32:44 -0800 Subject: [PATCH 46/73] Fixes a typo in a case where Klee is available but not c2c --- src/axom/quest/examples/shaping_driver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/axom/quest/examples/shaping_driver.cpp b/src/axom/quest/examples/shaping_driver.cpp index c2a1b994dc..a1e0ac700b 100644 --- a/src/axom/quest/examples/shaping_driver.cpp +++ b/src/axom/quest/examples/shaping_driver.cpp @@ -395,7 +395,7 @@ int main(int argc, char** argv) // Apply error checking #ifndef AXOM_USE_C2C - SLIC_ERROR_IF(shapeDim == klee::Dimension::Two, + SLIC_ERROR_IF(shapeDim == klee::Dimensions::Two, "Shaping with contour files requires an Axom configured with " "the C2C library"); #endif From a2c6a9b4b9b0fe429d0fa314e32dc0212cc08d2a Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 11 Nov 2021 19:40:41 -0800 Subject: [PATCH 47/73] Updates macOS image to 10.15 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 907824ce12..5ece891c60 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,7 +46,7 @@ jobs: TEST_TARGET: 'linux_clang10' HOST_CONFIG: 'docker-linux-ubuntu18.04-x86_64-clang@10.0.0' osx_gcc: - VM_ImageName: 'macos-10.14' + VM_ImageName: 'macos-1015' CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF' TEST_TARGET: 'osx_gcc' windows: From 498e3ade2478e28e85a6606c782a6becb41e7724 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 12 Nov 2021 16:19:58 -0800 Subject: [PATCH 48/73] fix some spack package build options --- scripts/spack/packages/raja/package.py | 7 ++++++- scripts/spack/packages/umpire/package.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/spack/packages/raja/package.py b/scripts/spack/packages/raja/package.py index c6ea65dfd8..6aa9c62b1b 100644 --- a/scripts/spack/packages/raja/package.py +++ b/scripts/spack/packages/raja/package.py @@ -132,7 +132,12 @@ def initconfig_package_entries(self): entries.append(cmake_cache_path("camp_DIR", spec['camp'].prefix)) entries.append(cmake_cache_option("BUILD_SHARED_LIBS", '+shared' in spec)) entries.append(cmake_cache_option("ENABLE_EXAMPLES", '+examples' in spec)) - entries.append(cmake_cache_option("ENABLE_EXERCISES", '+exercises' in spec)) + if spec.satisfies('@0.14.0:'): + entries.append(cmake_cache_option("RAJA_ENABLE_EXERCISES", + '+exercises' in spec)) + else: + entries.append(cmake_cache_option("ENABLE_EXERCISES", + '+exercises' in spec)) # Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which # is used by the spack compiler wrapper. This can go away when BLT diff --git a/scripts/spack/packages/umpire/package.py b/scripts/spack/packages/umpire/package.py index 63be406c01..fcbe0209cc 100644 --- a/scripts/spack/packages/umpire/package.py +++ b/scripts/spack/packages/umpire/package.py @@ -195,6 +195,7 @@ def initconfig_package_entries(self): entries.append(cmake_cache_option( "ENABLE_BENCHMARKS", 'tests=benchmarks' in spec)) entries.append(cmake_cache_option("ENABLE_EXAMPLES", '+examples' in spec)) + entries.append(cmake_cache_option("ENABLE_DOCS", False)) entries.append(cmake_cache_option("BUILD_SHARED_LIBS", '+shared' in spec)) entries.append(cmake_cache_option("ENABLE_TESTS", 'tests=none' not in spec)) From 9a98a5b54da3e9ade12cb777a974e2ca3f3c0c1d Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Sun, 7 Nov 2021 18:03:01 -0800 Subject: [PATCH 49/73] Improves handling of SignedDistance query for query points closest to edges and vertices of the mesh There are noticeable improvements in quest_regression_test against `tetrahedron` and `plane_simple` meshes, but it does not fix all cases. For example, ``` > ./tests/quest_regression_test -m ../data/quest_tetrahedron -r 99 99 99 --min -5 -5 -5 --max 5 5 5 ``` is fixed (went from 202 bad points to 0 bad points), while ``` > ./tests/quest_regression_test -m ../data/quest_tetrahedron -r 100 100 100 --min -5 -5 -5 --max 5 5 5 ``` is improved, but still has errors -- it went from 2125 bad points to 1024 bad points. --- src/axom/quest/SignedDistance.hpp | 176 +++++++++++++++++++++--------- 1 file changed, 125 insertions(+), 51 deletions(-) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index 66750821a8..d8914cd71e 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -77,6 +77,42 @@ struct UcdMeshData */ bool SD_GetUcdMeshData(const mint::Mesh* surfaceMesh, UcdMeshData& outSurfData); +/// Enum for different 'location' types returned by primal::closest_point() +enum class ClosestPointLocType +{ + uninitialized = -1, + vertex = 0, + edge = 1, + face = 2 +}; + +/// Converts from \a loc code returned by primal::closest_point() to a \a ClosestPointLocType enum +inline ClosestPointLocType getClosestPointLocType(int loc) +{ + SLIC_ASSERT_MSG(loc >= -3, + "Invalid closest point location type: " + << loc << ". See documentation for primal::closest_point()."); + switch(loc) + { + case -3: // intentional fall-through + case -2: + case -1: + return ClosestPointLocType::edge; + case 0: // intentional fall-through + case 1: + case 2: + return ClosestPointLocType::vertex; + default: + return ClosestPointLocType::face; + } +} + +/// A \a ClosestPointLocType is shared for a vertex or edge, unshared otherwise +inline bool isClosestPointTypeShared(ClosestPointLocType cpt) +{ + return cpt == ClosestPointLocType::edge || cpt == ClosestPointLocType::vertex; +} + } // end namespace detail template @@ -93,15 +129,22 @@ class SignedDistance private: struct MinCandidate { - double minSqDist = - numerics::floating_point_limits::max(); // Squared distance to query point - PointType minPt {}; // Closest point on element - int minLoc; // Location of closest point on element - int minElem; // Closest element index in mesh - TriangleType minTri; // The actual cell element - - VectorType sumNormals {}; // The normal if the closest point is on an edge - VectorType sumNormalsAngWt {}; // The normal if the closest point is a node + /// Squared distance to query point + double minSqDist {numerics::floating_point_limits::max()}; + /// Closest point on element + PointType minPt {}; + /// Type of the closest point + detail::ClosestPointLocType minType { + detail::ClosestPointLocType::uninitialized}; + /// Index within mesh of closest element + int minElem; + /// The actual cell element + TriangleType minTri; + + /// The normal, if the closest point is on an edge + VectorType sumNormals {}; + /// The normal, if the closest point is a node + VectorType sumNormalsAngWt {}; }; public: @@ -267,8 +310,7 @@ class SignedDistance bool computeSign); /*! - * \brief Computes the sign of the given query point given the closest point - * data. + * \brief Computes the sign of the given query point given the closest point data * * \param [in] qpt query point to check against surface element * \param [in] currMin the minimum-distance surface element data @@ -546,56 +588,88 @@ inline void SignedDistance::checkCandidate( TriangleType {meshPts[nodes[0]], meshPts[nodes[2]], meshPts[nodes[3]]}; } + using axom::primal::closest_point; + using axom::primal::squared_distance; + using axom::utilities::isNearlyEqual; + using detail::getClosestPointLocType; + using detail::isClosestPointTypeShared; + constexpr double EPS = 1e-8; + for(int ei = 0; ei < num_candidates; ei++) { int candidate_loc; PointType candidate_pt = - axom::primal::closest_point(qpt, surface_elems[ei], &candidate_loc); - double sq_dist = axom::primal::squared_distance(qpt, candidate_pt); + closest_point(qpt, surface_elems[ei], &candidate_loc); + double sq_dist = squared_distance(qpt, candidate_pt); + + // Check the type of intersection we found + const auto cpt_type = getClosestPointLocType(candidate_loc); + + // Determine if the closest point is on an edge or vertex + const bool is_cpt_shared = isClosestPointTypeShared(cpt_type); + + // Don't clear normals if new point is on edge or vertex + // and we've already found a point on this edge or vertex + const bool shouldClearVecs = + // Clear if we're not computing normals + !computeNormal || + // or not in a shared configuration + !is_cpt_shared || + // Also clear we've not yet seen a shared closest point type + !isClosestPointTypeShared(currMin.minType) || + // finally, if there was a previous shared point -- check if it's approximately the same + !isNearlyEqual(squared_distance(candidate_pt, currMin.minPt), 0., EPS); - bool shares_min_pt = true; + bool shouldUpdateNormals = false; if(sq_dist < currMin.minSqDist) { currMin.minSqDist = sq_dist; currMin.minPt = candidate_pt; - currMin.minLoc = candidate_loc; + currMin.minType = cpt_type; currMin.minElem = cellId; currMin.minTri = surface_elems[ei]; - currMin.sumNormals = VectorType {}; - currMin.sumNormalsAngWt = VectorType {}; + if(shouldClearVecs) + { + currMin.sumNormals = VectorType {}; + currMin.sumNormalsAngWt = VectorType {}; + } + + shouldUpdateNormals = (computeNormal && is_cpt_shared); } else { - // check if we have an element sharing the same closest point - double pt_dist_to_curr = - axom::primal::squared_distance(candidate_pt, currMin.minPt); - shares_min_pt = axom::utilities::isNearlyEqual(pt_dist_to_curr, 0.0, 1e-16); + shouldUpdateNormals = (computeNormal && is_cpt_shared) && + isNearlyEqual(squared_distance(candidate_pt, currMin.minPt), 0., EPS); } - if(computeNormal && shares_min_pt && - currMin.minLoc < TriangleType::NUM_TRI_VERTS) + if(shouldUpdateNormals) { VectorType norm = surface_elems[ei].normal(); - // 0 = closest point on edge - // 1 = closest point on vertex - // 2 = closest point on face - int cpt_type = (candidate_loc + 3) / 3; - - if(cpt_type == 0) + switch(cpt_type) { + case detail::ClosestPointLocType::edge: // Candidate closest point is on an edge - add the normal of a // potentially-adjacent face currMin.sumNormals += norm; - } - else if(cpt_type == 1 && !surface_elems[ei].degenerate()) - { - // Candidate closest point is on a vertex - add the angle-weighted - // normal of a face potentially sharing a vertex - double alpha = surface_elems[ei].angle(candidate_loc); - currMin.sumNormalsAngWt += (norm.unitVector() * alpha); + break; + case detail::ClosestPointLocType::face: + if(!surface_elems[ei].degenerate()) + { + // Candidate closest point is on a vertex - add the angle-weighted + // normal of a face potentially sharing a vertex + double alpha = surface_elems[ei].angle(candidate_loc); + currMin.sumNormalsAngWt += (norm.unitVector() * alpha); + } + else + { + SLIC_WARNING("Triangle for closest point was degenerate"); + } + break; + default: + break; // no-op } } } @@ -608,34 +682,34 @@ inline double SignedDistance::computeSign( const MinCandidate& currMin) { double sgn = 1.0; - // STEP 1: Select the pseudo-normal N at the closest point to calculate the - // sign. + // STEP 1: Select the pseudo-normal N at the closest point to calculate the sign. // There are effectively 3 cases based on the location of the closest point. VectorType N; - if(currMin.minLoc >= TriangleType::NUM_TRI_VERTS) + switch(currMin.minType) { + case detail::ClosestPointLocType::face: // CASE 1: closest point is on the face of the surface element N = currMin.minTri.normal(); - } - else if(currMin.minLoc < 0) - { - // CASE 2: closest point is on an edge, use sum of normals of equidistant - // faces + break; + case detail::ClosestPointLocType::edge: + // CASE 2: closest point is on an edge, use sum of normals of equidistant faces // TODO: Sometimes, the traversal fails to find the opposite face, so only // a single face's normal is accumulated here. The proper solution would be // to precompute edge pseudo-normals during construction time, but that - // would also require generating cell-to-face connectivity for the surface - // mesh. + // would also require generating cell-to-face connectivity for the surface mesh. N = currMin.sumNormals; - } - else - { + break; + case detail::ClosestPointLocType::vertex: // CASE 3: closest point is on a node, use angle-weighted pseudo-normal N = currMin.sumNormalsAngWt; + break; + default: + SLIC_WARNING("Did not find a valid closest point for query point: " << qpt); + break; } + // STEP 2: Given the pseudo-normal, N, and the vector r from the closest point - // to the query point, compute the sign by checking the sign of their dot - // product. + // to the query point, compute the sign by checking the sign of their dot product. VectorType r(currMin.minPt, qpt); double dotprod = r.dot(N); sgn = (dotprod >= 0.0) ? 1.0 : -1.0; From 68207bdc6bbc48116aa87a503c79a84bc4883316 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Sun, 7 Nov 2021 22:26:27 -0800 Subject: [PATCH 50/73] Adds standalone `operator+` functions to add a primal::Point and primal::Vector --- src/axom/primal/geometry/Vector.hpp | 40 +++++++++++++++++++++++ src/axom/primal/tests/primal_vector.cpp | 42 ++++++++++++++++++++----- 2 files changed, 75 insertions(+), 7 deletions(-) diff --git a/src/axom/primal/geometry/Vector.hpp b/src/axom/primal/geometry/Vector.hpp index 4fb6e04188..251e799330 100644 --- a/src/axom/primal/geometry/Vector.hpp +++ b/src/axom/primal/geometry/Vector.hpp @@ -27,6 +27,9 @@ namespace primal template class Vector; +template +class Point; + /// \name Forward Declared Overloaded Operators /// @{ @@ -40,6 +43,26 @@ template AXOM_HOST_DEVICE Vector operator+(const Vector& A, const Vector& B); +/*! + * \brief Adds vector \a V to point \a P and stores the result into a new point + * \param [in] P point on the left-hand side. + * \param [in] V vector on the right-hand side. + * \return resulting point, \f$ p'_i = p_i + v_i \forall i \f$ + */ +template +AXOM_HOST_DEVICE Point operator+(const Point& P, + const Vector& V); + +/*! + * \brief Adds vector \a V to point \a P and stores the result into a new point + * \param [in] V vector on the left-hand side. + * \param [in] P point on the right-hand side. + * \return resulting point, \f$ p'_i = v_i + p_i \forall i \f$ + */ +template +AXOM_HOST_DEVICE Point operator+(const Vector& V, + const Point& P); + /*! * \brief Subtracts vectors A, B and stores the result into a new vector C * \param [in] A vector on the left-hand side. @@ -550,6 +573,23 @@ inline Vector operator+(const Vector& vec1, return result; } +//------------------------------------------------------------------------------ +template +AXOM_HOST_DEVICE Point operator+(const Point& P, + const Vector& V) +{ + Point result(P); + result.array() += V.array(); + return result; +} + +template +AXOM_HOST_DEVICE Point operator+(const Vector& V, + const Point& P) +{ + return P + V; +} + //------------------------------------------------------------------------------ template inline Vector operator/(const Vector& vec, const T scalar) diff --git a/src/axom/primal/tests/primal_vector.cpp b/src/axom/primal/tests/primal_vector.cpp index 3ed90bd92d..b905e7be69 100644 --- a/src/axom/primal/tests/primal_vector.cpp +++ b/src/axom/primal/tests/primal_vector.cpp @@ -4,8 +4,10 @@ // SPDX-License-Identifier: (BSD-3-Clause) #include "gtest/gtest.h" +#include "axom/slic.hpp" #include "axom/primal/geometry/Vector.hpp" +#include "axom/primal/geometry/Point.hpp" #include "axom/core/execution/execution_space.hpp" // for execution_space traits #include "axom/core/execution/for_all.hpp" // for_all() @@ -295,6 +297,38 @@ TEST(primal_vector, vector_zero) } } +//------------------------------------------------------------------------------ +TEST(primal_vector, add_point_vector) +{ + constexpr int DIM = 3; + using QPt = primal::Point; + using QVec = primal::Vector; + + { + QPt one {1.}; + QVec zero {0.0}; + EXPECT_EQ(one, one + zero); + EXPECT_EQ(one, zero + one); + EXPECT_EQ(zero + one, one + zero); + } + + { + QPt pt {1.23, 4.56, 7.89}; + QVec vec {.23, .56, .89}; + + EXPECT_EQ(pt + vec, vec + pt); + + QPt pv = pt + -vec; + QPt vp = -vec + pt; + QPt exp {1, 4, 7}; + for(int i = 0; i < DIM; ++i) + { + EXPECT_DOUBLE_EQ(pv[i], vp[i]); + EXPECT_DOUBLE_EQ(exp[i], pv[i]); + } + } +} + //------------------------------------------------------------------------------ AXOM_CUDA_TEST(primal_numeric_array, numeric_array_check_policies) { @@ -319,19 +353,13 @@ AXOM_CUDA_TEST(primal_numeric_array, numeric_array_check_policies) } //---------------------------------------------------------------------- -//---------------------------------------------------------------------- -#include "axom/slic/core/SimpleLogger.hpp" -using axom::slic::SimpleLogger; int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); - - SimpleLogger logger; // create & initialize test logger, - - // finalized when exiting main scope + axom::slic::SimpleLogger logger; result = RUN_ALL_TESTS(); From 811858c7318fb9e8550b4d0ca69389763c05d55c Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Sun, 7 Nov 2021 22:28:50 -0800 Subject: [PATCH 51/73] Cleans up implementation of `primal::closest_point()` --- src/axom/primal/operators/closest_point.hpp | 104 ++++++++------------ 1 file changed, 42 insertions(+), 62 deletions(-) diff --git a/src/axom/primal/operators/closest_point.hpp b/src/axom/primal/operators/closest_point.hpp index 009e82ca00..1081627003 100644 --- a/src/axom/primal/operators/closest_point.hpp +++ b/src/axom/primal/operators/closest_point.hpp @@ -62,17 +62,19 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, const Triangle& tri, int* loc = nullptr) { -// convenience macros to access triangle vertices -#define A(t) t[0] -#define B(t) t[1] -#define C(t) t[2] + using PointType = Point; + using VectorType = Vector; + + const PointType& A = tri[0]; + const PointType& B = tri[1]; + const PointType& C = tri[2]; // Check if P in vertex region outside A - Vector ab(A(tri), B(tri)); - Vector ac(A(tri), C(tri)); - Vector ap(A(tri), P); - T d1 = Vector::dot_product(ab, ap); - T d2 = Vector::dot_product(ac, ap); + const VectorType ab(A, B); + const VectorType ac(A, C); + const VectorType ap(A, P); + const T d1 = VectorType::dot_product(ab, ap); + const T d2 = VectorType::dot_product(ac, ap); if(d1 <= 0.0f && d2 <= 0.0f) { // A is the closest point @@ -81,15 +83,14 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, *loc = 0; } - return (A(tri)); - - } // END if + return A; + } //---------------------------------------------------------------------------- // Check if P in vertex region outside B - Vector bp(B(tri), P); - T d3 = Vector::dot_product(ab, bp); - T d4 = Vector::dot_product(ac, bp); + const VectorType bp(B, P); + const T d3 = VectorType::dot_product(ab, bp); + const T d4 = VectorType::dot_product(ac, bp); if(d3 >= 0.0f && d4 <= d3) { // B is the closest point @@ -98,35 +99,30 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, *loc = 1; } - return (B(tri)); - - } // END if + return B; + } //---------------------------------------------------------------------------- // Check if P in edge region of AB - T vc = d1 * d4 - d3 * d2; + const T vc = d1 * d4 - d3 * d2; if(vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) { - T v = d1 / (d1 - d3); - Vector v_ab = ab * v; - - double x = A(tri)[0] + v_ab[0]; - double y = A(tri)[1] + v_ab[1]; - double z = (NDIMS == 3) ? A(tri)[2] + v_ab[2] : 0.0; + const T v = d1 / (d1 - d3); + const VectorType v_ab = ab * v; if(loc != nullptr) { *loc = -1; } - return (Point::make_point(x, y, z)); - } // END if + return A + v_ab; + } //---------------------------------------------------------------------------- // Check if P in vertex region outside C - Vector cp(C(tri), P); - T d5 = Vector::dot_product(ab, cp); - T d6 = Vector::dot_product(ac, cp); + const VectorType cp(C, P); + const T d5 = VectorType::dot_product(ab, cp); + const T d6 = VectorType::dot_product(ac, cp); if(d6 >= 0.0f && d5 <= d6) { // C is the closest point @@ -135,71 +131,55 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, *loc = 2; } - return (C(tri)); + return C; } //---------------------------------------------------------------------------- // Check if P in edge region of AC - T vb = d5 * d2 - d1 * d6; + const T vb = d5 * d2 - d1 * d6; if(vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) { - T w = d2 / (d2 - d6); - Vector w_ac = ac * w; - - double x = A(tri)[0] + w_ac[0]; - double y = A(tri)[1] + w_ac[1]; - double z = (NDIMS == 3) ? A(tri)[2] + w_ac[2] : 0.0; + const T w = d2 / (d2 - d6); + const VectorType w_ac = ac * w; if(loc != nullptr) { *loc = -3; } - return (Point::make_point(x, y, z)); - } // END if + return A + w_ac; + } //---------------------------------------------------------------------------- // Check if P in edge region of BC T va = d3 * d6 - d5 * d4; if(va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) { - T w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); - Vector bc(B(tri), C(tri)); - Vector w_bc = bc * w; - - double x = B(tri)[0] + w_bc[0]; - double y = B(tri)[1] + w_bc[1]; - double z = (NDIMS == 3) ? B(tri)[2] + w_bc[2] : 0.0; + const T w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); + const VectorType bc(B, C); + const VectorType w_bc = bc * w; if(loc != nullptr) { *loc = -2; } - return (Point::make_point(x, y, z)); - } // END if + return B + w_bc; + } //---------------------------------------------------------------------------- // P is inside face region - T denom = 1.0f / (va + vb + vc); - T v = vb * denom; - T w = vc * denom; - Vector N = (ab * v) + (ac * w); - - double x = A(tri)[0] + N[0]; - double y = A(tri)[1] + N[1]; - double z = (NDIMS == 3) ? A(tri)[2] + N[2] : 0.0; + const T denom = T(1) / (va + vb + vc); + const T v = vb * denom; + const T w = vc * denom; + const VectorType N = (ab * v) + (ac * w); if(loc != nullptr) { *loc = Triangle::NUM_TRI_VERTS; } - return (Point::make_point(x, y, z)); - -#undef A -#undef B -#undef C + return A + N; } /*! From 9a7717361e84a209a2c441c57ebcb5256f8a5378 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Sun, 7 Nov 2021 23:03:35 -0800 Subject: [PATCH 52/73] Improves robustness of primal::closest_point() operator via fuzzy comparisons Using new `EPS` tolerance parameter. --- src/axom/primal/operators/closest_point.hpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/axom/primal/operators/closest_point.hpp b/src/axom/primal/operators/closest_point.hpp index 1081627003..56b1659825 100644 --- a/src/axom/primal/operators/closest_point.hpp +++ b/src/axom/primal/operators/closest_point.hpp @@ -17,7 +17,7 @@ #include "axom/primal/geometry/Point.hpp" #include "axom/primal/geometry/Triangle.hpp" #include "axom/primal/geometry/OrientedBoundingBox.hpp" - +#include "axom/primal/operators/detail/intersect_impl.hpp" namespace axom { namespace primal @@ -60,11 +60,15 @@ namespace primal template AXOM_HOST_DEVICE inline Point closest_point(const Point& P, const Triangle& tri, - int* loc = nullptr) + int* loc = nullptr, + double EPS = 1E-8) { using PointType = Point; using VectorType = Vector; + using detail::isGeq; + using detail::isLeq; + const PointType& A = tri[0]; const PointType& B = tri[1]; const PointType& C = tri[2]; @@ -75,7 +79,7 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, const VectorType ap(A, P); const T d1 = VectorType::dot_product(ab, ap); const T d2 = VectorType::dot_product(ac, ap); - if(d1 <= 0.0f && d2 <= 0.0f) + if(isLeq(d1, T(0), EPS) && isLeq(d2, T(0), EPS)) { // A is the closest point if(loc != nullptr) @@ -91,7 +95,7 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, const VectorType bp(B, P); const T d3 = VectorType::dot_product(ab, bp); const T d4 = VectorType::dot_product(ac, bp); - if(d3 >= 0.0f && d4 <= d3) + if(isGeq(d3, T(0), EPS) && isLeq(d4, d3, EPS)) { // B is the closest point if(loc != nullptr) @@ -105,7 +109,7 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, //---------------------------------------------------------------------------- // Check if P in edge region of AB const T vc = d1 * d4 - d3 * d2; - if(vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) + if(isLeq(vc, T(0), EPS) && isGeq(d1, T(0), EPS) && isLeq(d3, T(0), EPS)) { const T v = d1 / (d1 - d3); const VectorType v_ab = ab * v; @@ -123,7 +127,7 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, const VectorType cp(C, P); const T d5 = VectorType::dot_product(ab, cp); const T d6 = VectorType::dot_product(ac, cp); - if(d6 >= 0.0f && d5 <= d6) + if(isGeq(d6, T(0), EPS) && isLeq(d5, d6, EPS)) { // C is the closest point if(loc != nullptr) @@ -137,7 +141,7 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, //---------------------------------------------------------------------------- // Check if P in edge region of AC const T vb = d5 * d2 - d1 * d6; - if(vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) + if(isLeq(vb, T(0), EPS) && isGeq(d2, T(0), EPS) && isLeq(d6, T(0), EPS)) { const T w = d2 / (d2 - d6); const VectorType w_ac = ac * w; @@ -153,7 +157,8 @@ AXOM_HOST_DEVICE inline Point closest_point(const Point& P, //---------------------------------------------------------------------------- // Check if P in edge region of BC T va = d3 * d6 - d5 * d4; - if(va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) + if(isLeq(va, T(0), EPS) && isGeq(d4 - d3, T(0), EPS) && + isGeq(d5 - d6, T(0), EPS)) { const T w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); const VectorType bc(B, C); From 6738a066a01405503cf3cd4293e697c3675f347f Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Sun, 7 Nov 2021 23:12:06 -0800 Subject: [PATCH 53/73] Improve robustness of SignedDistance query * Use fuzzy comparisons in closest_point calculations to better determine when the closest point is on an edge or a vertex * Improves tests that determine if we should reset the cached sum of normals and to see if we should add a new normal to the current point --- src/axom/quest/SignedDistance.hpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index d8914cd71e..8a01d68eda 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -599,7 +599,7 @@ inline void SignedDistance::checkCandidate( { int candidate_loc; PointType candidate_pt = - closest_point(qpt, surface_elems[ei], &candidate_loc); + closest_point(qpt, surface_elems[ei], &candidate_loc, EPS); double sq_dist = squared_distance(qpt, candidate_pt); // Check the type of intersection we found @@ -608,22 +608,21 @@ inline void SignedDistance::checkCandidate( // Determine if the closest point is on an edge or vertex const bool is_cpt_shared = isClosestPointTypeShared(cpt_type); - // Don't clear normals if new point is on edge or vertex - // and we've already found a point on this edge or vertex - const bool shouldClearVecs = - // Clear if we're not computing normals - !computeNormal || - // or not in a shared configuration - !is_cpt_shared || - // Also clear we've not yet seen a shared closest point type - !isClosestPointTypeShared(currMin.minType) || - // finally, if there was a previous shared point -- check if it's approximately the same - !isNearlyEqual(squared_distance(candidate_pt, currMin.minPt), 0., EPS); - bool shouldUpdateNormals = false; if(sq_dist < currMin.minSqDist) { + // Clear the sum of normals if: + const bool shouldClearVecs = + // we're not computing normals + !computeNormal || + // or we're not in a shared configuration + !is_cpt_shared || + // or, if previous closest point type was different than current + (currMin.minType != cpt_type) || + // finally, if there was a previous shared point -- check if approximately same as current + !isNearlyEqual(squared_distance(candidate_pt, currMin.minPt), 0., EPS); + currMin.minSqDist = sq_dist; currMin.minPt = candidate_pt; currMin.minType = cpt_type; @@ -640,7 +639,8 @@ inline void SignedDistance::checkCandidate( } else { - shouldUpdateNormals = (computeNormal && is_cpt_shared) && + shouldUpdateNormals = computeNormal && is_cpt_shared && + (currMin.minType == cpt_type) && isNearlyEqual(squared_distance(candidate_pt, currMin.minPt), 0., EPS); } From aaf03bd666abbe9bbbd482272d5f163e6816c311 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Sun, 7 Nov 2021 23:31:08 -0800 Subject: [PATCH 54/73] We now only need to store one normal vector for SignedDistance MinCandidate struct Since we've improved the robustness of the edge and vertex cases and we're tracking which case we're in, we no longer need a separate vector to track the sum of edge normals and the sum of vertex normals. --- src/axom/quest/SignedDistance.hpp | 32 +++++++------------------------ 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index 8a01d68eda..f8ab025947 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -138,13 +138,10 @@ class SignedDistance detail::ClosestPointLocType::uninitialized}; /// Index within mesh of closest element int minElem; - /// The actual cell element + /// Contains geometry of the closest element TriangleType minTri; - - /// The normal, if the closest point is on an edge + /// Weighted sum of normals when closest pt is on edge or vertex VectorType sumNormals {}; - /// The normal, if the closest point is a node - VectorType sumNormalsAngWt {}; }; public: @@ -613,10 +610,8 @@ inline void SignedDistance::checkCandidate( if(sq_dist < currMin.minSqDist) { // Clear the sum of normals if: - const bool shouldClearVecs = - // we're not computing normals - !computeNormal || - // or we're not in a shared configuration + const bool shouldClearNormals = + // we're not in a shared configuration !is_cpt_shared || // or, if previous closest point type was different than current (currMin.minType != cpt_type) || @@ -629,10 +624,9 @@ inline void SignedDistance::checkCandidate( currMin.minElem = cellId; currMin.minTri = surface_elems[ei]; - if(shouldClearVecs) + if(computeNormal && shouldClearNormals) { currMin.sumNormals = VectorType {}; - currMin.sumNormalsAngWt = VectorType {}; } shouldUpdateNormals = (computeNormal && is_cpt_shared); @@ -661,7 +655,7 @@ inline void SignedDistance::checkCandidate( // Candidate closest point is on a vertex - add the angle-weighted // normal of a face potentially sharing a vertex double alpha = surface_elems[ei].angle(candidate_loc); - currMin.sumNormalsAngWt += (norm.unitVector() * alpha); + currMin.sumNormals += (norm.unitVector() * alpha); } else { @@ -691,21 +685,9 @@ inline double SignedDistance::computeSign( // CASE 1: closest point is on the face of the surface element N = currMin.minTri.normal(); break; - case detail::ClosestPointLocType::edge: - // CASE 2: closest point is on an edge, use sum of normals of equidistant faces - // TODO: Sometimes, the traversal fails to find the opposite face, so only - // a single face's normal is accumulated here. The proper solution would be - // to precompute edge pseudo-normals during construction time, but that - // would also require generating cell-to-face connectivity for the surface mesh. + default: // Use precomputed normal for edges and vertices N = currMin.sumNormals; break; - case detail::ClosestPointLocType::vertex: - // CASE 3: closest point is on a node, use angle-weighted pseudo-normal - N = currMin.sumNormalsAngWt; - break; - default: - SLIC_WARNING("Did not find a valid closest point for query point: " << qpt); - break; } // STEP 2: Given the pseudo-normal, N, and the vector r from the closest point From 3eac867767439a8e39d29c375e9bc042b7d77529 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Sun, 7 Nov 2021 23:35:28 -0800 Subject: [PATCH 55/73] Updates `data` submodule --- data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data b/data index 74a47ea458..2bde262f66 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 74a47ea45851197f46c344863cb91f53ed69f5cd +Subproject commit 2bde262f66d0355d21d66e4398cb4405283e332a From 5209b20d2db41caa4442fc27bcc434370d06444d Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Mon, 8 Nov 2021 18:10:05 -0800 Subject: [PATCH 56/73] Fixes compilation errors with nvcc --- src/axom/quest/SignedDistance.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index f8ab025947..36cf983834 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -87,7 +87,7 @@ enum class ClosestPointLocType }; /// Converts from \a loc code returned by primal::closest_point() to a \a ClosestPointLocType enum -inline ClosestPointLocType getClosestPointLocType(int loc) +AXOM_HOST_DEVICE inline ClosestPointLocType getClosestPointLocType(int loc) { SLIC_ASSERT_MSG(loc >= -3, "Invalid closest point location type: " @@ -108,7 +108,7 @@ inline ClosestPointLocType getClosestPointLocType(int loc) } /// A \a ClosestPointLocType is shared for a vertex or edge, unshared otherwise -inline bool isClosestPointTypeShared(ClosestPointLocType cpt) +AXOM_HOST_DEVICE inline bool isClosestPointTypeShared(ClosestPointLocType cpt) { return cpt == ClosestPointLocType::edge || cpt == ClosestPointLocType::vertex; } @@ -657,10 +657,6 @@ inline void SignedDistance::checkCandidate( double alpha = surface_elems[ei].angle(candidate_loc); currMin.sumNormals += (norm.unitVector() * alpha); } - else - { - SLIC_WARNING("Triangle for closest point was degenerate"); - } break; default: break; // no-op From 802e56f16274b39ecdd5e52d8656821ec5b824d0 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Mon, 8 Nov 2021 19:18:31 -0800 Subject: [PATCH 57/73] Initializes input parameter in signed distance example Includes some additional minor fixes. --- src/axom/core/execution/execution_space.hpp | 4 ++-- src/axom/quest/examples/quest_signed_distance_interface.cpp | 2 +- src/axom/spin/BVH.hpp | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/axom/core/execution/execution_space.hpp b/src/axom/core/execution/execution_space.hpp index 7a13421a51..4ab3e032a0 100644 --- a/src/axom/core/execution/execution_space.hpp +++ b/src/axom/core/execution/execution_space.hpp @@ -86,7 +86,7 @@ struct execution_space static int allocatorID() noexcept { return axom::INVALID_ALLOCATOR_ID; }; }; -} /* namespace axom */ +} // namespace axom // execution_space traits specialization #include "axom/core/execution/internal/seq_exec.hpp" @@ -100,4 +100,4 @@ struct execution_space #include "axom/core/execution/internal/cuda_exec.hpp" #endif -#endif /* AXOM_SPIN_EXECUTIONSPACE_HPP_ */ +#endif // AXOM_EXECUTIONSPACE_HPP_ diff --git a/src/axom/quest/examples/quest_signed_distance_interface.cpp b/src/axom/quest/examples/quest_signed_distance_interface.cpp index 11668b9039..01a4f50ce8 100644 --- a/src/axom/quest/examples/quest_signed_distance_interface.cpp +++ b/src/axom/quest/examples/quest_signed_distance_interface.cpp @@ -78,7 +78,7 @@ struct Arguments bool use_shared {false}; bool use_batched_query {false}; bool ignore_signs {false}; - quest::SignedDistExec exec_space; + quest::SignedDistExec exec_space {quest::SignedDistExec::CPU}; void parse(int argc, char** argv, axom::CLI::App& app) { diff --git a/src/axom/spin/BVH.hpp b/src/axom/spin/BVH.hpp index 55dbb97b41..95fa32f962 100644 --- a/src/axom/spin/BVH.hpp +++ b/src/axom/spin/BVH.hpp @@ -100,11 +100,13 @@ struct BVHPolicy * spin::BVH< DIMENSION, axom::OMP_EXEC > bvh; * bvh.initialize( aabbs, numItems ); * - * // query points supplied in arrays, qx, qy, qz, + * // query points supplied in arrays, qx, qy, qz * const axom::IndexType numPoints = ... * const double* qx = ... * const double* qy = ... * const double* qz = ... + * //use the ZipPoint class to tie them together + * ZipPoint qpts {{qx,qy,qz}}; * * // output array buffers * axom::IndexType* offsets = axom::allocate< IndexType >( numPoints ); @@ -113,7 +115,7 @@ struct BVHPolicy * * // find candidates in parallel, allocates and populates the supplied * // candidates array - * bvh.findPoints( offsets, counts, candidates, numPoints, qx, qy, qz ); + * bvh.findPoints( offsets, counts, candidates, numPoints, qpts ); * SLIC_ASSERT( candidates != nullptr ); * * ... From 4018b3fcef61eef32acd2b8684eb44e6394c7896 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Mon, 8 Nov 2021 19:24:05 -0800 Subject: [PATCH 58/73] Adds a counter to the SignedDistance MinCandidate structure This counter tracks the number of entities at the current closest point. This is expected to be 2 for edges and higher for vertices. Added per PR suggestion. --- src/axom/quest/SignedDistance.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index 36cf983834..72cf5f940b 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -142,6 +142,8 @@ class SignedDistance TriangleType minTri; /// Weighted sum of normals when closest pt is on edge or vertex VectorType sumNormals {}; + /// Count of the number of elements found at the current closest distance + int minCount {0}; }; public: @@ -627,6 +629,7 @@ inline void SignedDistance::checkCandidate( if(computeNormal && shouldClearNormals) { currMin.sumNormals = VectorType {}; + currMin.minCount = 0; } shouldUpdateNormals = (computeNormal && is_cpt_shared); @@ -641,6 +644,7 @@ inline void SignedDistance::checkCandidate( if(shouldUpdateNormals) { VectorType norm = surface_elems[ei].normal(); + ++currMin.minCount; switch(cpt_type) { From feb296e431de4bf09eccece6a20611024ffc84e6 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Mon, 8 Nov 2021 21:09:46 -0800 Subject: [PATCH 59/73] Tightens tolerance for closest point computations in SignedDistance query --- src/axom/quest/SignedDistance.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index 72cf5f940b..115b39aad3 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -592,7 +592,7 @@ inline void SignedDistance::checkCandidate( using axom::utilities::isNearlyEqual; using detail::getClosestPointLocType; using detail::isClosestPointTypeShared; - constexpr double EPS = 1e-8; + constexpr double EPS = 1e-12; for(int ei = 0; ei < num_candidates; ei++) { From 3a8b811dc0313bde34938bd1acd23a1035eef6ce Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Mon, 8 Nov 2021 21:16:13 -0800 Subject: [PATCH 60/73] Bugfix for wrong case in SignedDistance's angle-weighted norm calculation --- src/axom/quest/SignedDistance.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/axom/quest/SignedDistance.hpp b/src/axom/quest/SignedDistance.hpp index 115b39aad3..b5f0a124a8 100644 --- a/src/axom/quest/SignedDistance.hpp +++ b/src/axom/quest/SignedDistance.hpp @@ -653,7 +653,7 @@ inline void SignedDistance::checkCandidate( // potentially-adjacent face currMin.sumNormals += norm; break; - case detail::ClosestPointLocType::face: + case detail::ClosestPointLocType::vertex: if(!surface_elems[ei].degenerate()) { // Candidate closest point is on a vertex - add the angle-weighted From 1fb92c909668370bd47f48b670e6cc75ceee6d80 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 14:24:47 -0800 Subject: [PATCH 61/73] Refactors how the quest regression tests are defined in the build system --- src/axom/quest/tests/CMakeLists.txt | 59 +++++++++++++++-------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/axom/quest/tests/CMakeLists.txt b/src/axom/quest/tests/CMakeLists.txt index 4c2cb05d94..fe1b28bea9 100644 --- a/src/axom/quest/tests/CMakeLists.txt +++ b/src/axom/quest/tests/CMakeLists.txt @@ -16,7 +16,7 @@ set(quest_tests quest_vertex_weld.cpp ) -blt_list_append(TO quest_tests +blt_list_append(TO quest_tests IF C2C_FOUND ELEMENTS quest_c2c_reader.cpp) @@ -96,7 +96,7 @@ set(quest_mpi_tests ) # Optionally, add tests that require AXOM_DATA_DIR -blt_list_append(TO quest_mpi_tests +blt_list_append(TO quest_mpi_tests IF AXOM_DATA_DIR ELEMENTS quest_inout_interface.cpp ) @@ -182,39 +182,40 @@ if (ENABLE_MPI AND AXOM_ENABLE_SIDRE) # Add resolution tests for each dataset and resolution if(AXOM_DATA_DIR) set(quest_data_dir ${AXOM_DATA_DIR}/quest) - - set(quest_regression_datasets - sphere - ) - set(quest_regression_resolutions - 16 - ) + # Datasets contain a mesh name and resolution delimited by a colon + set(quest_regression_datasets sphere:16) + + # Add additional regression datasets when its config variable is defined blt_list_append( TO quest_regression_datasets - ELEMENTS aatbase_3_binary - cap - naca0012 - plane_binary - plane_simp - IF AXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS - ) - blt_list_append( - TO quest_regression_resolutions - ELEMENTS 32 + ELEMENTS aatbase_3_binary:16 + aatbase_3_binary:32 + cap:16 + cap:32 + naca0012:16 + naca0012:32 + plane_binary:16 + plane_binary:32 + plane_simp:16 + plane_simp:32 + sphere:32 IF AXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS ) - foreach(dataset ${quest_regression_datasets}) - foreach(res ${quest_regression_resolutions}) - axom_add_test( - NAME quest_regression_${dataset}_${res} - COMMAND ${test_name} - --mesh ${quest_data_dir}/${dataset}.stl - --baseline ${quest_data_dir}/regression/${dataset}_${res}_baseline.root - NUM_MPI_TASKS 1 - ) - endforeach() + foreach(el ${quest_regression_datasets}) + # Extract mesh and resolution from the dataset string + string(REPLACE ":" ";" _dataset_res ${el}) + list(GET _dataset_res 0 _dataset) + list(GET _dataset_res 1 _res) + + axom_add_test( + NAME quest_regression_${_dataset}_${_res} + COMMAND ${test_name} + --mesh ${quest_data_dir}/${_dataset}.stl + --baseline ${quest_data_dir}/regression/${_dataset}_${_res}_baseline.root + NUM_MPI_TASKS 1 + ) endforeach() endif() endif() From aa7c1dddb9853d097cb1977c0cc15881ce6c3141 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 14:33:10 -0800 Subject: [PATCH 62/73] Adds some additional quest regression tests Adds tests for the `tetrahedron` mesh as well as the `boxedSphere` mesh. Also adds a regression configuration for the `plane_simp` mesh, as described in #703 --- src/axom/quest/tests/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/axom/quest/tests/CMakeLists.txt b/src/axom/quest/tests/CMakeLists.txt index fe1b28bea9..f23b3c4f22 100644 --- a/src/axom/quest/tests/CMakeLists.txt +++ b/src/axom/quest/tests/CMakeLists.txt @@ -184,13 +184,15 @@ if (ENABLE_MPI AND AXOM_ENABLE_SIDRE) set(quest_data_dir ${AXOM_DATA_DIR}/quest) # Datasets contain a mesh name and resolution delimited by a colon - set(quest_regression_datasets sphere:16) + set(quest_regression_datasets sphere:16 + tetrahedron:31) # Add additional regression datasets when its config variable is defined blt_list_append( TO quest_regression_datasets ELEMENTS aatbase_3_binary:16 aatbase_3_binary:32 + boxedSphere:40 cap:16 cap:32 naca0012:16 @@ -199,7 +201,9 @@ if (ENABLE_MPI AND AXOM_ENABLE_SIDRE) plane_binary:32 plane_simp:16 plane_simp:32 + plane_simp:120_120_60 sphere:32 + tetrahedron:100 IF AXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS ) From 1e0ab9717c32c15afa91b30daf59617c56d67c9f Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 15:45:32 -0800 Subject: [PATCH 63/73] Adds a missing operator that gets a vector by subtracting two points --- src/axom/primal/geometry/Vector.hpp | 18 ++++++++++++++ src/axom/primal/tests/primal_vector.cpp | 33 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/src/axom/primal/geometry/Vector.hpp b/src/axom/primal/geometry/Vector.hpp index 251e799330..fc5da7c8fd 100644 --- a/src/axom/primal/geometry/Vector.hpp +++ b/src/axom/primal/geometry/Vector.hpp @@ -73,6 +73,16 @@ template AXOM_HOST_DEVICE Vector operator-(const Vector& A, const Vector& B); +/*! + * \brief Subtracts Point \a t from Point \a h, yielding a vector + * \param [in] h the head of the resulting vector + * \param [in] t the tail of the resulting vector + * \return resulting vector, \f$ V_i = h_i - t_i \forall i \f$ + */ +template +AXOM_HOST_DEVICE Vector operator-(const Point& h, + const Point& t); + /*! * \brief Unary negation of a vector instance. * \param [in] vec1 vector instance to negate. @@ -609,6 +619,14 @@ inline Vector operator-(const Vector& vec1, return result; } +//------------------------------------------------------------------------------ +template +AXOM_HOST_DEVICE Vector operator-(const Point& h, + const Point& t) +{ + return Vector(t, h); +} + //------------------------------------------------------------------------------ template inline Vector operator-(const Vector& vec1) diff --git a/src/axom/primal/tests/primal_vector.cpp b/src/axom/primal/tests/primal_vector.cpp index b905e7be69..1d667d69ef 100644 --- a/src/axom/primal/tests/primal_vector.cpp +++ b/src/axom/primal/tests/primal_vector.cpp @@ -329,6 +329,39 @@ TEST(primal_vector, add_point_vector) } } +//------------------------------------------------------------------------------ +TEST(primal_vector, subtract_points) +{ + constexpr int DIM = 3; + using QPt = primal::Point; + using QVec = primal::Vector; + + { + QPt zeroPt {0.0}; + QPt onePt {1.0}; + + QVec oneVec {1.0}; + + EXPECT_EQ(oneVec, onePt - zeroPt); + EXPECT_EQ(-oneVec, zeroPt - onePt); + } + + { + QPt head {1.23, 4.56, 7.89}; + QPt tail {.23, .56, .89}; + + QVec diff = head - tail; + QVec exp {1, 4, 7}; + QVec ctor(tail, head); + + for(int i = 0; i < DIM; ++i) + { + EXPECT_DOUBLE_EQ(exp[i], diff[i]); + EXPECT_DOUBLE_EQ(ctor[i], diff[i]); + } + } +} + //------------------------------------------------------------------------------ AXOM_CUDA_TEST(primal_numeric_array, numeric_array_check_policies) { From 9cc3ff7b14be1ce499d200cf9aed3ef58a442ee1 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 14:52:09 -0800 Subject: [PATCH 64/73] Updates `data` submodule for new STL meshes and regression data --- data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data b/data index 2bde262f66..b3d8e6fc72 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 2bde262f66d0355d21d66e4398cb4405283e332a +Subproject commit b3d8e6fc72af0d5d8618033b33346f83112fdc91 From 00ca4104b018e8898c1bbbbb8fd0e4b92191c209 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 16:28:21 -0800 Subject: [PATCH 65/73] Updates RELEASE-NOTES --- RELEASE-NOTES.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 1c97c91a28..39350d0c6e 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -22,7 +22,11 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ### Added - Added a config variable, `AXOM_DEBUG_DEFINE` to control whether the `AXOM_DEBUG` compiler define is enabled. By `DEFAULT`, it is enabled for `Debug` and `RelWithDebInfo` configurations, but this can be overriden - by setting `AXOM_DEBUG_DEFINE` to `ON` or `OFF`. + by setting `AXOM_DEBUG_DEFINE` to `ON` or `OFF`. +- `axom::Array` is now GPU-compatible, in particular via a memory space template parameter and via + extensions to `axom::ArrayView` that allow for copying into kernels and transfers between memory spaces. +- Adds some utility arithmetic operators for adding and subracting `primal::Point`s and `primal::Vector`s + ### Changed - Renamed `AXOM_NOT_USED` macro to `AXOM_UNUSED_PARAM` for better consistency with other Axom macros - Added `explicit` to `axom::Inlet::InletVector` constructors and added a constructor that accepts a `double*` @@ -31,6 +35,11 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ### Fixed - The `AXOM_DEBUG` compiler define is now properly exported via the `axom` CMake target when it is enabled +- Added tolerance parameter `EPS` to `primal::closest_point()` operator. This effectively snaps + closest points to the triangle boundaries vertices and edges when they are within `EPS`, + improving consistency when, e.g., querying multiple triangles from the same mesh. +- Fixed regression in `SignedDistance` queries for query points closest to edges or vertices + of the input triangle mesh ## [Version 0.6.0] - Release date 2021-11-04 @@ -76,8 +85,6 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ - Added Sidre function `View::clear()`. - Core now provides an `axom::ArrayView` that provides view/indexing semantics over a raw pointer. This replaces the external buffer logic previously provided by `axom::Array`. -- `axom::Array` is now GPU-compatible, in particular via a memory space template parameter and via - extensions to `axom::ArrayView` that allow for copying into kernels and transfers between memory spaces. ### Changed - `MFEMSidreDataCollection` now reuses FESpace/QSpace objects with the same basis From 3ff4c484bb7b1194206146ba8b8c2878e9c0be25 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 16:39:29 -0800 Subject: [PATCH 66/73] Enables extra quest regression tests in 'linux_clang10' Azure pipeline job --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d31cddce95..7ba6bc6cf3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,7 +34,7 @@ jobs: linux_clang10: VM_ImageName: 'ubuntu-18.04' Compiler_ImageName: '$(CLANG10_IMAGENAME)' - CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON ' + CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON' COMPILER: 'clang++' TEST_TARGET: 'linux_clang10' HOST_CONFIG: 'docker-linux-ubuntu18.04-x86_64-clang@10.0.0' From 204af0caa236d389a9f916f3b3126aa338a5ca8b Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 18:05:51 -0800 Subject: [PATCH 67/73] Allow `linux-build_and_test` script to take a `BUILD_TYPE` variable (default: Debug) Also use `Release` build for `linux_clang10` Azure CI job. --- azure-pipelines.yml | 3 ++- scripts/azure-pipelines/linux-build_and_test.sh | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7ba6bc6cf3..dd4a7c416d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,6 +35,7 @@ jobs: VM_ImageName: 'ubuntu-18.04' Compiler_ImageName: '$(CLANG10_IMAGENAME)' CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON' + BUILD_TYPE: 'Release' COMPILER: 'clang++' TEST_TARGET: 'linux_clang10' HOST_CONFIG: 'docker-linux-ubuntu18.04-x86_64-clang@10.0.0' @@ -90,7 +91,7 @@ jobs: - script: | echo " -e $TEST_TARGET -e $COMPILER -e $DO_BUILD -e $DO_TEST -e $CMAKE_EXTRA_FLAGS $(Compiler_ImageName) ./scripts/azure-pipelines/linux-build_and_test.sh" docker run --rm --user='root' -v `pwd`:/home/axom/axom $(Compiler_ImageName) chown -R axom /home/axom - docker run --rm -v `pwd`:/home/axom/axom -e TEST_TARGET -e COMPILER -e DO_BUILD -e DO_TEST -e DO_CLEAN -e HOST_CONFIG -e CMAKE_EXTRA_FLAGS $(Compiler_ImageName) ./axom/scripts/azure-pipelines/linux-build_and_test.sh + docker run --rm -v `pwd`:/home/axom/axom -e TEST_TARGET -e COMPILER -e DO_BUILD -e DO_TEST -e DO_CLEAN -e HOST_CONFIG -e CMAKE_EXTRA_FLAGS -e BUILD_TYPE $(Compiler_ImageName) ./axom/scripts/azure-pipelines/linux-build_and_test.sh condition: eq( variables['Agent.OS'], 'Linux') displayName: 'Linux Build & Test ($(TEST_TARGET))' diff --git a/scripts/azure-pipelines/linux-build_and_test.sh b/scripts/azure-pipelines/linux-build_and_test.sh index 0dfb2668dd..10df29dd31 100755 --- a/scripts/azure-pipelines/linux-build_and_test.sh +++ b/scripts/azure-pipelines/linux-build_and_test.sh @@ -18,16 +18,19 @@ function or_die () { } or_die cd axom -git submodule init -git submodule update +git submodule init +git submodule update echo HOST_CONFIG echo $HOST_CONFIG +export BUILD_TYPE=${BUILD_TYPE:-Debug} + + if [[ "$DO_BUILD" == "yes" ]] ; then echo "~~~~~~ RUNNING CMAKE ~~~~~~~~" - or_die ./config-build.py -hc /home/axom/axom/host-configs/docker/${HOST_CONFIG}.cmake -DENABLE_GTEST_DEATH_TESTS=ON ${CMAKE_EXTRA_FLAGS} - or_die cd build-$HOST_CONFIG-debug + or_die ./config-build.py -hc /home/axom/axom/host-configs/docker/${HOST_CONFIG}.cmake -bt ${BUILD_TYPE} -DENABLE_GTEST_DEATH_TESTS=ON ${CMAKE_EXTRA_FLAGS} + or_die cd build-$HOST_CONFIG-${BUILD_TYPE,,} echo "~~~~~~ BUILDING ~~~~~~~~" if [[ ${CMAKE_EXTRA_FLAGS} == *COVERAGE* ]] ; then or_die make -j 10 From 0a94a2e5b0b0d35b4085bffa95ed3f642696d5d4 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 20:10:46 -0800 Subject: [PATCH 68/73] Adds an option to `build_src` script to build with a given CMake `build_type` Options are: 'Debug' (default), 'RelWithDebInfo', 'Release' and 'RelMinSize' --- .gitlab-ci.yml | 2 +- scripts/llnl_scripts/build_src.py | 20 ++++++++--- scripts/llnl_scripts/llnl_lc_build_tools.py | 39 +++++++++++++-------- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 942435cbe5..813f151aaa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ stages: - ASSIGN_ID=$(if [[ -n "${JOBID}" ]]; then echo "--jobid=${JOBID}"; fi) # BUILD + TEST - echo -e "\e[0Ksection_start:$(date +%s):src_build_and_test\r\e[0KSource Build and Test ${CI_PROJECT_NAME}" - - ${ALLOC_COMMAND} ${ASSIGN_ID} python3 scripts/llnl_scripts/build_src.py -v --host-config ${HOST_CONFIG} --extra-cmake-options -DENABLE_DOCS=OFF + - ${ALLOC_COMMAND} ${ASSIGN_ID} python3 scripts/llnl_scripts/build_src.py -v --host-config ${HOST_CONFIG} --extra-cmake-options '-DENABLE_DOCS=OFF ${EXTRA_CMAKE_OPTIONS}' --build-type ${BUILD_TYPE:-Debug} - echo -e "\e[0Ksection_end:$(date +%s):src_build_and_test\r\e[0K" artifacts: paths: diff --git a/scripts/llnl_scripts/build_src.py b/scripts/llnl_scripts/build_src.py index 629de762e2..f9032390ee 100755 --- a/scripts/llnl_scripts/build_src.py +++ b/scripts/llnl_scripts/build_src.py @@ -9,7 +9,7 @@ """ file: build_src.py - description: + description: Builds all Axom with the host-configs for the current machine. """ @@ -37,6 +37,12 @@ def parse_args(): dest="hostconfig", default="", help="Specific host-config file to build (Tries multiple known paths to locate given file)") + # Build type for the configuration + parser.add_option("--build-type", + dest="buildtype", + default="Debug", + choices = ("Debug", "RelWithDebInfo", "Release", "MinSizeRel"), + help="The CMake build type to use") # Extra cmake options to pass to config build parser.add_option("--extra-cmake-options", dest="extra_cmake_options", @@ -56,7 +62,7 @@ def parse_args(): # parse args ############### opts, extras = parser.parse_args() - # we want a dict b/c the values could + # we want a dict b/c the values could # be passed without using optparse opts = vars(opts) @@ -100,7 +106,10 @@ def main(): # Default to build all SYS_TYPE's host-configs in host-config/ build_all = not opts["hostconfig"] and not opts["automation"] if build_all: - res = build_and_test_host_configs(repo_dir, job_name, timestamp, False, opts["verbose"], opts["extra_cmake_options"]) + res = build_and_test_host_configs(repo_dir, job_name, timestamp, False, + report_to_stdout = opts["verbose"], + extra_cmake_options = opts["extra_cmake_options"], + build_type = opts["build_type"]) # Otherwise try to build a specific host-config else: # Command-line arg has highest priority @@ -149,7 +158,10 @@ def main(): test_root = get_build_and_test_root(repo_dir, timestamp) test_root = "{0}_{1}".format(test_root, hostconfig.replace(".cmake", "").replace("@","_")) os.mkdir(test_root) - res = build_and_test_host_config(test_root, hostconfig_path, opts["verbose"], opts["extra_cmake_options"]) + res = build_and_test_host_config(test_root, hostconfig_path, + report_to_stdout = opts["verbose"], + extra_cmake_options = opts["extra_cmake_options"], + build_type = opts["build_type"]) # Archive logs if opts["archive"] != "": diff --git a/scripts/llnl_scripts/llnl_lc_build_tools.py b/scripts/llnl_scripts/llnl_lc_build_tools.py index 911d0476cb..882b205d94 100755 --- a/scripts/llnl_scripts/llnl_lc_build_tools.py +++ b/scripts/llnl_scripts/llnl_lc_build_tools.py @@ -8,7 +8,7 @@ """ file: llnl_lc_uberenv_install_tools.py - description: + description: helpers for installing axom tpls on llnl lc systems. """ @@ -232,7 +232,7 @@ def archive_tpl_logs(prefix, job_name, timestamp): os.makedirs(archive_spec_dir) copy_if_exists(tpl_log, pjoin(archive_spec_dir, "output.log.spack.txt")) - + # Note: There should only be one of these per spec config_spec_logs = glob.glob(pjoin(build_and_test_root, "output.log.*-" + spec + ".configure.txt")) if len(config_spec_logs) > 0: @@ -296,7 +296,7 @@ def uberenv_build(prefix, spec, project_file, mirror_path): cmd += "--mirror=\"{0}\" ".format(mirror_path) if project_file: cmd += "--project-json=\"{0}\" ".format(project_file) - + spack_tpl_build_log = pjoin(prefix,"output.log.spack.tpl.build.%s.txt" % spec.replace(" ", "_")) print("[starting tpl install of spec %s]" % spec) print("[log file: %s]" % spack_tpl_build_log) @@ -322,7 +322,10 @@ def uberenv_build(prefix, spec, project_file, mirror_path): # helpers for testing a set of host configs ############################################################ -def build_and_test_host_config(test_root, host_config, report_to_stdout = False, extra_cmake_options = ""): +def build_and_test_host_config(test_root, host_config, + report_to_stdout = False, + extra_cmake_options = "", + build_type = "Debug"): host_config_root = get_host_config_root(host_config) # setup build and install dirs build_dir = pjoin(test_root,"build-%s" % host_config_root) @@ -335,7 +338,7 @@ def build_and_test_host_config(test_root, host_config, report_to_stdout = False, cfg_output_file = pjoin(test_root,"output.log.%s.configure.txt" % host_config_root) print("[starting configure of %s]" % host_config) print("[log file: %s]" % cfg_output_file) - res = sexe("python config-build.py -bp %s -ip %s -hc %s %s" % (build_dir, install_dir, host_config, extra_cmake_options), + res = sexe("python config-build.py -bp %s -ip %s -bt %s -hc %s %s" % (build_dir, install_dir, build_type, host_config, extra_cmake_options), output_file = cfg_output_file, echo=True) @@ -346,11 +349,11 @@ def build_and_test_host_config(test_root, host_config, report_to_stdout = False, if res != 0: print("[ERROR: Configure for host-config: %s failed]\n" % host_config) return res - + #### # build, test, and install #### - + # build the code bld_output_file = pjoin(build_dir,"output.log.make.txt") print("[starting build]") @@ -512,7 +515,13 @@ def build_and_test_host_config(test_root, host_config, report_to_stdout = False, return 0 -def build_and_test_host_configs(prefix, job_name, timestamp, use_generated_host_configs, report_to_stdout = False, extra_cmake_options = ""): +def build_and_test_host_configs(prefix, + job_name, + timestamp, + use_generated_host_configs, + report_to_stdout = False, + extra_cmake_options = "", + build_type = "Debug"): host_configs = get_host_configs_for_current_machine(prefix, use_generated_host_configs) if len(host_configs) == 0: log_failure(prefix,"[ERROR: No host configs found at %s]" % prefix) @@ -524,14 +533,17 @@ def build_and_test_host_configs(prefix, job_name, timestamp, use_generated_host_ test_root = get_build_and_test_root(prefix, timestamp) os.mkdir(test_root) - write_build_info(pjoin(test_root,"info.json"), job_name) + write_build_info(pjoin(test_root,"info.json"), job_name) ok = [] bad = [] for host_config in host_configs: build_dir = get_build_dir(test_root, host_config) start_time = time.time() - if build_and_test_host_config(test_root, host_config, report_to_stdout, extra_cmake_options) == 0: + if build_and_test_host_config(test_root, host_config, + report_to_stdout = report_to_stdout, + extra_cmake_options=extra_cmake_options, + build_type = build_type) == 0: ok.append(host_config) log_success(build_dir, job_name, timestamp) else: @@ -566,8 +578,7 @@ def build_and_test_host_configs(prefix, job_name, timestamp, use_generated_host_ def set_group_and_perms(directory): """ - Sets the proper group and access permissions of given input - directory. + Sets the proper group and access permissions of given input directory. """ skip = True @@ -657,7 +668,7 @@ def full_build_and_test_of_tpls(builds_dir, job_name, timestamp, spec, report_to src_build_failed = True else: print("[SUCCESS: Build and test of src vs tpls test passed.]\n") - + # set proper perms for installed tpls set_group_and_perms(prefix) @@ -861,7 +872,7 @@ def get_compiler_from_spec(spec): compiler = spec for c in ['~', '+']: index = compiler.find(c) - if index != -1: + if index != -1: compiler = compiler[:index] return compiler From 756eb03048e58100baca1380a990ae38db9215da Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 20:12:28 -0800 Subject: [PATCH 69/73] Adds a new gitlab job for a release build of `clang@10` with extra quest regression tests --- .gitlab/build_ruby.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab/build_ruby.yml b/.gitlab/build_ruby.yml index c68ab0a2d6..0634504261 100644 --- a/.gitlab/build_ruby.yml +++ b/.gitlab/build_ruby.yml @@ -63,6 +63,14 @@ ruby-clang_10_0_0-src: HOST_CONFIG: "ruby-toss_3_x86_64_ib-${COMPILER}.cmake" extends: .src_build_on_ruby +ruby-clang_10_0_0-release-src: + variables: + COMPILER: "clang@10.0.0" + HOST_CONFIG: "ruby-toss_3_x86_64_ib-${COMPILER}.cmake" + BUILD_TYPE: "Release" + EXTRA_CMAKE_OPTIONS: "-DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON" + extends: .src_build_on_ruby + ruby-clang_9_0_0-src: variables: COMPILER: "clang@9.0.0" From 8821ea2377a274bbd49bd25ddc8f4eff9474bef6 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 9 Nov 2021 20:17:43 -0800 Subject: [PATCH 70/73] Fixes a typo --- scripts/llnl_scripts/build_src.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/llnl_scripts/build_src.py b/scripts/llnl_scripts/build_src.py index f9032390ee..236ba2aa78 100755 --- a/scripts/llnl_scripts/build_src.py +++ b/scripts/llnl_scripts/build_src.py @@ -109,7 +109,7 @@ def main(): res = build_and_test_host_configs(repo_dir, job_name, timestamp, False, report_to_stdout = opts["verbose"], extra_cmake_options = opts["extra_cmake_options"], - build_type = opts["build_type"]) + build_type = opts["buildtype"]) # Otherwise try to build a specific host-config else: # Command-line arg has highest priority @@ -161,7 +161,7 @@ def main(): res = build_and_test_host_config(test_root, hostconfig_path, report_to_stdout = opts["verbose"], extra_cmake_options = opts["extra_cmake_options"], - build_type = opts["build_type"]) + build_type = opts["buildtype"]) # Archive logs if opts["archive"] != "": From e0fbd586398902d0f871e015e1edfa47ac1f3014 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 16 Nov 2021 12:17:29 -0800 Subject: [PATCH 71/73] Updates release number to v0.6.1 --- RELEASE | 2 +- src/cmake/AxomVersion.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE b/RELEASE index 79101753bb..b40458d3d0 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,6 @@ ******************************************************************************* -Axom: ................................, version 0.6.0 +Axom: ................................, version 0.6.1 Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory. diff --git a/src/cmake/AxomVersion.cmake b/src/cmake/AxomVersion.cmake index 63026612b4..772571b299 100644 --- a/src/cmake/AxomVersion.cmake +++ b/src/cmake/AxomVersion.cmake @@ -10,7 +10,7 @@ #------------------------------------------------------------------------------ set(AXOM_VERSION_MAJOR 0) set(AXOM_VERSION_MINOR 6) -set(AXOM_VERSION_PATCH 0) +set(AXOM_VERSION_PATCH 1) string(CONCAT AXOM_VERSION_FULL "v${AXOM_VERSION_MAJOR}" ".${AXOM_VERSION_MINOR}" From faa4138550430f9ae5125f63a8bcb121da2d3157 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 16 Nov 2021 12:19:07 -0800 Subject: [PATCH 72/73] Updates RELEASE-NOTES for release --- RELEASE-NOTES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 39350d0c6e..3cb62f7c12 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -19,6 +19,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ## [Unreleased] - Release date yyyy-mm-dd +## [Version 0.6.1] - Release date 2021-11-17 + ### Added - Added a config variable, `AXOM_DEBUG_DEFINE` to control whether the `AXOM_DEBUG` compiler define is enabled. By `DEFAULT`, it is enabled for `Debug` and `RelWithDebInfo` configurations, but this can be overriden @@ -651,7 +653,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ ### Security - Use this section in case of vulnerabilities -[Unreleased]: https://github.com/LLNL/axom/compare/v0.6.0...develop +[Unreleased]: https://github.com/LLNL/axom/compare/v0.6.1...develop +[Version 0.6.0]: https://github.com/LLNL/axom/compare/v0.6.0...v0.6.1 [Version 0.6.0]: https://github.com/LLNL/axom/compare/v0.5.0...v0.6.0 [Version 0.5.0]: https://github.com/LLNL/axom/compare/v0.4.0...v0.5.0 [Version 0.4.0]: https://github.com/LLNL/axom/compare/v0.3.3...v0.4.0 From 0b425c507b3a37c81c487441149183857c122400 Mon Sep 17 00:00:00 2001 From: Kenny Weiss Date: Tue, 16 Nov 2021 14:46:57 -0800 Subject: [PATCH 73/73] Fix link --- RELEASE-NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 3cb62f7c12..34f3b99f61 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -654,7 +654,7 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/ - Use this section in case of vulnerabilities [Unreleased]: https://github.com/LLNL/axom/compare/v0.6.1...develop -[Version 0.6.0]: https://github.com/LLNL/axom/compare/v0.6.0...v0.6.1 +[Version 0.6.1]: https://github.com/LLNL/axom/compare/v0.6.0...v0.6.1 [Version 0.6.0]: https://github.com/LLNL/axom/compare/v0.5.0...v0.6.0 [Version 0.5.0]: https://github.com/LLNL/axom/compare/v0.4.0...v0.5.0 [Version 0.4.0]: https://github.com/LLNL/axom/compare/v0.3.3...v0.4.0