Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!433Correct wrapping of multipoles in FFT task
...@@ -182,6 +182,9 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc) { ...@@ -182,6 +182,9 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc) {
pc->gcount = c->gcount; pc->gcount = c->gcount;
pc->scount = c->scount; pc->scount = c->scount;
c->tag = pc->tag = atomic_inc(&cell_next_tag) % cell_max_tag; 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. */ /* Fill in the progeny, depth-first recursion. */
int count = 1; int count = 1;
...@@ -227,6 +230,9 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c, ...@@ -227,6 +230,9 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c,
c->gcount = pc->gcount; c->gcount = pc->gcount;
c->scount = pc->scount; c->scount = pc->scount;
c->tag = pc->tag; c->tag = pc->tag;
#ifdef SWIFT_DEBUG_CHECKS
c->cellID = pc->cellID;
#endif
/* Number of new cells created. */ /* Number of new cells created. */
int count = 1; int count = 1;
......
...@@ -113,6 +113,11 @@ struct pcell { ...@@ -113,6 +113,11 @@ struct pcell {
/*! Relative indices of the cell's progeny. */ /*! Relative indices of the cell's progeny. */
int progeny[8]; int progeny[8];
#ifdef SWIFT_DEBUG_CHECKS
/* Cell ID (for debugging) */
int cellID;
#endif
} SWIFT_STRUCT_ALIGN; } SWIFT_STRUCT_ALIGN;
/** /**
...@@ -406,6 +411,9 @@ struct cell { ...@@ -406,6 +411,9 @@ struct cell {
char do_sub_sort; char do_sub_sort;
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
/* Cell ID (for debugging) */
int cellID;
/*! Last (integer) time the cell's sort arrays were updated. */ /*! Last (integer) time the cell's sort arrays were updated. */
integertime_t ti_sort; integertime_t ti_sort;
......
...@@ -64,6 +64,9 @@ int space_subsize_pair = space_subsize_pair_default; ...@@ -64,6 +64,9 @@ int space_subsize_pair = space_subsize_pair_default;
int space_subsize_self = space_subsize_self_default; int space_subsize_self = space_subsize_self_default;
int space_subsize_self_grav = space_subsize_self_grav_default; int space_subsize_self_grav = space_subsize_self_grav_default;
int space_maxsize = space_maxsize_default; int space_maxsize = space_maxsize_default;
#ifdef SWIFT_DEBUG_CHECKS
int last_cell_id;
#endif
/** /**
* @brief Interval stack necessary for parallel particle sorting. * @brief Interval stack necessary for parallel particle sorting.
...@@ -463,7 +466,7 @@ void space_regrid(struct space *s, int verbose) { ...@@ -463,7 +466,7 @@ void space_regrid(struct space *s, int verbose) {
c->ti_old_part = ti_old; c->ti_old_part = ti_old;
c->ti_old_gpart = ti_old; c->ti_old_gpart = ti_old;
c->ti_old_multipole = 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. */ /* Be verbose about the change. */
...@@ -2082,6 +2085,9 @@ void space_split_recursive(struct space *s, struct cell *c, ...@@ -2082,6 +2085,9 @@ void space_split_recursive(struct space *s, struct cell *c,
cp->nodeID = c->nodeID; cp->nodeID = c->nodeID;
cp->parent = c; cp->parent = c;
cp->super = NULL; cp->super = NULL;
#ifdef SWIFT_DEBUG_CHECKS
cp->cellID = last_cell_id++;
#endif
} }
/* Split the cell data. */ /* Split the cell data. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment