diff --git a/src/pe/rigidbody/StorageDataHandling.h b/src/pe/rigidbody/StorageDataHandling.h index 196dfe5cda5248f06d013776464315878e79456c..9c8419567e9b902a031ccdea1866f95542fe24f3 100644 --- a/src/pe/rigidbody/StorageDataHandling.h +++ b/src/pe/rigidbody/StorageDataHandling.h @@ -91,7 +91,7 @@ inline void StorageDataHandling<BodyTuple>::deserialize( IBlock * const block, c if ( !block->getAABB().contains( bd->getPosition()) ) { - WALBERLA_ABORT("Loaded body not contained within block!" ); + WALBERLA_ABORT("Loaded body not contained within block!\n" << block->getAABB() << "\n" << bd ); } WALBERLA_ASSERT_EQUAL(localBodyStorage.find( bd->getSystemID() ), localBodyStorage.end()); localBodyStorage.add(bd); diff --git a/src/pe/utility/CreateWorld.cpp b/src/pe/utility/CreateWorld.cpp index 50362dee003a59ae6ada881656714d78f4657f5d..feae8884dbc3278a75aafa304032c7d31594bff7 100644 --- a/src/pe/utility/CreateWorld.cpp +++ b/src/pe/utility/CreateWorld.cpp @@ -38,7 +38,10 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain, const Vector3<bool> isPeriodic, const uint_t numberOfProcesses) { - MPIManager::instance()->useWorldComm(); + WALBERLA_MPI_SECTION() + { + MPIManager::instance()->useWorldComm(); + } if (isPeriodic[0] && blocks[0]<2) { @@ -73,7 +76,10 @@ shared_ptr<BlockForest> createBlockForest(const math::AABB simulationDomain, const std::string sbffile, const uint_t numberOfProcesses) { - MPIManager::instance()->useWorldComm(); + WALBERLA_MPI_SECTION() + { + MPIManager::instance()->useWorldComm(); + } if (isPeriodic[0] && blocks[0]<2) { diff --git a/tests/pe/CMakeLists.txt b/tests/pe/CMakeLists.txt index 40ff645e154d33cfb12df8d593a24d53cab53857..feb9e032e06183838899087bd2721f0fcf4be27c 100644 --- a/tests/pe/CMakeLists.txt +++ b/tests/pe/CMakeLists.txt @@ -64,7 +64,15 @@ waLBerla_compile_test( NAME PE_RIGIDBODY FILES RigidBody.cpp DEPENDS core ) waLBerla_execute_test( NAME PE_RIGIDBODY ) waLBerla_compile_test( NAME PE_SERIALIZEDESERIALIZE FILES SerializeDeserialize.cpp DEPENDS core blockforest ) -waLBerla_execute_test( NAME PE_SERIALIZEDESERIALIZE PROCESSES 8 ) +waLBerla_execute_test( NAME PE_SERIALIZEDESERIALIZE01 COMMAND $<TARGET_FILE:PE_SERIALIZEDESERIALIZE> PROCESSES 1 ) +waLBerla_execute_test( NAME PE_SERIALIZEDESERIALIZE02 COMMAND $<TARGET_FILE:PE_SERIALIZEDESERIALIZE> PROCESSES 2 ) +waLBerla_execute_test( NAME PE_SERIALIZEDESERIALIZE04 COMMAND $<TARGET_FILE:PE_SERIALIZEDESERIALIZE> PROCESSES 4 ) +waLBerla_execute_test( NAME PE_SERIALIZEDESERIALIZE08 COMMAND $<TARGET_FILE:PE_SERIALIZEDESERIALIZE> PROCESSES 8 ) +if( WALBERLA_BUILD_WITH_MPI ) +set_property( TEST PE_SERIALIZEDESERIALIZE02 PROPERTY DEPENDS PE_SERIALIZEDESERIALIZE01 ) #serialize runs of tets to avoid i/o conflicts when running ctest with -jN +set_property( TEST PE_SERIALIZEDESERIALIZE04 PROPERTY DEPENDS PE_SERIALIZEDESERIALIZE02 ) #serialize runs of tets to avoid i/o conflicts when running ctest with -jN +set_property( TEST PE_SERIALIZEDESERIALIZE08 PROPERTY DEPENDS PE_SERIALIZEDESERIALIZE04 ) #serialize runs of tets to avoid i/o conflicts when running ctest with -jN +endif() waLBerla_compile_test( NAME PE_SHADOWCOPY FILES ShadowCopy.cpp DEPENDS core blockforest ) waLBerla_execute_test( NAME PE_SHADOWCOPY ) diff --git a/tests/pe/SerializeDeserialize.cpp b/tests/pe/SerializeDeserialize.cpp index ae03c0f490b120bb19856e13d7357da2a116d20f..5fc706632250d2b158a5f53f16dc0900896d567c 100644 --- a/tests/pe/SerializeDeserialize.cpp +++ b/tests/pe/SerializeDeserialize.cpp @@ -46,7 +46,10 @@ void createDump() shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage>(); // create blocks - auto forest = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), "SerializeDeserialize.sbf", true, false ) ); + auto forest = createBlockForest( math::AABB(0,0,0,60,60,60), + Vector3<uint_t>(2,2,2), // number of blocks + Vector3<bool>(false, false, false)); // periodicity + forest->saveToFile("SerializeDeserialize.sbf"); auto storageID = forest->addBlockData(createStorageDataHandling<BodyTuple>(), "Storage"); auto ccdID = forest->addBlockData(ccd::createHashGridsDataHandling( globalBodyStorage, storageID ), "CCD"); @@ -57,7 +60,7 @@ void createDump() } WALBERLA_LOG_DEVEL_ON_ROOT("dumping body storage"); - forest->saveBlockData("BodyStorageDump.dump", storageID); + forest->saveBlockData("SerializeDeserialize.dump", storageID); for (auto blockIt = forest->begin(); blockIt != forest->end(); ++blockIt) { @@ -79,7 +82,7 @@ void checkDump() // create blocks auto forest = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), "SerializeDeserialize.sbf", true, false ) ); - auto storageID = forest->loadBlockData("BodyStorageDump.dump", createStorageDataHandling<BodyTuple>(), "Storage"); + auto storageID = forest->loadBlockData("SerializeDeserialize.dump", createStorageDataHandling<BodyTuple>(), "Storage"); auto ccdID = forest->addBlockData(ccd::createHashGridsDataHandling( globalBodyStorage, storageID ), "CCD"); for (auto blockIt = forest->begin(); blockIt != forest->end(); ++blockIt) @@ -112,21 +115,19 @@ int main( int argc, char ** argv ) { walberla::debug::enterTestMode(); - walberla::MPIManager::instance()->initializeMPI( &argc, &argv ); - MPIManager::instance()->useWorldComm(); + WALBERLA_MPI_SECTION() + { + walberla::MPIManager::instance()->initializeMPI( &argc, &argv ); + } SetBodyTypeIDs<BodyTuple>::execute(); -// save SetupBlockForest, if you want to do that run with only one process - createBlockForest( math::AABB(0,0,0,60,60,60), - Vector3<uint_t>(2,2,2), // number of blocks - Vector3<bool>(false, false, false), // periodicity - true, // setup run? - "SerializeDeserialize.sbf" ); // sbf filename - WALBERLA_LOG_DEVEL_ON_ROOT("*** DUMPING ***"); createDump(); - WALBERLA_MPI_BARRIER(); + WALBERLA_MPI_SECTION() + { + WALBERLA_MPI_BARRIER(); + } WALBERLA_LOG_DEVEL_ON_ROOT("*** CHECKING ***"); checkDump();