From 5ddd0761f9f6364a3cf003a712a35a72fb61606a Mon Sep 17 00:00:00 2001 From: "Peter W. Draper" <p.w.draper@durham.ac.uk> Date: Fri, 10 Mar 2017 17:52:56 +0000 Subject: [PATCH] Formatting --- examples/main.c | 6 +++--- src/engine.c | 22 ++++++++++++---------- src/partition.c | 10 +++++++--- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/examples/main.c b/examples/main.c index a0fe512a71..7f23318212 100644 --- a/examples/main.c +++ b/examples/main.c @@ -514,9 +514,9 @@ int main(int argc, char *argv[]) { if (myrank == 0) clocks_gettime(&tic); struct engine e; engine_init(&e, &s, params, nr_nodes, myrank, nr_threads, N_total[0], - N_total[1], with_aff, engine_policies, talking, &reparttype, - &us, &prog_const, &hydro_properties, &gravity_properties, - &potential, &cooling_func, &sourceterms); + N_total[1], with_aff, engine_policies, talking, &reparttype, &us, + &prog_const, &hydro_properties, &gravity_properties, &potential, + &cooling_func, &sourceterms); if (myrank == 0) { clocks_gettime(&toc); message("engine_init took %.3f %s.", clocks_diff(&tic, &toc), diff --git a/src/engine.c b/src/engine.c index cb48c7219c..4fb988e41c 100644 --- a/src/engine.c +++ b/src/engine.c @@ -3040,21 +3040,21 @@ void engine_step(struct engine *e) { e->wallclock_time); fflush(stdout); - fprintf(e->file_timesteps, " %6d %14e %14e %10zu %10zu %10zu %21.3f %3d %3d\n", - e->step, e->time, e->timeStep, e->updates, e->g_updates, - e->s_updates, e->wallclock_time, (e->lastrebuild > 0), + fprintf(e->file_timesteps, + " %6d %14e %14e %10zu %10zu %10zu %21.3f %3d %3d\n", e->step, + e->time, e->timeStep, e->updates, e->g_updates, e->s_updates, + e->wallclock_time, (e->lastrebuild > 0), (e->lastrepart != REPART_NONE)); fflush(e->file_timesteps); } - /* Repartition the space amongst the nodes? */ +/* Repartition the space amongst the nodes? */ #ifdef WITH_MPI /* Old style if trigger is >1 or this is the second step. */ - if (e->reparttype->trigger > 1 || e->step == 2 ) { + if (e->reparttype->trigger > 1 || e->step == 2) { if (e->reparttype->trigger > 1) { - if (e->step % (int)e->reparttype->trigger == 2) - e->forcerepart = 1; + if (e->step % (int)e->reparttype->trigger == 2) e->forcerepart = 1; } else { e->forcerepart = 1; } @@ -3107,14 +3107,16 @@ void engine_step(struct engine *e) { if (elapsed_cputimes[k] < mintime) mintime = elapsed_cputimes[k]; } - if ((e->updates > 1 && e->updates >= e->total_nr_parts * e->reparttype->minfrac) || - (e->g_updates > 1 && e->g_updates >= e->total_nr_gparts * e->reparttype->minfrac)) { + if ((e->updates > 1 && + e->updates >= e->total_nr_parts * e->reparttype->minfrac) || + (e->g_updates > 1 && + e->g_updates >= e->total_nr_gparts * e->reparttype->minfrac)) { /* Are we out of balance? */ if (((maxtime - mintime) / mintime) > e->reparttype->trigger) { if (e->verbose) message("fractionaltime %.2f > %.2f will repartition", - (maxtime - mintime) / mintime, e->reparttype->trigger); + (maxtime - mintime) / mintime, e->reparttype->trigger); e->forcerepart = 1; } } diff --git a/src/partition.c b/src/partition.c index 39639eabbc..8821a3428b 100644 --- a/src/partition.c +++ b/src/partition.c @@ -1076,15 +1076,19 @@ void partition_init(struct partition *partition, /* Get the fraction CPU time difference between nodes (<1) or the number * of steps between repartitions (>1). */ - repartition->trigger = parser_get_opt_param_float(params, "DomainDecomposition:trigger", 0.05f); + repartition->trigger = + parser_get_opt_param_float(params, "DomainDecomposition:trigger", 0.05f); if (repartition->trigger <= 0) error("Invalid DomainDecomposition:trigger, must be greater than zero"); /* Fraction of particles that should be updated before a repartition * based on CPU time is considered. */ - repartition->minfrac = parser_get_opt_param_float(params, "DomainDecomposition:minfrac", 0.9f); + repartition->minfrac = + parser_get_opt_param_float(params, "DomainDecomposition:minfrac", 0.9f); if (repartition->minfrac <= 0 || repartition->minfrac > 1) - error("Invalid DomainDecomposition:minfrac, must be greater than 0 and less than equal to 1"); + error( + "Invalid DomainDecomposition:minfrac, must be greater than 0 and less " + "than equal to 1"); #else error("SWIFT was not compiled with MPI support"); -- GitLab