Commit 9470da94 authored by Loic Hausammann's avatar Loic Hausammann
Browse files

Update main code with modification in cell.h

parent c7ee1e42
......@@ -1084,21 +1084,24 @@ int main(int argc, char *argv[]) {
int count = 0;
for (int l = 0; l < e.sched.nr_tasks; l++) {
if (!e.sched.tasks[l].implicit && e.sched.tasks[l].toc != 0) {
fprintf(
file_thread,
" %03i %i %i %i %i %lli %lli %i %i %i %i %lli %i\n", myrank,
e.sched.tasks[l].rid, e.sched.tasks[l].type,
e.sched.tasks[l].subtype, (e.sched.tasks[l].cj == NULL),
e.sched.tasks[l].tic, e.sched.tasks[l].toc,
(e.sched.tasks[l].ci != NULL) ? e.sched.tasks[l].ci->count
: 0,
(e.sched.tasks[l].cj != NULL) ? e.sched.tasks[l].cj->count
: 0,
(e.sched.tasks[l].ci != NULL) ? e.sched.tasks[l].ci->gcount
: 0,
(e.sched.tasks[l].cj != NULL) ? e.sched.tasks[l].cj->gcount
: 0,
e.sched.tasks[l].flags, e.sched.tasks[l].sid);
fprintf(file_thread,
" %03i %i %i %i %i %lli %lli %i %i %i %i %lli %i\n",
myrank, e.sched.tasks[l].rid, e.sched.tasks[l].type,
e.sched.tasks[l].subtype, (e.sched.tasks[l].cj == NULL),
e.sched.tasks[l].tic, e.sched.tasks[l].toc,
(e.sched.tasks[l].ci != NULL)
? e.sched.tasks[l].ci->hydro.count
: 0,
(e.sched.tasks[l].cj != NULL)
? e.sched.tasks[l].cj->hydro.count
: 0,
(e.sched.tasks[l].ci != NULL)
? e.sched.tasks[l].ci->grav.gcount
: 0,
(e.sched.tasks[l].cj != NULL)
? e.sched.tasks[l].cj->grav.gcount
: 0,
e.sched.tasks[l].flags, e.sched.tasks[l].sid);
}
fflush(stdout);
count++;
......@@ -1126,10 +1129,14 @@ int main(int argc, char *argv[]) {
e.sched.tasks[l].rid, e.sched.tasks[l].type,
e.sched.tasks[l].subtype, (e.sched.tasks[l].cj == NULL),
e.sched.tasks[l].tic, e.sched.tasks[l].toc,
(e.sched.tasks[l].ci == NULL) ? 0 : e.sched.tasks[l].ci->count,
(e.sched.tasks[l].cj == NULL) ? 0 : e.sched.tasks[l].cj->count,
(e.sched.tasks[l].ci == NULL) ? 0 : e.sched.tasks[l].ci->gcount,
(e.sched.tasks[l].cj == NULL) ? 0 : e.sched.tasks[l].cj->gcount,
(e.sched.tasks[l].ci == NULL) ? 0
: e.sched.tasks[l].ci->hydro.count,
(e.sched.tasks[l].cj == NULL) ? 0
: e.sched.tasks[l].cj->hydro.count,
(e.sched.tasks[l].ci == NULL) ? 0
: e.sched.tasks[l].ci->grav.gcount,
(e.sched.tasks[l].cj == NULL) ? 0
: e.sched.tasks[l].cj->grav.gcount,
e.sched.tasks[l].sid);
}
}
......
......@@ -39,15 +39,15 @@ __attribute__((always_inline)) INLINE static int cell_are_part_drifted(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_old_part > e->ti_current)
if (c->hydro.ti_old > e->ti_current)
error(
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"and e->ti_current=%lld (t=%e, a=%e)",
c->ti_old_part, c->ti_old_part * e->time_base, e->ti_current,
c->hydro.ti_old, c->hydro.ti_old * e->time_base, e->ti_current,
e->ti_current * e->time_base, e->cosmology->a);
#endif
return (c->ti_old_part == e->ti_current);
return (c->hydro.ti_old == e->ti_current);
}
/**
......@@ -62,15 +62,15 @@ __attribute__((always_inline)) INLINE static int cell_are_gpart_drifted(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_old_gpart > e->ti_current)
if (c->grav.ti_old_gpart > e->ti_current)
error(
"Cell has been drifted too far forward in time! c->ti_old=%lld (t=%e) "
"and e->ti_current=%lld (t=%e)",
c->ti_old_gpart, c->ti_old_gpart * e->time_base, e->ti_current,
e->ti_current * e->time_base);
c->grav.ti_old_gpart, c->grav.ti_old_gpart * e->time_base,
e->ti_current, e->ti_current * e->time_base);
#endif
return (c->ti_old_gpart == e->ti_current);
return (c->grav.ti_old_gpart == e->ti_current);
}
/* Are cells / particles active for regular tasks ? */
......@@ -86,15 +86,15 @@ __attribute__((always_inline)) INLINE static int cell_is_active_hydro(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_hydro_end_min < e->ti_current)
if (c->hydro.ti_end_min < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and "
"e->ti_current=%lld (t=%e, a=%e)",
c->ti_hydro_end_min, c->ti_hydro_end_min * e->time_base, e->ti_current,
c->hydro.ti_end_min, c->hydro.ti_end_min * e->time_base, e->ti_current,
e->ti_current * e->time_base, e->cosmology->a);
#endif
return (c->ti_hydro_end_min == e->ti_current);
return (c->hydro.ti_end_min == e->ti_current);
}
/**
......@@ -108,14 +108,14 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active_hydro(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_hydro_end_max < e->ti_current)
if (c->hydro.ti_end_max < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_max=%lld "
"e->ti_current=%lld",
c->ti_hydro_end_max, e->ti_current);
c->hydro.ti_end_max, e->ti_current);
#endif
return (c->ti_hydro_end_max == e->ti_current);
return (c->hydro.ti_end_max == e->ti_current);
}
/**
......@@ -129,15 +129,15 @@ __attribute__((always_inline)) INLINE static int cell_is_active_gravity(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_gravity_end_min < e->ti_current)
if (c->grav.ti_end_min < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_min=%lld (t=%e) and "
"e->ti_current=%lld (t=%e, a=%e)",
c->ti_gravity_end_min, c->ti_gravity_end_min * e->time_base,
e->ti_current, e->ti_current * e->time_base, e->cosmology->a);
c->grav.ti_end_min, c->grav.ti_end_min * e->time_base, e->ti_current,
e->ti_current * e->time_base, e->cosmology->a);
#endif
return (c->ti_gravity_end_min == e->ti_current);
return (c->grav.ti_end_min == e->ti_current);
}
/**
......@@ -150,7 +150,7 @@ __attribute__((always_inline)) INLINE static int cell_is_active_gravity(
__attribute__((always_inline)) INLINE static int cell_is_active_gravity_mm(
const struct cell *c, const struct engine *e) {
return (c->ti_gravity_end_min == e->ti_current);
return (c->grav.ti_end_min == e->ti_current);
}
/**
......@@ -164,14 +164,14 @@ __attribute__((always_inline)) INLINE static int cell_is_all_active_gravity(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_gravity_end_max < e->ti_current)
if (c->grav.ti_end_max < e->ti_current)
error(
"cell in an impossible time-zone! c->ti_end_max=%lld "
"e->ti_current=%lld",
c->ti_gravity_end_max, e->ti_current);
c->grav.ti_end_max, e->ti_current);
#endif
return (c->ti_gravity_end_max == e->ti_current);
return (c->grav.ti_end_max == e->ti_current);
}
/**
......@@ -290,15 +290,15 @@ __attribute__((always_inline)) INLINE static int cell_is_starting_hydro(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_hydro_beg_max > e->ti_current)
if (c->hydro.ti_beg_max > e->ti_current)
error(
"cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and "
"e->ti_current=%lld (t=%e, a=%e)",
c->ti_hydro_beg_max, c->ti_hydro_beg_max * e->time_base, e->ti_current,
c->hydro.ti_beg_max, c->hydro.ti_beg_max * e->time_base, e->ti_current,
e->ti_current * e->time_base, e->cosmology->a);
#endif
return (c->ti_hydro_beg_max == e->ti_current);
return (c->hydro.ti_beg_max == e->ti_current);
}
/**
......@@ -312,15 +312,15 @@ __attribute__((always_inline)) INLINE static int cell_is_starting_gravity(
const struct cell *c, const struct engine *e) {
#ifdef SWIFT_DEBUG_CHECKS
if (c->ti_gravity_beg_max > e->ti_current)
if (c->grav.ti_beg_max > e->ti_current)
error(
"cell in an impossible time-zone! c->ti_beg_max=%lld (t=%e) and "
"e->ti_current=%lld (t=%e, a=%e)",
c->ti_gravity_beg_max, c->ti_gravity_beg_max * e->time_base,
e->ti_current, e->ti_current * e->time_base, e->cosmology->a);
c->grav.ti_beg_max, c->grav.ti_beg_max * e->time_base, e->ti_current,
e->ti_current * e->time_base, e->cosmology->a);
#endif
return (c->ti_gravity_beg_max == e->ti_current);
return (c->grav.ti_beg_max == e->ti_current);
}
/**
......
......@@ -197,12 +197,12 @@ __attribute__((always_inline)) INLINE void cache_read_particles(
swift_declare_aligned_ptr(float, vy, ci_cache->vy, SWIFT_CACHE_ALIGNMENT);
swift_declare_aligned_ptr(float, vz, ci_cache->vz, SWIFT_CACHE_ALIGNMENT);
const struct part *restrict parts = ci->parts;
const struct part *restrict parts = ci->hydro.parts;
const double loc[3] = {ci->loc[0], ci->loc[1], ci->loc[2]};
/* Shift the particles positions to a local frame so single precision can be
* used instead of double precision. */
for (int i = 0; i < ci->count; i++) {
for (int i = 0; i < ci->hydro.count; i++) {
x[i] = (float)(parts[i].x[0] - loc[0]);
y[i] = (float)(parts[i].x[1] - loc[1]);
z[i] = (float)(parts[i].x[2] - loc[2]);
......@@ -248,7 +248,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
swift_declare_aligned_ptr(float, vy, ci_cache->vy, SWIFT_CACHE_ALIGNMENT);
swift_declare_aligned_ptr(float, vz, ci_cache->vz, SWIFT_CACHE_ALIGNMENT);
const struct part *restrict parts = ci->parts;
const struct part *restrict parts = ci->hydro.parts;
/* The cell is on the right so read the particles
* into the cache from the start of the cell. */
......@@ -258,7 +258,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
const int pad = VEC_SIZE - rem;
/* Increase last_pi if there are particles in the cell left to read. */
if (*last_pi + pad < ci->count) *last_pi += pad;
if (*last_pi + pad < ci->hydro.count) *last_pi += pad;
}
/* Shift the particles positions to a local frame so single precision can be
......@@ -278,11 +278,11 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
const double max_dx = ci->dx_max_part;
const double max_dx = ci->hydro.dx_max;
const float pos_padded[3] = {-(2. * ci->width[0] + max_dx),
-(2. * ci->width[1] + max_dx),
-(2. * ci->width[2] + max_dx)};
const float h_padded = ci->parts[0].h;
const float h_padded = ci->hydro.parts[0].h;
for (int i = *last_pi; i < *last_pi + VEC_SIZE; i++) {
x[i] = pos_padded[0];
......@@ -299,7 +299,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
/* The cell is on the left so read the particles
* into the cache from the end of the cell. */
else {
const int rem = (ci->count - *first_pi) % VEC_SIZE;
const int rem = (ci->hydro.count - *first_pi) % VEC_SIZE;
if (rem != 0) {
const int pad = VEC_SIZE - rem;
......@@ -307,7 +307,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
if (*first_pi - pad >= 0) *first_pi -= pad;
}
const int ci_cache_count = ci->count - *first_pi;
const int ci_cache_count = ci->hydro.count - *first_pi;
/* Shift the particles positions to a local frame so single precision can be
* used instead of double precision. */
......@@ -326,14 +326,14 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
const double max_dx = ci->dx_max_part;
const double max_dx = ci->hydro.dx_max;
const float pos_padded[3] = {-(2. * ci->width[0] + max_dx),
-(2. * ci->width[1] + max_dx),
-(2. * ci->width[2] + max_dx)};
const float h_padded = ci->parts[0].h;
const float h_padded = ci->hydro.parts[0].h;
for (int i = ci->count - *first_pi; i < ci->count - *first_pi + VEC_SIZE;
i++) {
for (int i = ci->hydro.count - *first_pi;
i < ci->hydro.count - *first_pi + VEC_SIZE; i++) {
x[i] = pos_padded[0];
y[i] = pos_padded[1];
z[i] = pos_padded[2];
......@@ -382,12 +382,12 @@ __attribute__((always_inline)) INLINE void cache_read_force_particles(
swift_declare_aligned_ptr(float, soundspeed, ci_cache->soundspeed,
SWIFT_CACHE_ALIGNMENT);
const struct part *restrict parts = ci->parts;
const struct part *restrict parts = ci->hydro.parts;
const double loc[3] = {ci->loc[0], ci->loc[1], ci->loc[2]};
/* Shift the particles positions to a local frame so single precision can be
* used instead of double precision. */
for (int i = 0; i < ci->count; i++) {
for (int i = 0; i < ci->hydro.count; i++) {
x[i] = (float)(parts[i].x[0] - loc[0]);
y[i] = (float)(parts[i].x[1] - loc[1]);
z[i] = (float)(parts[i].x[2] - loc[2]);
......@@ -433,7 +433,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
* cache. */
/* Is the number of particles to read a multiple of the vector size? */
int rem = (ci->count - *first_pi) % VEC_SIZE;
int rem = (ci->hydro.count - *first_pi) % VEC_SIZE;
if (rem != 0) {
int pad = VEC_SIZE - rem;
......@@ -446,14 +446,14 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
int pad = VEC_SIZE - rem;
/* Increase last_pj if there are particles in the cell left to read. */
if (*last_pj + pad < cj->count) *last_pj += pad;
if (*last_pj + pad < cj->hydro.count) *last_pj += pad;
}
/* Get some local pointers */
const int first_pi_align = *first_pi;
const int last_pj_align = *last_pj;
const struct part *restrict parts_i = ci->parts;
const struct part *restrict parts_j = cj->parts;
const struct part *restrict parts_i = ci->hydro.parts;
const struct part *restrict parts_j = cj->hydro.parts;
/* Shift particles to the local frame and account for boundary conditions.*/
const double total_ci_shift[3] = {
......@@ -471,7 +471,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
swift_declare_aligned_ptr(float, vy, ci_cache->vy, SWIFT_CACHE_ALIGNMENT);
swift_declare_aligned_ptr(float, vz, ci_cache->vz, SWIFT_CACHE_ALIGNMENT);
int ci_cache_count = ci->count - first_pi_align;
int ci_cache_count = ci->hydro.count - first_pi_align;
/* Shift the particles positions to a local frame (ci frame) so single
* precision can be used instead of double precision. */
......@@ -491,11 +491,11 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
#ifdef SWIFT_DEBUG_CHECKS
const float shift_threshold_x =
2. * ci->width[0] + 2. * max(ci->dx_max_part, cj->dx_max_part);
2. * ci->width[0] + 2. * max(ci->hydro.dx_max, cj->hydro.dx_max);
const float shift_threshold_y =
2. * ci->width[1] + 2. * max(ci->dx_max_part, cj->dx_max_part);
2. * ci->width[1] + 2. * max(ci->hydro.dx_max, cj->hydro.dx_max);
const float shift_threshold_z =
2. * ci->width[2] + 2. * max(ci->dx_max_part, cj->dx_max_part);
2. * ci->width[2] + 2. * max(ci->hydro.dx_max, cj->hydro.dx_max);
/* Make sure that particle positions have been shifted correctly. */
for (int i = 0; i < ci_cache_count; i++) {
......@@ -529,14 +529,14 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
const double max_dx = max(ci->dx_max_part, cj->dx_max_part);
const double max_dx = max(ci->hydro.dx_max, cj->hydro.dx_max);
const float pos_padded[3] = {-(2. * ci->width[0] + max_dx),
-(2. * ci->width[1] + max_dx),
-(2. * ci->width[2] + max_dx)};
const float h_padded = ci->parts[0].h;
const float h_padded = ci->hydro.parts[0].h;
for (int i = ci->count - first_pi_align;
i < ci->count - first_pi_align + VEC_SIZE; i++) {
for (int i = ci->hydro.count - first_pi_align;
i < ci->hydro.count - first_pi_align + VEC_SIZE; i++) {
x[i] = pos_padded[0];
y[i] = pos_padded[1];
z[i] = pos_padded[2];
......@@ -609,7 +609,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
const float pos_padded_j[3] = {-(2. * cj->width[0] + max_dx),
-(2. * cj->width[1] + max_dx),
-(2. * cj->width[2] + max_dx)};
const float h_padded_j = cj->parts[0].h;
const float h_padded_j = cj->hydro.parts[0].h;
for (int i = last_pj_align + 1; i < last_pj_align + 1 + VEC_SIZE; i++) {
xj[i] = pos_padded_j[0];
......@@ -650,7 +650,7 @@ cache_read_two_partial_cells_sorted_force(
* cache. */
/* Is the number of particles to read a multiple of the vector size? */
int rem = (ci->count - *first_pi) % VEC_SIZE;
int rem = (ci->hydro.count - *first_pi) % VEC_SIZE;
if (rem != 0) {
int pad = VEC_SIZE - rem;
......@@ -663,14 +663,14 @@ cache_read_two_partial_cells_sorted_force(
int pad = VEC_SIZE - rem;
/* Increase last_pj if there are particles in the cell left to read. */
if (*last_pj + pad < cj->count) *last_pj += pad;
if (*last_pj + pad < cj->hydro.count) *last_pj += pad;
}
/* Get some local pointers */
const int first_pi_align = *first_pi;
const int last_pj_align = *last_pj;
const struct part *restrict parts_i = ci->parts;
const struct part *restrict parts_j = cj->parts;
const struct part *restrict parts_i = ci->hydro.parts;
const struct part *restrict parts_j = cj->hydro.parts;
/* Shift particles to the local frame and account for boundary conditions.*/
const double total_ci_shift[3] = {
......@@ -697,7 +697,7 @@ cache_read_two_partial_cells_sorted_force(
swift_declare_aligned_ptr(float, soundspeed, ci_cache->soundspeed,
SWIFT_CACHE_ALIGNMENT);
int ci_cache_count = ci->count - first_pi_align;
int ci_cache_count = ci->hydro.count - first_pi_align;
/* Shift the particles positions to a local frame (ci frame) so single
* precision can be used instead of double precision. */
for (int i = 0; i < ci_cache_count; i++) {
......@@ -723,14 +723,14 @@ cache_read_two_partial_cells_sorted_force(
/* Pad cache with fake particles that exist outside the cell so will not
* interact. We use values of the same magnitude (but negative!) as the real
* particles to avoid overflow problems. */
const double max_dx = max(ci->dx_max_part, cj->dx_max_part);
const double max_dx = max(ci->hydro.dx_max, cj->hydro.dx_max);
const float pos_padded[3] = {-(2. * ci->width[0] + max_dx),
-(2. * ci->width[1] + max_dx),
-(2. * ci->width[2] + max_dx)};
const float h_padded = ci->parts[0].h;
const float h_padded = ci->hydro.parts[0].h;
for (int i = ci->count - first_pi_align;
i < ci->count - first_pi_align + VEC_SIZE; i++) {
for (int i = ci->hydro.count - first_pi_align;
i < ci->hydro.count - first_pi_align + VEC_SIZE; i++) {
x[i] = pos_padded[0];
y[i] = pos_padded[1];
z[i] = pos_padded[2];
......@@ -791,7 +791,7 @@ cache_read_two_partial_cells_sorted_force(
const float pos_padded_j[3] = {-(2. * cj->width[0] + max_dx),
-(2. * cj->width[1] + max_dx),
-(2. * cj->width[2] + max_dx)};
const float h_padded_j = cj->parts[0].h;
const float h_padded_j = cj->hydro.parts[0].h;
for (int i = last_pj_align + 1; i < last_pj_align + 1 + VEC_SIZE; i++) {
xj[i] = pos_padded_j[0];
......
......@@ -97,7 +97,7 @@ int cell_getsize(struct cell *c) {
*/
int cell_link_parts(struct cell *c, struct part *parts) {
c->parts = parts;
c->hydro.parts = parts;
/* Fill the progeny recursively, depth-first. */
if (c->split) {
......@@ -109,7 +109,7 @@ int cell_link_parts(struct cell *c, struct part *parts) {
}
/* Return the total number of linked particles. */
return c->count;
return c->hydro.count;
}
/**
......@@ -122,7 +122,7 @@ int cell_link_parts(struct cell *c, struct part *parts) {
*/
int cell_link_gparts(struct cell *c, struct gpart *gparts) {
c->gparts = gparts;
c->grav.gparts = gparts;
/* Fill the progeny recursively, depth-first. */
if (c->split) {
......@@ -134,7 +134,7 @@ int cell_link_gparts(struct cell *c, struct gpart *gparts) {
}
/* Return the total number of linked particles. */
return c->gcount;
return c->grav.gcount;
}
/**
......@@ -179,31 +179,31 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc,
#ifdef WITH_MPI
/* Start by packing the data of the current cell. */
pc->h_max = c->h_max;
pc->ti_hydro_end_min = c->ti_hydro_end_min;
pc->ti_hydro_end_max = c->ti_hydro_end_max;
pc->ti_gravity_end_min = c->ti_gravity_end_min;
pc->ti_gravity_end_max = c->ti_gravity_end_max;
pc->ti_old_part = c->ti_old_part;
pc->ti_old_gpart = c->ti_old_gpart;
pc->ti_old_multipole = c->ti_old_multipole;
pc->count = c->count;
pc->gcount = c->gcount;
pc->hydro.h_max = c->hydro.h_max;
pc->hydro.ti_end_min = c->hydro.ti_end_min;
pc->hydro.ti_end_max = c->hydro.ti_end_max;
pc->grav.ti_end_min = c->grav.ti_end_min;
pc->grav.ti_end_max = c->grav.ti_end_max;
pc->hydro.ti_old = c->hydro.ti_old;
pc->grav.ti_old_gpart = c->grav.ti_old_gpart;
pc->grav.ti_old_multipole = c->grav.ti_old_multipole;
pc->hydro.count = c->hydro.count;
pc->grav.gcount = c->grav.gcount;
pc->scount = c->scount;
/* Copy the Multipole related information */
if (with_gravity) {
const struct gravity_tensors *mp = c->multipole;
const struct gravity_tensors *mp = c->grav.multipole;
pc->m_pole = mp->m_pole;
pc->CoM[0] = mp->CoM[0];
pc->CoM[1] = mp->CoM[1];
pc->CoM[2] = mp->CoM[2];
pc->CoM_rebuild[0] = mp->CoM_rebuild[0];
pc->CoM_rebuild[1] = mp->CoM_rebuild[1];
pc->CoM_rebuild[2] = mp->CoM_rebuild[2];
pc->r_max = mp->r_max;
pc->r_max_rebuild = mp->r_max_rebuild;
pc->grav.m_pole = mp->m_pole;
pc->grav.CoM[0] = mp->CoM[0];
pc->grav.CoM[1] = mp->CoM[1];
pc->grav.CoM[2] = mp->CoM[2];
pc->grav.CoM_rebuild[0] = mp->CoM_rebuild[0];
pc->grav.CoM_rebuild[1] = mp->CoM_rebuild[1];
pc->grav.CoM_rebuild[2] = mp->CoM_rebuild[2];
pc->grav.r_max = mp->r_max;
pc->grav.r_max_rebuild = mp->r_max_rebuild;
}
#ifdef SWIFT_DEBUG_CHECKS
......@@ -221,7 +221,7 @@ int cell_pack(struct cell *restrict c, struct pcell *restrict pc,
}
/* Return the number of packed cells used. */
c->pcell_size = count;
c->mpi.pcell_size = count;
return count;
#else
......@@ -243,7 +243,7 @@ int cell_pack_tags(const struct cell *c, int *tags) {
#ifdef WITH_MPI
/* Start by packing the data of the current cell. */
tags[0] = c->tag;
tags[0] = c->mpi.tag;
/* Fill in the progeny, depth-first recursion. */
int count = 1;
......@@ -252,7 +252,7 @@ int cell_pack_tags(const struct cell *c, int *tags) {
count += cell_pack_tags(c->progeny[k], &tags[count]);
#ifdef SWIFT_DEBUG_CHECKS
if (c->pcell_size != count) error("Inconsistent tag and pcell count!");
if (c->mpi.pcell_size != count) error("Inconsistent tag and pcell count!");
#endif // SWIFT_DEBUG_CHECKS
/* Return the number of packed tags used. */
......@@ -281,16 +281,16 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c,
#ifdef WITH_MPI
/* Unpack the current pcell. */
c->h_max = pc->h_max;
c->ti_hydro_end_min = pc->ti_hydro_end_min;
c->ti_hydro_end_max = pc->ti_hydro_end_max;
c->ti_gravity_end_min = pc->ti_gravity_end_min;
c->ti_gravity_end_max = pc->ti_gravity_end_max;
c->ti_old_part = pc->ti_old_part;
c->ti_old_gpart = pc->ti_old_gpart;
c->ti_old_multipole = pc->ti_old_multipole;
c->count = pc->count;
c->gcount = pc->gcount;
c->hydro.h_max = pc->hydro.h_max;
c->hydro.ti_end_min = pc->hydro.ti_end_min;
c->hydro.ti_end_max = pc->hydro.ti_end_max;
c->grav.ti_end_min = pc->grav.ti_end_min;
c->grav.ti_end_max = pc->grav.ti_end_max;
c->hydro.ti_old = pc->hydro.ti_old;
c->grav.ti_old_gpart = pc->grav.ti_old_gpart;
c->grav.ti_old_multipole = pc->grav.ti_old_multipole;
c->hydro.count = pc->hydro.count;
c->grav.gcount = pc->grav.gcount;
c->scount = pc->scount;
#ifdef SWIFT_DEBUG_CHECKS
c->cellID = pc->cellID;
......@@ -299,17 +299,17 @@ int cell_unpack(struct pcell *restrict pc, struct cell *restrict c,
/* Copy the Multipole related information */
if (with_gravity) {