Commit 4045669d authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Updated the tests to use the new cell properties for sorting and not the old...

Updated the tests to use the new cell properties for sorting and not the old ones. All tests now run smoothly. Make sure the xparts array actually exist in a cell before reinitialising its particles.
parent 02edec0e
......@@ -461,12 +461,16 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int cleanup,
/* Otherwise, just sort. */
else {
/* Reset the sort distance if we are in a local cell */
/* Reset the sort distance */
if (c->sorted == 0) {
for (int k = 0; k < count; k++) {
xparts[k].x_diff_sort[0] = 0.0f;
xparts[k].x_diff_sort[1] = 0.0f;
xparts[k].x_diff_sort[2] = 0.0f;
/* And the individual sort distances if we are a local cell */
if (xparts != NULL) {
for (int k = 0; k < count; k++) {
xparts[k].x_diff_sort[0] = 0.0f;
xparts[k].x_diff_sort[1] = 0.0f;
xparts[k].x_diff_sort[2] = 0.0f;
}
}
c->dx_max_sort_old = c->dx_max_sort = 0.f;
}
......
......@@ -342,7 +342,6 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h,
cell->sorted = 0;
cell->sort = NULL;
cell->sortsize = 0;
return cell;
}
......@@ -618,7 +617,8 @@ int main(int argc, char *argv[]) {
}
/* First, sort stuff */
for (int j = 0; j < 125; ++j) runner_do_sort(&runner, cells[j], 0x1FFF, 0);
for (int j = 0; j < 125; ++j)
runner_do_sort(&runner, cells[j], 0x1FFF, 0, 0);
/* Do the density calculation */
#if !(defined(MINIMAL_SPH) && defined(WITH_VECTORIZATION))
......
......@@ -180,7 +180,6 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
cell->sorted = 0;
cell->sort = NULL;
cell->sortsize = 0;
return cell;
}
......@@ -423,7 +422,7 @@ int main(int argc, char *argv[]) {
runner_do_drift_part(&runner, cells[i * 9 + j * 3 + k], 0);
runner_do_sort(&runner, cells[i * 9 + j * 3 + k], 0x1FFF, 0);
runner_do_sort(&runner, cells[i * 9 + j * 3 + k], 0x1FFF, 0, 0);
}
}
}
......
......@@ -122,7 +122,6 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
cell->sorted = 0;
cell->sort = NULL;
cell->sortsize = 0;
return cell;
}
......@@ -290,8 +289,8 @@ int main(int argc, char *argv[]) {
for (size_t i = 0; i < type + 1; ++i) offset[i] = 1.;
cj = make_cell(particles, offset, size, h, rho, &partId, perturbation);
runner_do_sort(&runner, ci, 0x1FFF, 0);
runner_do_sort(&runner, cj, 0x1FFF, 0);
runner_do_sort(&runner, ci, 0x1FFF, 0, 0);
runner_do_sort(&runner, cj, 0x1FFF, 0, 0);
time = 0;
for (size_t i = 0; i < runs; ++i) {
......
......@@ -179,7 +179,6 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
cell->sorted = 0;
cell->sort = NULL;
cell->sortsize = 0;
return cell;
}
......@@ -500,7 +499,7 @@ int main(int argc, char *argv[]) {
runner_do_drift_part(&runner, cells[i * (dim * dim) + j * dim + k], 0);
runner_do_sort(&runner, cells[i * (dim * dim) + j * dim + k], 0x1FFF,
runner_do_sort(&runner, cells[i * (dim * dim) + j * dim + k], 0x1FFF, 0,
0);
}
}
......
......@@ -82,7 +82,6 @@ struct cell *make_cell(size_t N, float cellSize, int offset[3], int id_offset) {
cell->sorted = 0;
cell->sort = NULL;
cell->sortsize = 0;
return cell;
}
......
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