ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Ghost particles and particle exchange. More...
#include "ghosts.hpp"
#include "BoxGeometry.hpp"
#include "Particle.hpp"
#include "system/System.hpp"
#include <utils/serialization/memcpy_archive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/iostreams/device/array.hpp>
#include <boost/iostreams/device/back_inserter.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/mpi/collectives.hpp>
#include <boost/range/numeric.hpp>
#include <boost/serialization/vector.hpp>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <functional>
#include <iterator>
#include <span>
#include <vector>
Go to the source code of this file.
Classes | |
class | CommBuf |
Class that stores marshalled data for ghost communications. More... | |
class | SerializationSizeCalculator |
Pseudo-archive to calculate the size of the serialization buffer. More... | |
Macros | |
#define | REQ_GHOST_SEND 100 |
Tag for ghosts communications. | |
Enumerations | |
enum class | ReductionPolicy { MOVE , UPDATE } |
Type of reduction to carry out during serialization. More... | |
enum class | SerializationDirection { SAVE , LOAD } |
Whether to save the state to or load the state from the archive. More... | |
Functions | |
template<class Archive > | |
static void | serialize_and_reduce (Archive &ar, Particle &p, unsigned int data_parts, ReductionPolicy policy, SerializationDirection direction, BoxGeometry const &box_geo, Utils::Vector3d const *ghost_shift) |
Serialize particle data, possibly with reduction. | |
static auto | calc_transmit_size (BoxGeometry const &box_geo, unsigned data_parts) |
static auto | calc_transmit_size (GhostCommunication const &ghost_comm, BoxGeometry const &box_geo, unsigned int data_parts) |
static void | prepare_send_buffer (CommBuf &send_buffer, GhostCommunication const &ghost_comm, BoxGeometry const &box_geo, unsigned int data_parts) |
static void | prepare_ghost_cell (ParticleList *cell, std::size_t size) |
static void | prepare_recv_buffer (CommBuf &recv_buffer, GhostCommunication const &ghost_comm, BoxGeometry const &box_geo, unsigned int data_parts) |
static void | put_recv_buffer (CommBuf &recv_buffer, GhostCommunication const &ghost_comm, BoxGeometry const &box_geo, unsigned int data_parts) |
static void | add_rattle_correction_from_recv_buffer (CommBuf &recv_buffer, const GhostCommunication &ghost_comm) |
static void | add_forces_from_recv_buffer (CommBuf &recv_buffer, const GhostCommunication &ghost_comm) |
static void | cell_cell_transfer (GhostCommunication const &ghost_comm, BoxGeometry const &box_geo, unsigned int data_parts) |
static bool | is_send_op (int comm_type, int node, int this_node) |
static bool | is_recv_op (int comm_type, int node, int this_node) |
static bool | is_prefetchable (GhostCommunication const &ghost_comm, int this_node) |
static bool | is_poststorable (GhostCommunication const &ghost_comm, int this_node) |
void | ghost_communicator (GhostCommunicator const &gcr, BoxGeometry const &box_geo, unsigned int data_parts) |
Do a ghost communication with the specified data parts. | |
Ghost particles and particle exchange.
For more information on ghosts, see ghosts.hpp
Note on variable naming:
Definition in file ghosts.cpp.
#define REQ_GHOST_SEND 100 |
Tag for ghosts communications.
Definition at line 57 of file ghosts.cpp.
|
strong |
Type of reduction to carry out during serialization.
Enumerator | |
---|---|
MOVE | Reduction for domain-to-domain particle communication. |
UPDATE | Reduction for cell-to-cell particle update. |
Definition at line 108 of file ghosts.cpp.
|
strong |
Whether to save the state to or load the state from the archive.
Enumerator | |
---|---|
SAVE | |
LOAD |
Definition at line 116 of file ghosts.cpp.
|
static |
Definition at line 364 of file ghosts.cpp.
References CommBuf::make_span(), and GhostCommunication::part_lists.
Referenced by ghost_communicator().
|
static |
Definition at line 350 of file ghosts.cpp.
References CommBuf::make_span(), and GhostCommunication::part_lists.
Referenced by ghost_communicator().
|
static |
Definition at line 229 of file ghosts.cpp.
References MOVE, SAVE, serialize_and_reduce(), and SerializationSizeCalculator::size().
Referenced by calc_transmit_size(), cell_cell_transfer(), ghost_communicator(), prepare_recv_buffer(), and prepare_send_buffer().
|
static |
Definition at line 238 of file ghosts.cpp.
References calc_transmit_size(), GHOSTTRANS_PARTNUM, and GhostCommunication::part_lists.
|
static |
Definition at line 377 of file ghosts.cpp.
References calc_transmit_size(), GHOSTTRANS_BONDS, GHOSTTRANS_PARTNUM, LOAD, CommBuf::make_span(), GhostCommunication::part_lists, prepare_ghost_cell(), CommBuf::resize(), SAVE, serialize_and_reduce(), GhostCommunication::shift, and UPDATE.
Referenced by ghost_communicator().
void ghost_communicator | ( | GhostCommunicator const & | gcr, |
BoxGeometry const & | box_geo, | ||
unsigned int | data_parts | ||
) |
Do a ghost communication with the specified data parts.
Definition at line 442 of file ghosts.cpp.
References add_forces_from_recv_buffer(), add_rattle_correction_from_recv_buffer(), CommBuf::bonds(), calc_transmit_size(), cell_cell_transfer(), GhostCommunicator::communications, CommBuf::data(), GHOST_BCST, GHOST_JOBMASK, GHOST_LOCL, GHOST_PREFETCH, GHOST_PSTSTORE, GHOST_RDCE, GHOST_RECV, GHOST_SEND, GHOSTTRANS_FORCE, GHOSTTRANS_NONE, GHOSTTRANS_RATTLE, is_recv_op(), is_send_op(), GhostCommunicator::mpi_comm, GhostCommunication::node, prepare_recv_buffer(), prepare_send_buffer(), put_recv_buffer(), REQ_GHOST_SEND, CommBuf::size(), this_node, and GhostCommunication::type.
Referenced by CellStructure::ghosts_count(), CellStructure::ghosts_reduce_forces(), CellStructure::ghosts_reduce_rattle_correction(), CellStructure::ghosts_update(), and HybridDecomposition::resort().
|
static |
Definition at line 434 of file ghosts.cpp.
References GHOST_JOBMASK, GHOST_PSTSTORE, is_recv_op(), GhostCommunication::node, this_node, and GhostCommunication::type.
|
static |
Definition at line 426 of file ghosts.cpp.
References GHOST_JOBMASK, GHOST_PREFETCH, is_send_op(), GhostCommunication::node, this_node, and GhostCommunication::type.
|
static |
Definition at line 420 of file ghosts.cpp.
References GHOST_BCST, GHOST_RDCE, GHOST_RECV, and this_node.
Referenced by ghost_communicator(), and is_poststorable().
|
static |
Definition at line 415 of file ghosts.cpp.
References GHOST_BCST, GHOST_RDCE, GHOST_SEND, and this_node.
Referenced by ghost_communicator(), and is_prefetchable().
|
static |
Definition at line 289 of file ghosts.cpp.
References Utils::Bag< T >::resize().
Referenced by cell_cell_transfer(), and put_recv_buffer().
|
static |
Definition at line 299 of file ghosts.cpp.
References CommBuf::bonds(), calc_transmit_size(), and CommBuf::resize().
Referenced by ghost_communicator().
|
static |
Definition at line 251 of file ghosts.cpp.
References CommBuf::bonds(), calc_transmit_size(), GHOSTTRANS_BONDS, GHOSTTRANS_PARTNUM, CommBuf::make_span(), MOVE, GhostCommunication::part_lists, CommBuf::resize(), SAVE, serialize_and_reduce(), GhostCommunication::shift, and CommBuf::size().
Referenced by ghost_communicator().
|
static |
Definition at line 309 of file ghosts.cpp.
References CommBuf::bonds(), GHOSTTRANS_BONDS, GHOSTTRANS_PARTNUM, LOAD, CommBuf::make_span(), MOVE, GhostCommunication::part_lists, prepare_ghost_cell(), serialize_and_reduce(), and CommBuf::size().
Referenced by ghost_communicator().
|
static |
Serialize particle data, possibly with reduction.
The reduction can take place during the save stage, e.g. to apply a ghost shift to the particle position, or during the load stage, e.g. to transfer momentum between particles in two local cells.
Definition at line 126 of file ghosts.cpp.
References Particle::dipm(), Particle::ext_force(), Particle::ext_torque(), Particle::fixed(), BoxGeometry::fold_position(), Particle::force(), Particle::gamma(), Particle::gamma_rot(), GHOSTTRANS_FORCE, GHOSTTRANS_MOMENTUM, GHOSTTRANS_POSITION, GHOSTTRANS_PROPRTS, GHOSTTRANS_RATTLE, Particle::id(), Particle::image_box(), LOAD, Particle::mass(), Particle::mol_id(), Particle::mu_E(), Particle::omega(), Particle::pos(), Particle::pos_last_time_step(), Particle::propagation(), Particle::q(), Particle::quat(), Particle::rattle_correction(), Particle::rinertia(), Particle::rotation(), SAVE, Particle::swimming(), Particle::torque(), Particle::type(), UPDATE, Particle::v(), and Particle::vs_relative().
Referenced by calc_transmit_size(), cell_cell_transfer(), prepare_send_buffer(), and put_recv_buffer().