diff --git a/examples/main.c b/examples/main.c index a0fe512a712e1bee5fda293f8ecaf779bc59140a..7f2331821271e203743f69154499fcc67db0384c 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 cb48c7219cf20a3f16c95553bab5fdd85395b0f1..4fb988e41c66413470b4b20f3c0f2d71589ff529 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 39639eabbca717e9f1b28dcf137f092cfb6fbe89..8821a3428bbf75bd13286ce16f420cbbc9aebfe6 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");