p4est 2.8.7.456-de8c6
p4est is a software library for parallel adaptive mesh refinement.
Loading...
Searching...
No Matches
p4est_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 P4EST_COMMUNICATION_H
33#define P4EST_COMMUNICATION_H
34
35#include <p4est.h>
36
37SC_EXTERN_C_BEGIN;
38
52int p4est_bsearch_partition (p4est_gloidx_t target,
53 const p4est_gloidx_t * gfq,
54 int nmemb);
55
62void p4est_comm_parallel_env_assign (p4est_t * p4est,
63 sc_MPI_Comm mpicomm);
64
69void p4est_comm_parallel_env_duplicate (p4est_t * p4est);
70
73void p4est_comm_parallel_env_release (p4est_t * p4est);
74
81void p4est_comm_parallel_env_replace (p4est_t * p4est,
82 sc_MPI_Comm mpicomm);
83
86void p4est_comm_parallel_env_get_info (p4est_t * p4est);
87
92int p4est_comm_parallel_env_is_null (p4est_t * p4est);
93
102int p4est_comm_parallel_env_reduce (p4est_t **
103 p4est_supercomm);
104
122int p4est_comm_parallel_env_reduce_ext (p4est_t **
123 p4est_supercomm,
124 sc_MPI_Group
125 group_add,
126 int add_to_beginning,
127 int **ranks_subcomm);
128
133void p4est_comm_count_quadrants (p4est_t * p4est);
134
143void p4est_comm_global_partition (p4est_t * p4est,
145 first_quad);
146
157void p4est_comm_global_first_quadrant (p4est_gloidx_t
158 global_num_quadrants,
159 int mpisize,
160 p4est_gloidx_t * gfq);
161
168void p4est_comm_count_pertree (p4est_t * p4est,
169 p4est_gloidx_t * pertree);
170
176int p4est_comm_is_empty (p4est_t *p4est, int p);
177
185int p4est_comm_is_empty_gfq (const p4est_gloidx_t *gfq,
186 int num_procs, int p);
187
195int p4est_comm_is_empty_gfp (const p4est_quadrant_t *gfp,
196 int num_procs, int p);
197
204int p4est_comm_is_contained (p4est_t * p4est,
205 p4est_locidx_t which_tree,
206 const p4est_quadrant_t * q,
207 int rank);
208
219int p4est_comm_is_owner (p4est_t *p4est,
220 p4est_locidx_t which_tree,
221 const p4est_quadrant_t *q,
222 int rank);
223
237int p4est_comm_is_owner_gfp
238 (const p4est_quadrant_t *gfp, int num_procs, p4est_topidx_t num_trees,
239 p4est_locidx_t which_tree, const p4est_quadrant_t *q, int rank);
240
246int p4est_comm_find_owner (p4est_t * p4est,
247 p4est_locidx_t which_tree,
248 const p4est_quadrant_t * q,
249 int guess);
250
262void p4est_comm_tree_info (p4est_t * p4est,
263 p4est_locidx_t which_tree,
264 int full_tree[],
265 int tree_contact[],
266 const p4est_quadrant_t ** firstq,
267 const p4est_quadrant_t ** nextq);
268
276int p4est_comm_is_boundary (p4est_t * p4est,
277 p4est_locidx_t which_tree,
278 int full_tree[],
279 p4est_quadrant_t * q);
280
287int p4est_comm_sync_flag (p4est_t * p4est,
288 int flag, sc_MPI_Op operation);
289
299unsigned p4est_comm_checksum (p4est_t * p4est,
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
341void p4est_transfer_fixed (const p4est_gloidx_t * dest_gfq,
342 const p4est_gloidx_t * src_gfq,
343 sc_MPI_Comm mpicomm, int tag,
344 void *dest_data,
345 const void *src_data,
346 size_t data_size);
347
376p4est_transfer_context_t *p4est_transfer_fixed_begin (const p4est_gloidx_t *
377 dest_gfq,
378 const p4est_gloidx_t *
379 src_gfq,
380 sc_MPI_Comm mpicomm,
381 int tag,
382 void *dest_data,
383 const void *src_data,
384 size_t data_size);
385
391void p4est_transfer_fixed_end (p4est_transfer_context_t * tc);
392
434void p4est_transfer_custom (const p4est_gloidx_t * dest_gfq,
435 const p4est_gloidx_t * src_gfq,
436 sc_MPI_Comm mpicomm, int tag,
437 void *dest_data,
438 const int *dest_sizes,
439 const void *src_data,
440 const int *src_sizes);
441
485p4est_transfer_context_t *p4est_transfer_custom_begin (const p4est_gloidx_t *
486 dest_gfq,
487 const p4est_gloidx_t *
488 src_gfq,
489 sc_MPI_Comm mpicomm,
490 int tag,
491 void *dest_data,
492 const int *dest_sizes,
493 const void *src_data,
494 const int *src_sizes);
495
501void p4est_transfer_custom_end (p4est_transfer_context_t * tc);
502
547void p4est_transfer_items
548 (const p4est_gloidx_t * dest_gfq, const p4est_gloidx_t * src_gfq,
549 sc_MPI_Comm mpicomm, int tag,
550 void *dest_data, const int *dest_counts,
551 const void *src_data, const int *src_counts, size_t item_size);
552
560p4est_transfer_context_t *p4est_transfer_items_begin
561 (const p4est_gloidx_t * dest_gfq, const p4est_gloidx_t * src_gfq,
562 sc_MPI_Comm mpicomm, int tag,
563 void *dest_data, const int *dest_counts,
564 const void *src_data, const int *src_counts, size_t item_size);
565
571void p4est_transfer_items_end (p4est_transfer_context_t * tc);
572
582void p4est_transfer_end (p4est_transfer_context_t * tc);
583
584SC_EXTERN_C_END;
585
586#endif /* !P4EST_COMMUNICATION_H */
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
struct p4est_transfer_context p4est_transfer_context_t
Context data to allow for split begin/end data transfer.
The 2D quadrant datatype.
Definition p4est.h:76
Context data to allow for split begin/end data transfer.
Definition p4est_communication.h:305
The p4est forest datatype.
Definition p4est.h:150