Commit 1f3c79fa authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Code formatting

parent a6d77ac8
......@@ -155,8 +155,7 @@ int main(int argc, char *argv[]) {
/* Let's pin the main thread */
#if defined(HAVE_SETAFFINITY) && defined(HAVE_LIBNUMA) && defined(_GNU_SOURCE)
if (((ENGINE_POLICY) & engine_policy_setaffinity) ==
engine_policy_setaffinity)
if (((ENGINE_POLICY)&engine_policy_setaffinity) == engine_policy_setaffinity)
engine_pin();
#endif
......
......@@ -1283,7 +1283,7 @@ void cell_clean(struct cell *c) {
if (c->sort[i] != NULL) {
free(c->sort[i]);
c->sort[i] = NULL;
}
}
/* Recurse */
for (int k = 0; k < 8; k++)
......
......@@ -2610,8 +2610,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Only interested in density tasks as of here. */
if (t->subtype == task_subtype_density) {
/* Too much particle movement? */
if (cell_need_rebuild_for_pair(ci, cj)) *rebuild_space = 1;
/* Too much particle movement? */
if (cell_need_rebuild_for_pair(ci, cj)) *rebuild_space = 1;
#ifdef WITH_MPI
/* Activate the send/recv tasks. */
......
......@@ -340,8 +340,7 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h,
// shuffle_particles(cell->parts, cell->count);
cell->sorted = 0;
for (int k = 0; k < 13; k++)
cell->sort[k] = NULL;
for (int k = 0; k < 13; k++) cell->sort[k] = NULL;
return cell;
}
......@@ -350,8 +349,7 @@ void clean_up(struct cell *ci) {
free(ci->parts);
free(ci->xparts);
for (int k = 0; k < 13; k++)
if (ci->sort[k] != NULL)
free(ci->sort[k]);
if (ci->sort[k] != NULL) free(ci->sort[k]);
free(ci);
}
......
......@@ -178,8 +178,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles(cell->parts, cell->count);
cell->sorted = 0;
for (int k = 0; k < 13; k++)
cell->sort[k] = NULL;
for (int k = 0; k < 13; k++) cell->sort[k] = NULL;
return cell;
}
......@@ -187,8 +186,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
void clean_up(struct cell *ci) {
free(ci->parts);
for (int k = 0; k < 13; k++)
if (ci->sort[k] != NULL)
free(ci->sort[k]);
if (ci->sort[k] != NULL) free(ci->sort[k]);
free(ci);
}
......
......@@ -121,8 +121,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles(cell->parts, cell->count);
cell->sorted = 0;
for (int k = 0; k < 13; k++)
cell->sort[k] = NULL;
for (int k = 0; k < 13; k++) cell->sort[k] = NULL;
return cell;
}
......@@ -130,8 +129,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
void clean_up(struct cell *ci) {
free(ci->parts);
for (int k = 0; k < 13; k++)
if (ci->sort[k] != NULL)
free(ci->sort[k]);
if (ci->sort[k] != NULL) free(ci->sort[k]);
free(ci);
}
......
......@@ -177,8 +177,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles(cell->parts, cell->count);
cell->sorted = 0;
for (int k = 0; k < 13; k++)
cell->sort[k] = NULL;
for (int k = 0; k < 13; k++) cell->sort[k] = NULL;
return cell;
}
......@@ -186,8 +185,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
void clean_up(struct cell *ci) {
free(ci->parts);
for (int k = 0; k < 13; k++)
if (ci->sort[k] != NULL)
free(ci->sort[k]);
if (ci->sort[k] != NULL) free(ci->sort[k]);
free(ci);
}
......
......@@ -81,8 +81,7 @@ struct cell *make_cell(size_t N, float cellSize, int offset[3], int id_offset) {
cell->ti_end_max = 1;
cell->sorted = 0;
for (int k = 0; k < 13; k++)
cell->sort[k] = NULL;
for (int k = 0; k < 13; k++) cell->sort[k] = NULL;
return cell;
}
......@@ -213,8 +212,7 @@ int main() {
free(cells[j]->parts);
free(cells[j]->xparts);
for (int k = 0; k < 13; k++)
if (cells[j]->sort[k] != NULL)
free(cells[j]->sort[k]);
if (cells[j]->sort[k] != NULL) free(cells[j]->sort[k]);
free(cells[j]);
}
......
......@@ -82,7 +82,7 @@ int main(int argc, char *argv[]) {
threadpool_map(&tp, map_function_first, data, N, sizeof(int), 2, NULL);
}
/* If logging was enabled, dump the log. */
/* If logging was enabled, dump the log. */
#ifdef SWIFT_DEBUG_THREADPOOL
char filename[80];
sprintf(filename, "threadpool_log-%d.txt", num_thread);
......
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