t8
1.2.0
t8code is a C library to manage a forest of adaptive space-trees of general element classes in parallel.
|
TODO: document this file. More...
#include "t8_cmesh_offset.h"
Functions | |
t8_gloidx_t | t8_offset_first (int proc, const t8_gloidx_t *offset) |
Return the global id of the first local tree of a given process in a partition. More... | |
t8_gloidx_t | t8_offset_first_tree_to_entry (t8_gloidx_t first_tree, int shared) |
Given the global tree id of the first local tree of a process and the flag whether it is shared or not, compute the entry in the offset array. More... | |
t8_gloidx_t | t8_offset_num_trees (int proc, const t8_gloidx_t *offset) |
The number of trees of a given process in a partition. More... | |
t8_gloidx_t | t8_offset_last (int proc, const t8_gloidx_t *offset) |
Return the last local tree of a given process in a partition. More... | |
int | t8_offset_empty (int proc, const t8_gloidx_t *offset) |
Check whether a given process has no local trees in a given partition. More... | |
int | t8_offset_next_nonempty_rank (int rank, int mpisize, const t8_gloidx_t *offset) |
Find the next higher rank that is not empty. More... | |
int | t8_offset_in_range (t8_gloidx_t tree_id, 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. More... | |
int | t8_offset_any_owner_of_tree (int mpisize, t8_gloidx_t gtree, const t8_gloidx_t *offset) |
Find any process that has a given tree as local tree. More... | |
int | t8_offset_first_owner_of_tree (int mpisize, t8_gloidx_t gtree, const t8_gloidx_t *offset, int *some_owner) |
Find the smallest process that has a given tree as local tree. More... | |
int | t8_offset_next_owner_of_tree (int mpisize, 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 also has this tree as local tree. More... | |
int | t8_offset_prev_owner_of_tree (int mpisize, 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 smaller rank that also has this tree as local tree. More... | |
int | t8_offset_last_owner_of_tree (int mpisize, t8_gloidx_t gtree, const t8_gloidx_t *offset, int *some_owner) |
Find the biggest process that has a given tree as local tree. More... | |
void | t8_offset_all_owners_of_tree (int mpisize, 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. More... | |
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 process (including itself) More... | |
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 ghosts) to a given other process. More... | |
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. More... | |
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 repartitioning setting. More... | |
void | t8_offset_print (t8_shmem_array_t offset, sc_MPI_Comm comm) |
Print an offset array. More... | |
TODO: document this file.
void t8_offset_all_owners_of_tree | ( | int | mpisize, |
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.
[in] | mpisize | The number of MPI ranks, also the number of entries in offset minus 1. |
[in] | gtree | The global index of a tree. |
[in] | offset | The partition to be considered. |
[in,out] | owners | On input an initialized sc_array with integer entries and zero elements. On output a sorted list of all MPI ranks that have gtree as a local tree in offset. |
int t8_offset_any_owner_of_tree | ( | int | mpisize, |
t8_gloidx_t | gtree, | ||
const t8_gloidx_t * | offset | ||
) |
Find any process that has a given tree as local tree.
[in] | mpisize | The number of MPI ranks, also the number of entries in offset minus 1. |
[in] | gtree | The global id of a tree. |
[in] | offset | The partition to be considered. |
int t8_offset_empty | ( | int | proc, |
const t8_gloidx_t * | offset | ||
) |
Check whether a given process has no local trees in a given partition.
[in] | proc | A mpi rank. |
[in] | offset | A partition table. |
t8_gloidx_t t8_offset_first | ( | int | proc, |
const t8_gloidx_t * | offset | ||
) |
Return the global id of the first local tree of a given process in a partition.
[in] | proc | The rank of the process. |
[in] | offset | The partition table. |
int t8_offset_first_owner_of_tree | ( | int | mpisize, |
t8_gloidx_t | gtree, | ||
const t8_gloidx_t * | offset, | ||
int * | some_owner | ||
) |
Find the smallest process that has a given tree as local tree.
To increase the runtime, an arbitrary process having this tree as local tree can be passed as an argument. Otherwise, such an owner is computed during the call.
[in] | mpisize | The number of MPI ranks, also the number of entries in offset minus 1. |
[in] | gtree | The global id of a tree. |
[in] | offset | The partition to be considered. |
[in] | some_owner | If >= 0 considered as input: a process that has gtree as local tree. If < 0 on output a process that has gtree as local tree. Specifying some_owner increases the runtime from O(log mpisize) to O(n), where n is the number of owners of the tree. |
t8_gloidx_t t8_offset_first_tree_to_entry | ( | t8_gloidx_t | first_tree, |
int | shared | ||
) |
Given the global tree id of the first local tree of a process and the flag whether it is shared or not, compute the entry in the offset array.
This entry is the first_tree if it is not shared and -first_tree - 1 if it is shared.
[in] | first_tree | The global tree id of a process's first tree. |
[in] | shared | 0 if first_tree is not shared with a smaller rank, 1 if it is. |
int t8_offset_in_range | ( | t8_gloidx_t | tree_id, |
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.
[in] | tree_id | A global tree id. |
[in] | proc | A mpi rank. |
[in] | offset | A partition table. |
t8_gloidx_t t8_offset_last | ( | int | proc, |
const t8_gloidx_t * | offset | ||
) |
Return the last local tree of a given process in a partition.
[in] | proc | A mpi rank. |
[in] | offset | A partition table. |
int t8_offset_last_owner_of_tree | ( | int | mpisize, |
t8_gloidx_t | gtree, | ||
const t8_gloidx_t * | offset, | ||
int * | some_owner | ||
) |
Find the biggest process that has a given tree as local tree.
To increase the runtime, an arbitrary process having this tree as local tree can be passed as an argument. Otherwise, such an owner is computed during the call.
[in] | mpisize | The number of MPI ranks, also the number of entries in offset minus 1. |
[in] | gtree | The global id of a tree. |
[in] | offset | The partition to be considered. |
[in,out] | some_owner | If >= 0 considered as input: a process that has gtree as local tree. If < 0 on output a process that has gtree as local tree. Specifying some_owner increases the runtime from O(log mpisize) to O(n), where n is the number of owners of the tree. |
int t8_offset_next_nonempty_rank | ( | int | rank, |
int | mpisize, | ||
const t8_gloidx_t * | offset | ||
) |
Find the next higher rank that is not empty.
returns mpisize if this rank does not exist.
[in] | proc | An MPI rank. |
[in] | mpisize | The number of total MPI ranks. |
[in] | offset | An array with at least mpisize + 1 entries. |
int t8_offset_next_owner_of_tree | ( | int | mpisize, |
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 also has this tree as local tree.
[in] | mpisize | The number of MPI ranks, also the number of entries in offset minus 1. |
[in] | gtree | The global id of a tree. |
[in] | offset | The partition to be considered. |
[in] | current_owner | A process that has gtree as local tree. |
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 process (including itself)
[in] | proc | A mpi rank. |
[in] | mpisize | The number of MPI ranks, also the number of entries in offset minus 1. |
[in] | offset_from | The partition table of the current partition. |
[in] | offset_to | The partition table of the next partition. |
t8_gloidx_t t8_offset_num_trees | ( | int | proc, |
const t8_gloidx_t * | offset | ||
) |
The number of trees of a given process in a partition.
[in] | proc | A mpi rank. |
[in] | offset | A partition table. |
int t8_offset_prev_owner_of_tree | ( | int | mpisize, |
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 smaller rank that also has this tree as local tree.
[in] | mpisize | The number of MPI ranks, also the number of entries in offset minus 1. |
[in] | gtree | The global id of a tree. |
[in] | offset | The partition to be considered. |
[in] | current_owner | A process that has gtree as local tree. |
void t8_offset_print | ( | t8_shmem_array_t | offset, |
sc_MPI_Comm | comm | ||
) |
Print an offset array.
Useful for debugging.
[in] | offset | The offset to print |
[in] | comm | An mpi communicator matching the offset size. |
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 repartitioning setting.
[in] | start | The first mpi rank to be considered as sender. |
[in] | end | The last mpi rank to be considered as sender. |
[in] | mpirank | The mpirank to be considered as receiver. |
[in] | offset_from | The partition table of the current partition. |
[in] | offset_to | The partition table of the next partition. |
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 ghosts) to a given other process.
[in] | proca | Mpi rank of the possible sending process. |
[in] | procb | Mpi rank of the possible receiver. |
[in] | offset_from | The partition table of the current partition. |
[in] | offset_to | The partition table of the next partition. |
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.
[in] | proc_send | Mpi rank of the possible sending process. |
[in] | proc_recv | Mpi rank of the possible receiver. |
[in] | gtree | A global tree id. |
[in] | offset_from | The partition table of the current partition. |
[in] | offset_to | The partition table of the next partition. |