Commit 1ef92d72 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Add a unique cell ID for all the non top-level cells.

parent b494c6d0
......@@ -182,6 +182,9 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc) {
pc->gcount = c->gcount;
pc->scount = c->scount;
c->tag = pc->tag = atomic_inc(&cell_next_tag) % cell_max_tag;
#ifdef SWIFT_DEBUG_CHECKS
pc->cellID = c->cellID;
#endif
/* Fill in the progeny, depth-first recursion. */
int count = 1;
......@@ -227,6 +230,9 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c,
c->gcount = pc->gcount;
c->scount = pc->scount;
c->tag = pc->tag;
#ifdef SWIFT_DEBUG_CHECKS
c->cellID = pc->cellID;
#endif
/* Number of new cells created. */
int count = 1;
......
......@@ -113,6 +113,11 @@ struct pcell {
/*! Relative indices of the cell's progeny. */
int progeny[8];
#ifdef SWIFT_DEBUG_CHECKS
/* Cell ID (for debugging) */
int cellID;
#endif
} SWIFT_STRUCT_ALIGN;
/**
......@@ -406,6 +411,9 @@ struct cell {
char do_sub_sort;
#ifdef SWIFT_DEBUG_CHECKS
/* Cell ID (for debugging) */
int cellID;
/*! Last (integer) time the cell's sort arrays were updated. */
integertime_t ti_sort;
......
......@@ -64,6 +64,9 @@ int space_subsize_pair = space_subsize_pair_default;
int space_subsize_self = space_subsize_self_default;
int space_subsize_self_grav = space_subsize_self_grav_default;
int space_maxsize = space_maxsize_default;
#ifdef SWIFT_DEBUG_CHECKS
int last_cell_id;
#endif
/**
* @brief Interval stack necessary for parallel particle sorting.
......@@ -463,7 +466,7 @@ void space_regrid(struct space *s, int verbose) {
c->ti_old_part = ti_old;
c->ti_old_gpart = ti_old;
c->ti_old_multipole = ti_old;
if (s->gravity) c->multipole = &s->multipoles_top[cid];
if (s->gravity) c->multipole = &s->multipoles_top[cid];
}
/* Be verbose about the change. */
......@@ -2082,6 +2085,9 @@ void space_split_recursive(struct space *s, struct cell *c,
cp->nodeID = c->nodeID;
cp->parent = c;
cp->super = NULL;
#ifdef SWIFT_DEBUG_CHECKS
cp->cellID = last_cell_id++;
#endif
}
/* Split the cell data. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment