Skip to content
Snippets Groups Projects
Commit 4783b2a5 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Merge remote-tracking branch 'upstream/master' into openmpi-dlopen

parents c6c1afe2 97716f13
No related merge requests found
......@@ -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
......
......@@ -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;
}
......
......@@ -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
......
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