p4est 2.8.7.456-de8c6
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
p8est_communication.h
Go to the documentation of this file.
1/*
2 This file is part of p4est.
3 p4est is a C library to manage a collection (a forest) of multiple
4 connected adaptive quadtrees or octrees in parallel.
5
6 Copyright (C) 2010 The University of Texas System
7 Additional copyright (C) 2011 individual authors
8 Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
9
10 p4est is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 p4est is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with p4est; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23*/
24
32#ifndef P8EST_COMMUNICATION_H
33#define P8EST_COMMUNICATION_H
34
35#include <p8est.h>
36
37SC_EXTERN_C_BEGIN;
38
53 const p4est_gloidx_t * gfq,
54 int nmemb);
55
63 sc_MPI_Comm mpicomm);
64
70
74
82 sc_MPI_Comm mpicomm);
83
87
93
103 p8est_supercomm);
104
123 p8est_supercomm,
124 sc_MPI_Group
125 group_add,
126 int add_to_beginning,
127 int **ranks_subcomm);
128
134
145 first_quad);
146
158 global_num_quadrants,
159 int mpisize,
160 p4est_gloidx_t * gfq);
161
169 p4est_gloidx_t * pertree);
170
177
186 int num_procs, int p);
187
196 int num_procs, int p);
197
205 p4est_locidx_t which_tree,
206 const p8est_quadrant_t * q,
207 int rank);
208
220 p4est_locidx_t which_tree,
221 const p8est_quadrant_t *q,
222 int rank);
223
238 (const p8est_quadrant_t *gfp, int num_procs, p4est_topidx_t num_trees,
239 p4est_locidx_t which_tree, const p8est_quadrant_t *q, int rank);
240
247 p4est_locidx_t which_tree,
248 const p8est_quadrant_t * q,
249 int guess);
250
263 p4est_locidx_t which_tree,
264 int full_tree[],
265 int tree_contact[],
266 const p8est_quadrant_t ** firstq,
267 const p8est_quadrant_t ** nextq);
268
277 p4est_locidx_t which_tree,
278 int full_tree[],
279 p8est_quadrant_t * q);
280
288 int flag, sc_MPI_Op operation);
289
300 unsigned local_crc,
301 size_t local_bytes);
302
305{
306 int variable;
307 int num_senders;
308 int num_receivers;
309 sc_MPI_Request *recv_req;
310 sc_MPI_Request *send_req;
311}
313
339 const p4est_gloidx_t * src_gfq,
340 sc_MPI_Comm mpicomm, int tag,
341 void *dest_data,
342 const void *src_data,
343 size_t data_size);
344
372 dest_gfq,
373 const p4est_gloidx_t *
374 src_gfq,
375 sc_MPI_Comm mpicomm,
376 int tag,
377 void *dest_data,
378 const void *src_data,
379 size_t data_size);
380
387
426 const p4est_gloidx_t * src_gfq,
427 sc_MPI_Comm mpicomm, int tag,
428 void *dest_data,
429 const int *dest_sizes,
430 const void *src_data,
431 const int *src_sizes);
432
475 dest_gfq,
476 const p4est_gloidx_t *
477 src_gfq,
478 sc_MPI_Comm mpicomm,
479 int tag,
480 void *dest_data,
481 const int *dest_sizes,
482 const void *src_data,
483 const int *src_sizes);
484
491
537 (const p4est_gloidx_t * dest_gfq, const p4est_gloidx_t * src_gfq,
538 sc_MPI_Comm mpicomm, int tag,
539 void *dest_data, const int *dest_counts,
540 const void *src_data, const int *src_counts, size_t item_size);
541
550 (const p4est_gloidx_t * dest_gfq, const p4est_gloidx_t * src_gfq,
551 sc_MPI_Comm mpicomm, int tag,
552 void *dest_data, const int *dest_counts,
553 const void *src_data, const int *src_counts, size_t item_size);
554
561
572
573SC_EXTERN_C_END;
574
575#endif /* !P8EST_COMMUNICATION_H */
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
The top-level 3D p8est interface.
int p8est_comm_is_empty(p8est_t *p8est, int p)
Query whether a processor has no quadrants.
int p8est_comm_parallel_env_reduce(p8est_t **p8est_supercomm)
Reduce MPI communicator to non-empty ranks (i.e., nonzero quadrant counts).
int p8est_comm_parallel_env_is_null(p8est_t *p8est)
Check if the MPI communicator is valid.
void p8est_comm_count_quadrants(p8est_t *p8est)
Calculate the number and partition of quadrants.
int p8est_comm_is_boundary(p8est_t *p8est, p4est_locidx_t which_tree, int full_tree[], p8est_quadrant_t *q)
Test whether a quadrant touches the partition or tree boundary.
struct p8est_transfer_context p8est_transfer_context_t
Context data to allow for split begin/end data transfer.
void p8est_comm_parallel_env_release(p8est_t *p8est)
Release MPI communicator if it is owned by p8est.
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.
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.
void p8est_comm_parallel_env_assign(p8est_t *p8est, sc_MPI_Comm mpicomm)
Assign an MPI communicator to p8est; retrieve parallel environment.
void p8est_comm_count_pertree(p8est_t *p8est, p4est_gloidx_t *pertree)
Compute and distribute the cumulative number of quadrants per tree.
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.
void p8est_comm_parallel_env_get_info(p8est_t *p8est)
Retrieve parallel environment information.
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.
int p8est_comm_is_empty_gfp(const p8est_quadrant_t *gfp, int num_procs, int p)
Query whether a processor has no quadrants.
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.
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 c...
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.
void p8est_transfer_end(p8est_transfer_context_t *tc)
Complete any of the transfer_begin functions.
void p8est_transfer_items_end(p8est_transfer_context_t *tc)
Complete a variable-count item transfer between partitions.
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.
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.
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.
void p8est_comm_global_partition(p8est_t *p8est, p8est_quadrant_t *first_quad)
Distribute the global partition boundaries.
void p8est_transfer_custom_end(p8est_transfer_context_t *tc)
Complete a variable-size data transfer between partitions.
int p8est_comm_is_empty_gfq(const p4est_gloidx_t *gfq, int num_procs, int p)
Query whether a processor has no quadrants.
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.
void p8est_comm_parallel_env_duplicate(p8est_t *p8est)
Duplicate MPI communicator and replace the current one by the duplicate.
void p8est_comm_parallel_env_replace(p8est_t *p8est, sc_MPI_Comm mpicomm)
Replace the current MPI communicator by the one provided as input.
int p8est_comm_sync_flag(p8est_t *p8est, int flag, sc_MPI_Op operation)
Evaluates true/false of a flag among processors.
void p8est_transfer_fixed_end(p8est_transfer_context_t *tc)
Complete a fixed-size data transfer between partitions.
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.
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].
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.
unsigned p8est_comm_checksum(p8est_t *p8est, unsigned local_crc, size_t local_bytes)
Compute a parallel partition-independent checksum out of local checksums.
The 3D quadrant (i.e., octant) datatype.
Definition p8est.h:72
Context data to allow for split begin/end data transfer.
Definition p8est_communication.h:305
The p8est forest datatype.
Definition p8est.h:146