36#include <boost/mpi.hpp>
37#include <boost/mpi/communicator.hpp>
38#include <boost/mpi/environment.hpp>
72void init(std::shared_ptr<boost::mpi::environment> mpi_env) {
76 std::make_shared<Communication::MpiCallbacks>(
comm_cart, mpi_env);
96 auto constexpr reorder =
false;
100 std::ignore = Utils::Mpi::cart_neighbors<3>(
comm);
106 MPI_Comm_size(MPI_COMM_WORLD, &
size);
120std::shared_ptr<boost::mpi::environment>
mpi_init(
int argc,
char **argv) {
121 return std::make_shared<boost::mpi::environment>(argc, argv);
126 mpiCallbacks().
loop();
Vector implementation and trait types for boost qvm interoperability.
The interface of the MPI callback mechanism.
void loop() const
Start the MPI loop.
void mpi_loop()
Process requests from head node.
Communicator communicator
boost::mpi::communicator comm_cart
The communicator.
std::shared_ptr< boost::mpi::environment > mpi_init(int argc, char **argv)
Initialize MPI.
int this_node
The number of this node.
This file contains the defaults for ESPResSo.
This file contains the errorhandling code for severe errors, like a broken bond or illegal parameter ...
void cuda_on_program_start()
Called on program start.
std::shared_ptr< MpiCallbacks > mpiCallbacksHandle()
static std::shared_ptr< MpiCallbacks > m_callbacks
void init(std::shared_ptr< boost::mpi::environment > mpi_env)
Init globals for communication.
MpiCallbacks & mpiCallbacks()
Returns a reference to the global callback class instance.
void init_error_handling(std::weak_ptr< Communication::MpiCallbacks > callbacks)
Initialize the error collection system.
boost::mpi::communicator cart_create(boost::mpi::communicator const &comm, Vector< int, dim > const &dims, bool reorder=true, Vector< int, dim > const &periodicity=Vector< int, dim >::broadcast(1))
Wrapper around MPI_Cart_create.
void mpi_init()
Initialize waLBerla's MPI manager.
boost::mpi::communicator & comm
void full_initialization()
int size
The MPI world size.
int & this_node
The MPI rank.
Utils::Vector3i calc_node_index() const
Calculate the node index in the Cartesian topology.
Utils::Vector3i node_grid
void set_node_grid(Utils::Vector3i const &value)
Set new Cartesian topology.