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

[BUGFIX] uninitialized member in Owner class

parent 73052d09
Branches
Tags
No related merge requests found
......@@ -40,7 +40,7 @@ struct Owner
int rank_; //< rank of the owner of the shadow copy
IBlockID::IDType blockID_; //< block id of the block the shadow copy is located in
Owner(): rank_(-1) {}
Owner(): rank_(-1), blockID_(0) {}
Owner(const int rank, const IBlockID::IDType blockID) : rank_(rank), blockID_(blockID) {}
};
//*************************************************************************************************
......
......@@ -156,7 +156,6 @@ void generateSynchonizationMessages(mpi::BufferSystem& bs, const Block& block, B
{
// Body is no longer locally owned (body is about to be migrated).
Owner owner( findContainingProcess( block, gpos ) );
WALBERLA_ASSERT_UNEQUAL( owner.blockID_, me.blockID_, "Position is " << gpos << "\nlocal Block is: " << block.getAABB() );
WALBERLA_LOG_DETAIL( "Local body " << b->getSystemID() << " is no longer on process " << body->MPITrait.getOwner() << " but on process " << owner );
......@@ -174,9 +173,10 @@ void generateSynchonizationMessages(mpi::BufferSystem& bs, const Block& block, B
// of which we own a shadow copy in the next position update since (probably) we no longer require the body but
// are still part of its registration list.
continue;
}
else
} else
{
WALBERLA_ASSERT_UNEQUAL( owner.blockID_, me.blockID_, "Position is " << gpos << "\nlocal Block is: " << block.getAABB() );
// New owner found among neighbors.
WALBERLA_ASSERT_UNEQUAL( owner.blockID_, block.getId().getID(), "Migration is restricted to neighboring blocks." );
......
......@@ -111,10 +111,14 @@ waLBerla_execute_test( NAME PE_SYNCHRONIZATION09 COMMAND $<TARGET_FILE:PE_SYNC
waLBerla_execute_test( NAME PE_SYNCHRONIZATION27 COMMAND $<TARGET_FILE:PE_SYNCHRONIZATION> PROCESSES 27)
waLBerla_compile_test( NAME PE_SYNCHRONIZATIONDELETE FILES SynchronizationDelete.cpp DEPENDS core )
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE01 COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> )
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE03 COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> PROCESSES 3 LABELS longrun)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE09 COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> PROCESSES 9 LABELS longrun)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE27 COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> PROCESSES 27)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE01_NN COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> )
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE03_NN COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> PROCESSES 3 LABELS longrun)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE09_NN COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> PROCESSES 9 LABELS longrun)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE27_NN COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> PROCESSES 27)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE01_SO COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> --syncShadowOwners )
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE03_SO COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> --syncShadowOwners PROCESSES 3 LABELS longrun)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE09_SO COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> --syncShadowOwners PROCESSES 9 LABELS longrun)
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONDELETE27_SO COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONDELETE> --syncShadowOwners PROCESSES 27)
waLBerla_compile_test( NAME PE_SYNCHRONIZATIONLARGEBODY FILES SynchronizationLargeBody.cpp DEPENDS core )
waLBerla_execute_test( NAME PE_SYNCHRONIZATIONLARGEBODY01 COMMAND $<TARGET_FILE:PE_SYNCHRONIZATIONLARGEBODY> )
......
......@@ -61,6 +61,19 @@ int main( int argc, char ** argv )
// logging::Logging::instance()->setFileLogLevel( logging::Logging::DETAIL );
// logging::Logging::instance()->includeLoggingToFile("SyncLog");
bool syncShadowOwners = false;
for( int i = 1; i < argc; ++i )
{
if( std::strcmp( argv[i], "--syncShadowOwners" ) == 0 ) syncShadowOwners = true;
}
if (syncShadowOwners)
{
WALBERLA_LOG_DEVEL("running with syncShadowOwners");
} else
{
WALBERLA_LOG_DEVEL("running with syncNextNeighbour");
}
shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage> ();
// create blocks
......@@ -109,8 +122,17 @@ int main( int argc, char ** argv )
}
}
std::function<void(void)> syncCall;
if (!syncShadowOwners)
{
syncCall = std::bind( pe::syncNextNeighbors<BodyTuple>, std::ref(forest->getBlockForest()), storageID, static_cast<WcTimingTree*>(nullptr), real_c(0.0), false );
} else
{
syncCall = std::bind( pe::syncShadowOwners<BodyTuple>, std::ref(forest->getBlockForest()), storageID, static_cast<WcTimingTree*>(nullptr), real_c(0.0), false );
}
for (int i = 0; i < 500; ++i){
syncNextNeighbors<BodyTuple>(forest->getBlockForest(), storageID);
syncCall();
integrate(*forest, storageID, real_c(0.1));
}
......
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