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

Make sure that the stack entries in which we will store new data are actually...

Make sure that the stack entries in which we will store new data are actually ready to receive data.
parent 2d219a25
......@@ -596,6 +596,7 @@ void space_do_parts_sort() {
if (jj > i && pivot > min) {
qid = atomic_inc(&space_sort_struct.last) %
space_sort_struct.stack_size;
while (!space_sort_struct.stack[qid].ready);
space_sort_struct.stack[qid].i = i;
space_sort_struct.stack[qid].j = jj;
space_sort_struct.stack[qid].min = min;
......@@ -619,6 +620,7 @@ void space_do_parts_sort() {
if (pivot + 1 < max) {
qid = atomic_inc(&space_sort_struct.last) %
space_sort_struct.stack_size;
while (!space_sort_struct.stack[qid].ready);
space_sort_struct.stack[qid].i = jj + 1;
space_sort_struct.stack[qid].j = j;
space_sort_struct.stack[qid].min = pivot + 1;
......@@ -1175,4 +1177,4 @@ void space_init(struct space *s, double dim[3], struct part *parts, int N,
/* Build the cells and the tasks. */
space_regrid(s, h_max, verbose);
}
}
\ No newline at end of file
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