Commit a6aef317 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Align the runner structures on a memory bound.

parent 5c87444c
......@@ -5450,8 +5450,8 @@ void engine_init(struct engine *e, struct space *s,
parser_get_opt_param_int(params, "Scheduler:mpi_message_limit", 4) * 1024;
/* Allocate and init the threads. */
if ((e->runners = (struct runner *)malloc(sizeof(struct runner) *
e->nr_threads)) == NULL)
if (posix_memalign((void *)&e->runners, SWIFT_STRUCT_ALIGNMENT,
e->nr_threads * sizeof(struct runner)) != 0)
error("Failed to allocate threads array.");
for (int k = 0; k < e->nr_threads; k++) {
e->runners[k].id = 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