template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
class grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >
This class is an helper for the communication of grid_dist_id.
- Template Parameters
-
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 |
- See also
- grid_dist_id
Definition at line 140 of file grid_dist_id_comm.hpp.
|
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, const openfpm::vector< e_box_multi< dim >> &eb_gid_list, bool use_bx_def, openfpm::vector< device_grid > &loc_grid, const grid_sm< dim, void > &ginfo, std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box, size_t opt) |
| It fill the ghost part of the grids. More...
|
|
template<template< typename, typename > class op, int... prp> |
void | ghost_put_ (Decomposition &dec, 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...
|
|
| grid_dist_id_comm (const grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid > &gc) |
| Copy constructor. More...
|
|
|
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, const grid_sm< dim, void > &ginfo, bool use_bx_def, size_t opt) |
| 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...
|
|
void | send_or_queue (size_t prc, char *pointer, char *pointer2) |
|
template<typename prp_object > |
void | queue_recv_data_get (const openfpm::vector< ep_box_grid< dim >> &eg_box, std::vector< size_t > &prp_recv, ExtPreAlloc< Memory > &prRecv_prp) |
|
template<typename prp_object > |
void | queue_recv_data_put (const openfpm::vector< ip_box_grid< dim >> &ig_box, std::vector< size_t > &prp_recv, ExtPreAlloc< Memory > &prRecv_prp) |
|
template<typename mem , unsigned ... prp> |
void | unpack_data_to_ext_ghost (ExtPreAlloc< mem > &emem, openfpm::vector< device_grid > &loc_grid, size_t i, const openfpm::vector< ep_box_grid< dim >> &eg_box, const std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box, const openfpm::vector< e_box_multi< dim >> &eb_gid_list, Unpack_stat &ps, size_t opt) |
|
template<typename mem , typename header_type , unsigned ... prp> |
void | unpack_data_to_ext_ghost_with_header (ExtPreAlloc< mem > &emem, openfpm::vector< device_grid > &loc_grid, header_type &headers, size_t i, const openfpm::vector< ep_box_grid< dim >> &eg_box, const std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box, const openfpm::vector< e_box_multi< dim >> &eb_gid_list, Unpack_stat &ps, size_t opt) |
|
template<unsigned int ... prp> |
void | fill_headers (size_t opt) |
|
template<unsigned ... prp> |
void | merge_received_data_get (openfpm::vector< device_grid > &loc_grid, const openfpm::vector< ep_box_grid< dim >> &eg_box, const std::vector< size_t > &prp_recv, ExtPreAlloc< Memory > &prRecv_prp, const std::unordered_map< size_t, size_t > &g_id_to_external_ghost_box, const openfpm::vector< e_box_multi< dim >> &eb_gid_list, size_t opt) |
|
template<template< typename, typename > class op, unsigned ... prp> |
void | merge_received_data_put (Decomposition &dec, openfpm::vector< device_grid > &loc_grid, const openfpm::vector< ip_box_grid< dim >> &ig_box, const std::vector< size_t > &prp_recv, ExtPreAlloc< Memory > &prRecv_prp, const openfpm::vector< GBoxes< device_grid::dims >> &gdb_ext, const openfpm::vector< std::unordered_map< size_t, size_t >> &g_id_to_internal_ghost_box) |
|
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<int... prp>
void grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >::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, |
|
|
const openfpm::vector< e_box_multi< dim >> & |
eb_gid_list, |
|
|
bool |
use_bx_def, |
|
|
openfpm::vector< device_grid > & |
loc_grid, |
|
|
const grid_sm< dim, void > & |
ginfo, |
|
|
std::unordered_map< size_t, size_t > & |
g_id_to_external_ghost_box, |
|
|
size_t |
opt |
|
) |
| |
|
inline |
It fill the ghost part of the grids.
- Parameters
-
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 1189 of file grid_dist_id_comm.hpp.
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<int... prp>
void grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >::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, |
|
|
const grid_sm< dim, void > & |
ginfo, |
|
|
bool |
use_bx_def, |
|
|
size_t |
opt |
|
) |
| |
|
inlineprivate |
Sync the local ghost part.
- Template Parameters
-
- Parameters
-
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.
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<template< typename, typename > class op, int... prp>
void grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >::ghost_put_ |
( |
Decomposition & |
dec, |
|
|
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 |
|
) |
| |
|
inline |
It merge the information in the ghost with the real information.
- Template Parameters
-
- Parameters
-
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 |
Definition at line 1439 of file grid_dist_id_comm.hpp.
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<template< typename, typename > class op, int... prp>
void grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >::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 |
|
) |
| |
|
inlineprivate |
Sync the local ghost part.
- Template Parameters
-
- Parameters
-
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 315 of file grid_dist_id_comm.hpp.
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
void grid_dist_id_comm< dim, St, T, Decomposition, Memory, device_grid >::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 |
|
) |
| |
|
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
- Parameters
-
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 1128 of file grid_dist_id_comm.hpp.
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<typename prp_object >
Receive the information from each processors
Resize the receiving buffer
Definition at line 413 of file grid_dist_id_comm.hpp.
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
template<typename prp_object >
template<unsigned int dim, typename St, typename T, typename Decomposition = CartDecomposition<dim,St>, typename Memory = HeapMemory, typename device_grid = grid_cpu<dim,T>>
For each near processor, outgoing intersection grid
- Warning
- m_oGrid is assumed to be an ordered list first id is grid second id is the processor id
Definition at line 184 of file grid_dist_id_comm.hpp.