diff --git a/examples/main.c b/examples/main.c index 28b54edf4a6cd3162172bb15ce087c25123f4320..016f948bb1b031ba756a344d020d4b26c8a42bed 100644 --- a/examples/main.c +++ b/examples/main.c @@ -74,7 +74,8 @@ void print_help_message() { printf(" %2s %8s %s\n", "-g", "", "Run with an external gravitational potential"); printf(" %2s %8s %s\n", "-G", "", "Run with self-gravity"); - printf(" %2s %8s %s\n", "-n", "{int}", "Execute a fixed number of time steps"); + printf(" %2s %8s %s\n", "-n", "{int}", + "Execute a fixed number of time steps"); printf(" %2s %8s %s\n", "-s", "", "Run with SPH"); printf(" %2s %8s %s\n", "-t", "{int}", "The number of threads to use on each MPI rank. Defaults to 1 if not " diff --git a/src/engine.c b/src/engine.c index 94e975e7b503e0d2362098b690e1f0ea9a0e3f69..07332635f66f4acf4f0c4f99146b82cf0d84c5b2 100644 --- a/src/engine.c +++ b/src/engine.c @@ -66,11 +66,19 @@ #include "timers.h" #include "units.h" -const char *engine_policy_names[13] = { - "none", "rand", "steal", "keep", - "block", "fix_dt", "cpu_tight", "mpi", - "numa_affinity", "hydro", "self_gravity", "external_gravity", - "cosmology_integration"}; +const char *engine_policy_names[13] = {"none", + "rand", + "steal", + "keep", + "block", + "fix_dt", + "cpu_tight", + "mpi", + "numa_affinity", + "hydro", + "self_gravity", + "external_gravity", + "cosmology_integration"}; /** The rank of the engine as a global variable (for messages). */ int engine_rank; diff --git a/src/runner.c b/src/runner.c index 349ae7cc1eb0a955127c0d85b101b085bc6264f0..a0b8c51cfabf830afd685a210bd78d3f98af62f0 100644 --- a/src/runner.c +++ b/src/runner.c @@ -71,7 +71,8 @@ const double runner_shift[13][3] = { {0.0, 7.071067811865475e-01, 7.071067811865475e-01}, {0.0, 1.0, 0.0}, {0.0, 7.071067811865475e-01, -7.071067811865475e-01}, - {0.0, 0.0, 1.0}, }; + {0.0, 0.0, 1.0}, +}; /* Does the axis need flipping ? */ const char runner_flip[27] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, diff --git a/src/scheduler.c b/src/scheduler.c index 8447436529fa2b3982ddbfa3efe3d1ba4df792a6..e79429f74779f667c02ce6e67af910b166f77543 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -69,8 +69,8 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta, struct task **unlocks_new; int *unlock_ind_new; s->size_unlocks *= 2; - if ((unlocks_new = (struct task **)malloc( - sizeof(struct task *) *s->size_unlocks)) == NULL || + if ((unlocks_new = (struct task **)malloc(sizeof(struct task *) * + s->size_unlocks)) == NULL || (unlock_ind_new = (int *)malloc(sizeof(int) * s->size_unlocks)) == NULL) error("Failed to re-allocate unlocks."); memcpy(unlocks_new, s->unlocks, sizeof(struct task *) * s->nr_unlocks); @@ -98,13 +98,11 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta, void scheduler_splittasks(struct scheduler *s) { - const int pts[7][8] = {{-1, 12, 10, 9, 4, 3, 1, 0}, - {-1, -1, 11, 10, 5, 4, 2, 1}, - {-1, -1, -1, 12, 7, 6, 4, 3}, - {-1, -1, -1, -1, 8, 7, 5, 4}, - {-1, -1, -1, -1, -1, 12, 10, 9}, - {-1, -1, -1, -1, -1, -1, 11, 10}, - {-1, -1, -1, -1, -1, -1, -1, 12}}; + const int pts[7][8] = { + {-1, 12, 10, 9, 4, 3, 1, 0}, {-1, -1, 11, 10, 5, 4, 2, 1}, + {-1, -1, -1, 12, 7, 6, 4, 3}, {-1, -1, -1, -1, 8, 7, 5, 4}, + {-1, -1, -1, -1, -1, 12, 10, 9}, {-1, -1, -1, -1, -1, -1, 11, 10}, + {-1, -1, -1, -1, -1, -1, -1, 12}}; const float sid_scale[13] = {0.1897, 0.4025, 0.1897, 0.4025, 0.5788, 0.4025, 0.1897, 0.4025, 0.1897, 0.4025, 0.5788, 0.4025, 0.5788}; @@ -709,7 +707,8 @@ void scheduler_reset(struct scheduler *s, int size) { if (s->tasks_ind != NULL) free(s->tasks_ind); /* Allocate the new lists. */ - if ((s->tasks = (struct task *)malloc(sizeof(struct task) *size)) == NULL || + if ((s->tasks = (struct task *)malloc(sizeof(struct task) * size)) == + NULL || (s->tasks_ind = (int *)malloc(sizeof(int) * size)) == NULL) error("Failed to allocate task lists."); } @@ -1229,7 +1228,7 @@ void scheduler_init(struct scheduler *s, struct space *space, int nr_tasks, /* Init the unlocks. */ if ((s->unlocks = (struct task **)malloc( - sizeof(struct task *) *scheduler_init_nr_unlocks)) == NULL || + sizeof(struct task *) * scheduler_init_nr_unlocks)) == NULL || (s->unlock_ind = (int *)malloc(sizeof(int) * scheduler_init_nr_unlocks)) == NULL) error("Failed to allocate unlocks.");