p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p4est_communication.h
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  Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
8 
9  p4est is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  p4est is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with p4est; if not, write to the Free Software Foundation, Inc.,
21  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23 
24 #ifndef P4EST_COMMUNICATION_H
25 #define P4EST_COMMUNICATION_H
26 
27 #include <p4est.h>
28 
29 SC_EXTERN_C_BEGIN;
30 
31 typedef enum
32 {
33  P4EST_COMM_COUNT_PERTREE = 1,
34  P4EST_COMM_BALANCE_FIRST_COUNT,
35  P4EST_COMM_BALANCE_FIRST_LOAD,
36  P4EST_COMM_BALANCE_SECOND_COUNT,
37  P4EST_COMM_BALANCE_SECOND_LOAD,
38  P4EST_COMM_PARTITION_GIVEN,
39  P4EST_COMM_PARTITION_WEIGHTED_LOW,
40  P4EST_COMM_PARTITION_WEIGHTED_HIGH,
41  P4EST_COMM_PARTITION_CORRECTION,
42  P4EST_COMM_GHOST_COUNT,
43  P4EST_COMM_GHOST_LOAD,
44  P4EST_COMM_GHOST_EXCHANGE,
45  P4EST_COMM_GHOST_EXPAND_COUNT,
46  P4EST_COMM_GHOST_EXPAND_LOAD,
47  P4EST_COMM_GHOST_SUPPORT_COUNT,
48  P4EST_COMM_GHOST_SUPPORT_LOAD,
49  P4EST_COMM_GHOST_CHECKSUM,
50  P4EST_COMM_NODES_QUERY,
51  P4EST_COMM_NODES_REPLY,
52  P4EST_COMM_SAVE,
53  P4EST_COMM_LNODES_TEST,
54  P4EST_COMM_LNODES_PASS,
55  P4EST_COMM_LNODES_OWNED,
56  P4EST_COMM_LNODES_ALL
57 }
58 p4est_comm_tag_t;
59 
64 void p4est_comm_count_quadrants (p4est_t * p4est);
65 
74 void p4est_comm_global_partition (p4est_t * p4est,
76  first_quad);
77 
84 void p4est_comm_count_pertree (p4est_t * p4est,
85  p4est_gloidx_t * pertree);
86 
92 int p4est_comm_is_owner (p4est_t * p4est,
93  p4est_locidx_t which_tree,
94  const p4est_quadrant_t * q,
95  int rank);
96 
102 int p4est_comm_find_owner (p4est_t * p4est,
103  p4est_locidx_t which_tree,
104  const p4est_quadrant_t * q,
105  int guess);
106 
117 void p4est_comm_tree_info (p4est_t * p4est,
118  p4est_locidx_t which_tree,
119  int full_tree[],
120  int tree_contact[],
121  const p4est_quadrant_t ** firstq,
122  const p4est_quadrant_t ** nextq);
123 
132 int p4est_comm_neighborhood_owned (p4est_t * p4est,
133  p4est_locidx_t which_tree,
134  int full_tree[],
135  int tree_contact[],
136  p4est_quadrant_t * q);
137 
144 int p4est_comm_sync_flag (p4est_t * p4est,
145  int flag, sc_MPI_Op operation);
146 
153 unsigned p4est_comm_checksum (p4est_t * p4est,
154  unsigned local_crc,
155  size_t local_bytes);
156 
157 SC_EXTERN_C_END;
158 
159 #endif /* !P4EST_COMMUNICATION_H */
int64_t p4est_gloidx_t
Typedef for globally unique indexing of quadrants.
Definition: p4est_base.h:84
The p4est forest datatype.
Definition: p4est.h:129
The top-level 2D p4est interface.
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:74
The 2D quadrant datatype.
Definition: p4est.h:65