Skip to content
Snippets Groups Projects
Commit e0b83490 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

Merge branch '54-there-are-gaps-created-by-the-sfc-partitionier' into 'master'

Resolve "There are "gaps" created by the SFC partitionier"

Closes #54

See merge request walberla/walberla!96
parents e803bb59 6e2112bd
Branches
Tags
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);
......
......@@ -144,7 +144,7 @@ int main( int argc, char ** argv )
ccd->reloadBodies();
}
WALBERLA_CHECK_EQUAL( blockforest.size(), mpi::MPIManager::instance()->worldRank() == 6 ? 1 : 0);
WALBERLA_CHECK_EQUAL( blockforest.size(), mpi::MPIManager::instance()->worldRank() == 0 ? 1 : 0);
WALBERLA_LOG_DEVEL( infoCollection->size() );
for (unsigned int i = 0; i < 30; ++i)
......
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