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

fixed wrong initialization of communicator

parent 153d3b89
No related merge requests found
...@@ -59,7 +59,8 @@ std::unique_ptr<SetupBlockForest> createSetupBlockForest(const math::AABB simula ...@@ -59,7 +59,8 @@ std::unique_ptr<SetupBlockForest> createSetupBlockForest(const math::AABB simula
{ {
WALBERLA_MPI_SECTION() WALBERLA_MPI_SECTION()
{ {
MPIManager::instance()->useWorldComm(); if (!MPIManager::instance()->rankValid())
MPIManager::instance()->useWorldComm();
} }
if (isPeriodic[0] && blocks[0]<2) if (isPeriodic[0] && blocks[0]<2)
...@@ -95,6 +96,12 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain, ...@@ -95,6 +96,12 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
const uint_t numberOfProcesses, const uint_t numberOfProcesses,
const uint_t initialRefinementLevel) const uint_t initialRefinementLevel)
{ {
WALBERLA_MPI_SECTION()
{
if (!MPIManager::instance()->rankValid())
MPIManager::instance()->useWorldComm();
}
std::unique_ptr<SetupBlockForest> sforest( createSetupBlockForest( simulationDomain, blocks, isPeriodic, numberOfProcesses, initialRefinementLevel )); std::unique_ptr<SetupBlockForest> sforest( createSetupBlockForest( simulationDomain, blocks, isPeriodic, numberOfProcesses, initialRefinementLevel ));
return shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), *sforest, false ) ); return shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), *sforest, false ) );
} }
...@@ -127,6 +134,12 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain, ...@@ -127,6 +134,12 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain,
return shared_ptr<BlockForest>(); return shared_ptr<BlockForest>();
} }
WALBERLA_MPI_SECTION()
{
if (!MPIManager::instance()->rankValid())
MPIManager::instance()->useWorldComm();
}
WALBERLA_LOG_INFO_ON_ROOT( "Production Run!" ); WALBERLA_LOG_INFO_ON_ROOT( "Production Run!" );
WALBERLA_LOG_INFO_ON_ROOT( "Creating the block structure: loading from file \'" << sbffile << "\' ..." ); WALBERLA_LOG_INFO_ON_ROOT( "Creating the block structure: loading from file \'" << sbffile << "\' ..." );
return shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false ) ); return shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false ) );
......
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