From 2cf78e20c127e60ba2f66bafd701daa437ae3a53 Mon Sep 17 00:00:00 2001 From: Sebastian Eibl <sebastian.eibl@fau.de> Date: Tue, 27 Feb 2018 14:39:07 +0100 Subject: [PATCH] extended MetisAssignmentFunctor --- .../weight_assignment/MetisAssignmentFunctor.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h b/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h index ee5647f3d..720c80a2e 100644 --- a/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h +++ b/src/pe/amr/weight_assignment/MetisAssignmentFunctor.h @@ -41,12 +41,15 @@ public: { for( auto it = blockData.begin(); it != blockData.end(); ++it ) { - const uint_t& weight = ic_->find( it->first->getId() )->second.numberOfLocalBodies + uint_c(baseWeight_); - blockforest::DynamicParMetisBlockInfo info( int64_c(weight) ); - info.setVertexSize(int64_c( weight )); + const double weight = double_c( ic_->find( it->first->getId() )->second.numberOfLocalBodies ) + baseWeight_; + //const double commWeight = double_c( edgeWeightFactor * (double_c(ic_->find( it->first->getId() )->second.numberOfShadowBodies) + baseWeight_)) + 1; + blockforest::DynamicParMetisBlockInfo info( 0 ); + info.setVertexWeight( int64_c(weight) ); + info.setVertexSize( int64_c( weight ) ); + info.setVertexCoords( it->first->getAABB().center() ); for( uint_t nb = uint_t(0); nb < it->first->getNeighborhoodSize(); ++nb ) { - info.setEdgeWeight(it->first->getNeighborId(nb), int64_c(weight) ); + info.setEdgeWeight(it->first->getNeighborId(nb), int64_c(edgeWeight_) ); } it->second = info; } @@ -55,11 +58,15 @@ public: inline void setBaseWeight( const double weight) { baseWeight_ = weight;} inline double getBaseWeight() const { return baseWeight_; } + inline void setEdgeWeight( const double weight) { edgeWeight_ = weight;} + inline double getEdgeWeight() const { return edgeWeight_; } + private: shared_ptr< InfoCollection > ic_; ///Base weight due to allocated data structures. A weight of zero for blocks is dangerous as empty blocks might accumulate on one process! - double baseWeight_ = real_t(10.0); + double baseWeight_ = 10.0; + double edgeWeight_ = 1.0; }; } -- GitLab