Commit 3e9fef1b authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

rename cell_tag to cell_ensure_tagged, it's a bit more descriptive.

parent 54e66abc
......@@ -344,6 +344,7 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c,
c->split = 1;
count += cell_unpack(&pc[pc->progeny[k]], temp, s, with_gravity);
}
c->split = (count > 1);
/* Return the total number of unpacked cells. */
c->mpi.pcell_size = count;
......@@ -3160,7 +3161,7 @@ void cell_set_super_mapper(void *map_data, int num_elements, void *extra_data) {
/* All top-level cells get an MPI tag. */
#ifdef WITH_MPI
if (c->mpi.tag < 0 && c->mpi.sendto) cell_tag(c);
if (c->mpi.sendto) cell_ensure_tagged(c);
#endif
/* Super-pointer for hydro */
......
......@@ -850,13 +850,9 @@ __attribute__((always_inline)) INLINE static int cell_need_rebuild_for_pair(
*
* @param c The #cell to tag.
*/
__attribute__((always_inline)) INLINE static void cell_tag(struct cell *c) {
__attribute__((always_inline)) INLINE static void cell_ensure_tagged(struct cell *c) {
#ifdef WITH_MPI
#ifdef SWIFT_DEBUG_CHECKS
if (c->mpi.tag > 0) error("setting tag for already tagged cell");
#endif
lock_lock(&c->hydro.lock);
if (c->mpi.tag < 0 &&
(c->mpi.tag = atomic_inc(&cell_next_tag)) > cell_max_tag)
......
......@@ -1497,7 +1497,7 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
if (t_xv == NULL) {
/* Make sure this cell is tagged. */
cell_tag(ci);
cell_ensure_tagged(ci);
t_xv = scheduler_addtask(s, task_type_send, task_subtype_xv, ci->mpi.tag,
0, ci, cj);
......@@ -1589,7 +1589,7 @@ void engine_addtasks_send_gravity(struct engine *e, struct cell *ci,
if (t_grav == NULL) {
/* Make sure this cell is tagged. */
cell_tag(ci);
cell_ensure_tagged(ci);
t_grav = scheduler_addtask(s, task_type_send, task_subtype_gpart,
ci->mpi.tag, 0, ci, cj);
......@@ -1652,7 +1652,7 @@ void engine_addtasks_send_timestep(struct engine *e, struct cell *ci,
if (t_ti == NULL) {
/* Make sure this cell is tagged. */
cell_tag(ci);
cell_ensure_tagged(ci);
t_ti = scheduler_addtask(s, task_type_send, task_subtype_tend,
ci->mpi.tag, 0, ci, cj);
......
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