ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Classes | |
struct | CartInfo |
Information about a cartesian communicator. More... | |
Functions | |
template<typename T > | |
bool | all_compare (boost::mpi::communicator const &comm, T const &value) |
Compare values on all nodes. | |
template<std::size_t dim> | |
Vector< int, dim > | dims_create (int nodes) |
Wrapper around MPI_Dims_create. | |
template<std::size_t dim> | |
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. | |
template<std::size_t dims> | |
Vector3i | cart_coords (boost::mpi::communicator const &comm, int rank) |
Wrapper around MPI_Cart_coords. | |
template<std::size_t dims> | |
int | cart_rank (boost::mpi::communicator const &comm, const Vector< int, dims > &pos) |
Wrapper around MPI_Cart_rank. | |
std::pair< int, int > | cart_shift (boost::mpi::communicator const &comm, int direction, int displacement) |
Wrapper around MPI_Cart_shift. | |
template<std::size_t dim> | |
Utils::Vector< int, 2 *dim > | cart_neighbors (const boost::mpi::communicator &comm) |
Calculates the numbers of the nearest neighbors for a node. | |
template<std::size_t dim> | |
CartInfo< dim > | cart_get (const boost::mpi::communicator &comm) |
Wrapper around MPI_Cart_get. | |
template<typename T , class Allocator > | |
void | gather_buffer (std::vector< T, Allocator > &buffer, boost::mpi::communicator const &comm, int root=0) |
Gather buffer with different size on each node. | |
template<typename T > | |
void | gatherv (const boost::mpi::communicator &comm, const T *in_values, int in_size, T *out_values, const int *sizes, const int *displs, int root) |
template<typename T > | |
void | gatherv (const boost::mpi::communicator &comm, const T *in_values, int in_size, T *out_values, const int *sizes, int root) |
template<typename T > | |
void | gatherv (const boost::mpi::communicator &comm, const T *in_values, int in_size, int root) |
template<typename T > | |
auto | iall_gatherv (boost::mpi::communicator const &comm, T const *in_values, int in_size, T *out_values, int const *sizes) |
template<typename T > | |
T | reduce_optional (boost::mpi::communicator const &comm, std::optional< T > const &result) |
Reduce an optional on the head node. | |
template<typename T > | |
void | scatter_buffer (T *buffer, int n_elem, boost::mpi::communicator comm, int root=0) |
Scatter buffer with different size on each node. | |
template<typename T > | |
mpi::status | sendrecv (mpi::communicator const &comm, int dest, int stag, const T &sval, int src, int rtag, T &rval) |
template<typename T > | |
std::array< mpi::request, 2 > | isendrecv (mpi::communicator const &comm, int dest, int stag, const T &sval, int src, int rtag, T &rval) |
bool Utils::Mpi::all_compare | ( | boost::mpi::communicator const & | comm, |
T const & | value | ||
) |
Compare values on all nodes.
comm | The communicator to operate on. |
value | the value to compare. |
T | the type of value. |
Returns true iff all ranks in comm called the function with the same value. T has to be serializeable.
Definition at line 42 of file all_compare.hpp.
Referenced by CollisionDetection::BindAtPointOfCollision::handle_collisions(), CollisionDetection::GlueToSurface::handle_collisions(), and System::System::on_integration_start().
Vector3i Utils::Mpi::cart_coords | ( | boost::mpi::communicator const & | comm, |
int | rank | ||
) |
Wrapper around MPI_Cart_coords.
dims | Number of dimensions |
Definition at line 72 of file cart_comm.hpp.
References Utils::Array< T, N >::data().
boost::mpi::communicator Utils::Mpi::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.
dim | Number of dimensions |
Definition at line 54 of file cart_comm.hpp.
References Utils::Array< T, N >::data().
Referenced by Communicator::init_comm_cart().
CartInfo< dim > Utils::Mpi::cart_get | ( | const boost::mpi::communicator & | comm | ) |
Wrapper around MPI_Cart_get.
dim | Number of dimensions. |
comm | Communicator with cartesian topology. |
Definition at line 150 of file cart_comm.hpp.
Utils::Vector< int, 2 *dim > Utils::Mpi::cart_neighbors | ( | const boost::mpi::communicator & | comm | ) |
Calculates the numbers of the nearest neighbors for a node.
dim | Dimension of the communicator |
comm | Cartesian communicator |
Definition at line 115 of file cart_comm.hpp.
References cart_shift().
int Utils::Mpi::cart_rank | ( | boost::mpi::communicator const & | comm, |
const Vector< int, dims > & | pos | ||
) |
Wrapper around MPI_Cart_rank.
dims | Number of dimensions |
Definition at line 84 of file cart_comm.hpp.
References Utils::Array< T, N >::data().
|
inline |
Wrapper around MPI_Cart_shift.
Definition at line 96 of file cart_comm.hpp.
Referenced by cart_neighbors().
Vector< int, dim > Utils::Mpi::dims_create | ( | int | nodes | ) |
Wrapper around MPI_Dims_create.
dim | Number of dimensions |
Definition at line 40 of file cart_comm.hpp.
void Utils::Mpi::gather_buffer | ( | std::vector< T, Allocator > & | buffer, |
boost::mpi::communicator const & | comm, | ||
int | root = 0 |
||
) |
Gather buffer with different size on each node.
Gathers buffers with different lengths from all nodes to root. The buffer is resized to the total size. On the root
node, the first n_elem
elements of buffer
are moved, if need be. On the other nodes, buffer
is not touched.
This encapsulates a common combination of MPI_Gather()
and MPI_{Send,Recv}()
.
buffer | On the head node: the target buffer that has the local part in the beginning. On worker nodes: the local buffer. |
comm | The MPI communicator. |
root | The rank where the data should be gathered. |
Definition at line 54 of file gather_buffer.hpp.
References gatherv().
Referenced by ScriptInterface::Particles::auto_exclusions(), ScriptInterface::Analysis::Analysis::do_call_method(), ScriptInterface::CellSystem::CellSystem::do_call_method(), ErrorHandling::RuntimeErrorCollector::gather(), CollisionDetection::gather_collision_queue(), BondBreakage::gather_global_queue(), ErrorHandling::RuntimeErrorCollector::gather_local(), gather_traits_for_types(), GatherParticleTraits< T >::join(), mindist(), nbhood(), and propagate_vel_pos_sd().
void Utils::Mpi::gatherv | ( | const boost::mpi::communicator & | comm, |
const T * | in_values, | ||
int | in_size, | ||
int | root | ||
) |
Definition at line 116 of file gatherv.hpp.
References gatherv().
void Utils::Mpi::gatherv | ( | const boost::mpi::communicator & | comm, |
const T * | in_values, | ||
int | in_size, | ||
T * | out_values, | ||
const int * | sizes, | ||
const int * | displs, | ||
int | root | ||
) |
Definition at line 87 of file gatherv.hpp.
Referenced by gather_buffer(), gatherv(), mpi_get_particles(), and mpi_get_particles_local().
void Utils::Mpi::gatherv | ( | const boost::mpi::communicator & | comm, |
const T * | in_values, | ||
int | in_size, | ||
T * | out_values, | ||
const int * | sizes, | ||
int | root | ||
) |
Definition at line 95 of file gatherv.hpp.
auto Utils::Mpi::iall_gatherv | ( | boost::mpi::communicator const & | comm, |
T const * | in_values, | ||
int | in_size, | ||
T * | out_values, | ||
int const * | sizes | ||
) |
Definition at line 73 of file iall_gatherv.hpp.
Referenced by gather_particle_data().
std::array< mpi::request, 2 > Utils::Mpi::isendrecv | ( | mpi::communicator const & | comm, |
int | dest, | ||
int | stag, | ||
const T & | sval, | ||
int | src, | ||
int | rtag, | ||
T & | rval | ||
) |
Definition at line 73 of file sendrecv.hpp.
T Utils::Mpi::reduce_optional | ( | boost::mpi::communicator const & | comm, |
std::optional< T > const & | result | ||
) |
Reduce an optional on the head node.
Worker nodes get a default-constructed object.
Definition at line 36 of file reduce_optional.hpp.
Referenced by ScriptInterface::walberla::EKIndexedReaction::do_call_method(), ScriptInterface::walberla::EKSpeciesNode::do_call_method(), and ScriptInterface::walberla::LBFluidNode::do_call_method().
void Utils::Mpi::scatter_buffer | ( | T * | buffer, |
int | n_elem, | ||
boost::mpi::communicator | comm, | ||
int | root = 0 |
||
) |
Scatter buffer with different size on each node.
Scatter a buffer to the nodes, where every node gets a different chunk of the buffer, controlled by the worker node.
This is a collective call.
Definition at line 44 of file scatter_buffer.hpp.
Referenced by propagate_vel_pos_sd().
mpi::status Utils::Mpi::sendrecv | ( | mpi::communicator const & | comm, |
int | dest, | ||
int | stag, | ||
const T & | sval, | ||
int | src, | ||
int | rtag, | ||
T & | rval | ||
) |
Definition at line 66 of file sendrecv.hpp.