From 8bc1a07e727adb844414183998ed7411eb9b4e37 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Fri, 16 May 2014 15:06:37 +0000 Subject: [PATCH] More cleanup [[Imported from SVN: r9747]] --- dune/gfe/parallel/globalindex.hh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dune/gfe/parallel/globalindex.hh b/dune/gfe/parallel/globalindex.hh index 4833e02e..4999ad95 100644 --- a/dune/gfe/parallel/globalindex.hh +++ b/dune/gfe/parallel/globalindex.hh @@ -188,8 +188,7 @@ public: /**********************************************************************************************************************/ GlobalUniqueIndex(const GridView& gridview) : gridview_(gridview), - uniqueEntityPartition_(gridview), - size_(gridview.comm().size()) + uniqueEntityPartition_(gridview) { int rank = gridview.comm().rank(); int size = gridview.comm().size(); @@ -214,16 +213,14 @@ public: * for this; first, we gather the number of locally owned entities on the root process and, second, we * broadcast the array to all processes where the respective offset can be calculated. */ - int offset[size]; - - for(int ii=0;ii<size;ii++) - offset[ii]=0; + std::vector<int> offset(size); + std::fill(offset.begin(), offset.end(), 0); /** gather number of locally owned entities on root process */ - collective.template gather<int>(&nLocalEntity_,offset,1,0); + collective.template gather<int>(&nLocalEntity_,offset.data(),1,0); /** broadcast the array containing the number of locally owned entities to all processes */ - collective.template broadcast<int>(offset,size_,0); + collective.template broadcast<int>(offset.data(),size,0); indexOffset_.clear(); indexOffset_.resize(size,0); -- GitLab