t8  UNKNOWN
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
t8_cmesh_offset.h
Go to the documentation of this file.
1 /*
2  This file is part of t8code.
3  t8code is a C library to manage a collection (a forest) of multiple
4  connected adaptive space-trees of general element classes in parallel.
5 
6  Copyright (C) 2015 the developers
7 
8  t8code is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  t8code is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with t8code; if not, write to the Free Software Foundation, Inc.,
20  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 */
22 
31 #ifndef T8_CMESH_OFFSET_H
32 #define T8_CMESH_OFFSET_H
33 
34 #include <t8.h>
35 #include <t8_cmesh.h>
36 
37 T8_EXTERN_C_BEGIN ();
38 
47 t8_offset_first (const int proc, const t8_gloidx_t *offset);
48 
61 t8_offset_first_tree_to_entry (const t8_gloidx_t first_tree, const int shared);
62 
70 t8_offset_num_trees (const int proc, const t8_gloidx_t *offset);
71 
79 t8_offset_last (const int proc, const t8_gloidx_t *offset);
80 
87 int
88 t8_offset_empty (const int proc, const t8_gloidx_t *offset);
89 
101 int
102 t8_offset_next_nonempty_rank (const int rank, const int mpisize, const t8_gloidx_t *offset);
103 
104 #if T8_ENABLE_DEBUG
118 int
119 t8_offset_consistent (const int mpisize, const t8_shmem_array_t offset_shmem, const t8_gloidx_t num_trees);
120 #endif
121 
130 int
131 t8_offset_in_range (const t8_gloidx_t tree_id, const int proc, const t8_gloidx_t *offset);
132 
139 int
140 t8_offset_any_owner_of_tree (const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset);
141 
149 int
150 t8_offset_any_owner_of_tree_ext (const int mpisize, const int start_proc, const t8_gloidx_t gtree,
151  const t8_gloidx_t *offset);
152 
166 int
167 t8_offset_first_owner_of_tree (const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, int *some_owner);
168 
182 int
183 t8_offset_last_owner_of_tree (const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, int *some_owner);
184 
195 int
196 t8_offset_next_owner_of_tree (const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, int current_owner);
197 
208 int
209 t8_offset_prev_owner_of_tree (const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset,
210  const int current_owner);
211 
220 void
221 t8_offset_all_owners_of_tree (const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset,
222  sc_array_t *owners);
223 
234 int
235 t8_offset_nosend (int proc, int mpisize, const t8_gloidx_t *offset_from, const t8_gloidx_t *offset_to);
236 
247 int
248 t8_offset_sendsto (int proca, int procb, const t8_gloidx_t *t8_offset_from, const t8_gloidx_t *t8_offset_to);
249 
263 int
264 t8_offset_sendstree (int proc_send, int proc_to, t8_gloidx_t gtree, const t8_gloidx_t *offset_from,
265  const t8_gloidx_t *offset_to);
266 
278 int
279 t8_offset_range_send (int start, int end, int mpirank, const t8_gloidx_t *offset_from, const t8_gloidx_t *offset_to);
280 
285 void
286 t8_offset_print (t8_shmem_array_t offset, sc_MPI_Comm comm);
287 
288 T8_EXTERN_C_END ();
289 
290 #endif /* !T8_CMESH_OFFSET_H */
Shared memory array structure.
Definition: t8_shmem.c:35
This is the administrative header file for t8code.
int64_t t8_gloidx_t
A type for global indexing that holds really big numbers.
Definition: t8.h:100
We define the coarse mesh of trees in this file.
int t8_offset_last_owner_of_tree(const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, int *some_owner)
Find the biggest process that has a given tree as local tree.
Definition: t8_cmesh_offset.c:290
int t8_offset_next_nonempty_rank(const int rank, const int mpisize, const t8_gloidx_t *offset)
Find the next higher rank that is not empty.
Definition: t8_cmesh_offset.c:109
int t8_offset_prev_owner_of_tree(const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, const int current_owner)
Given a process current_owner that has the tree gtree as local tree, find the next smaller rank that ...
Definition: t8_cmesh_offset.c:280
t8_gloidx_t t8_offset_first(const int proc, const t8_gloidx_t *offset)
Return the global id of the first local tree of a given process in a partition.
Definition: t8_cmesh_offset.c:40
int t8_offset_sendstree(int proc_send, int proc_to, t8_gloidx_t gtree, const t8_gloidx_t *offset_from, const t8_gloidx_t *offset_to)
Query whether in a repartitioning setting, a given process sends a given tree to a second process.
Definition: t8_cmesh_offset.c:476
int t8_offset_any_owner_of_tree_ext(const int mpisize, const int start_proc, const t8_gloidx_t gtree, const t8_gloidx_t *offset)
Find any process that has a given tree as local tree.
Definition: t8_cmesh_offset.c:166
int t8_offset_any_owner_of_tree(const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset)
Find any process that has a given tree as local tree.
Definition: t8_cmesh_offset.c:195
int t8_offset_range_send(int start, int end, int mpirank, const t8_gloidx_t *offset_from, const t8_gloidx_t *offset_to)
Count the number of processes in a given range [a,b] that send to a given other process in a repartit...
Definition: t8_cmesh_offset.c:512
int t8_offset_consistent(const int mpisize, const t8_shmem_array_t offset_shmem, const t8_gloidx_t num_trees)
Check whether a given offset array represents a valid partition.
Definition: t8_cmesh_offset.c:123
int t8_offset_nosend(int proc, int mpisize, const t8_gloidx_t *offset_from, const t8_gloidx_t *offset_to)
Query whether in a repartition setting a given process does send any of its local trees to any other ...
Definition: t8_cmesh_offset.c:364
int t8_offset_next_owner_of_tree(const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, int current_owner)
Given a process current_owner that has the tree gtree as local tree, find the next bigger rank that a...
Definition: t8_cmesh_offset.c:269
int t8_offset_empty(const int proc, const t8_gloidx_t *offset)
Check whether a given process has no local trees in a given partition.
Definition: t8_cmesh_offset.c:95
int t8_offset_in_range(const t8_gloidx_t tree_id, const int proc, const t8_gloidx_t *offset)
Determine whether a given global tree id is a local tree of a given process in a certain partition.
Definition: t8_cmesh_offset.c:160
int t8_offset_first_owner_of_tree(const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, int *some_owner)
Find the smallest process that has a given tree as local tree.
Definition: t8_cmesh_offset.c:204
void t8_offset_all_owners_of_tree(const int mpisize, const t8_gloidx_t gtree, const t8_gloidx_t *offset, sc_array_t *owners)
Compute a list of all processes that own a specific tree.n offset minus 1.
Definition: t8_cmesh_offset.c:332
void t8_offset_print(t8_shmem_array_t offset, sc_MPI_Comm comm)
Print an offset array.
Definition: t8_cmesh_offset.c:525
t8_gloidx_t t8_offset_last(const int proc, const t8_gloidx_t *offset)
Return the last local tree of a given process in a partition.
Definition: t8_cmesh_offset.c:73
int t8_offset_sendsto(int proca, int procb, const t8_gloidx_t *t8_offset_from, const t8_gloidx_t *t8_offset_to)
Query whether in a repartitioning setting, a given process sends local trees (and then possibly ghost...
Definition: t8_cmesh_offset.c:432
t8_gloidx_t t8_offset_first_tree_to_entry(const t8_gloidx_t first_tree, const int shared)
Given the global tree id of the first local tree of a process and the flag whether it is shared or no...
Definition: t8_cmesh_offset.c:53
t8_gloidx_t t8_offset_num_trees(const int proc, const t8_gloidx_t *offset)
The number of trees of a given process in a partition.
Definition: t8_cmesh_offset.c:60