Commit ccfafcb2 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

add cell_set_super_mapper.

parent 0912571f
......@@ -1889,6 +1889,13 @@ void cell_set_super(struct cell *c, struct cell *super) {
if (c->progeny[k] != NULL) cell_set_super(c->progeny[k], super);
}
void cell_set_super_mapper(void *map_data, int num_elements, void *extra_data) {
for (int ind = 0; ind < num_elements; ind++) {
struct cell *c = &((struct cell *)map_data)[ind];
cell_set_super(c, NULL);
}
}
/**
* @brief Recursively drifts the #part in a cell hierarchy.
*
......
......@@ -404,6 +404,7 @@ void cell_activate_subcell_tasks(struct cell *ci, struct cell *cj,
void cell_activate_drift_part(struct cell *c, struct scheduler *s);
void cell_activate_sorts(struct cell *c, int sid, struct scheduler *s);
void cell_clear_drift_flags(struct cell *c, void *data);
void cell_set_super_mapper(void *map_data, int num_elements, void *extra_data);
/* Inlined functions (for speed). */
......
......@@ -2506,7 +2506,8 @@ void engine_maketasks(struct engine *e) {
/* Now that the self/pair tasks are at the right level, set the super
* pointers. */
for (int k = 0; k < nr_cells; k++) cell_set_super(&cells[k], NULL);
threadpool_map(&e->threadpool, cell_set_super_mapper, cells, nr_cells,
sizeof(struct cell), 0, NULL);
/* Append hierarchical tasks to each cell. */
for (int k = 0; k < nr_cells; k++)
......
Markdown is supported
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