Commit f96fb228 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'master' into gizmo_fix

parents cf57807a 0b3df5fe
......@@ -15,25 +15,26 @@ Usage: swift [OPTION]... PARAMFILE
swift_mpi [OPTION]... PARAMFILE
Valid options are:
-a Pin runners using processor affinity
-c Run with cosmological time integration
-C Run with cooling
-a Pin runners using processor affinity.
-c Run with cosmological time integration.
-C Run with cooling.
-d Dry run. Read the parameter file, allocate memory but does not read
the particles from ICs and exit before the start of time integration.
Allows user to check validy of parameter and IC files as well as memory limits.
-D Always drift all particles even the ones far from active particles.
-e Enable floating-point exceptions (debugging mode)
-f {int} Overwrite the CPU frequency (Hz) to be used for time measurements
-g Run with an external gravitational potential
-G Run with self-gravity
-D Always drift all particles even the ones far from active particles. This emulates
Gadget-[23] and GIZMO's default behaviours.
-e Enable floating-point exceptions (debugging mode).
-f {int} Overwrite the CPU frequency (Hz) to be used for time measurements.
-g Run with an external gravitational potential.
-G Run with self-gravity.
-n {int} Execute a fixed number of time steps. When unset use the time_end parameter to stop.
-s Run with SPH
-S Run with stars
-s Run with hydrodynamics.
-S Run with stars.
-t {int} The number of threads to use on each MPI rank. Defaults to 1 if not specified.
-v [12] Increase the level of verbosity
1: MPI-rank 0 writes
2: All MPI-ranks write
-y {int} Time-step frequency at which task graphs are dumped
-h Print this help message and exit
-y {int} Time-step frequency at which task graphs are dumped.
-h Print this help message and exit.
See the file examples/parameter_example.yml for an example of parameter file.
......@@ -200,6 +200,20 @@ if test "$enable_debugging_checks" = "yes"; then
AC_DEFINE([SWIFT_DEBUG_CHECKS],1,[Enable expensive debugging])
fi
# Check if gravity force checks are on for some particles.
AC_ARG_ENABLE([gravity-force-checks],
[AS_HELP_STRING([--enable-gravity-force-checks],
[Activate expensive brute-force gravity checks for a fraction 1/N of all particles @<:@N@:>@]
)],
[gravity_force_checks="$enableval"],
[gravity_force_checks="no"]
)
if test "$gravity_force_checks" == "yes"; then
AC_MSG_ERROR(Need to specify the fraction of particles to check when using --enable-gravity-force-checks!)
elif test "$gravity_force_checks" != "no"; then
AC_DEFINE_UNQUOTED([SWIFT_GRAVITY_FORCE_CHECKS], [$enableval] ,[Enable gravity brute-force checks])
fi
# Define HAVE_POSIX_MEMALIGN if it works.
AX_FUNC_POSIX_MEMALIGN
......@@ -637,13 +651,13 @@ AC_ARG_WITH([hydro-dimension],
)
case "$with_dimension" in
1)
AC_DEFINE([HYDRO_DIMENSION_1D], [1], [1D analysis])
AC_DEFINE([HYDRO_DIMENSION_1D], [1], [1D solver])
;;
2)
AC_DEFINE([HYDRO_DIMENSION_2D], [2], [2D analysis])
AC_DEFINE([HYDRO_DIMENSION_2D], [2], [2D solver])
;;
3)
AC_DEFINE([HYDRO_DIMENSION_3D], [3], [3D analysis])
AC_DEFINE([HYDRO_DIMENSION_3D], [3], [3D solver])
;;
*)
AC_MSG_ERROR([Dimensionality must be 1, 2 or 3])
......@@ -824,8 +838,10 @@ AC_MSG_RESULT([
Riemann solver : $with_riemann
Cooling function : $with_cooling
External potential : $with_potential
Task debugging : $enable_task_debugging
Debugging checks : $enable_debugging_checks
Gravity checks : $gravity_force_checks
])
# Make sure the latest git revision string gets included
......
......@@ -57,9 +57,9 @@ void print_help_message() {
printf(" swift_mpi [OPTION]... PARAMFILE\n\n");
printf("Valid options are:\n");
printf(" %2s %8s %s\n", "-a", "", "Pin runners using processor affinity");
printf(" %2s %8s %s\n", "-c", "", "Run with cosmological time integration");
printf(" %2s %8s %s\n", "-C", "", "Run with cooling");
printf(" %2s %8s %s\n", "-a", "", "Pin runners using processor affinity.");
printf(" %2s %8s %s\n", "-c", "", "Run with cosmological time integration.");
printf(" %2s %8s %s\n", "-C", "", "Run with cooling.");
printf(
" %2s %8s %s\n", "-d", "",
"Dry run. Read the parameter file, allocate memory but does not read ");
......@@ -70,29 +70,32 @@ void print_help_message() {
"Allows user to check validy of parameter and IC files as well as "
"memory limits.");
printf(" %2s %8s %s\n", "-D", "",
"Always drift all particles even the ones far from active particles.");
"Always drift all particles even the ones far from active particles. "
"This emulates");
printf(" %2s %8s %s\n", "", "",
"Gadget-[23] and GIZMO's default behaviours.");
printf(" %2s %8s %s\n", "-e", "",
"Enable floating-point exceptions (debugging mode)");
"Enable floating-point exceptions (debugging mode).");
printf(" %2s %8s %s\n", "-f", "{int}",
"Overwrite the CPU frequency (Hz) to be used for time measurements");
"Overwrite the CPU frequency (Hz) to be used for time measurements.");
printf(" %2s %8s %s\n", "-g", "",
"Run with an external gravitational potential");
printf(" %2s %8s %s\n", "-F", "", "Run with feedback ");
printf(" %2s %8s %s\n", "-G", "", "Run with self-gravity");
"Run with an external gravitational potential.");
printf(" %2s %8s %s\n", "-F", "", "Run with feedback.");
printf(" %2s %8s %s\n", "-G", "", "Run with self-gravity.");
printf(" %2s %8s %s\n", "-n", "{int}",
"Execute a fixed number of time steps. When unset use the time_end "
"parameter to stop.");
printf(" %2s %8s %s\n", "-s", "", "Run with SPH");
printf(" %2s %8s %s\n", "-S", "", "Run with stars");
printf(" %2s %8s %s\n", "-s", "", "Run with hydrodynamics.");
printf(" %2s %8s %s\n", "-S", "", "Run with stars.");
printf(" %2s %8s %s\n", "-t", "{int}",
"The number of threads to use on each MPI rank. Defaults to 1 if not "
"specified.");
printf(" %2s %8s %s\n", "-v", "[12]", "Increase the level of verbosity");
printf(" %2s %8s %s\n", "-v", "[12]", "Increase the level of verbosity.");
printf(" %2s %8s %s\n", "", "", "1: MPI-rank 0 writes ");
printf(" %2s %8s %s\n", "", "", "2: All MPI-ranks write");
printf(" %2s %8s %s\n", "-y", "{int}",
"Time-step frequency at which task graphs are dumped");
printf(" %2s %8s %s\n", "-h", "", "Print this help message and exit");
"Time-step frequency at which task graphs are dumped.");
printf(" %2s %8s %s\n", "-h", "", "Print this help message and exit.");
printf(
"\nSee the file parameter_example.yml for an example of "
"parameter file.\n");
......@@ -302,6 +305,15 @@ int main(int argc, char *argv[]) {
message("WARNING: Debugging checks activated. Code will be slower !");
#endif
/* Do we have gravity accuracy checks ? */
#ifdef SWIFT_GRAVITY_FORCE_CHECKS
if (myrank == 0)
message(
"WARNING: Checking 1/%d of all gpart for gravity accuracy. Code will "
"be slower !",
SWIFT_GRAVITY_FORCE_CHECKS);
#endif
/* Do we choke on FP-exceptions ? */
if (with_fp_exceptions) {
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
......@@ -311,13 +323,14 @@ int main(int argc, char *argv[]) {
/* How large are the parts? */
if (myrank == 0) {
message("sizeof(part) is %4zi bytes.", sizeof(struct part));
message("sizeof(xpart) is %4zi bytes.", sizeof(struct xpart));
message("sizeof(spart) is %4zi bytes.", sizeof(struct spart));
message("sizeof(gpart) is %4zi bytes.", sizeof(struct gpart));
message("sizeof(multipole) is %4zi bytes.", sizeof(struct multipole));
message("sizeof(task) is %4zi bytes.", sizeof(struct task));
message("sizeof(cell) is %4zi bytes.", sizeof(struct cell));
message("sizeof(part) is %4zi bytes.", sizeof(struct part));
message("sizeof(xpart) is %4zi bytes.", sizeof(struct xpart));
message("sizeof(spart) is %4zi bytes.", sizeof(struct spart));
message("sizeof(gpart) is %4zi bytes.", sizeof(struct gpart));
message("sizeof(multipole) is %4zi bytes.", sizeof(struct multipole));
message("sizeof(acc_tensor) is %4zi bytes.", sizeof(struct acc_tensor));
message("sizeof(task) is %4zi bytes.", sizeof(struct task));
message("sizeof(cell) is %4zi bytes.", sizeof(struct cell));
}
/* Read the parameter file */
......
......@@ -47,6 +47,7 @@ SPH:
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.
max_ghost_iterations: 30 # (Optional) Maximal number of iterations allowed to converge towards the smoothing length.
max_volume_change: 2. # (Optional) Maximal allowed change of kernel volume over one time-step
h_max: 10. # (Optional) Maximal allowed smoothing length in internal units. Defaults to FLT_MAX if unspecified.
# Parameters for the self-gravity scheme
Gravity:
......@@ -54,7 +55,6 @@ Gravity:
epsilon: 0.1 # Softening length (in internal units).
a_smooth: 1.25 # (Optional) Smoothing scale in top-level cell sizes to smooth the long-range forces over (this is the default value).
r_cut: 4.5 # (Optional) Cut-off in number of top-level cells beyond which no FMM forces are computed (this is the default value).
# Parameters related to the initial conditions
InitialConditions:
......
......@@ -55,7 +55,7 @@ AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
physical_constants.c potential.c hydro_properties.c \
runner_doiact_fft.c threadpool.c cooling.c sourceterms.c \
statistics.c runner_doiact_vec.c profiler.c dump.c logger.c \
part_type.c xmf.c gravity_properties.c
part_type.c xmf.c gravity_properties.c gravity.c
# Include files for distribution, not installation.
nobase_noinst_HEADERS = align.h approx_math.h atomic.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
......
......@@ -1056,6 +1056,23 @@ void cell_check_drift_point(struct cell *c, void *data) {
#endif
}
/**
* @brief Resets all the individual cell task counters to 0.
*
* Should only be used for debugging purposes.
*
* @param c The #cell to reset.
*/
void cell_reset_task_counters(struct cell *c) {
#ifdef SWIFT_DEBUG_CHECKS
for (int t = 0; t < task_type_count; ++t) c->tasks_executed[t] = 0;
for (int t = 0; t < task_subtype_count; ++t) c->subtasks_executed[t] = 0;
#else
error("Calling debugging code without debugging flag activated.");
#endif
}
/**
* @brief Checks whether the cells are direct neighbours ot not. Both cells have
* to be of the same size
......@@ -1095,7 +1112,8 @@ int cell_are_neighbours(const struct cell *restrict ci,
*/
void cell_check_multipole(struct cell *c, void *data) {
struct multipole ma;
#ifdef SWIFT_DEBUG_CHECKS
struct gravity_tensors ma;
const double tolerance = 1e-5; /* Relative */
/* First recurse */
......@@ -1106,18 +1124,22 @@ void cell_check_multipole(struct cell *c, void *data) {
if (c->gcount > 0) {
/* Brute-force calculation */
multipole_P2M(&ma, c->gparts, c->gcount);
gravity_P2M(&ma, c->gparts, c->gcount);
/* Now compare the multipole expansion */
if (!multipole_equal(&ma, c->multipole, tolerance)) {
if (!gravity_multipole_equal(&ma.m_pole, &c->multipole->m_pole,
tolerance)) {
message("Multipoles are not equal at depth=%d!", c->depth);
message("Correct answer:");
multipole_print(&ma);
gravity_multipole_print(&ma.m_pole);
message("Recursive multipole:");
multipole_print(c->multipole);
gravity_multipole_print(&c->multipole->m_pole);
error("Aborting");
}
}
#else
error("Calling debugging code without debugging flag activated.");
#endif
}
/**
......@@ -1299,6 +1321,9 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
if (c->kick1 != NULL) scheduler_activate(s, c->kick1);
if (c->kick2 != NULL) scheduler_activate(s, c->kick2);
if (c->timestep != NULL) scheduler_activate(s, c->timestep);
if (c->grav_down != NULL) scheduler_activate(s, c->grav_down);
if (c->grav_long_range != NULL) scheduler_activate(s, c->grav_long_range);
if (c->grav_top_level != NULL) scheduler_activate(s, c->grav_top_level);
if (c->cooling != NULL) scheduler_activate(s, c->cooling);
if (c->sourceterms != NULL) scheduler_activate(s, c->sourceterms);
......@@ -1333,6 +1358,7 @@ void cell_set_super(struct cell *c, struct cell *super) {
*/
void cell_drift_particles(struct cell *c, const struct engine *e) {
const float hydro_h_max = e->hydro_properties->h_max;
const double timeBase = e->timeBase;
const integertime_t ti_old = c->ti_old;
const integertime_t ti_current = e->ti_current;
......@@ -1343,7 +1369,7 @@ void cell_drift_particles(struct cell *c, const struct engine *e) {
/* Drift from the last time the cell was drifted to the current time */
const double dt = (ti_current - ti_old) * timeBase;
float dx_max = 0.f, dx2_max = 0.f, h_max = 0.f;
float dx_max = 0.f, dx2_max = 0.f, cell_h_max = 0.f;
/* Check that we are actually going to move forward. */
if (ti_current < ti_old) error("Attempt to drift to the past");
......@@ -1357,7 +1383,7 @@ void cell_drift_particles(struct cell *c, const struct engine *e) {
struct cell *cp = c->progeny[k];
cell_drift_particles(cp, e);
dx_max = max(dx_max, cp->dx_max);
h_max = max(h_max, cp->h_max);
cell_h_max = max(cell_h_max, cp->h_max);
}
} else if (ti_current > ti_old) {
......@@ -1376,7 +1402,7 @@ void cell_drift_particles(struct cell *c, const struct engine *e) {
const float dx2 = gp->x_diff[0] * gp->x_diff[0] +
gp->x_diff[1] * gp->x_diff[1] +
gp->x_diff[2] * gp->x_diff[2];
dx2_max = (dx2_max > dx2) ? dx2_max : dx2;
dx2_max = max(dx2_max, dx2);
}
/* Loop over all the gas particles in the cell */
......@@ -1390,14 +1416,17 @@ void cell_drift_particles(struct cell *c, const struct engine *e) {
/* Drift... */
drift_part(p, xp, dt, timeBase, ti_old, ti_current);
/* Limit h to within the allowed range */
p->h = min(p->h, hydro_h_max);
/* Compute (square of) motion since last cell construction */
const float dx2 = xp->x_diff[0] * xp->x_diff[0] +
xp->x_diff[1] * xp->x_diff[1] +
xp->x_diff[2] * xp->x_diff[2];
dx2_max = (dx2_max > dx2) ? dx2_max : dx2;
dx2_max = max(dx2_max, dx2);
/* Maximal smoothing length */
h_max = (h_max > p->h) ? h_max : p->h;
cell_h_max = max(cell_h_max, p->h);
}
/* Loop over all the star particles in the cell */
......@@ -1418,12 +1447,12 @@ void cell_drift_particles(struct cell *c, const struct engine *e) {
} else {
h_max = c->h_max;
cell_h_max = c->h_max;
dx_max = c->dx_max;
}
/* Store the values */
c->h_max = h_max;
c->h_max = cell_h_max;
c->dx_max = dx_max;
/* Update the time of the last drift */
......@@ -1436,7 +1465,7 @@ void cell_drift_particles(struct cell *c, const struct engine *e) {
* @param c The #cell.
* @param e The #engine (to get ti_current).
*/
void cell_drift_multipole(struct cell *c, const struct engine *e) {
void cell_drift_all_multipoles(struct cell *c, const struct engine *e) {
const double timeBase = e->timeBase;
const integertime_t ti_old_multipole = c->ti_old_multipole;
......@@ -1458,13 +1487,26 @@ void cell_drift_multipole(struct cell *c, const struct engine *e) {
} else if (ti_current > ti_old_multipole) {
/* Drift the multipole */
multipole_drift(c->multipole, dt);
gravity_multipole_drift(c->multipole, dt);
}
/* Update the time of the last drift */
c->ti_old_multipole = ti_current;
}
/**
* @brief Drifts the multipole of a cell to the current time.
*
* Only drifts the multipole at this level. Multipoles deeper in the
* tree are not updated.
*
* @param c The #cell.
* @param e The #engine (to get ti_current).
*/
void cell_drift_multipole(struct cell *c, const struct engine *e) {
error("To be implemented");
}
/**
* @brief Recursively checks that all particles in a cell have a time-step
*/
......
......@@ -104,7 +104,7 @@ struct cell {
double h_max;
/*! This cell's multipole. */
struct multipole *multipole;
struct gravity_tensors *multipole;
/*! Linking pointer for "memory management". */
struct cell *next;
......@@ -170,7 +170,10 @@ struct cell {
struct task *timestep;
/*! Task constructing the multipole from the particles */
struct task *grav_up;
struct task *grav_top_level;
/*! Task constructing the multipole from the particles */
struct task *grav_long_range;
/*! Task propagating the multipole to the particles */
struct task *grav_down;
......@@ -308,6 +311,14 @@ struct cell {
/*! The maximal depth of this cell and its progenies */
char maxdepth;
#ifdef SWIFT_DEBUG_CHECKS
/*! The list of tasks that have been executed on this cell */
char tasks_executed[64];
/*! The list of sub-tasks that have been executed on this cell */
char subtasks_executed[64];
#endif
} SWIFT_STRUCT_ALIGN;
/* Convert cell location to ID. */
......@@ -342,11 +353,13 @@ int cell_are_neighbours(const struct cell *restrict ci,
void cell_check_multipole(struct cell *c, void *data);
void cell_clean(struct cell *c);
void cell_check_drift_point(struct cell *c, void *data);
void cell_reset_task_counters(struct cell *c);
int cell_is_drift_needed(struct cell *c, const struct engine *e);
int cell_unskip_tasks(struct cell *c, struct scheduler *s);
void cell_set_super(struct cell *c, struct cell *super);
void cell_drift_particles(struct cell *c, const struct engine *e);
void cell_drift_multipole(struct cell *c, const struct engine *e);
void cell_drift_all_multipoles(struct cell *c, const struct engine *e);
void cell_check_timesteps(struct cell *c);
#endif /* SWIFT_CELL_H */
......@@ -41,9 +41,6 @@
/* Self gravity stuff. */
#define const_gravity_multipole_order 1
#define const_gravity_a_smooth 1.25f
#define const_gravity_r_cut 4.5f
#define const_gravity_eta 0.025f
/* Type of gradients to use (GIZMO_SPH only) */
/* If no option is chosen, no gradients are used (first order scheme) */
......
......@@ -55,6 +55,7 @@
#include "cycle.h"
#include "debug.h"
#include "error.h"
#include "gravity.h"
#include "hydro.h"
#include "minmax.h"
#include "parallel_io.h"
......@@ -132,6 +133,7 @@ void engine_make_hierarchical_tasks(struct engine *e, struct cell *c) {
struct scheduler *s = &e->sched;
const int is_hydro = (e->policy & engine_policy_hydro);
const int is_self_gravity = (e->policy & engine_policy_self_gravity);
const int is_with_cooling = (e->policy & engine_policy_cooling);
const int is_with_sourceterms = (e->policy & engine_policy_sourceterms);
......@@ -165,6 +167,27 @@ void engine_make_hierarchical_tasks(struct engine *e, struct cell *c) {
scheduler_addunlock(s, c->drift, c->init);
if (is_self_gravity) {
/* Gravity non-neighbouring pm calculations */
c->grav_long_range = scheduler_addtask(
s, task_type_grav_long_range, task_subtype_none, 0, 0, c, NULL, 0);
/* Gravity top-level periodic calculation */
c->grav_top_level = scheduler_addtask(
s, task_type_grav_top_level, task_subtype_none, 0, 0, c, NULL, 0);
/* Gravity recursive down-pass */
c->grav_down = scheduler_addtask(s, task_type_grav_down,
task_subtype_none, 0, 0, c, NULL, 0);
scheduler_addunlock(s, c->init, c->grav_long_range);
scheduler_addunlock(s, c->init, c->grav_top_level);
scheduler_addunlock(s, c->grav_long_range, c->grav_down);
scheduler_addunlock(s, c->grav_top_level, c->grav_down);
scheduler_addunlock(s, c->grav_down, c->kick2);
}
/* Generate the ghost task. */
if (is_hydro)
c->ghost = scheduler_addtask(s, task_type_ghost, task_subtype_none, 0,
......@@ -871,7 +894,7 @@ void engine_addtasks_grav(struct engine *e, struct cell *c, struct task *up,
struct task *down) {
/* Link the tasks to this cell. */
c->grav_up = up;
// c->grav_up = up;
c->grav_down = down;
/* Recurse? */
......@@ -1550,7 +1573,7 @@ void engine_exchange_strays(struct engine *e, size_t offset_parts,
*
* @param e The #engine.
*/
void engine_make_gravity_tasks(struct engine *e) {
void engine_make_self_gravity_tasks(struct engine *e) {
struct space *s = e->s;
struct scheduler *sched = &e->sched;
......@@ -1572,10 +1595,6 @@ void engine_make_gravity_tasks(struct engine *e) {
scheduler_addtask(sched, task_type_self, task_subtype_grav, 0, 0, ci, NULL,
0);
/* Let's also build a task for all the non-neighbouring pm calculations */
scheduler_addtask(sched, task_type_grav_mm, task_subtype_none, 0, 0, ci,
NULL, 0);
for (int cjd = cid + 1; cjd < nr_cells; ++cjd) {
struct cell *cj = &cells[cjd];
......@@ -1777,25 +1796,20 @@ void engine_count_and_link_tasks(struct engine *e) {
}
}
/*
/**
* @brief Creates the dependency network for the gravity tasks of a given cell.
*
* @param sched The #scheduler.
* @param gravity The gravity task to link.
* @param c The cell.
*/
/* static inline void engine_make_gravity_dependencies(struct scheduler *sched,
*/
/* struct task *gravity, */
/* struct cell *c) { */
/* /\* init --> gravity --> kick *\/ */
/* scheduler_addunlock(sched, c->super->init, gravity); */
/* scheduler_addunlock(sched, gravity, c->super->kick2); */
static inline void engine_make_self_gravity_dependencies(
struct scheduler *sched, struct task *gravity, struct cell *c) {
/* /\* grav_up --> gravity ( --> kick) *\/ */
/* scheduler_addunlock(sched, c->super->grav_up, gravity); */
/* } */
/* init --> gravity --> grav_down --> kick */
scheduler_addunlock(sched, c->super->init, gravity);
scheduler_addunlock(sched, gravity, c->super->grav_down);
}
/**
* @brief Creates the dependency network for the external gravity tasks of a
......@@ -1829,12 +1843,11 @@ void engine_link_gravity_tasks(struct engine *e) {
/* Get a pointer to the task. */
struct task *t = &sched->tasks[k];
/* /\* Self-interaction for self-gravity? *\/ */
/* if (t->type == task_type_self && t->subtype == task_subtype_grav) { */
/* engine_make_gravity_dependencies(sched, t, t->ci); */
/* Self-interaction for self-gravity? */
if (t->type == task_type_self && t->subtype == task_subtype_grav) {
/* } */
engine_make_self_gravity_dependencies(sched, t, t->ci);
}
/* Self-interaction for external gravity ? */
if (t->type == task_type_self && t->subtype == task_subtype_external_grav) {
......@@ -1843,31 +1856,28 @@ void engine_link_gravity_tasks(struct engine *e) {
}
/* /\* Otherwise, pair interaction? *\/ */
/* else if (t->type == task_type_pair && t->subtype == task_subtype_grav)
* {
*/
/* Otherwise, pair interaction? */
else if (t->type == task_type_pair && t->subtype == task_subtype_grav) {
/* if (t->ci->nodeID == nodeID) { */
if (t->ci->nodeID == nodeID) {
/* engine_make_gravity_dependencies(sched, t, t->ci); */
/* } */
engine_make_self_gravity_dependencies(sched, t, t->ci);
}
/* if (t->cj->nodeID == nodeID && t->ci->super != t->cj->super) { */
if (t->cj->nodeID == nodeID && t->ci->super != t->cj->super) {
/* engine_make_gravity_dependencies(sched, t, t->cj); */
/* } */
engine_make_self_gravity_dependencies(sched, t, t->cj);
}
/* } */
}
/* /\* Otherwise, sub-self interaction? *\/ */
/* else if (t->type == task_type_sub_self && t->subtype ==
* task_subtype_grav) { */
/* Otherwise, sub-self interaction? */
else if (t->type == task_type_sub_self && t->subtype == task_subtype_grav) {
/* if (t->ci->nodeID == nodeID) { */
/* engine_make_gravity_dependencies(sched, t, t->ci); */
/* } */
/* } */
if (t->ci->nodeID == nodeID) {
engine_make_self_gravity_dependencies(sched, t, t->ci);
}
}
/* Sub-self-interaction for external gravity ? */
else if (t->type == task_type_sub_self &&
......@@ -1878,19 +1888,18 @@ void engine_link_gravity_tasks(struct engine *e) {
}
}
/* /\* Otherwise, sub-pair interaction? *\/ */
/* else if (t->type == task_type_sub_pair && t->subtype ==
* task_subtype_grav) { */
/* Otherwise, sub-pair interaction? */
else if (t->type == task_type_sub_pair && t->subtype == task_subtype_grav) {
/* if (t->ci->nodeID == nodeID) { */
if (t->ci->nodeID == nodeID) {
/* engine_make_gravity_dependencies(sched, t, t->ci); */
/* } */
/* if (t->cj->nodeID == nodeID && t->ci->super != t->cj->super) { */
engine_make_self_gravity_dependencies(sched, t, t->ci);
}
if (t->cj->nodeID == nodeID && t->ci->super != t->cj->super) {
/* engine_make_gravity_dependencies(sched, t, t->cj); */