This class is an helper for the communication of vector_dist. More...
This class is an helper for the communication of vector_dist.
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 ... |
Definition at line 346 of file vector_dist_comm.hpp.
#include <vector_dist_comm.hpp>
Data Structures | |
struct | proc_with_prp |
process the particle with properties More... | |
struct | set_mem_retained_buffers |
struct | set_mem_retained_buffers< true, send_vector, v_mpl > |
struct | set_mem_retained_buffers_inte |
Set the buffer for each property. More... | |
Public Member Functions | |
vector_dist_comm (const vector_dist_comm< dim, St, prop, Decomposition, Memory, layout_base > &v) | |
Copy Constructor. | |
vector_dist_comm (const Decomposition &dec) | |
Constructor. | |
vector_dist_comm (Decomposition &&dec) | |
Constructor. | |
vector_dist_comm () | |
Constructor. | |
~vector_dist_comm () | |
Destructor. | |
size_t | getDecompositionGranularity () |
Get the number of minimum sub-domain per processor. | |
void | setDecompositionGranularity (size_t n_sub) |
Set the minimum number of sub-domain per processor. | |
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. | |
void | init_decomposition_gr_cell (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. | |
template<unsigned int impl, int ... prp> | |
void | ghost_get_ (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, size_t &g_m, size_t opt=WITH_POSITION) |
It synchronize the properties and position of the ghost particles. | |
template<int ... prp> | |
void | ghost_wait_ (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, size_t &g_m, size_t opt=WITH_POSITION) |
It synchronize the properties and position of the ghost particles. | |
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) |
It move all the particles that does not belong to the local processor to the respective processor. | |
template<typename obp = KillParticle> | |
void | map_ (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, size_t &g_m, size_t opt) |
It move all the particles that does not belong to the local processor to the respective processor. | |
Decomposition & | getDecomposition () |
Get the decomposition. | |
const Decomposition & | getDecomposition () const |
Get the decomposition. | |
vector_dist_comm< dim, St, prop, Decomposition, Memory, layout_base > & | operator= (const vector_dist_comm< dim, St, prop, Decomposition, Memory, layout_base > &vc) |
Copy a vector. | |
vector_dist_comm< dim, St, prop, Decomposition, Memory, layout_base > & | operator= (vector_dist_comm< dim, St, prop, Decomposition, Memory, layout_base > &&vc) |
Copy a vector. | |
template<template< typename, typename > class op, int ... prp> | |
void | ghost_put_ (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, size_t &g_m, size_t opt) |
Ghost put. | |
Private Types | |
typedef openfpm::vector< Point< dim, St >, Memory, layout_base, openfpm::grow_policy_identity > | send_pos_vector |
definition of the send vector for position | |
Private Member Functions | |
size_t | get_last_ghost_get_received_parts (size_t i) |
Get the number of particles received from each processor during the last ghost_get. | |
size_t | get_last_ghost_get_num_proc () |
Get the number of processor involved during the last ghost_get. | |
openfpm::vector< size_t > & | get_last_ghost_get_num_proc_vector () |
Get the number of processor involved during the last ghost_get. | |
void | calc_send_buffers (openfpm::vector< aggregate< unsigned int, unsigned int >, Memory, layout_base > &prc_sz, openfpm::vector< size_t > &prc_sz_r, openfpm::vector< size_t > &prc_r, size_t opt) |
Calculate sending buffer size for each processor. | |
void | createShiftBox () |
For every internal ghost box we create a structure that order such internal local ghost box in shift vectors. | |
void | local_ghost_from_opart (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, size_t opt) |
Local ghost from labeled particles. | |
void | local_ghost_from_dec (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, size_t g_m, size_t opt) |
Local ghost from decomposition. | |
void | add_loc_particles_bc (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, size_t &g_m, size_t opt) |
Add local particles based on the boundary conditions. | |
void | fill_send_ghost_pos_buf (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< size_t > &prc_sz, openfpm::vector< send_pos_vector > &g_pos_send, size_t opt, bool async) |
This function fill the send buffer for the particle position after the particles has been label with labelParticles. | |
template<typename send_vector , typename prp_object , int ... prp> | |
void | fill_send_ghost_put_prp_buf (openfpm::vector< prop, Memory, layout_base > &v_prp, openfpm::vector< send_vector > &g_send_prp, size_t &g_m, size_t opt) |
This function fill the send buffer for ghost_put. | |
void | resize_retained_buffer (openfpm::vector_fr< Memory > &rt_buf, size_t nbf) |
resize the retained buffer by nbf | |
template<typename send_vector , typename prp_object , int ... prp> | |
void | fill_send_ghost_prp_buf (openfpm::vector< prop, Memory, layout_base > &v_prp, openfpm::vector< size_t > &prc_sz, openfpm::vector< send_vector > &g_send_prp, size_t opt) |
This function fill the send buffer for properties after the particles has been label with labelParticles. | |
void | fill_send_map_buf (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, openfpm::vector< size_t > &prc_sz_r, openfpm::vector< size_t > &prc_r, openfpm::vector< openfpm::vector< Point< dim, St >, Memory, layout_base, openfpm::grow_policy_identity > > &m_pos, openfpm::vector< openfpm::vector< prop, Memory, layout_base, openfpm::grow_policy_identity > > &m_prp, openfpm::vector< aggregate< unsigned int, unsigned int >, Memory, layout_base > &prc_sz, size_t opt) |
allocate and fill the send buffer for the map function | |
template<typename prp_object , int ... prp> | |
void | fill_send_map_buf_list (openfpm::vector< Point< dim, St > > &v_pos, openfpm::vector< prop, Memory, 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 | |
template<typename obp > | |
void | labelParticleProcessor (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< aggregate< int, int, int >, Memory, layout_base > &lbl_p, openfpm::vector< aggregate< unsigned int, unsigned int >, Memory, layout_base > &prc_sz, size_t opt) |
Label particles for mappings. | |
void | labelParticlesGhost (openfpm::vector< Point< dim, St >, Memory, layout_base > &v_pos, openfpm::vector< prop, Memory, layout_base > &v_prp, openfpm::vector< size_t > &prc, openfpm::vector< size_t > &prc_sz, openfpm::vector< aggregate< unsigned int, unsigned int >, Memory, layout_base > &prc_offset, size_t &g_m, size_t opt) |
Label the particles. | |
Static Private Member Functions | |
static void * | message_alloc_map (size_t msg_i, size_t total_msg, size_t total_p, size_t i, size_t ri, void *ptr) |
Call-back to allocate buffer to receive incoming elements (particles) | |
Private Attributes | |
size_t | v_sub_unit_factor = 64 |
Number of units for each sub-domain. | |
Vcluster< Memory > & | v_cl |
VCluster. | |
Decomposition | dec |
Domain decomposition. | |
openfpm::vector< size_t > | p_map_req |
It map the processor id with the communication request into map procedure. | |
openfpm::vector< aggregate< int, int, int >, Memory, layout_base > | m_opart |
openfpm::vector< openfpm::vector< aggregate< size_t, size_t > > > | g_opart |
openfpm::vector< aggregate< unsigned int, unsigned long int >, CudaMemory, memory_traits_inte > | g_opart_device |
Same as g_opart but on device, the vector of vector is flatten into a single vector. | |
openfpm::vector< Point< dim, St >, Memory, layout_base > | v_pos_tmp |
Helper buffer for computation (on GPU) of local particles (position) | |
openfpm::vector< prop, Memory, layout_base > | v_prp_tmp |
Helper buffer for computation (on GPU) of local particles (properties) | |
openfpm::vector< size_t > | g_opart_sz |
Per processor number of particle g_opart_sz.get(i) = g_opart.get(i).size() | |
openfpm::vector< size_t > | prc_g_opart |
processor rank list of g_opart | |
openfpm::vector< size_t > | prc_recv_get_pos |
openfpm::vector< size_t > | prc_recv_get_prp |
openfpm::vector< size_t > | prc_recv_put |
the same as prc_recv_get but for put | |
openfpm::vector< size_t > | prc_recv_map |
the same as prc_recv_get but for map | |
openfpm::vector< size_t > | recv_sz_get_pos |
openfpm::vector< size_t > | recv_sz_get_prp |
openfpm::vector< size_t > | recv_sz_get_byte |
Conversion to byte of recv_sz_get. | |
openfpm::vector< size_t > | recv_sz_put |
The same as recv_sz_get but for put. | |
openfpm::vector< size_t > | recv_sz_map |
The same as recv_sz_get but for map. | |
openfpm::vector< size_t > | prc_sz_gg |
elements sent for each processors (ghost_get) | |
openfpm::vector< aggregate< unsigned int >, Memory, layout_base > | proc_id_out |
temporary buffer to processors ids | |
openfpm::vector< aggregate< unsigned int >, Memory, layout_base > | starts |
temporary buffer for the scan result | |
openfpm::vector< aggregate< unsigned int, unsigned int >, Memory, layout_base > | prc_offset |
Processor communication size. | |
CudaMemory | mem |
Temporary CudaMemory to do stuff. | |
size_t | lg_m |
openfpm::vector_fr< Memory > | hsmem |
Sending buffer. | |
long int | shift_box_ndec = -1 |
From which decomposition the shift boxes are calculated. | |
std::unordered_map< size_t, size_t > | map_cmb |
this map is used to check if a combination is already present | |
openfpm::vector_std< openfpm::vector_std< Box< dim, St > > > | box_f |
openfpm::vector< Box< dim, St >, Memory, layout_base > | box_f_dev |
The boxes touching the border of the domain + shift vector linearized from where they come from. | |
openfpm::vector< aggregate< unsigned int >, Memory, layout_base > | box_f_sv |
openfpm::vector_std< comb< dim > > | box_cmb |
Store the sector for each group (previous vector) | |
openfpm::vector< aggregate< unsigned int, unsigned int >, Memory, layout_base > | o_part_loc |
Id of the local particle to replicate for ghost_get. | |
openfpm::vector< aggregate< unsigned int, unsigned int >, Memory, layout_base > | prc_sz |
Processor communication size. | |
|
private |
definition of the send vector for position
Definition at line 352 of file vector_dist_comm.hpp.
|
inline |
|
inline |
Constructor.
dec | Domain decompositon |
Definition at line 1641 of file vector_dist_comm.hpp.
|
inline |
Constructor.
dec | Domain decompositon |
Definition at line 1652 of file vector_dist_comm.hpp.
|
inline |
Constructor.
Definition at line 1661 of file vector_dist_comm.hpp.
|
inline |
|
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 845 of file vector_dist_comm.hpp.
|
inlineprivate |
Calculate sending buffer size for each processor.
prc_sz_r | processor size |
prc_r | processor ids |
Definition at line 509 of file vector_dist_comm.hpp.
|
inlineprivate |
For every internal ghost box we create a structure that order such internal local ghost box in shift vectors.
Definition at line 588 of file vector_dist_comm.hpp.
|
inlineprivate |
This function fill the send buffer for the particle position after the particles has been label with labelParticles.
v_pos | vector of particle positions |
g_pos_send | Send buffer to fill |
Definition at line 873 of file vector_dist_comm.hpp.
|
inlineprivate |
This function fill the send buffer for properties after the particles has been label with labelParticles.
send_vector | type used to send data |
prp_object | object containing only the properties to send |
prp | set of properties to send |
v_prp | vector of particle properties |
g_send_prp | Send buffer to fill |
Definition at line 1151 of file vector_dist_comm.hpp.
|
inlineprivate |
This function fill the send buffer for ghost_put.
send_vector | type used to send data |
prp_object | object containing only the properties to send |
prp | set of properties to send |
v_prp | vector of particle properties |
g_send_prp | Send buffer to fill |
g_m | ghost marker |
Definition at line 962 of file vector_dist_comm.hpp.
|
inlineprivate |
allocate and fill the send buffer for the map function
v_pos | vector of particle positions |
v_prp | vector of particles properties |
prc_sz_r | For each processor in the list the size of the message to send |
m_pos | sending buffer for position |
m_prp | sending buffer for properties |
offset | from where start the list of the particles that migrate in o_part This parameter is used only in case of RUN_ON_DEVICE option |
Definition at line 1242 of file vector_dist_comm.hpp.
|
inlineprivate |
allocate and fill the send buffer for the map function
prp_object | object type to send |
prp | properties to send |
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 1356 of file vector_dist_comm.hpp.
|
inlineprivate |
Get the number of processor involved during the last ghost_get.
Definition at line 483 of file vector_dist_comm.hpp.
|
inlineprivate |
Get the number of processor involved during the last ghost_get.
Definition at line 495 of file vector_dist_comm.hpp.
|
inlineprivate |
Get the number of particles received from each processor during the last ghost_get.
i | processor (list index) |
Definition at line 469 of file vector_dist_comm.hpp.
|
inline |
|
inline |
|
inline |
Get the number of minimum sub-domain per processor.
Definition at line 1688 of file vector_dist_comm.hpp.
|
inline |
It synchronize the properties and position of the ghost particles.
prp | list of properties to get synchronize |
opt | options WITH_POSITION, it send also the positional information of the particles |
v_pos | vector of position to update |
v_prp | vector of properties to update |
g_m | marker between real and ghost particles |
Definition at line 1778 of file vector_dist_comm.hpp.
|
inline |
Ghost put.
op | operation to apply |
prp | set of properties |
v_pos | vector of particle positions |
v_prp | vector od particle properties |
g_m | ghost marker |
opt | options |
Definition at line 2100 of file vector_dist_comm.hpp.
|
inline |
It synchronize the properties and position of the ghost particles.
prp | list of properties to get synchronize |
opt | options WITH_POSITION, it send also the positional information of the particles |
v_pos | vector of position to update |
v_prp | vector of properties to update |
g_m | marker between real and ghost particles |
Definition at line 1865 of file vector_dist_comm.hpp.
|
inline |
Initialize the decomposition.
box | domain |
bc | boundary conditions |
g | ghost extension |
opt | additional options |
Definition at line 1711 of file vector_dist_comm.hpp.
|
inline |
Initialize the decomposition.
box | domain |
bc | boundary conditions |
g | ghost extension |
opt | additional options |
Definition at line 1751 of file vector_dist_comm.hpp.
|
inlineprivate |
Label particles for mappings.
v_pos | vector of particle positions |
lbl_p | Particle labeled |
prc_sz | For each processor the number of particles to send |
opt | options |
Definition at line 1398 of file vector_dist_comm.hpp.
|
inlineprivate |
Label the particles.
It count the number of particle to send to each processors and save its ids
v_pos | vector of particle positions |
v_prp | vector of particle properties |
prc | for each particle it label the processor id (the owner of the particle, or where it should go the particle) |
g_m | ghost marker |
opt | ghost_get options |
Definition at line 1530 of file vector_dist_comm.hpp.
|
inlineprivate |
Local ghost from decomposition.
v_pos | vector of particle positions |
v_prp | vector of particle properties |
g_m | ghost marker |
Definition at line 734 of file vector_dist_comm.hpp.
|
inlineprivate |
Local ghost from labeled particles.
v_pos | vector of particle positions |
v_prp | vector of particles properties |
opt | options |
Definition at line 677 of file vector_dist_comm.hpp.
|
inline |
It move all the particles that does not belong to the local processor to the respective processor.
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
v_pos | vector of particle positions |
v_prp | vector of particle properties |
g_m | ghost marker |
position vector
properties vector
Definition at line 1982 of file vector_dist_comm.hpp.
|
inline |
It move all the particles that does not belong to the local processor to the respective processor.
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
prp | properties to communicate |
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 1905 of file vector_dist_comm.hpp.
|
inlinestaticprivate |
Call-back to allocate buffer to receive incoming elements (particles)
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 |
Definition at line 1611 of file vector_dist_comm.hpp.
|
inline |
Copy a vector.
vc | vector to copy |
Definition at line 2067 of file vector_dist_comm.hpp.
|
inline |
Copy a vector.
vc | vector to copy |
Definition at line 2081 of file vector_dist_comm.hpp.
|
inlineprivate |
resize the retained buffer by nbf
Definition at line 1056 of file vector_dist_comm.hpp.
|
inline |
Set the minimum number of sub-domain per processor.
n_sub |
Definition at line 1698 of file vector_dist_comm.hpp.
|
private |
Store the sector for each group (previous vector)
Definition at line 576 of file vector_dist_comm.hpp.
|
private |
The boxes touching the border of the domain are divided in groups (first vector) each group contain internal ghost coming from sub-domains of the same section
Definition at line 569 of file vector_dist_comm.hpp.
|
private |
The boxes touching the border of the domain + shift vector linearized from where they come from.
Definition at line 572 of file vector_dist_comm.hpp.
|
private |
Definition at line 573 of file vector_dist_comm.hpp.
|
private |
Domain decomposition.
Definition at line 358 of file vector_dist_comm.hpp.
|
private |
Per processor ordered particles id for ghost_get (see prc_g_opart) For each processor the internal vector store the id of the particles that must be communicated to the other processors
Definition at line 375 of file vector_dist_comm.hpp.
|
private |
Same as g_opart but on device, the vector of vector is flatten into a single vector.
Definition at line 380 of file vector_dist_comm.hpp.
|
private |
Per processor number of particle g_opart_sz.get(i) = g_opart.get(i).size()
Definition at line 389 of file vector_dist_comm.hpp.
|
private |
Sending buffer.
Definition at line 444 of file vector_dist_comm.hpp.
|
private |
Local ghost marker (across the ghost particles it mark from where we have the) replicated ghost particles that are local
Definition at line 441 of file vector_dist_comm.hpp.
|
private |
For each near processor, outgoing particle id
Definition at line 370 of file vector_dist_comm.hpp.
|
private |
this map is used to check if a combination is already present
Definition at line 565 of file vector_dist_comm.hpp.
|
private |
Temporary CudaMemory to do stuff.
Definition at line 437 of file vector_dist_comm.hpp.
|
private |
Id of the local particle to replicate for ghost_get.
Definition at line 579 of file vector_dist_comm.hpp.
|
private |
It map the processor id with the communication request into map procedure.
Definition at line 361 of file vector_dist_comm.hpp.
|
private |
processor rank list of g_opart
Definition at line 392 of file vector_dist_comm.hpp.
|
private |
Processor communication size.
Definition at line 433 of file vector_dist_comm.hpp.
|
private |
It store the list of processor that communicate with us (local processor) from the last ghost get
Definition at line 396 of file vector_dist_comm.hpp.
|
private |
Definition at line 397 of file vector_dist_comm.hpp.
|
private |
the same as prc_recv_get but for map
Definition at line 403 of file vector_dist_comm.hpp.
|
private |
the same as prc_recv_get but for put
Definition at line 400 of file vector_dist_comm.hpp.
|
private |
Processor communication size.
Definition at line 582 of file vector_dist_comm.hpp.
|
private |
elements sent for each processors (ghost_get)
Definition at line 420 of file vector_dist_comm.hpp.
|
private |
temporary buffer to processors ids
Definition at line 425 of file vector_dist_comm.hpp.
|
private |
Conversion to byte of recv_sz_get.
Definition at line 410 of file vector_dist_comm.hpp.
|
private |
It store the size of the elements added for each processor that communicate with us (local processor) from the last ghost get
Definition at line 407 of file vector_dist_comm.hpp.
|
private |
Definition at line 408 of file vector_dist_comm.hpp.
|
private |
The same as recv_sz_get but for map.
Definition at line 417 of file vector_dist_comm.hpp.
|
private |
The same as recv_sz_get but for put.
Definition at line 414 of file vector_dist_comm.hpp.
|
private |
From which decomposition the shift boxes are calculated.
Definition at line 562 of file vector_dist_comm.hpp.
|
private |
temporary buffer for the scan result
Definition at line 430 of file vector_dist_comm.hpp.
|
private |
VCluster.
Definition at line 355 of file vector_dist_comm.hpp.
|
private |
Helper buffer for computation (on GPU) of local particles (position)
Definition at line 383 of file vector_dist_comm.hpp.
|
private |
Helper buffer for computation (on GPU) of local particles (properties)
Definition at line 386 of file vector_dist_comm.hpp.
|
private |
Number of units for each sub-domain.
Definition at line 349 of file vector_dist_comm.hpp.