Reference documentation for deal.II version 9.1.1
|
Public Member Functions | |
void | pack_data (const std::vector< quadrant_cell_relation_t > &quad_cell_relations, const std::vector< typename CellAttachedData::pack_callback_t > &pack_callbacks_fixed, const std::vector< typename CellAttachedData::pack_callback_t > &pack_callbacks_variable) |
void | execute_transfer (const typename ::internal::p4est::types< dim >::forest *parallel_forest, const typename ::internal::p4est::types< dim >::gloidx *previous_global_first_quadrant) |
void | unpack_cell_status (std::vector< quadrant_cell_relation_t > &quad_cell_relations) const |
void | unpack_data (const std::vector< quadrant_cell_relation_t > &quad_cell_relations, const unsigned int handle, const std::function< void(const typename ::Triangulation< dim, spacedim >::cell_iterator &, const typename ::Triangulation< dim, spacedim >::CellStatus &, const boost::iterator_range< std::vector< char >::const_iterator > &)> &unpack_callback) const |
void | save (const typename ::internal::p4est::types< dim >::forest *parallel_forest, const std::string &filename) const |
void | load (const typename ::internal::p4est::types< dim >::forest *parallel_forest, const std::string &filename, const unsigned int n_attached_deserialize_fixed, const unsigned int n_attached_deserialize_variable) |
void | clear () |
Private Attributes | |
bool | variable_size_data_stored |
std::vector< unsigned int > | sizes_fixed_cumulative |
std::vector< char > | src_data_fixed |
std::vector< int > | src_sizes_variable |
This class in the private scope of parallel::distributed::Triangulation is dedicated to the data transfer across repartitioned meshes and to the file system.
It is designed to store all data buffers intended for transfer separated from the parallel_forest and to interface with p4est where it is absolutely necessary.
void parallel::distributed::Triangulation< dim, spacedim >::DataTransfer::pack_data | ( | const std::vector< quadrant_cell_relation_t > & | quad_cell_relations, |
const std::vector< typename CellAttachedData::pack_callback_t > & | pack_callbacks_fixed, | ||
const std::vector< typename CellAttachedData::pack_callback_t > & | pack_callbacks_variable | ||
) |
Prepare data transfer by calling the pack callback functions on each cell in quad_cell_relations
.
All registered callback functions in pack_callbacks_fixed
will write into the fixed size buffer, whereas each entry of pack_callbacks_variable
will write its data into the variable size buffer.
void parallel::distributed::Triangulation< dim, spacedim >::DataTransfer::execute_transfer | ( | const typename ::internal::p4est::types< dim >::forest * | parallel_forest, |
const typename ::internal::p4est::types< dim >::gloidx * | previous_global_first_quadrant | ||
) |
Transfer data across forests.
Besides the actual parallel_forest
, which has been already refined and repartitioned, this function also needs information about its previous state, i.e. the locally owned intervals in p4est's sc_array of each processor. This information needs to be memcopyied out of the old p4est object and has to be provided via the parameter previous_global_first_quadrant
.
Data has to be previously packed with pack_data().
void parallel::distributed::Triangulation< dim, spacedim >::DataTransfer::unpack_cell_status | ( | std::vector< quadrant_cell_relation_t > & | quad_cell_relations | ) | const |
Unpack the CellStatus information on each entry of quad_cell_relations
.
Data has to be previously transferred with execute_transfer() or read from the file system via load().
void parallel::distributed::Triangulation< dim, spacedim >::DataTransfer::unpack_data | ( | const std::vector< quadrant_cell_relation_t > & | quad_cell_relations, |
const unsigned int | handle, | ||
const std::function< void(const typename ::Triangulation< dim, spacedim >::cell_iterator &, const typename ::Triangulation< dim, spacedim >::CellStatus &, const boost::iterator_range< std::vector< char >::const_iterator > &)> & | unpack_callback | ||
) | const |
Unpack previously transferred data on each cell registered in quad_cell_relations
with the provided unpack_callback
function.
The parameter handle
corresponds to the position where the unpack_callback
function is allowed to read from the memory. Its value needs to be in accordance with the corresponding pack_callback function that has been registered previously.
Data has to be previously transferred with execute_transfer() or read from the file system via load().
void parallel::distributed::Triangulation< dim, spacedim >::DataTransfer::save | ( | const typename ::internal::p4est::types< dim >::forest * | parallel_forest, |
const std::string & | filename | ||
) | const |
Transfer data to file system.
The data will be written in a separate file, whose name consists of the stem filename
and an attached identifier -fixed.data
for fixed size data and -variable.data
for variable size data.
All processors write into these files simultaneously via MPIIO. Each processor's position to write to will be determined from the provided parallel_forest
.
Data has to be previously packed with pack_data().
void parallel::distributed::Triangulation< dim, spacedim >::DataTransfer::load | ( | const typename ::internal::p4est::types< dim >::forest * | parallel_forest, |
const std::string & | filename, | ||
const unsigned int | n_attached_deserialize_fixed, | ||
const unsigned int | n_attached_deserialize_variable | ||
) |
Transfer data from file system.
The data will be read from separate file, whose name consists of the stem filename
and an attached identifier -fixed.data
for fixed size data and -variable.data
for variable size data. The n_attached_deserialize_fixed
and n_attached_deserialize_variable
parameters are required to gather the memory offsets for each callback.
All processors read from these files simultaneously via MPIIO. Each processor's position to read from will be determined from the provided parallel_forest
.
After loading, unpack_data() needs to be called to finally distribute data across the associated triangulation.
void parallel::distributed::Triangulation< dim, spacedim >::DataTransfer::clear | ( | ) |
|
private |
|
private |
Cumulative size in bytes that those functions that have called register_data_attach() want to attach to each cell. This number only pertains to fixed-sized buffers where the data attached to each cell has exactly the same size.
The last entry of this container corresponds to the data size packed per cell in the fixed size buffer (which can be accessed calling sizes_fixed_cumulative.back()
).
|
private |
|
private |