Commit b8b5f0e9 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Remove debugging output and format

parent fc6717e1
...@@ -300,11 +300,12 @@ static void dumpCells_map(struct cell *c, void *data) { ...@@ -300,11 +300,12 @@ static void dumpCells_map(struct cell *c, void *data) {
/* Only locally active cells are dumped. */ /* Only locally active cells are dumped. */
if (c->count > 0) if (c->count > 0)
fprintf(file, " %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d " fprintf(file,
"%6.1f %20lld %6d %6d %6d %6d\n", c->loc[0], c->loc[1], " %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d "
c->loc[2], c->width[0], c->width[1], c->width[2], c->count, "%6.1f %20lld %6d %6d %6d %6d\n",
c->gcount, c->scount, c->depth, ntasks, c->ti_end_min, c->loc[0], c->loc[1], c->loc[2], c->width[0], c->width[1],
get_time_bin(c->ti_end_min), (c->super == c), c->width[2], c->count, c->gcount, c->scount, c->depth, ntasks,
c->ti_end_min, get_time_bin(c->ti_end_min), (c->super == c),
cell_is_active(c, e), c->nodeID); cell_is_active(c, e), c->nodeID);
} }
...@@ -328,14 +329,15 @@ void dumpCells(const char *prefix, struct space *s) { ...@@ -328,14 +329,15 @@ void dumpCells(const char *prefix, struct space *s) {
file = fopen(fname, "w"); file = fopen(fname, "w");
/* Header. */ /* Header. */
fprintf(file, "# %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s " fprintf(file,
"%20s %6s %6s %6s\n", "x", "y", "z", "xw", "yw", "zw", "count", "# %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s %6s "
"gcount", "scount", "depth", "tasks", "ti_end_min", "%20s %6s %6s %6s\n",
"timebin", "issuper", "active", "rank"); "x", "y", "z", "xw", "yw", "zw", "count", "gcount", "scount", "depth",
"tasks", "ti_end_min", "timebin", "issuper", "active", "rank");
uintptr_t data[2]; uintptr_t data[2];
data[0] = (size_t) file; data[0] = (size_t)file;
data[1] = (size_t) s->e; data[1] = (size_t)s->e;
space_map_cells_pre(s, 1, dumpCells_map, &data); space_map_cells_pre(s, 1, dumpCells_map, &data);
fclose(file); fclose(file);
} }
......
...@@ -2906,8 +2906,7 @@ void engine_print_task_counts(struct engine *e) { ...@@ -2906,8 +2906,7 @@ void engine_print_task_counts(struct engine *e) {
int engine_estimate_nr_tasks(struct engine *e) { int engine_estimate_nr_tasks(struct engine *e) {
int tasks_per_cell = e->tasks_per_cell; int tasks_per_cell = e->tasks_per_cell;
if (tasks_per_cell > 0) if (tasks_per_cell > 0) return e->s->tot_cells * tasks_per_cell;
return e->s->tot_cells * tasks_per_cell;
/* Our guess differs depending on the types of tasks we are using, but we /* Our guess differs depending on the types of tasks we are using, but we
* basically use a formula <n1>*ntopcells + <n2>*(totcells - ntopcells). * basically use a formula <n1>*ntopcells + <n2>*(totcells - ntopcells).
...@@ -2966,14 +2965,14 @@ int engine_estimate_nr_tasks(struct engine *e) { ...@@ -2966,14 +2965,14 @@ int engine_estimate_nr_tasks(struct engine *e) {
struct cell *c = &e->s->cells_top[k]; struct cell *c = &e->s->cells_top[k];
/* Any cells with particles will have tasks (local & foreign). */ /* Any cells with particles will have tasks (local & foreign). */
int nparts = c->count + c->gcount + c->scount; int nparts = c->count + c->gcount + c->scount;
if (nparts > 0) { if (nparts > 0) {
ntop++; ntop++;
ncells++; ncells++;
/* Count cell depth until we get below the parts per cell threshold. */ /* Count cell depth until we get below the parts per cell threshold. */
int depth = 3; int depth = 3;
while ( nparts > space_splitsize) { while (nparts > space_splitsize) {
depth++; depth++;
nparts /= 8; nparts /= 8;
ncells += (1 << depth); ncells += (1 << depth);
...@@ -3656,12 +3655,6 @@ void engine_step(struct engine *e) { ...@@ -3656,12 +3655,6 @@ void engine_step(struct engine *e) {
/* Print the number of active tasks ? */ /* Print the number of active tasks ? */
if (e->verbose) engine_print_task_counts(e); if (e->verbose) engine_print_task_counts(e);
/* Dump cells of our space. */
char name[15];
sprintf(name, "%s_%d", "cells", e->nodeID);
dumpCells(name, e->s);
#ifdef SWIFT_DEBUG_CHECKS #ifdef SWIFT_DEBUG_CHECKS
/* Check that we have the correct total mass in the top-level multipoles */ /* Check that we have the correct total mass in the top-level multipoles */
size_t num_gpart_mpole = 0; size_t num_gpart_mpole = 0;
......
...@@ -772,8 +772,11 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type, ...@@ -772,8 +772,11 @@ struct task *scheduler_addtask(struct scheduler *s, enum task_types type,
const int ind = atomic_inc(&s->tasks_next); const int ind = atomic_inc(&s->tasks_next);
/* Overflow? */ /* Overflow? */
if (ind >= s->size) error("Task list overflow (%d). Need to increase " if (ind >= s->size)
"Scheduler:tasks_per_cell.", ind); error(
"Task list overflow (%d). Need to increase "
"Scheduler:tasks_per_cell.",
ind);
/* Get a pointer to the new task. */ /* Get a pointer to the new task. */
struct task *t = &s->tasks[ind]; struct task *t = &s->tasks[ind];
......
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