This class is an helper for the communication of grid_dist_id. More...
This class is an helper for the communication of grid_dist_id.
dim | Dimensionality of the grid |
St | Type of space where the grid is living |
T | object the grid is storing |
Decomposition | Class that decompose the grid for example CartDecomposition |
Memory | Is the allocator |
device_grid | of base structure is going to store the data |
Definition at line 177 of file grid_dist_id_comm.hpp.
#include <grid_dist_id_comm.hpp>
Public Member Functions | |
void | grids_reconstruct (openfpm::vector< openfpm::vector< aggregate< device_grid, SpaceBox< dim, long int >>>> &m_oGrid_recv, openfpm::vector< device_grid > &loc_grid, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, CellDecomposer_sm< dim, St, shift< dim, St >> &cd_sm) |
Reconstruct the local grids. More... | |
void | labelIntersectionGridsProcessor (Decomposition &dec, CellDecomposer_sm< dim, St, shift< dim, St >> &cd_sm, openfpm::vector< device_grid > &loc_grid_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_global, openfpm::vector< openfpm::vector< aggregate< device_grid, SpaceBox< dim, long int >>>> &lbl_b, openfpm::vector< size_t > &prc_sz) |
Label intersection grids for mappings. More... | |
void | map_ (Decomposition &dec, CellDecomposer_sm< dim, St, shift< dim, St >> &cd_sm, openfpm::vector< device_grid > &loc_grid, openfpm::vector< device_grid > &loc_grid_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_old, openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext_global) |
Moves all the grids that does not belong to the local processor to the respective processor. More... | |
template<int... prp> | |
void | ghost_get_ (const openfpm::vector< ip_box_grid< dim >> &ig_box, const openfpm::vector< ep_box_grid< dim >> &eg_box, const openfpm::vector< i_lbox_grid< dim >> &loc_ig_box, const openfpm::vector< e_lbox_grid< dim >> &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< device_grid > &loc_grid, std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box) |
It fill the ghost part of the grids. More... | |
template<template< typename, typename > class op, int... prp> | |
void | ghost_put_ (const openfpm::vector< ip_box_grid< dim >> &ig_box, const openfpm::vector< ep_box_grid< dim >> &eg_box, const openfpm::vector< i_lbox_grid< dim >> &loc_ig_box, const openfpm::vector< e_lbox_grid< dim >> &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< device_grid > &loc_grid, openfpm::vector< std::unordered_map< size_t, size_t >> &g_id_to_internal_ghost_box) |
It merge the information in the ghost with the real information. More... | |
grid_dist_id_comm () | |
Constructor. More... | |
Private Member Functions | |
template<int... prp> | |
void | ghost_get_local (const openfpm::vector< i_lbox_grid< dim >> &loc_ig_box, const openfpm::vector< e_lbox_grid< dim >> &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< device_grid > &loc_grid, std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box) |
Sync the local ghost part. More... | |
template<template< typename, typename > class op, int... prp> | |
void | ghost_put_local (const openfpm::vector< i_lbox_grid< dim >> &loc_ig_box, const openfpm::vector< e_lbox_grid< dim >> &loc_eg_box, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< device_grid > &loc_grid, openfpm::vector< std::unordered_map< size_t, size_t >> &g_id_to_external_ghost_box) |
Sync the local ghost part. More... | |
template<int... prp> | |
void | send_and_receive_ghost (ExtPreAlloc< Memory > **prAlloc_prp, ExtPreAlloc< Memory > **prRecv_prp, const openfpm::vector< ip_box_grid< dim >> &ig_box, const openfpm::vector< ep_box_grid< dim >> &eg_box, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, openfpm::vector< device_grid > &loc_grid, size_t &req) |
this function create send and receive asynchronously to receive ghosts part More... | |
template<int... prp> | |
void | process_received (ExtPreAlloc< Memory > *prRecv_prp, const openfpm::vector< ep_box_grid< dim >> &eg_box, openfpm::vector< device_grid > &loc_grid, std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box) |
Process the received data. More... | |
Private Attributes | |
Vcluster & | v_cl |
VCluster. | |
openfpm::vector< size_t > | p_map_req |
Maps the processor id with the communication request into map procedure. | |
openfpm::vector< size_t > | prc_recv_map |
Stores the list of processors that communicate with us (local processor) | |
openfpm::vector< size_t > | recv_sz_map |
Stores the size of the elements added for each processor that communicate with us (local processor) | |
openfpm::vector < openfpm::vector< aggregate < device_grid, SpaceBox< dim, long int > > > > | m_oGrid |
Memory | g_send_prp_mem |
Memory for the ghost sending buffer. | |
Memory | g_recv_prp_mem |
Memory for the ghost sending buffer. | |
|
inline |
Constructor.
Definition at line 1036 of file grid_dist_id_comm.hpp.
|
inline |
It fill the ghost part of the grids.
ig_box | internal ghost box |
eg_box | external ghost box |
loc_ig_box | local internal ghost box |
loc_eg_box | local external ghost box |
gdb_ext | local grids information |
loc_grid | set of local grid |
g_id_to_external_ghost_box | index to external ghost box |
Definition at line 817 of file grid_dist_id_comm.hpp.
|
inlineprivate |
Sync the local ghost part.
prp... | properties to sync |
loc_ig_box | local internel ghost boxes |
loc_eg_box | local external ghost boxes |
gdb_ext | information about the local grids |
loc_grid | local grids |
g_id_to_external_ghost_box | from global index to external ghost box |
For all the sub-domains
For all the internal ghost boxes of each sub-domain
Definition at line 215 of file grid_dist_id_comm.hpp.
|
inline |
It merge the information in the ghost with the real information.
op | merge operation |
ig_box | internal ghost box |
eg_box | external ghost box |
loc_ig_box | local internal ghost box |
loc_eg_box | local external ghost box |
gdb_ext | local grids information |
loc_grid | set of local grid |
g_id_to_internal_ghost_box | index to internal ghost box |
Receive the information from each processors
Resize the receiving buffer
Definition at line 860 of file grid_dist_id_comm.hpp.
|
inlineprivate |
Sync the local ghost part.
prp... | properties to sync |
loc_ig_box | local internel ghost boxes |
loc_eg_box | local external ghost boxes |
gdb_ext | information about the local grids |
loc_grid | local grids |
g_id_to_external_ghost_box | global-if to external ghost box |
For all the sub-domains
For all the external ghost boxes of each sub-domain
Definition at line 298 of file grid_dist_id_comm.hpp.
|
inline |
Reconstruct the local grids.
m_oGrid_recv | Vector of labeled grids to combine into a local grid |
loc_grid | local grids |
gdb_ext | information of the local grids |
cd_sm | Cell-decomposer |
Definition at line 552 of file grid_dist_id_comm.hpp.
|
inline |
Label intersection grids for mappings.
dec | Decomposition |
loc_grid_old | old local grids |
cd_sm | Cell-decomposer |
gdb_ext | information of the local grids |
gdb_ext_old | information of the old local grids |
gdb_ext_global | information of the grids globaly |
lbl_b | label for each grid |
prc_sz | For each processor the number of grids to send to |
Definition at line 631 of file grid_dist_id_comm.hpp.
|
inline |
Moves all the grids that does not belong to the local processor to the respective processor.
This function in general is called if the decomposition change
dec | Decomposition |
cd_sm | cell-decomposer |
loc_grid | set of local grids |
loc_grid_old | set of old local grids |
gdb_ext | information of the local grids |
gdb_ext_old | information of the old local grids |
gdb_ext_global | it contain the decomposition at global level |
Definition at line 756 of file grid_dist_id_comm.hpp.
|
inlineprivate |
Process the received data.
eg_box | external ghost box |
Definition at line 493 of file grid_dist_id_comm.hpp.
|
inlineprivate |
this function create send and receive asynchronously to receive ghosts part
ig_box | internal ghost box |
eg_box | external ghost box |
Receive the information from each processors
Resize the receiving buffer
Definition at line 368 of file grid_dist_id_comm.hpp.
|
private |
For each near processor, outgoing intersection grid
Definition at line 195 of file grid_dist_id_comm.hpp.