template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
class vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >
This class is an helper for the communication of vector_dist.
- Template Parameters
-
| dim | Dimensionality of the space where the elements lives |
| St | type of space float, double ... |
| prop | properties the vector element store in OpenFPM data structure format |
| Decomposition | Decomposition strategy to use CartDecomposition ... |
| Memory | Memory pool where store the information HeapMemory ... |
- See Also
- vector_dist
Definition at line 54 of file vector_dist_comm.hpp.
|
| | vector_dist_comm (const vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory > &v) |
| | Copy Constructor. More...
|
| |
| | vector_dist_comm (const Decomposition &dec) |
| | Constructor. More...
|
| |
| | vector_dist_comm (Decomposition &&dec) |
| | Constructor. More...
|
| |
| | vector_dist_comm () |
| | Constructor. More...
|
| |
| | ~vector_dist_comm () |
| | Destructor. More...
|
| |
| size_t | getDecompositionGranularity () |
| | Get the number of minimum sub-domain per processor. More...
|
| |
| void | setDecompositionGranularity (size_t n_sub) |
| | Set the minimum number of sub-domain per processor. More...
|
| |
| void | init_decomposition (Box< dim, St > &box, const size_t(&bc)[dim], const Ghost< dim, St > &g, size_t opt, const grid_sm< dim, void > &gdist) |
| | Initialize the decomposition. More...
|
| |
| template<int... prp> |
| void | ghost_get_ (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, size_t &g_m, size_t opt=WITH_POSITION) |
| | It synchronize the properties and position of the ghost particles. More...
|
| |
| template<unsigned int... prp> |
| void | map_list_ (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop > &v_prp, size_t &g_m, size_t opt=NONE) |
| | It move all the particles that does not belong to the local processor to the respective processor. More...
|
| |
| template<typename obp = KillParticle> |
| void | map_ (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, size_t &g_m, size_t opt=NONE) |
| | It move all the particles that does not belong to the local processor to the respective processor. More...
|
| |
| Decomposition & | getDecomposition () |
| | Get the decomposition. More...
|
| |
| const Decomposition & | getDecomposition () const |
| | Get the decomposition. More...
|
| |
vector_dist_comm< dim, St,
prop, layout, layout_base,
Decomposition, Memory > & | operator= (const vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory > &vc) |
| | Copy a vector. More...
|
| |
vector_dist_comm< dim, St,
prop, layout, layout_base,
Decomposition, Memory > & | operator= (vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory > &&vc) |
| | Copy a vector. More...
|
| |
| template<template< typename, typename > class op, int... prp> |
| void | ghost_put_ (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop > &v_prp, size_t &g_m, size_t opt) |
| | Ghost put. More...
|
| |
|
|
template<typename proc_class , typename T1 , typename T2 , typename T3 , typename T4 > |
| void | process_map_particle (size_t i, long int &end, long int &id_end, T1 &m_pos, T2 &m_prp, T3 &v_pos, T4 &v_prp, openfpm::vector< size_t > &cnt) |
| | It process one particle.
|
| |
| size_t | get_end_valid (long int &end, long int &end_id) |
| | Return a valid particle starting from end and tracing back. More...
|
| |
| void | createShiftBox () |
| | For every internal ghost box we create a structure that order such internal local ghost box in shift vectors. More...
|
| |
| void | local_ghost_from_opart (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, size_t opt) |
| | Local ghost from labeled particles. More...
|
| |
| void | local_ghost_from_dec (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, size_t g_m) |
| | Local ghost from decomposition. More...
|
| |
| void | add_loc_particles_bc (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, size_t &g_m, size_t opt) |
| | Add local particles based on the boundary conditions. More...
|
| |
| void | fill_send_ghost_pos_buf (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< send_pos_vector > &g_pos_send) |
| | This function fill the send buffer for the particle position after the particles has been label with labelParticles. More...
|
| |
| template<typename send_vector , typename prp_object , int... prp> |
| void | fill_send_ghost_put_prp_buf (openfpm::vector< prop > &v_prp, openfpm::vector< send_vector > &g_send_prp, size_t &g_m) |
| | This function fill the send buffer for ghost_put. More...
|
| |
| void | resize_retained_buffer (openfpm::vector< HeapMemory > &rt_buf, size_t nbf) |
| | resize the retained buffer by nbf More...
|
| |
| template<typename send_vector , typename prp_object , int... prp> |
| void | fill_send_ghost_prp_buf (openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, openfpm::vector< send_vector > &g_send_prp) |
| | This function fill the send buffer for properties after the particles has been label with labelParticles. More...
|
| |
| void | fill_send_map_buf (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, openfpm::vector< size_t > &prc_sz_r, openfpm::vector< openfpm::vector< Point< dim, St >>> &m_pos, openfpm::vector< openfpm::vector< prop >> &m_prp) |
| | allocate and fill the send buffer for the map function More...
|
| |
| template<typename prp_object , int... prp> |
| void | fill_send_map_buf_list (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, openfpm::vector< size_t > &prc_sz_r, openfpm::vector< openfpm::vector< Point< dim, St >>> &m_pos, openfpm::vector< openfpm::vector< prp_object >> &m_prp) |
| | allocate and fill the send buffer for the map function More...
|
| |
| template<typename obp > |
| void | labelParticleProcessor (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< aggregate< size_t, size_t, size_t >> &lbl_p, openfpm::vector< size_t > &prc_sz) |
| | Label particles for mappings. More...
|
| |
| void | labelParticlesGhost (openfpm::vector< Point< dim, St >> &v_pos, openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > &v_prp, openfpm::vector< size_t > &prc, size_t &g_m) |
| | Label the particles. More...
|
| |
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
| void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::add_loc_particles_bc |
( |
openfpm::vector< Point< dim, St >> & |
v_pos, |
|
|
openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > & |
v_prp, |
|
|
size_t & |
g_m, |
|
|
size_t |
opt |
|
) |
| |
|
inlineprivate |
Add local particles based on the boundary conditions.
In order to understand what this function use the following
[1,1]
+---------+------------------------+---------+
| (1,-1) | | (1,1) |
| | | (1,0) --> 7 | | |
| v | | v |
| 6 | | 8 |
+--------------------------------------------+
| | | |
| | | |
| | | |
| (-1,0) | | (1,0) |
| | | | | |
| v | (0,0) --> 4 | v |
| 3 | | 5 |
| | | |
B | | | A |
* | | | * |
| | | |
| | | |
| | | |
+--------------------------------------------+
| (-1,-1) | | (-1,1) |
| | | (-1,0) --> 1 | | |
| v | | v |
| 0 | | 2 |
+---------+------------------------+---------+ The box is the domain, while all boxes at the border (so not (0,0) ) are the
ghost part at the border of the domain. If a particle A is in the position in figure
a particle B must be created. This function duplicate the particle A, if A and B are
local
\param v_pos vector of particle of positions
\param v_prp vector of particle properties
\param g_m ghost marker
\param opt options
Definition at line 418 of file vector_dist_comm.hpp.
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
template<typename send_vector , typename prp_object , int... prp>
| void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::fill_send_ghost_prp_buf |
( |
openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > & |
v_prp, |
|
|
openfpm::vector< send_vector > & |
g_send_prp |
|
) |
| |
|
inlineprivate |
This function fill the send buffer for properties after the particles has been label with labelParticles.
- Template Parameters
-
| send_vector | type used to send data |
| prp_object | object containing only the properties to send |
| prp | set of properties to send |
- Parameters
-
| v_prp | vector of particle properties |
| g_send_prp | Send buffer to fill |
Definition at line 564 of file vector_dist_comm.hpp.
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
template<typename send_vector , typename prp_object , int... prp>
This function fill the send buffer for ghost_put.
- Template Parameters
-
| send_vector | type used to send data |
| prp_object | object containing only the properties to send |
| prp | set of properties to send |
- Parameters
-
| v_prp | vector of particle properties |
| g_send_prp | Send buffer to fill |
| g_m | ghost marker |
Definition at line 493 of file vector_dist_comm.hpp.
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
template<typename prp_object , int... prp>
| void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::fill_send_map_buf_list |
( |
openfpm::vector< Point< dim, St >> & |
v_pos, |
|
|
openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > & |
v_prp, |
|
|
openfpm::vector< size_t > & |
prc_sz_r, |
|
|
openfpm::vector< openfpm::vector< Point< dim, St >>> & |
m_pos, |
|
|
openfpm::vector< openfpm::vector< prp_object >> & |
m_prp |
|
) |
| |
|
inlineprivate |
allocate and fill the send buffer for the map function
- Template Parameters
-
| prp_object | object type to send |
| prp | properties to send |
- Parameters
-
| v_pos | vector of particle positions |
| v_prp | vector of particle properties |
| prc_sz_r | number of particles to send for each processor |
| m_pos | sending buffer for position |
| m_prp | sending buffer for properties |
Definition at line 659 of file vector_dist_comm.hpp.
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
template<template< typename, typename > class op, int... prp>
| void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::ghost_put_ |
( |
openfpm::vector< Point< dim, St >> & |
v_pos, |
|
|
openfpm::vector< prop > & |
v_prp, |
|
|
size_t & |
g_m, |
|
|
size_t |
opt |
|
) |
| |
|
inline |
Ghost put.
- Template Parameters
-
| op | operation to apply |
| prp | set of properties |
- Parameters
-
| v_pos | vector of particle positions |
| v_prp | vector od particle properties |
| g_m | ghost marker |
| opt | options |
Definition at line 1259 of file vector_dist_comm.hpp.
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
template<typename obp = KillParticle>
| void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::map_ |
( |
openfpm::vector< Point< dim, St >> & |
v_pos, |
|
|
openfpm::vector< prop, Memory, typename layout_base< prop >::type, layout_base > & |
v_prp, |
|
|
size_t & |
g_m, |
|
|
size_t |
opt = NONE |
|
) |
| |
|
inline |
It move all the particles that does not belong to the local processor to the respective processor.
- Template Parameters
-
| out | of bound policy it specify what to do when the particles are detected out of bound |
In general this function is called after moving the particles to move the elements out the local processor. Or just after initialization if each processor contain non local particles
- Parameters
-
| v_pos | vector of particle positions |
| v_prp | vector of particle properties |
| g_m | ghost marker |
position vector
properties vector
Definition at line 1154 of file vector_dist_comm.hpp.
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
template<unsigned int... prp>
| void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::map_list_ |
( |
openfpm::vector< Point< dim, St >> & |
v_pos, |
|
|
openfpm::vector< prop > & |
v_prp, |
|
|
size_t & |
g_m, |
|
|
size_t |
opt = NONE |
|
) |
| |
|
inline |
It move all the particles that does not belong to the local processor to the respective processor.
- Template Parameters
-
| out | of bound policy it specify what to do when the particles are detected out of bound |
In general this function is called after moving the particles to move the elements out the local processor. Or just after initialization if each processor contain non local particles
- Template Parameters
-
| prp | properties to communicate |
- Parameters
-
| v_pos | vector of particle positions |
| v_prp | vector of particle properties |
| g_m | ghost marker |
| opt | options |
position vector
properties vector
Definition at line 1080 of file vector_dist_comm.hpp.
template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
| static void* vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::message_alloc_map |
( |
size_t |
msg_i, |
|
|
size_t |
total_msg, |
|
|
size_t |
total_p, |
|
|
size_t |
i, |
|
|
size_t |
ri, |
|
|
void * |
ptr |
|
) |
| |
|
inlinestaticprivate |
Call-back to allocate buffer to receive incoming elements (particles)
- Parameters
-
| msg_i | size required to receive the message from i |
| total_msg | total size to receive from all the processors |
| total_p | the total number of processor that want to communicate with you |
| i | processor id |
| ri | request id (it is an id that goes from 0 to total_p, and is unique every time message_alloc is called) |
| ptr | a pointer to the vector_dist structure |
- Returns
- the pointer where to store the message for the processor i
Definition at line 832 of file vector_dist_comm.hpp.