Skip to content
Snippets Groups Projects
Commit e5b7288a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Re-ordered the content of the cell structure to save memory.

parent 3e8a929d
Branches
Tags
2 merge requests!688Star formation (non-MPI),!684Add star particles on-the-fly
......@@ -211,12 +211,12 @@ struct cell {
/*! The cell dimensions. */
double width[3];
/*! Linking pointer for "memory management". */
struct cell *next;
/*! Pointers to the next level of cells. */
struct cell *progeny[8];
/*! Linking pointer for "memory management". */
struct cell *next;
/*! Parent cell. */
struct cell *parent;
......@@ -239,18 +239,45 @@ struct cell {
* pair/self tasks */
struct cell *super;
/*! Last (integer) time the cell's part were drifted forward in time. */
integertime_t ti_old_part;
/*! The task computing this cell's sorts. */
struct task *sorts;
/*! Maximum part movement in this cell since last construction. */
float dx_max_part;
/*! The drift task for parts */
struct task *drift;
/*! Maximum particle movement in this cell since the last sort. */
float dx_max_sort;
/*! Linked list of the tasks computing this cell's hydro density. */
struct link *density;
/* Linked list of the tasks computing this cell's hydro gradients. */
struct link *gradient;
/*! Linked list of the tasks computing this cell's hydro forces. */
struct link *force;
/*! Dependency implicit task for the ghost (in->ghost->out)*/
struct task *ghost_in;
/*! Dependency implicit task for the ghost (in->ghost->out)*/
struct task *ghost_out;
/*! The ghost task itself */
struct task *ghost;
/*! The extra ghost task for complex hydro schemes */
struct task *extra_ghost;
/*! Task for cooling */
struct task *cooling;
/*! Task for star formation */
struct task *star_formation;
/*! Max smoothing length in this cell. */
double h_max;
/*! Last (integer) time the cell's part were drifted forward in time. */
integertime_t ti_old_part;
/*! Minimum end of (integer) time step in this cell for hydro tasks. */
integertime_t ti_end_min;
......@@ -261,20 +288,14 @@ struct cell {
*/
integertime_t ti_beg_max;
/*! Nr of #part in this cell. */
int count;
/*! Spin lock for various uses (#part case). */
swift_lock_type lock;
/*! Number of #part updated in this cell. */
int updated;
/*! Number of #part inhibited in this cell. */
int inhibited;
/*! Maximum part movement in this cell since last construction. */
float dx_max_part;
/*! Is the #part data of this cell being used in a sub-cell? */
int hold;
/*! Maximum particle movement in this cell since the last sort. */
float dx_max_sort;
/*! Values of h_max before the drifts, used for sub-cell tasks. */
float h_max_old;
......@@ -285,12 +306,27 @@ struct cell {
/*! Values of dx_max_sort before the drifts, used for sub-cell tasks. */
float dx_max_sort_old;
/*! Nr of #part in this cell. */
int count;
/*! Number of #part updated in this cell. */
int updated;
/*! Number of #part inhibited in this cell. */
int inhibited;
/*! Is the #part data of this cell being used in a sub-cell? */
int hold;
/*! Bit mask of sort directions that will be needed in the next timestep. */
unsigned int requires_sorts;
/*! Bit mask of sorts that need to be computed for this cell. */
unsigned int do_sort;
/*! Bit-mask indicating the sorted directions */
unsigned int sorted;
/*! Does this cell need to be drifted (hydro)? */
char do_drift;
......@@ -300,42 +336,6 @@ struct cell {
/*! Do any of this cell's sub-cells need to be sorted? */
char do_sub_sort;
/*! Bit-mask indicating the sorted directions */
unsigned int sorted;
/*! The task computing this cell's sorts. */
struct task *sorts;
/*! The drift task for parts */
struct task *drift;
/*! Linked list of the tasks computing this cell's hydro density. */
struct link *density;
/* Linked list of the tasks computing this cell's hydro gradients. */
struct link *gradient;
/*! Linked list of the tasks computing this cell's hydro forces. */
struct link *force;
/*! Dependency implicit task for the ghost (in->ghost->out)*/
struct task *ghost_in;
/*! Dependency implicit task for the ghost (in->ghost->out)*/
struct task *ghost_out;
/*! The ghost task itself */
struct task *ghost;
/*! The extra ghost task for complex hydro schemes */
struct task *extra_ghost;
/*! Task for cooling */
struct task *cooling;
/*! Task for star formation */
struct task *star_formation;
#ifdef SWIFT_DEBUG_CHECKS
/*! Last (integer) time the cell's sort arrays were updated. */
......@@ -358,6 +358,33 @@ struct cell {
* tasks */
struct cell *super;
/*! The drift task for gparts */
struct task *drift;
/*! Linked list of the tasks computing this cell's gravity forces. */
struct link *grav;
/*! Linked list of the tasks computing this cell's gravity M-M forces. */
struct link *mm;
/*! The multipole initialistation task */
struct task *init;
/*! Implicit task for the gravity initialisation */
struct task *init_out;
/*! Task computing long range non-periodic gravity interactions */
struct task *long_range;
/*! Implicit task for the down propagation */
struct task *down_in;
/*! Task propagating the mesh forces to the particles */
struct task *mesh;
/*! Task propagating the multipole to the particles */
struct task *down;
/*! Minimum end of (integer) time step in this cell for gravity tasks. */
integertime_t ti_end_min;
......@@ -374,15 +401,15 @@ struct cell {
/*! Last (integer) time the cell's multipole was drifted forward in time. */
integertime_t ti_old_multipole;
/*! Nr of #gpart in this cell. */
int count;
/*! Spin lock for various uses (#gpart case). */
swift_lock_type plock;
/*! Spin lock for various uses (#multipole case). */
swift_lock_type mlock;
/*! Nr of #gpart in this cell. */
int count;
/*! Number of #gpart updated in this cell. */
int updated;
......@@ -395,42 +422,15 @@ struct cell {
/*! Is the #multipole data of this cell being used in a sub-cell? */
int mhold;
/*! Number of M-M tasks that are associated with this cell. */
short int nr_mm_tasks;
/*! Does this cell need to be drifted (gravity)? */
char do_drift;
/*! Do any of this cell's sub-cells need to be drifted (gravity)? */
char do_sub_drift;
/*! The drift task for gparts */
struct task *drift;
/*! Linked list of the tasks computing this cell's gravity forces. */
struct link *grav;
/*! Linked list of the tasks computing this cell's gravity M-M forces. */
struct link *mm;
/*! The multipole initialistation task */
struct task *init;
/*! Implicit task for the gravity initialisation */
struct task *init_out;
/*! Task computing long range non-periodic gravity interactions */
struct task *long_range;
/*! Implicit task for the down propagation */
struct task *down_in;
/*! Task propagating the mesh forces to the particles */
struct task *mesh;
/*! Task propagating the multipole to the particles */
struct task *down;
/*! Number of M-M tasks that are associated with this cell. */
short int nr_mm_tasks;
} grav;
/*! Stars variables */
......@@ -439,12 +439,27 @@ struct cell {
/*! Pointer to the #spart data. */
struct spart *parts;
/*! Nr of #spart in this cell. */
int count;
/*! Dependency implicit task for the star ghost (in->ghost->out)*/
struct task *ghost_in;
/*! Dependency implicit task for the star ghost (in->ghost->out)*/
struct task *ghost_out;
/*! The star ghost task itself */
struct task *ghost;
/*! Linked list of the tasks computing this cell's star density. */
struct link *density;
/*! Max smoothing length in this cell. */
double h_max;
/*! Spin lock for various uses (#spart case). */
swift_lock_type lock;
/*! Nr of #spart in this cell. */
int count;
/*! Values of h_max before the drifts, used for sub-cell tasks. */
float h_max_old;
......@@ -454,18 +469,6 @@ struct cell {
/*! Values of dx_max before the drifts, used for sub-cell tasks. */
float dx_max_part_old;
/*! Dependency implicit task for the star ghost (in->ghost->out)*/
struct task *ghost_in;
/*! Dependency implicit task for the star ghost (in->ghost->out)*/
struct task *ghost_out;
/*! The star ghost task itself */
struct task *ghost;
/*! Linked list of the tasks computing this cell's star density. */
struct link *density;
/*! Number of #spart updated in this cell. */
int updated;
......@@ -475,9 +478,6 @@ struct cell {
/*! Is the #spart data of this cell being used in a sub-cell? */
int hold;
/*! Spin lock for various uses (#spart case). */
swift_lock_type lock;
} stars;
#ifdef WITH_MPI
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment