diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07fc1069080c8a62847e044bc67344a99fdd25f5..bd497da3fab7f7404654988ba7fff90e73cdfa90 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1558,7 +1558,7 @@ gcc_9_stl_debug: ############################################################################### doc: - image: i10git.cs.fau.de:5005/walberla/buildenvs/ubuntu:18.04 + image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9 script: - cmake --version - doxygen --version @@ -1916,6 +1916,7 @@ mac_MpiOnly_Dbg: WALBERLA_BUILD_WITH_MPI: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_PYTHON: "ON" + OMPI_MCA_btl: "self,tcp" except: variables: - $DISABLE_PER_COMMIT_BUILDS @@ -1928,6 +1929,7 @@ mac_MpiOnly: WALBERLA_BUILD_WITH_MPI: "ON" WALBERLA_BUILD_WITH_OPENMP: "OFF" WALBERLA_BUILD_WITH_PYTHON: "ON" + OMPI_MCA_btl: "self,tcp" except: variables: - $DISABLE_PER_COMMIT_BUILDS diff --git a/src/core/mpi/MPIManager.cpp b/src/core/mpi/MPIManager.cpp index 2a2ac24824c86659a405508cb098e6419f44b772..a334bc16c4878cea58a1452cd083fba31d9d3c7e 100644 --- a/src/core/mpi/MPIManager.cpp +++ b/src/core/mpi/MPIManager.cpp @@ -32,6 +32,9 @@ #include <stdexcept> #include <string> #include <vector> +#ifdef __APPLE__ +#include <thread> +#endif namespace walberla { @@ -94,6 +97,12 @@ void MPIManager::initializeMPI(int* argc, char*** argv, bool abortOnException) MPI_Initialized(&mpiAlreadyInitialized); if (!mpiAlreadyInitialized) { +#ifdef __APPLE__ + /* Work around a race condition on macOS. + If a process started by mpiexec finishes too quickly, it sometimes doesn't start all processes. + */ + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); +#endif MPI_Init(argc, argv); finalizeOnDestruction_ = true; } diff --git a/tests/lbm/codegen/FluctuatingMRT.cpp b/tests/lbm/codegen/FluctuatingMRT.cpp index 46ceaea05a58e64249230b5ddbb6d338d41c1d12..342d2d4236e01cffede917dbfa537280dcd5d64c 100644 --- a/tests/lbm/codegen/FluctuatingMRT.cpp +++ b/tests/lbm/codegen/FluctuatingMRT.cpp @@ -74,8 +74,9 @@ int main( int argc, char ** argv ) BlockDataID pdfFieldId = lbm::addPdfFieldToStorage( blocks, "pdf field", latticeModel, initialVelocity, real_t(1) ); BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >( blocks, "flag field" ); - // create and initialize boundary handling + // create and initialize flag field const FlagUID fluidFlagUID( "Fluid" ); + geometry::setNonBoundaryCellsToDomain<FlagField_T>(*blocks, flagFieldId, fluidFlagUID); // create time loop SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps ); @@ -84,9 +85,14 @@ int main( int argc, char ** argv ) blockforest::communication::UniformBufferedScheme< CommunicationStencil_T > communication( blocks ); communication.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldId ) ); - // add LBM sweep and communication to time loop + // set the RNG counter to match the time step and propagate it to the fields' copies of the lattice model timeloop.add() << BeforeFunction( [&](){ latticeModel.time_step_ = uint32_c(timeloop.getCurrentTimeStep()); }, "set RNG counter" ) - << BeforeFunction( communication, "communication" ) + << Sweep( [&]( IBlock * block ){ + auto field = block->getData< PdfField_T >( pdfFieldId ); + field->latticeModel().time_step_ = latticeModel.time_step_; + }, "set RNG counter" ); + // add LBM sweep and communication to time loop + timeloop.add() << BeforeFunction( communication, "communication" ) << Sweep( LatticeModel_T::Sweep( pdfFieldId ), "LB stream & collide" ); // LBM stability check