p4est  1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p8est_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 P8EST_COMMUNICATION_H
25 #define P8EST_COMMUNICATION_H
26 
27 #include <p8est.h>
28 
29 SC_EXTERN_C_BEGIN;
30 
31 typedef enum
32 {
33  P8EST_COMM_COUNT_PERTREE = 1,
34  P8EST_COMM_BALANCE_FIRST_COUNT,
35  P8EST_COMM_BALANCE_FIRST_LOAD,
36  P8EST_COMM_BALANCE_SECOND_COUNT,
37  P8EST_COMM_BALANCE_SECOND_LOAD,
38  P8EST_COMM_PARTITION_GIVEN,
39  P8EST_COMM_PARTITION_WEIGHTED_LOW,
40  P8EST_COMM_PARTITION_WEIGHTED_HIGH,
41  P8EST_COMM_PARTITION_CORRECTION,
42  P8EST_COMM_GHOST_COUNT,
43  P8EST_COMM_GHOST_LOAD,
44  P8EST_COMM_GHOST_EXCHANGE,
45  P8EST_COMM_GHOST_EXPAND_COUNT,
46  P8EST_COMM_GHOST_EXPAND_LOAD,
47  P8EST_COMM_GHOST_SUPPORT_COUNT,
48  P8EST_COMM_GHOST_SUPPORT_LOAD,
49  P8EST_COMM_GHOST_CHECKSUM,
50  P8EST_COMM_NODES_QUERY,
51  P8EST_COMM_NODES_REPLY,
52  P8EST_COMM_SAVE,
53  P8EST_COMM_LNODES_TEST,
54  P8EST_COMM_LNODES_PASS,
55  P8EST_COMM_LNODES_OWNED,
56  P8EST_COMM_LNODES_ALL
57 }
58 p8est_comm_tag_t;
59 
64 void p8est_comm_count_quadrants (p8est_t * p8est);
65 
74 void p8est_comm_global_partition (p8est_t * p8est,
76  first_quad);
77 
84 void p8est_comm_count_pertree (p8est_t * p8est,
85  p4est_gloidx_t * pertree);
86 
92 int p8est_comm_is_owner (p8est_t * p8est,
93  p4est_locidx_t which_tree,
94  const p8est_quadrant_t * q,
95  int rank);
96 
102 int p8est_comm_find_owner (p8est_t * p8est,
103  p4est_locidx_t which_tree,
104  const p8est_quadrant_t * q,
105  int guess);
106 
117 void p8est_comm_tree_info (p8est_t * p8est,
118  p4est_locidx_t which_tree,
119  int full_tree[],
120  int tree_contact[],
121  const p8est_quadrant_t ** firstq,
122  const p8est_quadrant_t ** nextq);
123 
132 int p8est_comm_neighborhood_owned (p8est_t * p8est,
133  p4est_locidx_t which_tree,
134  int full_tree[],
135  int tree_contact[],
136  p8est_quadrant_t * q);
137 
144 int p8est_comm_sync_flag (p8est_t * p8est,
145  int flag, sc_MPI_Op operation);
146 
153 unsigned p8est_comm_checksum (p8est_t * p8est,
154  unsigned local_crc,
155  size_t local_bytes);
156 
157 SC_EXTERN_C_END;
158 
159 #endif /* !P8EST_COMMUNICATION_H */
The top-level 3D p8est interface.
int64_t p4est_gloidx_t
Typedef for globally unique indexing of quadrants.
Definition: p4est_base.h:84
The 3D quadrant (i.e.
Definition: p8est.h:61
The p8est forest datatype.
Definition: p8est.h:125
int32_t p4est_locidx_t
Typedef for processor-local indexing of quadrants and nodes.
Definition: p4est_base.h:74