Commit 45bf163e authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Removed debugging code. Code formatting and documentation.

parent f1b15c44
......@@ -594,9 +594,6 @@ struct cell {
/* Task receiving hydro data (gradient). */
struct task *recv_gradient;
/* Task receiving hydro data (force). */
struct task *recv_force;
/* Linked list for sending hydro data (positions). */
struct link *send_xv;
......@@ -606,9 +603,6 @@ struct cell {
/* Linked list for sending hydro data (gradient). */
struct link *send_gradient;
/* Linked list for sending hydro data (force). */
struct link *send_force;
} hydro;
struct {
......
......@@ -85,7 +85,7 @@ __attribute__((always_inline)) INLINE static void drift_part(
p->ti_drift = ti_current;
#endif
/* Drift... */
p->x[0] += xp->v_full[0] * dt_drift;
p->x[1] += xp->v_full[1] * dt_drift;
......
......@@ -120,8 +120,7 @@ void engine_addtasks_send_gravity(struct engine *e, struct cell *ci,
*/
void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
struct cell *cj, struct task *t_xv,
struct task *t_rho, struct task *t_gradient,
struct task *t_force) {
struct task *t_rho, struct task *t_gradient) {
#ifdef WITH_MPI
struct link *l = NULL;
......@@ -153,9 +152,6 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
ci->mpi.tag, 0, ci, cj);
#endif
/* t_force = scheduler_addtask(s, task_type_send, task_subtype_force, */
/* ci->mpi.tag, 0, ci, cj); */
#ifdef EXTRA_HYDRO_LOOP
scheduler_addunlock(s, t_gradient, ci->hydro.super->hydro.end_force);
......@@ -184,8 +180,6 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
#endif
//scheduler_addunlock(s, ci->hydro.super->hydro.end_force, t_force);
//scheduler_addunlock(s, ci->hydro.super->hydro.drift, t_force);
scheduler_addunlock(s, ci->hydro.super->hydro.drift, t_rho);
/* Drift before you send */
......@@ -198,7 +192,6 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
#ifdef EXTRA_HYDRO_LOOP
engine_addlink(e, &ci->mpi.hydro.send_gradient, t_gradient);
#endif
//engine_addlink(e, &ci->mpi.hydro.send_force, t_force);
}
/* Recurse? */
......@@ -206,7 +199,7 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
for (int k = 0; k < 8; k++)
if (ci->progeny[k] != NULL)
engine_addtasks_send_hydro(e, ci->progeny[k], cj, t_xv, t_rho,
t_gradient, t_force);
t_gradient);
#else
error("SWIFT was not compiled with MPI support.");
......@@ -365,7 +358,7 @@ void engine_addtasks_send_timestep(struct engine *e, struct cell *ci,
*/
void engine_addtasks_recv_hydro(struct engine *e, struct cell *c,
struct task *t_xv, struct task *t_rho,
struct task *t_gradient, struct task *t_force) {
struct task *t_gradient) {
#ifdef WITH_MPI
struct scheduler *s = &e->sched;
......@@ -387,21 +380,16 @@ void engine_addtasks_recv_hydro(struct engine *e, struct cell *c,
t_gradient = scheduler_addtask(s, task_type_recv, task_subtype_gradient,
c->mpi.tag, 0, c, NULL);
#endif
/* t_force = scheduler_addtask(s, task_type_recv, task_subtype_force, */
/* c->mpi.tag, 0, c, NULL); */
}
c->mpi.hydro.recv_xv = t_xv;
c->mpi.hydro.recv_rho = t_rho;
c->mpi.hydro.recv_gradient = t_gradient;
//c->mpi.hydro.recv_force = t_force;
/* Add dependencies. */
if (c->hydro.sorts != NULL) {
scheduler_addunlock(s, t_xv, c->hydro.sorts);
scheduler_addunlock(s, c->hydro.sorts, t_rho);
//scheduler_addunlock(s, c->hydro.sorts, t_force);
}
for (struct link *l = c->hydro.density; l != NULL; l = l->next) {
......@@ -422,10 +410,7 @@ void engine_addtasks_recv_hydro(struct engine *e, struct cell *c,
}
#endif
/* for (struct link *l = c->hydro.force; l != NULL; l = l->next) { */
/* scheduler_addunlock(s, l->t, t_force); */
/* } */
/* Make sure the density has been computed before the stars compute theirs. */
for (struct link *l = c->stars.density; l != NULL; l = l->next) {
scheduler_addunlock(s, t_rho, l->t);
}
......@@ -434,8 +419,7 @@ void engine_addtasks_recv_hydro(struct engine *e, struct cell *c,
if (c->split)
for (int k = 0; k < 8; k++)
if (c->progeny[k] != NULL)
engine_addtasks_recv_hydro(e, c->progeny[k], t_xv, t_rho, t_gradient,
t_force);
engine_addtasks_recv_hydro(e, c->progeny[k], t_xv, t_rho, t_gradient);
#else
error("SWIFT was not compiled with MPI support.");
......@@ -868,7 +852,7 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c) {
if (with_stars) {
c->stars.drift = scheduler_addtask(s, task_type_drift_spart,
task_subtype_none, 0, 0, c, NULL);
scheduler_addunlock(s, c->stars.drift, c->super->kick2);
scheduler_addunlock(s, c->stars.drift, c->super->kick2);
}
/* Subgrid tasks: cooling */
......@@ -2194,7 +2178,7 @@ void engine_addtasks_send_mapper(void *map_data, int num_elements,
* connection. */
if ((e->policy & engine_policy_hydro) && (type & proxy_cell_type_hydro))
engine_addtasks_send_hydro(e, ci, cj, /*t_xv=*/NULL,
/*t_rho=*/NULL, /*t_gradient=*/NULL, NULL);
/*t_rho=*/NULL, /*t_gradient=*/NULL);
/* Add the send tasks for the cells in the proxy that have a stars
* connection. */
......@@ -2226,7 +2210,7 @@ void engine_addtasks_recv_mapper(void *map_data, int num_elements,
/* Add the recv tasks for the cells in the proxy that have a hydro
* connection. */
if ((e->policy & engine_policy_hydro) && (type & proxy_cell_type_hydro))
engine_addtasks_recv_hydro(e, ci, NULL, NULL, NULL, NULL);
engine_addtasks_recv_hydro(e, ci, NULL, NULL, NULL);
/* Add the recv tasks for the cells in the proxy that have a stars
* connection. */
......
......@@ -54,7 +54,7 @@ extern int engine_rank;
fprintf(stderr, "[%04i] %s %s:%s():%i: " s "\n", engine_rank, \
clocks_get_timesincestart(), __FILE__, __FUNCTION__, __LINE__, \
##__VA_ARGS__); \
swift_abort(-1); \
MPI_Abort(MPI_COMM_WORLD, -1); \
})
#else
#define error(s, ...) \
......
......@@ -931,7 +931,7 @@ void runner_do_hydro_sort(struct runner *r, struct cell *c, int flags,
/* Fill the sort array. */
for (int k = 0; k < count; k++) {
const double px[3] = {parts[k].x[0], parts[k].x[1], parts[k].x[2]};
const double px[3] = {parts[k].x[0], parts[k].x[1], parts[k].x[2]};
for (int j = 0; j < 13; j++)
if (flags & (1 << j)) {
c->hydro.sort[j][k].i = k;
......@@ -3273,7 +3273,7 @@ void *runner_main(void *data) {
break;
#endif
case task_type_stars_ghost:
runner_do_stars_ghost(r, ci, 1);
runner_do_stars_ghost(r, ci, 1);
break;
case task_type_drift_part:
runner_do_drift_part(r, ci, 1);
......@@ -3322,7 +3322,7 @@ void *runner_main(void *data) {
} else if (t->subtype == task_subtype_gradient) {
runner_do_recv_part(r, ci, 0, 1);
} else if (t->subtype == task_subtype_force) {
error("oo");runner_do_recv_part(r, ci, 0, 1);
runner_do_recv_part(r, ci, 0, 1);
} else if (t->subtype == task_subtype_limiter) {
runner_do_recv_part(r, ci, 0, 1);
} else if (t->subtype == task_subtype_gpart) {
......
......@@ -275,7 +275,6 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
c->mpi.hydro.recv_xv = NULL;
c->mpi.hydro.recv_rho = NULL;
c->mpi.hydro.recv_gradient = NULL;
c->mpi.hydro.recv_force = NULL;
c->mpi.grav.recv = NULL;
c->mpi.stars.recv = NULL;
c->mpi.recv_ti = NULL;
......@@ -284,7 +283,6 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
c->mpi.hydro.send_xv = NULL;
c->mpi.hydro.send_rho = NULL;
c->mpi.hydro.send_gradient = NULL;
c->mpi.hydro.send_force = NULL;
c->mpi.grav.send = NULL;
c->mpi.stars.send = NULL;
c->mpi.send_ti = NULL;
......@@ -552,11 +550,9 @@ void space_regrid(struct space *s, int verbose) {
c->mpi.hydro.recv_xv = NULL;
c->mpi.hydro.recv_rho = NULL;
c->mpi.hydro.recv_gradient = NULL;
c->mpi.hydro.recv_force = NULL;
c->mpi.hydro.send_xv = NULL;
c->mpi.hydro.send_rho = NULL;
c->mpi.hydro.send_gradient = NULL;
c->mpi.hydro.send_force = NULL;
c->mpi.stars.send = NULL;
c->mpi.stars.recv = NULL;
c->mpi.grav.recv = NULL;
......
......@@ -688,11 +688,7 @@ void task_get_group_name(int type, int subtype, char *cluster) {
}
break;
case task_subtype_force:
if (type == task_type_send || type == task_type_recv) {
strcpy(cluster, "None");
} else {
strcpy(cluster, "Force");
}
strcpy(cluster, "Force");
break;
case task_subtype_grav:
strcpy(cluster, "Gravity");
......
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