OpenFPM_pdata  1.1.0
Project that contain the implementation of distributed structures
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Pages
vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory > Class Template Reference

This class is an helper for the communication of vector_dist. More...

Detailed Description

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
dimDimensionality of the space where the elements lives
Sttype of space float, double ...
propproperties the vector element store in OpenFPM data structure format
DecompositionDecomposition strategy to use CartDecomposition ...
MemoryMemory pool where store the information HeapMemory ...
See Also
vector_dist

Definition at line 54 of file vector_dist_comm.hpp.

#include <vector_dist_comm.hpp>

+ Inheritance diagram for vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >:

Data Structures

struct  proc_with_prp
 process the particle with properties More...
 
struct  proc_without_prp
 process the particle without properties More...
 

Public Member Functions

 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...
 
DecompositiongetDecomposition ()
 Get the decomposition. More...
 
const DecompositiongetDecomposition () 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...
 

Private Types

typedef openfpm::vector< Point
< dim, St >, Memory > 
send_pos_vector
 definition of the send vector for position
 

Private Member Functions

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...
 

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) More...
 

Private Attributes

size_t v_sub_unit_factor = 64
 Number of units for each sub-domain.
 
Vclusterv_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
< size_t, size_t, size_t > > 
m_opart
 
openfpm::vector
< openfpm::vector< aggregate
< size_t, size_t > > > 
g_opart
 
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
 
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
 
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.
 
size_t lg_m
 
openfpm::vector< HeapMemoryhsmem
 Sending buffer.
 
openfpm::vector< HeapMemoryhrmem
 Receiving buffer.
 
bool is_shift_box_created = false
 Flags that indicate that the function createShiftBox() has been called.
 
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_std< comb< dim > > box_cmb
 Store the sector for each group (previous vector)
 
openfpm::vector< aggregate
< size_t, size_t > > 
o_part_loc
 Id of the local particle to replicate for ghost_get.
 

Constructor & Destructor Documentation

template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::vector_dist_comm ( const vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory > &  v)
inline

Copy Constructor.

Parameters
vvector to copy

Definition at line 850 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>
vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::vector_dist_comm ( const Decomposition dec)
inline

Constructor.

Parameters
decDomain decompositon

Definition at line 862 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>
vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::vector_dist_comm ( Decomposition &&  dec)
inline

Constructor.

Parameters
decDomain decompositon

Definition at line 873 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>
vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::vector_dist_comm ( )
inline

Constructor.

Definition at line 882 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>
vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::~vector_dist_comm ( )
inline

Destructor.

Release the retained buffer

Definition at line 892 of file vector_dist_comm.hpp.

Member Function Documentation

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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::createShiftBox ( )
inlineprivate

For every internal ghost box we create a structure that order such internal local ghost box in shift vectors.

Definition at line 227 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::fill_send_ghost_pos_buf ( openfpm::vector< Point< dim, St >> &  v_pos,
openfpm::vector< send_pos_vector > &  g_pos_send 
)
inlineprivate

This function fill the send buffer for the particle position after the particles has been label with labelParticles.

Parameters
v_posvector of particle positions
g_pos_sendSend buffer to fill

Definition at line 446 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_vectortype used to send data
prp_objectobject containing only the properties to send
prpset of properties to send
Parameters
v_prpvector of particle properties
g_send_prpSend 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::fill_send_ghost_put_prp_buf ( openfpm::vector< prop > &  v_prp,
openfpm::vector< send_vector > &  g_send_prp,
size_t &  g_m 
)
inlineprivate

This function fill the send buffer for ghost_put.

Template Parameters
send_vectortype used to send data
prp_objectobject containing only the properties to send
prpset of properties to send
Parameters
v_prpvector of particle properties
g_send_prpSend buffer to fill
g_mghost 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::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 
)
inlineprivate

allocate and fill the send buffer for the map function

Parameters
v_posvector of particle positions
v_prpvector of particles properties
prc_sz_rFor each processor in the list the size of the message to send
m_possending buffer for position
m_prpsending buffer for properties

Definition at line 611 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_objectobject type to send
prpproperties to send
Parameters
v_posvector of particle positions
v_prpvector of particle properties
prc_sz_rnumber of particles to send for each processor
m_possending buffer for position
m_prpsending 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>
size_t vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::get_end_valid ( long int &  end,
long int &  end_id 
)
inlineprivate

Return a valid particle starting from end and tracing back.

Parameters
endactual opart particle pointer
end_idactual end particle point
Returns
a valid particle

Definition at line 194 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>
Decomposition& vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::getDecomposition ( )
inline

Get the decomposition.

Returns

Definition at line 1204 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>
const Decomposition& vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::getDecomposition ( ) const
inline

Get the decomposition.

Returns

Definition at line 1214 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>
size_t vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::getDecompositionGranularity ( )
inline

Get the number of minimum sub-domain per processor.

Returns
minimum number

Definition at line 909 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<int... prp>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::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 
)
inline

It synchronize the properties and position of the ghost particles.

Template Parameters
prplist of properties to get synchronize
Parameters
optoptions WITH_POSITION, it send also the positional information of the particles
v_posvector of position to update
v_prpvector of properties to update
g_mmarker between real and ghost particles

Definition at line 975 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
opoperation to apply
prpset of properties
Parameters
v_posvector of particle positions
v_prpvector od particle properties
g_mghost marker
optoptions

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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::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 
)
inline

Initialize the decomposition.

Parameters
boxdomain
bcboundary conditions
gghost extension
optadditional options

Definition at line 932 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 >
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::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 
)
inlineprivate

Label particles for mappings.

Parameters
v_posvector of particle positions
lbl_pParticle labeled
prc_szFor each processor the number of particles to send

Definition at line 701 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::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 
)
inlineprivate

Label the particles.

It count the number of particle to send to each processors and save its ids

See Also
nn_prcs::getShiftvectors()
Parameters
v_posvector of particle positions
v_prpvector of particle properties
prcfor each particle it label the processor id (the owner of the particle, or where it should go the particle)
g_mghost marker

Definition at line 768 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::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 
)
inlineprivate

Local ghost from decomposition.

Parameters
v_posvector of particle positions
v_prpvector of particle properties
g_mghost marker

Definition at line 315 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::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 
)
inlineprivate

Local ghost from labeled particles.

Parameters
v_posvector of particle positions
v_prpvector of particles properties
optoptions

Definition at line 274 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
outof 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_posvector of particle positions
v_prpvector of particle properties
g_mghost 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
outof 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
prpproperties to communicate
Parameters
v_posvector of particle positions
v_prpvector of particle properties
g_mghost marker
optoptions

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_isize required to receive the message from i
total_msgtotal size to receive from all the processors
total_pthe total number of processor that want to communicate with you
iprocessor id
rirequest id (it is an id that goes from 0 to total_p, and is unique every time message_alloc is called)
ptra 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.

template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
vector_dist_comm<dim,St,prop,layout,layout_base,Decomposition,Memory>& 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)
inline

Copy a vector.

Parameters
vcvector to copy
Returns
iteself

Definition at line 1226 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>
vector_dist_comm<dim,St,prop,layout,layout_base,Decomposition,Memory>& vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::operator= ( vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory > &&  vc)
inline

Copy a vector.

Parameters
vcvector to copy
Returns
itself

Definition at line 1240 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::resize_retained_buffer ( openfpm::vector< HeapMemory > &  rt_buf,
size_t  nbf 
)
inlineprivate

resize the retained buffer by nbf

Definition at line 542 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>
void vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::setDecompositionGranularity ( size_t  n_sub)
inline

Set the minimum number of sub-domain per processor.

Parameters
n_sub

Definition at line 919 of file vector_dist_comm.hpp.

Field Documentation

template<unsigned int dim, typename St, typename prop, typename layout, template< typename > class layout_base, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory>
openfpm::vector_std<openfpm::vector_std<Box<dim, St> > > vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::box_f
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 215 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>
openfpm::vector<openfpm::vector<aggregate<size_t,size_t> > > vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::g_opart
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 81 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>
size_t vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::lg_m
private

Local ghost marker (across the ghost particles it mark from where we have the) replicated ghost particles that are local

Definition at line 114 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>
openfpm::vector<aggregate<size_t,size_t,size_t> > vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::m_opart
private

For each near processor, outgoing particle id

Warning
opart is assumed to be an ordered list first id particle id second id shift id third id is the processor id

Definition at line 76 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>
openfpm::vector<size_t> vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::prc_recv_get
private

It store the list of processor that communicate with us (local processor) from the last ghost get

Definition at line 91 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>
openfpm::vector<size_t> vector_dist_comm< dim, St, prop, layout, layout_base, Decomposition, Memory >::recv_sz_get
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 101 of file vector_dist_comm.hpp.


The documentation for this class was generated from the following file: