Skip to content
Snippets Groups Projects
Commit 40f1c524 authored by Florian Schornbaum's avatar Florian Schornbaum
Browse files

[BUGFIX] No more "gaps" in the SFC partitioning (#54)

parent e803bb59
No related merge requests found
......@@ -792,8 +792,9 @@ void DynamicCurveBalance< PhantomData_T >::balanceWeighted( const std::vector< s
long double weight( 0 );
int numBlocks( 0 );
while( c < blocks.size() &&
std::abs( pWeight - weight - numeric_cast< long double >( allBlocks[ uint_c( blocks[c].first ) ][ blocks[c].second ].second ) ) <=
std::abs( pWeight - weight ) &&
( isIdentical(weight, 0.0l) ||
std::abs( pWeight - weight - numeric_cast< long double >( allBlocks[ uint_c( blocks[c].first ) ][ blocks[c].second ].second ) ) <=
std::abs( pWeight - weight ) ) &&
numBlocks < maxBlocksPerProcess_ )
{
targets[ uint_c( blocks[c].first ) ][ blocks[c].second ] = pid_c(p);
......
......@@ -123,9 +123,9 @@ uint_t StaticLevelwiseCurveBalanceWeighted::operator()( SetupBlockForest & fores
{
const workload_t pWeight = totalWeight / workload_c( numberOfProcesses - p );
workload_t weight( 0 );
while( c < blocksOnLevel.size() &&
while( c < blocksOnLevel.size() && ( isIdentical(weight, workload_t(0)) ||
std::abs( pWeight - weight - blocksOnLevel[c]->getWorkload() ) <=
std::abs( pWeight - weight ) )
std::abs( pWeight - weight ) ) )
{
blocksOnLevel[c]->assignTargetProcess(p);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment