dash icon indicating copy to clipboard operation
dash copied to clipboard

dash::GlobStaticMem<LMemSpace>::operator= is a deleted function

Open bertwesarg opened this issue 5 years ago • 4 comments

The intel compiler 18.5 complains about calling a delete member function:

https://github.com/dash-project/dash/blob/964c45ab23b352bae5a777c6da57108d100eb0a3/dash/include/dash/memory/GlobStaticMem.h#L137

Here are the errors:

mpiicpc -c -o multigrid3d.o -DNDEBUG -I. -DBOOST_ALL_NO_LIB    -O3 -no-prec-div -ansi-alias -xCORE-AVX512 -std=c++14   -DSPEC_LP64     -I./ -DDASH -DDASH_ENABLE_DEFAULT_INDEX_TYPE_LONG  multigrid3d.cpp
dash/include/dash/Array.h(1451): error: function "dash::GlobStaticMem<LMemSpace>::operator=(const dash::GlobStaticMem<LMemSpace> &) [with LMemSpace=dash::HostSpace]" (declared at line 137 of "dash/include/dash/memory/GlobStaticMem.h") cannot be referenced -- it is a deleted function
      m_globmem   = memory_type{*m_team};
                  ^
          detected during:
            instantiation of "void dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::do_allocate() [with ElementType=dash::Coevent::event_cnt_t, IndexType=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternType=dash::BlockPattern<1, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 1530
            instantiation of "bool dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::allocate(const PatternType &) [with ElementType=dash::Coevent::event_cnt_t, IndexType=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternType=dash::BlockPattern<1, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 1345
            instantiation of "bool dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::allocate(dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::size_type, dash::DistributionSpec<1>, dash::Team &) [with ElementType=dash::Coevent::event_cnt_t, IndexType=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternType=dash::BlockPattern<1, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 1359
            instantiation of "bool dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::allocate(dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::size_type, dash::Team &) [with ElementType=dash::Coevent::event_cnt_t, IndexType=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternType=dash::BlockPattern<1, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 141 of "dash/include/dash/Coevent.h"

dash/include/dash/Array.h(1451): error: function "dash::GlobStaticMem<LMemSpace>::operator=(const dash::GlobStaticMem<LMemSpace> &) [with LMemSpace=dash::HostSpace]" (declared at line 137 of "dash/include/dash/memory/GlobStaticMem.h") cannot be referenced -- it is a deleted function
      m_globmem   = memory_type{*m_team};
                  ^
          detected during:
            instantiation of "void dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::do_allocate() [with ElementType=double, IndexType=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternType=dash::BlockPattern<1, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 1530
            instantiation of "bool dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::allocate(const PatternType &) [with ElementType=double, IndexType=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternType=dash::BlockPattern<1, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 792
            instantiation of "dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::Array(dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::size_type, const dash::Array<ElementType, IndexType, PatternType, LocalMemSpaceT>::distribution_spec &, dash::Team &) [with ElementType=double, IndexType=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternType=dash::BlockPattern<1, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 34 of "allreduce.h"

dash/include/dash/matrix/internal/Matrix-inl.h(217): error: function "dash::GlobStaticMem<LMemSpace>::operator=(const dash::GlobStaticMem<LMemSpace> &) [with LMemSpace=dash::HostSpace]" (declared at line 137 of "dash/include/dash/memory/GlobStaticMem.h") cannot be referenced -- it is a deleted function
    _glob_mem   = GlobMem_t{*_team};
                ^
          detected during:
            instantiation of "bool dash::Matrix<ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT>::allocate(const PatternT &) [with ElementT=double, NumDimensions=3, IndexT=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternT=dash::Pattern<3, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 56
            instantiation of "dash::Matrix<ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT>::Matrix(const dash::Matrix<ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT>::size_spec &, const dash::Matrix<ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT>::distribution_spec &, dash::Team &, const dash::Matrix<ElementT, NumDimensions, IndexT, PatternT, LocalMemSpaceT>::team_spec &) [with ElementT=double, NumDimensions=3, IndexT=dash::default_index_t={dash::internal::default_signed_index={long}}, PatternT=dash::Pattern<3, (dash::MemArrange={dash::MemArrange})1, dash::default_index_t={dash::internal::default_signed_index={long}}>, LocalMemSpaceT=dash::HostSpace]" at line 120 of "multigrid3d.cpp"

bertwesarg avatar Aug 27 '19 10:08 bertwesarg

any news here? thanks.

bertwesarg avatar Sep 04 '19 06:09 bertwesarg

Just got word that Intel 19.4 does not has this issue. Is there any know workaround.

bertwesarg avatar Sep 05 '19 10:09 bertwesarg

And still no response here. Thanks.

bertwesarg avatar Feb 20 '20 10:02 bertwesarg

My pragmatic solution is to add a reset method to GlobStaticMem

diff --git i/dash/include/dash/Array.h w/dash/include/dash/Array.h
index 373bd6574..53a18062a 100644
--- i/dash/include/dash/Array.h
+++ w/dash/include/dash/Array.h
@@ -1448,7 +1448,7 @@ private:
     m_data.reset();
 
     m_team      = &(m_pattern.team());
-    m_globmem   = memory_type{*m_team};
+    m_globmem.reset(*m_team);
     m_allocator = allocator_type{&m_globmem};
 
     // Check requested capacity:
diff --git i/dash/include/dash/matrix/internal/Matrix-inl.h w/dash/include/dash/matrix/internal/Matrix-inl.h
index 8ff97173d..7ad02ed66 100644
--- i/dash/include/dash/matrix/internal/Matrix-inl.h
+++ w/dash/include/dash/matrix/internal/Matrix-inl.h
@@ -214,7 +214,7 @@ bool Matrix<T, NumDim, IndexT, PatternT, LocalMemT>
     _team = &pattern.team();
   }
 
-  _glob_mem   = GlobMem_t{*_team};
+  _glob_mem.reset(*_team);
   _allocator = allocator_type{&_glob_mem};
 
   // Copy sizes from pattern:
diff --git i/dash/include/dash/memory/GlobStaticMem.h w/dash/include/dash/memory/GlobStaticMem.h
index d89793296..b916413d4 100644
--- i/dash/include/dash/memory/GlobStaticMem.h
+++ w/dash/include/dash/memory/GlobStaticMem.h
@@ -142,6 +142,12 @@ public:
 
   GlobStaticMem& operator=(GlobStaticMem&&) noexcept = default;
 
+  void reset(dash::Team const& team)
+  {
+    m_team = &team;
+    m_local_sizes.resize(std::max(team.size(), std::size_t(1)));
+  }
+
   constexpr size_type capacity() const noexcept;
 
   constexpr size_type capacity(dash::team_unit_t uid) const noexcept

bertwesarg avatar Feb 20 '20 14:02 bertwesarg