Skip to content

Commit

Permalink
remove comm_is_empty_gfx
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesbrandt committed Dec 6, 2023
1 parent 9b5486d commit 176b92a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 49 deletions.
15 changes: 0 additions & 15 deletions src/p4est_communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,21 +604,6 @@ p4est_comm_is_empty_gfp (const p4est_quadrant_t *gfp, int num_procs, int p)
return p4est_quadrant_is_equal_piggy (&gfp[p], &gfp[p + 1]);
}

int
p4est_comm_is_empty_gfx (const p4est_gloidx_t *gfq, const p4est_quadrant_t *gfp,
int num_procs, int p)
{
P4EST_ASSERT (gfp != NULL);
P4EST_ASSERT (0 <= p && p < num_procs);

if (gfq != NULL) {
return gfq[p] == gfq[p + 1];
}
else {
return p4est_quadrant_is_equal_piggy (&gfp[p], &gfp[p + 1]);
}
}

int
p4est_comm_is_contained (p4est_t * p4est, p4est_locidx_t which_tree,
const p4est_quadrant_t * q, int rank)
Expand Down
16 changes: 0 additions & 16 deletions src/p4est_communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,6 @@ int p4est_comm_is_empty_gfq (const p4est_gloidx_t *gfq,
int p4est_comm_is_empty_gfp (const p4est_quadrant_t *gfp,
int num_procs, int p);

/** Query whether a processor has no quadrants.
* If \a gfq == NULL, the function uses p4est_quadrant_is_equal on \a gfp, else
* it compares the entries \a p and \a p+1 of \a gfq.
* \param [in] gfq An array encoding the partition offsets in the
* global quadrant array; length \a num_procs + 1.
* \param [in] gfp An array encoding the partition shape.
* Non-decreasing; length \a num_procs + 1.
* \param [in] num_procs Number of processes in the partition.
* \param [in] p Valid 0 <= \a p < \a num_procs.
* \return True if and only if processor \a p is empty.
*/
int p4est_comm_is_empty_gfx (const p4est_gloidx_t *gfq,
const p4est_quadrant_t *gfp,
int num_procs, int p);


/** Test whether a quadrant is fully contained in a rank's owned region.
* This function may return false when \ref p4est_comm_is_owner returns true.
* \param [in] rank Rank whose ownership is tested.
Expand Down
9 changes: 7 additions & 2 deletions src/p4est_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
#endif
#include <sc_search.h>

#define P4EST_COMM_IS_EMPTY_GFQ_GFP(gfq, gfp, num_procs, p) \
(((gfq) != NULL) ? \
p4est_comm_is_empty_gfq ((gfq), (num_procs), (p)) :\
p4est_comm_is_empty_gfp ((gfp), (num_procs), (p)))

/** A callback function that describes the search window.
* The idea is to define the type of an array entry as type 1, if
* my_begin <= array[i], my_end > array[i] and as type 2, if the entry
Expand Down Expand Up @@ -1347,7 +1352,7 @@ p4est_partition_recursion (const p4est_partition_recursion_t * rec,
(rec->gfp, rec->num_procs, rec->num_trees, &child, cpfirst)) {
/* cpfirst starts at the tree's first descendant but may be empty */
P4EST_ASSERT (i > 0);
while (p4est_comm_is_empty_gfx
while (P4EST_COMM_IS_EMPTY_GFQ_GFP
(rec->gfq, rec->gfp, rec->num_procs, cpfirst)) {
++cpfirst;
P4EST_ASSERT (p4est_traverse_type_childid
Expand Down Expand Up @@ -1553,7 +1558,7 @@ void p4est_search_partition_internal
if (p4est_traverse_is_clean_start
(rec->gfp, rec->num_procs, rec->num_trees, &root, pfirst)) {
/* pfirst starts at the tree's first descendant but may be empty */
while (p4est_comm_is_empty_gfx
while (P4EST_COMM_IS_EMPTY_GFQ_GFP
(rec->gfq, rec->gfp, rec->num_procs, pfirst)) {
++pfirst;
P4EST_ASSERT (p4est_traverse_type_tree
Expand Down
1 change: 0 additions & 1 deletion src/p4est_to_p8est.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@
#define p4est_comm_is_empty p8est_comm_is_empty
#define p4est_comm_is_empty_gfq p8est_comm_is_empty_gfq
#define p4est_comm_is_empty_gfp p8est_comm_is_empty_gfp
#define p4est_comm_is_empty_gfx p8est_comm_is_empty_gfx
#define p4est_comm_is_contained p8est_comm_is_contained
#define p4est_comm_is_owner p8est_comm_is_owner
#define p4est_comm_is_owner_gfp p8est_comm_is_owner_gfp
Expand Down
15 changes: 0 additions & 15 deletions src/p8est_communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,6 @@ int p8est_comm_is_empty_gfq (const p4est_gloidx_t *gfq,
int p8est_comm_is_empty_gfp (const p8est_quadrant_t *gfp,
int num_procs, int p);

/** Query whether a processor has no quadrants.
* If \a gfq == NULL, the function uses p4est_quadrant_is_equal on \a gfp, else
* it compares the entries \a p and \a p+1 of \a gfq.
* \param [in] gfq An array encoding the partition offsets in the
* global quadrant array; length \a num_procs + 1.
* \param [in] gfp An array encoding the partition shape.
* Non-decreasing; length \a num_procs + 1.
* \param [in] num_procs Number of processes in the partition.
* \param [in] p Valid 0 <= \a p < \a num_procs.
* \return True if and only if processor \a p is empty.
*/
int p8est_comm_is_empty_gfx (const p4est_gloidx_t *gfq,
const p4est_quadrant_t *gfp,
int num_procs, int p);

/** Test whether a quadrant is fully contained in a rank's owned region.
* This function may return false when \ref p8est_comm_is_owner returns true.
* \param [in] rank Rank whose ownership is tested.
Expand Down

0 comments on commit 176b92a

Please sign in to comment.