32 #ifndef P4EST_COMMUNICATION_H
33 #define P4EST_COMMUNICATION_H
126 int add_to_beginning,
127 int **ranks_subcomm);
158 global_num_quadrants,
186 int num_procs,
int p);
196 int num_procs,
int p);
289 int flag, sc_MPI_Op operation);
310 sc_MPI_Request *recv_req;
311 sc_MPI_Request *send_req;
344 sc_MPI_Comm mpicomm,
int tag,
346 const void *src_data,
384 const void *src_data,
437 sc_MPI_Comm mpicomm,
int tag,
439 const int *dest_sizes,
440 const void *src_data,
441 const int *src_sizes);
493 const int *dest_sizes,
494 const void *src_data,
495 const int *src_sizes);
550 sc_MPI_Comm mpicomm,
int tag,
551 void *dest_data,
const int *dest_counts,
552 const void *src_data,
const int *src_counts,
size_t item_size);
563 sc_MPI_Comm mpicomm,
int tag,
564 void *dest_data,
const int *dest_counts,
565 const void *src_data,
const int *src_counts,
size_t item_size);
The top-level 2D p4est interface.
int32_t p4est_topidx_t
Typedef for counting topological entities (trees, tree vertices).
Definition: p4est_base.h:93
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:106
int64_t p4est_gloidx_t
Typedef for globally unique indexing of quadrants.
Definition: p4est_base.h:118
void p4est_comm_parallel_env_duplicate(p4est_t *p4est)
Duplicate MPI communicator and replace the current one by the duplicate.
void p4est_comm_global_partition(p4est_t *p4est, p4est_quadrant_t *first_quad)
Distribute the global partition boundaries.
int p4est_comm_find_owner(p4est_t *p4est, p4est_locidx_t which_tree, const p4est_quadrant_t *q, int guess)
Searches the owner of a quadrant via p4est->global_first_position.
int p4est_comm_sync_flag(p4est_t *p4est, int flag, sc_MPI_Op operation)
Evaluates true/false of a flag among processors.
void p4est_transfer_fixed_end(p4est_transfer_context_t *tc)
Complete a fixed-size data transfer between partitions.
void p4est_comm_parallel_env_release(p4est_t *p4est)
Release MPI communicator if it is owned by p4est.
void p4est_comm_parallel_env_assign(p4est_t *p4est, sc_MPI_Comm mpicomm)
Assign an MPI communicator to p4est; retrieve parallel environment.
int p4est_comm_is_owner_gfp(const p4est_quadrant_t *gfp, int num_procs, p4est_topidx_t num_trees, p4est_locidx_t which_tree, const p4est_quadrant_t *q, int rank)
Test ownership of a quadrant via a global_first_position array.
int p4est_comm_parallel_env_reduce(p4est_t **p4est_supercomm)
Reduce MPI communicator to non-empty ranks (i.e., nonzero quadrant counts).
p4est_transfer_context_t * p4est_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.
int p4est_comm_parallel_env_reduce_ext(p4est_t **p4est_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 c...
void p4est_transfer_end(p4est_transfer_context_t *tc)
Complete any of the transfer_begin functions.
void p4est_comm_tree_info(p4est_t *p4est, p4est_locidx_t which_tree, int full_tree[], int tree_contact[], const p4est_quadrant_t **firstq, const p4est_quadrant_t **nextq)
Computes information about a tree being fully owned.
int p4est_comm_is_empty(p4est_t *p4est, int p)
Query whether a processor has no quadrants.
int p4est_comm_is_empty_gfq(const p4est_gloidx_t *gfq, int num_procs, int p)
Query whether a processor has no quadrants.
int p4est_comm_parallel_env_is_null(p4est_t *p4est)
Check if the MPI communicator is valid.
int p4est_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].
unsigned p4est_comm_checksum(p4est_t *p4est, unsigned local_crc, size_t local_bytes)
Compute a parallel partition-independent checksum out of local checksums.
void p4est_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.
void p4est_comm_parallel_env_get_info(p4est_t *p4est)
Retrieve parallel environment information.
void p4est_comm_count_quadrants(p4est_t *p4est)
Calculate the number and partition of quadrants.
void p4est_transfer_custom_end(p4est_transfer_context_t *tc)
Complete a variable-size data transfer between partitions.
int p4est_comm_neighborhood_owned(p4est_t *p4est, p4est_locidx_t which_tree, int full_tree[], int tree_contact[], p4est_quadrant_t *q)
Test if the 3x3 neighborhood of a quadrant is owned by this processor.
int p4est_comm_is_contained(p4est_t *p4est, p4est_locidx_t which_tree, const p4est_quadrant_t *q, int rank)
Test whether a quadrant is fully contained in a rank's owned region.
void p4est_comm_parallel_env_replace(p4est_t *p4est, sc_MPI_Comm mpicomm)
Replace the current MPI communicator by the one provided as input.
p4est_transfer_context_t * p4est_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.
int p4est_comm_is_owner(p4est_t *p4est, p4est_locidx_t which_tree, const p4est_quadrant_t *q, int rank)
Test ownership of a quadrant via p4est->global_first_position.
void p4est_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.
int p4est_comm_is_empty_gfp(const p4est_quadrant_t *gfp, int num_procs, int p)
Query whether a processor has no quadrants.
void p4est_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.
struct p4est_transfer_context p4est_transfer_context_t
Context data to allow for split begin/end data transfer.
void p4est_comm_count_pertree(p4est_t *p4est, p4est_gloidx_t *pertree)
Compute and distribute the cumulative number of quadrants per tree.
void p4est_transfer_items_end(p4est_transfer_context_t *tc)
Complete a variable-count item transfer between partitions.
p4est_transfer_context_t * p4est_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.
void p4est_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.
The 2D quadrant datatype.
Definition: p4est.h:76
Context data to allow for split begin/end data transfer.
Definition: p4est_communication.h:306
The p4est forest datatype.
Definition: p4est.h:150