p4est
2.8.7
p4est is a software library for parallel adaptive mesh refinement.
|
Parallel messaging and support code. More...
#include <p8est.h>
Go to the source code of this file.
Data Structures | |
struct | p8est_transfer_context |
Context data to allow for split begin/end data transfer. More... | |
Typedefs | |
typedef struct p8est_transfer_context | p8est_transfer_context_t |
Context data to allow for split begin/end data transfer. | |
Functions | |
int | p8est_bsearch_partition (p4est_gloidx_t target, const p4est_gloidx_t *gfq, int nmemb) |
Given target, find index p such that gfq[p] <= target < gfq[p + 1] . More... | |
void | p8est_comm_parallel_env_assign (p8est_t *p8est, sc_MPI_Comm mpicomm) |
Assign an MPI communicator to p8est; retrieve parallel environment. More... | |
void | p8est_comm_parallel_env_duplicate (p8est_t *p8est) |
Duplicate MPI communicator and replace the current one by the duplicate. More... | |
void | p8est_comm_parallel_env_release (p8est_t *p8est) |
Release MPI communicator if it is owned by p8est. | |
void | p8est_comm_parallel_env_replace (p8est_t *p8est, sc_MPI_Comm mpicomm) |
Replace the current MPI communicator by the one provided as input. More... | |
void | p8est_comm_parallel_env_get_info (p8est_t *p8est) |
Retrieve parallel environment information. | |
int | p8est_comm_parallel_env_is_null (p8est_t *p8est) |
Check if the MPI communicator is valid. More... | |
int | p8est_comm_parallel_env_reduce (p8est_t **p8est_supercomm) |
Reduce MPI communicator to non-empty ranks (i.e., nonzero quadrant counts). More... | |
int | p8est_comm_parallel_env_reduce_ext (p8est_t **p8est_supercomm, sc_MPI_Group group_add, int add_to_beginning, int **ranks_subcomm) |
Reduce MPI communicator to non-empty ranks and add a group of ranks that will remain in the reduced communicator regardless whether they are empty or not. More... | |
void | p8est_comm_count_quadrants (p8est_t *p8est) |
Calculate the number and partition of quadrants. More... | |
void | p8est_comm_global_partition (p8est_t *p8est, p8est_quadrant_t *first_quad) |
Distribute the global partition boundaries. More... | |
void | p8est_comm_global_first_quadrant (p4est_gloidx_t global_num_quadrants, int mpisize, p4est_gloidx_t *gfq) |
Calculate the global fist quadrant array for a uniform partition. More... | |
void | p8est_comm_count_pertree (p8est_t *p8est, p4est_gloidx_t *pertree) |
Compute and distribute the cumulative number of quadrants per tree. More... | |
int | p8est_comm_is_empty (p8est_t *p8est, int p) |
Query whether a processor has no quadrants. More... | |
int | p8est_comm_is_empty_gfq (const p4est_gloidx_t *gfq, int num_procs, int p) |
Query whether a processor has no quadrants. More... | |
int | p8est_comm_is_empty_gfp (const p8est_quadrant_t *gfp, int num_procs, int p) |
Query whether a processor has no quadrants. More... | |
int | p8est_comm_is_contained (p8est_t *p8est, p4est_locidx_t which_tree, const p8est_quadrant_t *q, int rank) |
Test whether a quadrant is fully contained in a rank's owned region. More... | |
int | p8est_comm_is_owner (p8est_t *p8est, p4est_locidx_t which_tree, const p8est_quadrant_t *q, int rank) |
Test ownership of a quadrant via p8est->global_first_position. More... | |
int | p8est_comm_is_owner_gfp (const p8est_quadrant_t *gfp, int num_procs, p4est_topidx_t num_trees, p4est_locidx_t which_tree, const p8est_quadrant_t *q, int rank) |
Test ownership of a quadrant via a global_first_position array. More... | |
int | p8est_comm_find_owner (p8est_t *p8est, p4est_locidx_t which_tree, const p8est_quadrant_t *q, int guess) |
Searches the owner of a quadrant via p8est->global_first_position. More... | |
void | p8est_comm_tree_info (p8est_t *p8est, p4est_locidx_t which_tree, int full_tree[], int tree_contact[], const p8est_quadrant_t **firstq, const p8est_quadrant_t **nextq) |
Computes information about a tree being fully owned. More... | |
int | p8est_comm_neighborhood_owned (p8est_t *p8est, p4est_locidx_t which_tree, int full_tree[], int tree_contact[], p8est_quadrant_t *q) |
Test if the 3x3 neighborhood of a quadrant is owned by this processor. More... | |
int | p8est_comm_sync_flag (p8est_t *p8est, int flag, sc_MPI_Op operation) |
Evaluates true/false of a flag among processors. More... | |
unsigned | p8est_comm_checksum (p8est_t *p8est, unsigned local_crc, size_t local_bytes) |
Compute a parallel partition-independent checksum out of local checksums. More... | |
void | p8est_transfer_fixed (const p4est_gloidx_t *dest_gfq, const p4est_gloidx_t *src_gfq, sc_MPI_Comm mpicomm, int tag, void *dest_data, const void *src_data, size_t data_size) |
Transfer data associated with one forest partition to another. More... | |
p8est_transfer_context_t * | p8est_transfer_fixed_begin (const p4est_gloidx_t *dest_gfq, const p4est_gloidx_t *src_gfq, sc_MPI_Comm mpicomm, int tag, void *dest_data, const void *src_data, size_t data_size) |
Initiate a fixed-size data transfer between partitions. More... | |
void | p8est_transfer_fixed_end (p8est_transfer_context_t *tc) |
Complete a fixed-size data transfer between partitions. More... | |
void | p8est_transfer_custom (const p4est_gloidx_t *dest_gfq, const p4est_gloidx_t *src_gfq, sc_MPI_Comm mpicomm, int tag, void *dest_data, const int *dest_sizes, const void *src_data, const int *src_sizes) |
Transfer variable-size quadrant data between partitions. More... | |
p8est_transfer_context_t * | p8est_transfer_custom_begin (const p4est_gloidx_t *dest_gfq, const p4est_gloidx_t *src_gfq, sc_MPI_Comm mpicomm, int tag, void *dest_data, const int *dest_sizes, const void *src_data, const int *src_sizes) |
Initiate a variable-size data transfer between partitions. More... | |
void | p8est_transfer_custom_end (p8est_transfer_context_t *tc) |
Complete a variable-size data transfer between partitions. More... | |
void | p8est_transfer_items (const p4est_gloidx_t *dest_gfq, const p4est_gloidx_t *src_gfq, sc_MPI_Comm mpicomm, int tag, void *dest_data, const int *dest_counts, const void *src_data, const int *src_counts, size_t item_size) |
Transfer variable-count item data between partitions. More... | |
p8est_transfer_context_t * | p8est_transfer_items_begin (const p4est_gloidx_t *dest_gfq, const p4est_gloidx_t *src_gfq, sc_MPI_Comm mpicomm, int tag, void *dest_data, const int *dest_counts, const void *src_data, const int *src_counts, size_t item_size) |
Initiate a variable-count item transfer between partitions. More... | |
void | p8est_transfer_items_end (p8est_transfer_context_t *tc) |
Complete a variable-count item transfer between partitions. More... | |
void | p8est_transfer_end (p8est_transfer_context_t *tc) |
Complete any of the transfer_begin functions. More... | |
Parallel messaging and support code.
int p8est_bsearch_partition | ( | p4est_gloidx_t | target, |
const p4est_gloidx_t * | gfq, | ||
int | nmemb | ||
) |
Given target, find index p such that gfq[p] <= target < gfq[p + 1]
.
[in] | target | The value that is searched in gfq. target has to satisfy gfq[0] <= target < gfq[nmemb] . |
[in] | gfq | The sorted array (ascending) in that the function will search. |
[in] | nmemb | Number of entries in array MINUS ONE. |
gfq[p] <= target < gfq[p + 1]
. unsigned p8est_comm_checksum | ( | p8est_t * | p8est, |
unsigned | local_crc, | ||
size_t | local_bytes | ||
) |
Compute a parallel partition-independent checksum out of local checksums.
This checksum depends on the global refinement topology. It does not depend on how the mesh is partitioned. The result is available on all processors.
[in] | p8est | The MPI information of this p8est will be used. |
[in] | local_crc | Locally computed adler32 checksum. |
[in] | local_bytes | Number of bytes used for local checksum. |
void p8est_comm_count_pertree | ( | p8est_t * | p8est, |
p4est_gloidx_t * | pertree | ||
) |
void p8est_comm_count_quadrants | ( | p8est_t * | p8est | ) |
Calculate the number and partition of quadrants.
[in,out] | p8est | Adds all p8est->local_num_quadrant counters and puts cumulative sums in p8est->global_first_quadrant. |
int p8est_comm_find_owner | ( | p8est_t * | p8est, |
p4est_locidx_t | which_tree, | ||
const p8est_quadrant_t * | q, | ||
int | guess | ||
) |
Searches the owner of a quadrant via p8est->global_first_position.
Assumes a tree with no overlaps.
[in] | guess | Initial guess for the search. |
void p8est_comm_global_first_quadrant | ( | p4est_gloidx_t | global_num_quadrants, |
int | mpisize, | ||
p4est_gloidx_t * | gfq | ||
) |
Calculate the global fist quadrant array for a uniform partition.
[in] | global_num_quadrants | The global number of quadrants. |
[in] | mpisize | The number of MPI ranks. |
[in,out] | gfq | At least allocated mpisize + 1 p4est_gloidx_t. This array is filled with the global first quadrant array assuming a uniform partition. |
void p8est_comm_global_partition | ( | p8est_t * | p8est, |
p8est_quadrant_t * | first_quad | ||
) |
Distribute the global partition boundaries.
[in,out] | p8est | Fills p8est->global_first_position . p8est->first_local_tree must be set correctly. If this processor is not empty and first_quad is NULL, the first quadrant of the first local tree must be set correctly. |
[in] | first_quad | If not NULL will be used as first quadrant. |
int p8est_comm_is_contained | ( | p8est_t * | p8est, |
p4est_locidx_t | which_tree, | ||
const p8est_quadrant_t * | q, | ||
int | rank | ||
) |
Test whether a quadrant is fully contained in a rank's owned region.
This function may return false when p8est_comm_is_owner returns true.
[in] | rank | Rank whose ownership is tested. Assumes a forest with no overlaps. |
int p8est_comm_is_empty | ( | p8est_t * | p8est, |
int | p | ||
) |
Query whether a processor has no quadrants.
[in] | p8est | This forests' global_first_position array must be valid. |
[in] | p | Valid processor id. |
is
empty. int p8est_comm_is_empty_gfp | ( | const p8est_quadrant_t * | gfp, |
int | num_procs, | ||
int | p | ||
) |
Query whether a processor has no quadrants.
[in] | gfp | An array encoding the partition shape. Non-decreasing; length num_procs + 1. |
[in] | num_procs | Number of processes in the partition. |
[in] | p | Valid 0 <= p < num_procs. |
int p8est_comm_is_empty_gfq | ( | const p4est_gloidx_t * | gfq, |
int | num_procs, | ||
int | p | ||
) |
Query whether a processor has no quadrants.
[in] | gfq | An array encoding the partition offsets in the global quadrant array; length num_procs + 1. |
[in] | num_procs | Number of processes in the partition. |
[in] | p | Valid 0 <= p < num_procs. |
int p8est_comm_is_owner | ( | p8est_t * | p8est, |
p4est_locidx_t | which_tree, | ||
const p8est_quadrant_t * | q, | ||
int | rank | ||
) |
Test ownership of a quadrant via p8est->global_first_position.
The quadrant is considered owned if its first descendant is owned. Thus, a positive result occurs even if its last descendant overlaps a higher process.
[in] | p8est | Valid forest. |
[in] | which_tree | Valid tree number wrt. the forest. |
[in] | q | Valid quadrant wrt. the forest. |
[in] | rank | Rank whose ownership is tested. |
int p8est_comm_is_owner_gfp | ( | const p8est_quadrant_t * | gfp, |
int | num_procs, | ||
p4est_topidx_t | num_trees, | ||
p4est_locidx_t | which_tree, | ||
const p8est_quadrant_t * | q, | ||
int | rank | ||
) |
Test ownership of a quadrant via a global_first_position array.
This array encodes part of the partition of a valid forest object. The quadrant is considered owned if its first descendant is owned. Thus, a positive result occurs even if its last descendant overlaps a higher process.
[in] | gfp | Position array of length num_procs + 1. |
[in] | num_procs | Number of processes in this context. |
[in] | num_trees | Number of trees in this context. |
[in] | which_tree | Valid tree number wrt. the forest. |
[in] | q | Valid quadrant wrt. the forest. |
[in] | rank | Rank whose ownership is tested. |
int p8est_comm_neighborhood_owned | ( | p8est_t * | p8est, |
p4est_locidx_t | which_tree, | ||
int | full_tree[], | ||
int | tree_contact[], | ||
p8est_quadrant_t * | q | ||
) |
Test if the 3x3 neighborhood of a quadrant is owned by this processor.
[in] | p8est | The p8est to work on. |
[in] | which_tree | The tree index to work on. |
[in] | full_tree | Flags as computed by p8est_comm_tree_info. |
[in] | tree_contact | Flags as computed by p8est_comm_tree_info. |
[in] | q | The quadrant to be checked. |
void p8est_comm_parallel_env_assign | ( | p8est_t * | p8est, |
sc_MPI_Comm | mpicomm | ||
) |
void p8est_comm_parallel_env_duplicate | ( | p8est_t * | p8est | ) |
Duplicate MPI communicator and replace the current one by the duplicate.
int p8est_comm_parallel_env_is_null | ( | p8est_t * | p8est | ) |
Check if the MPI communicator is valid.
int p8est_comm_parallel_env_reduce | ( | p8est_t ** | p8est_supercomm | ) |
int p8est_comm_parallel_env_reduce_ext | ( | p8est_t ** | p8est_supercomm, |
sc_MPI_Group | group_add, | ||
int | add_to_beginning, | ||
int ** | ranks_subcomm | ||
) |
Reduce MPI communicator to non-empty ranks and add a group of ranks that will remain in the reduced communicator regardless whether they are empty or not.
[in,out] | p8est_supercomm | Object which communicator is reduced. Points to NULL if this p8est does not exists. |
[in] | group_add | Group of ranks that will remain in communicator. |
[in] | add_to_beginning | If true, ranks will be added to the beginning of the reduced communicator, otherwise to the end. |
[out] | ranks_subcomm | If not null, array of size 'subcommsize' with subcommrank->supercommrank map. |
void p8est_comm_parallel_env_replace | ( | p8est_t * | p8est, |
sc_MPI_Comm | mpicomm | ||
) |
Replace the current MPI communicator by the one provided as input.
[in] | mpicomm | A valid MPI communicator. |
int p8est_comm_sync_flag | ( | p8est_t * | p8est, |
int | flag, | ||
sc_MPI_Op | operation | ||
) |
void p8est_comm_tree_info | ( | p8est_t * | p8est, |
p4est_locidx_t | which_tree, | ||
int | full_tree[], | ||
int | tree_contact[], | ||
const p8est_quadrant_t ** | firstq, | ||
const p8est_quadrant_t ** | nextq | ||
) |
Computes information about a tree being fully owned.
This is determined separately for the beginning and end of the tree.
[in] | p8est | The p8est to work on. |
[in] | which_tree | The tree in question must be partially owned. |
[out] | full_tree | Full ownership of beginning and end of tree. |
[out] | tree_contact | True if there are neighbors across the face. |
[out] | firstq | Smallest possible first quadrant on this core. |
[out] | nextq | Smallest possible first quadrant on next core. Any of tree_contact, firstq and nextq may be NULL. |
void p8est_transfer_custom | ( | const p4est_gloidx_t * | dest_gfq, |
const p4est_gloidx_t * | src_gfq, | ||
sc_MPI_Comm | mpicomm, | ||
int | tag, | ||
void * | dest_data, | ||
const int * | dest_sizes, | ||
const void * | src_data, | ||
const int * | src_sizes | ||
) |
Transfer variable-size quadrant data between partitions.
(See p8est_transfer_fixed that is optimized for fixed-size data.) The destination process may not know the data size for the elements it receives. In this case the sizes need to be obtained separately in advance, for example by calling p8est_transfer_fixed with src_sizes as payload data, or alternatively its split begin/end versions.
[in] | dest_gfq | The target partition encoded as a p8est->global_first_quadrant array. Has mpisize
|
[in] | src_gfq | The original partition, analogous to dest_gfq. |
[in] | mpicomm | The communicator to use. Its mpisize must match dest_gfq and src_gfq. |
[in] | tag | This tag is used in all messages. The user must guarantee that mpicomm and tag do not conflict with other messages in transit. |
[out] | dest_data | User-allocated memory of sum_{i in dest->local_num_quadrants} dest_sizes [i] many bytes is received into. See below about how to choose its size. |
[in] | dest_sizes | User-allocated memory of one integer for each quadrant, storing the data size to receive for it. We understand that the sizes are often not known a priori, in which case they can be obtained by a prior call to p8est_transfer_fixed. Optionally the split begin/end versions can be used for added flexibility and overlapping of messages. We use the type int to minimize the message size, and to conform to MPI that has no type for size_t. |
[in] | src_data | User-allocated memory of sum_{i in src->local_num_quadrants} src_sizes [i] many bytes is sent from. |
[in] | src_sizes | User-allocated memory of one integer for each quadrant, storing the data size to send for it. We use the type int to minimize the message size, and to conform to MPI that has no type for size_t. |
p8est_transfer_context_t* p8est_transfer_custom_begin | ( | const p4est_gloidx_t * | dest_gfq, |
const p4est_gloidx_t * | src_gfq, | ||
sc_MPI_Comm | mpicomm, | ||
int | tag, | ||
void * | dest_data, | ||
const int * | dest_sizes, | ||
const void * | src_data, | ||
const int * | src_sizes | ||
) |
Initiate a variable-size data transfer between partitions.
See p8est_transfer_custom for a full description. Must be matched with p8est_transfer_custom_end for completion. All parameters must stay alive until the completion has been called.
[in] | dest_gfq | The target partition encoded as a p8est->global_first_quadrant array. Has mpisize
|
[in] | src_gfq | The original partition, analogous to dest_gfq. |
[in] | mpicomm | The communicator to use. Its mpisize must match dest_gfq and src_gfq. |
[in] | tag | This tag is used in all messages. The user must guarantee that mpicomm and tag do not conflict with other messages in transit. |
[out] | dest_data | User-allocated memory of sum_{i in dest->local_num_quadrants} dest_sizes [i] many bytes is received into. It must not be accessed before completion with p8est_transfer_custom_end. See below about how to choose its size. |
[in] | dest_sizes | User-allocated memory of one integer for each quadrant, storing the data size to receive for it. We understand that the sizes are often not known a priori, in which case they can be obtained by a prior call to p8est_transfer_fixed. Optionally the split begin/end versions can be used for added flexibility and overlapping of messages. We use the type int to minimize the message size, and to conform to MPI that has no type for size_t. |
[in] | src_data | User-allocated memory of sum_{i in src->local_num_quadrants} src_sizes [i] many bytes is sent from. It must not be accessed before completion with p8est_transfer_custom_end. |
[in] | src_sizes | User-allocated memory of one integer for each quadrant, storing the data size to send for it. We use the type int to minimize the message size, and to conform to MPI that has no type for size_t. |
void p8est_transfer_custom_end | ( | p8est_transfer_context_t * | tc | ) |
Complete a variable-size data transfer between partitions.
Waits for remaining messages to complete and frees the transfer context.
[in] | tc | Context data from p8est_transfer_custom_begin. Is deallocated before this function returns. |
void p8est_transfer_end | ( | p8est_transfer_context_t * | tc | ) |
Complete any of the transfer_begin functions.
The specialized transfer_end functions are recommended over this one for slightly stricter error checking: p8est_transfer_fixed_end, p8est_transfer_custom_end, and p8est_transfer_items_end.
[in,out] | tc | A valid context from one of the begin functions. This function waits for remaining communications to complete and frees the transfer context. |
void p8est_transfer_fixed | ( | const p4est_gloidx_t * | dest_gfq, |
const p4est_gloidx_t * | src_gfq, | ||
sc_MPI_Comm | mpicomm, | ||
int | tag, | ||
void * | dest_data, | ||
const void * | src_data, | ||
size_t | data_size | ||
) |
Transfer data associated with one forest partition to another.
In p8est_partition, each quadrant's user data is transferred. If the application maintains per-quadrant data outside of the p8est object, this function can be used to transfer it, matching the call to partition. This variant of the function assumes that the quadrant data size is fixed. It sends point-to-point messages only and is blocking collective. There is a split collective version; see the functions p8est_transfer_fixed_begin and p8est_transfer_fixed_end.
[in] | dest_gfq | The target partition encoded as a p8est->global_first_quadrant array. Has mpisize
|
[in] | src_gfq | The original partition, analogous to dest_gfq. |
[in] | mpicomm | The communicator to use. Its mpisize must match dest_gfq and src_gfq. |
[in] | tag | This tag is used in all messages. The user must guarantee that mpicomm and tag do not conflict with other messages in transit. |
[out] | dest_data | User-allocated memory of size data_size * dest->local_num_quadrants is received into. |
[in] | src_data | User-allocated memory of size data_size * src->local_num_quadrants bytes is sent from. |
[in] | data_size | Fixed data size per quadrant. |
p8est_transfer_context_t* p8est_transfer_fixed_begin | ( | const p4est_gloidx_t * | dest_gfq, |
const p4est_gloidx_t * | src_gfq, | ||
sc_MPI_Comm | mpicomm, | ||
int | tag, | ||
void * | dest_data, | ||
const void * | src_data, | ||
size_t | data_size | ||
) |
Initiate a fixed-size data transfer between partitions.
See p8est_transfer_fixed for a full description. Must be matched with p8est_transfer_fixed_end for completion. All parameters must stay alive until the completion has been called.
[in] | dest_gfq | The target partition encoded as a p8est->global_first_quadrant array. Has mpisize
|
[in] | src_gfq | The original partition, analogous to dest_gfq. |
[in] | mpicomm | The communicator to use. Its mpisize must match dest_gfq and src_gfq. |
[in] | tag | This tag is used in all messages. The user must guarantee that mpicomm and tag do not conflict with other messages in transit. |
[out] | dest_data | User-allocated memory of size data_size * dest->local_num_quadrants bytes is received into. It must not be accessed before completion with p8est_transfer_fixed_end. |
[in] | src_data | User-allocated memory of size data_size * src->local_num_quadrants bytes is sent from. It must not be accessed before completion with p8est_transfer_fixed_end. |
[in] | data_size | Fixed data size per quadrant. |
void p8est_transfer_fixed_end | ( | p8est_transfer_context_t * | tc | ) |
Complete a fixed-size data transfer between partitions.
Waits for remaining messages to complete and frees the transfer context.
[in] | tc | Context data from p8est_transfer_fixed_begin. Is deallocated before this function returns. |
void p8est_transfer_items | ( | const p4est_gloidx_t * | dest_gfq, |
const p4est_gloidx_t * | src_gfq, | ||
sc_MPI_Comm | mpicomm, | ||
int | tag, | ||
void * | dest_data, | ||
const int * | dest_counts, | ||
const void * | src_data, | ||
const int * | src_counts, | ||
size_t | item_size | ||
) |
Transfer variable-count item data between partitions.
Each quadrant may have a different number of items (including 0). (See p8est_transfer_fixed that is optimized for fixed-count data, and p8est_transfer_custom for data that is not itemized at all.) The destination process may not know the item count for the elements it receives. In this case the counts need to be obtained separately in advance, for example by calling p8est_transfer_fixed with src_counts as payload data, or alternatively its split begin/end versions.
[in] | dest_gfq | The target partition encoded as a p8est->global_first_quadrant array. Has mpisize
|
[in] | src_gfq | The original partition, analogous to dest_gfq. |
[in] | mpicomm | The communicator to use. Its mpisize must match dest_gfq and src_gfq. |
[in] | tag | This tag is used in all messages. The user must guarantee that mpicomm and tag do not conflict with other messages in transit. |
[out] | dest_data | User-allocated memory of sum_{i in dest->local_num_quadrants} item_size
|
[in] | dest_counts | User-allocated memory of one integer for each quadrant, storing the item count to receive for it. We understand that the counts are often not known a priori, in which case they can be obtained by a prior call to p8est_transfer_fixed. Optionally the split begin/end versions can be used for added flexibility and overlapping of messages. We use the type int to minimize the message size, and to conform to MPI that has no type for size_t. If dest has quadrants, must be non-NULL. |
[in] | src_data | User-allocated memory of sum_{i in src->local_num_quadrants} item_size
|
[in] | src_counts | User-allocated memory of one integer for each quadrant, storing the item count to send for it. We use the type int to minimize the message size, and to conform to MPI that has no type for size_t. If src has quadrants, must be non-NULL. |
[in] | item_size | Data size for each item in bytes. |
p8est_transfer_context_t* p8est_transfer_items_begin | ( | const p4est_gloidx_t * | dest_gfq, |
const p4est_gloidx_t * | src_gfq, | ||
sc_MPI_Comm | mpicomm, | ||
int | tag, | ||
void * | dest_data, | ||
const int * | dest_counts, | ||
const void * | src_data, | ||
const int * | src_counts, | ||
size_t | item_size | ||
) |
Initiate a variable-count item transfer between partitions.
See p8est_transfer_items for a full description. This functions calls asynchronous MPI send/receive and returns. Must be matched with p8est_transfer_items_end for completion, which calls blocking MPI wait until all messages have been processed. All parameters must stay alive until the completion has been called.
void p8est_transfer_items_end | ( | p8est_transfer_context_t * | tc | ) |
Complete a variable-count item transfer between partitions.
Waits for remaining messages to complete and frees the transfer context.
[in] | tc | Context data from p8est_transfer_items_begin. Is deallocated before this function returns. |