Commit 02ae0b6c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

post-merge fixes

parent 12c44561
......@@ -566,6 +566,7 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset,
struct part *parts = c->parts;
struct xpart *xparts = c->xparts;
struct gpart *gparts = c->gparts;
struct spart *sparts = c->sparts;
const double pivot[3] = {c->loc[0] + c->width[0] / 2,
c->loc[1] + c->width[1] / 2,
c->loc[2] + c->width[2] / 2};
......@@ -596,7 +597,7 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset,
const int bid = (parts[k].x[0] > pivot[0]) * 4 +
(parts[k].x[1] > pivot[1]) * 2 + (parts[k].x[2] > pivot[2]);
bucket_count[bid]++;
buff[k] = bid;
buff[k].ind = bid;
}
/* Set the buffer offsets. */
......@@ -610,13 +611,13 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset,
for (int bucket = 0; bucket < 8; bucket++) {
for (int k = bucket_offset[bucket] + bucket_count[bucket];
k < bucket_offset[bucket + 1]; k++) {
int bid = buff[k];
int bid = buff[k].ind;
if (bid != bucket) {
struct part part = parts[k];
struct xpart xpart = xparts[k];
while (bid != bucket) {
int j = bucket_offset[bid] + bucket_count[bid]++;
while (buff[j] == bid) {
while (buff[j].ind == bid) {
j++;
bucket_count[bid]++;
}
......@@ -626,7 +627,7 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset,
}
parts[k] = part;
xparts[k] = xpart;
buff[k] = bid;
buff[k].ind = bid;
}
bucket_count[bid]++;
}
......@@ -734,7 +735,7 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset,
(gparts[k].x[1] > pivot[1]) * 2 +
(gparts[k].x[2] > pivot[2]);
bucket_count[bid]++;
buff[k] = bid;
buff[k].ind = bid;
}
/* Set the buffer offsets. */
......@@ -748,12 +749,12 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset,
for (int bucket = 0; bucket < 8; bucket++) {
for (int k = bucket_offset[bucket] + bucket_count[bucket];
k < bucket_offset[bucket + 1]; k++) {
int bid = buff[k];
int bid = buff[k].ind;
if (bid != bucket) {
struct gpart gpart = gparts[k];
while (bid != bucket) {
int j = bucket_offset[bid] + bucket_count[bid]++;
while (buff[j] == bid) {
while (buff[j].ind == bid) {
j++;
bucket_count[bid]++;
}
......@@ -761,7 +762,7 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, ptrdiff_t sparts_offset,
memswap(&buff[j], &bid, sizeof(int));
}
gparts[k] = gpart;
buff[k] = bid;
buff[k].ind = bid;
}
bucket_count[bid]++;
}
......
......@@ -1840,7 +1840,7 @@ void space_split_recursive(struct space *s, struct cell *c,
temp->count = 0;
temp->gcount = 0;
temp->scount = 0;
temp->ti_old = e->ti_current;
temp->ti_old = c->ti_old;
temp->loc[0] = c->loc[0];
temp->loc[1] = c->loc[1];
temp->loc[2] = c->loc[2];
......
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