Commit 094feea6 authored by Marcel Koch's avatar Marcel Koch
Browse files

adds mpi barrier to ensure all pIDs are recieved

this is a fix for #155 with some additional assertions for sanity checking.
parent 492958cb
Pipeline #33227 failed with stages
in 183 minutes and 27 seconds
......@@ -388,10 +388,10 @@ MigrationInfo reverseDistribution( const MigrationInfo& originalMigrationInfo, P
MigrationInfo reverseDistributionDry( const MigrationInfo& originalMigrationInfo )
{
MigrationMap_T migrationMap;
const uint_t numReceivingPrimitivesInverseMapping = originalMigrationInfo.getMap().size();
const uint_t numReceivingPrimitivesInverseMapping = originalMigrationInfo.getNumReceivingPrimitives();
// send messages along the original migration info to build the inverse mapping
PackageBufferSystem bs( walberla::mpi::MPIManager::instance()->comm(), originalMigrationInfo.getNumReceivingPrimitives() );
PackageBufferSystem bs( walberla::mpi::MPIManager::instance()->comm(), numReceivingPrimitivesInverseMapping );
for ( const auto& it : originalMigrationInfo.getMap() )
{
......@@ -406,9 +406,13 @@ MigrationInfo reverseDistributionDry( const MigrationInfo& originalMigrationInfo
auto& buffer = package.buffer();
PrimitiveID::IDType pID;
buffer >> pID;
WALBERLA_CHECK_EQUAL( migrationMap.count( pID ), 0, "Recieved pID " + std::to_string( pID ) + " twice." );
migrationMap[pID] = uint_c( package.senderRank() );
}
WALBERLA_MPI_BARRIER();
WALBERLA_CHECK_EQUAL(
migrationMap.size(), originalMigrationInfo.getNumReceivingPrimitives(), "Too many or too few primitives recieved." );
MigrationInfo migrationInfo( migrationMap, numReceivingPrimitivesInverseMapping );
return migrationInfo;
......
Markdown is supported
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