From 26b99d75ba2c40ceb51a457e123d3844227f33ce Mon Sep 17 00:00:00 2001 From: "Peter W. Draper" <p.w.draper@durham.ac.uk> Date: Thu, 8 Dec 2016 17:48:25 +0000 Subject: [PATCH] Formatting --- examples/main.c | 7 +++---- src/clocks.c | 6 +++--- src/clocks.h | 3 +-- src/engine.c | 2 +- src/partition.c | 8 ++++---- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/main.c b/examples/main.c index 103f76048d..eccc83a3fe 100644 --- a/examples/main.c +++ b/examples/main.c @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) { MPI_Bcast(params, sizeof(struct swift_params), MPI_BYTE, 0, MPI_COMM_WORLD); #endif -/* Prepare the domain decomposition scheme */ + /* Prepare the domain decomposition scheme */ struct repartition repartition; #ifdef WITH_MPI struct partition initial_partition; @@ -489,9 +489,8 @@ 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, &us, - &prog_const, &hydro_properties, &potential, &cooling_func, - &sourceterms); + N_total[1], with_aff, engine_policies, talking, &us, &prog_const, + &hydro_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/clocks.c b/src/clocks.c index 22e28ee012..d5f0e571fe 100644 --- a/src/clocks.c +++ b/src/clocks.c @@ -259,7 +259,7 @@ const char *clocks_get_timesincestart() { */ double clocks_get_cputime_used() { - struct tms tmstic; - times(&tmstic); - return (double)(tmstic.tms_utime + tmstic.tms_cutime); + struct tms tmstic; + times(&tmstic); + return (double)(tmstic.tms_utime + tmstic.tms_cutime); } diff --git a/src/clocks.h b/src/clocks.h index 51b53f5414..4c69e130d9 100644 --- a/src/clocks.h +++ b/src/clocks.h @@ -19,8 +19,8 @@ #ifndef SWIFT_CLOCKS_H #define SWIFT_CLOCKS_H -#include <time.h> #include <sys/times.h> +#include <time.h> #include "cycle.h" /* Struct to record a time for the clocks functions. */ @@ -44,5 +44,4 @@ const char *clocks_get_timesincestart(); double clocks_get_cputime_used(); - #endif /* SWIFT_CLOCKS_H */ diff --git a/src/engine.c b/src/engine.c index 46ebb4110e..b729bc01f9 100644 --- a/src/engine.c +++ b/src/engine.c @@ -3277,7 +3277,7 @@ void engine_init(struct engine *e, struct space *s, fprintf(e->file_timesteps, "# %6s %14s %14s %10s %10s %16s [%s]\n", "Step", "Time", "Time-step", "Updates", "g-Updates", "Wall-clock time", - clocks_getunit()); + clocks_getunit()); fflush(e->file_timesteps); } diff --git a/src/partition.c b/src/partition.c index 012ef9c076..d185277667 100644 --- a/src/partition.c +++ b/src/partition.c @@ -722,8 +722,7 @@ void partition_repartition(enum repartition_type reparttype, int nodeID, #if defined(WITH_MPI) && defined(HAVE_METIS) - if (reparttype == REPART_METIS_BOTH || - reparttype == REPART_METIS_EDGE || + if (reparttype == REPART_METIS_BOTH || reparttype == REPART_METIS_EDGE || reparttype == REPART_METIS_VERTEX_EDGE) { int partweights; @@ -1006,9 +1005,10 @@ void partition_init(struct partition *partition, /* Get the fraction time difference between nodes. If larger than * this when a repartition is being considered it will be allowed. */ repartition->fractionaltime = parser_get_opt_param_float( - params, "DomainDecomposition:fractionaltime", 0.1); + params, "DomainDecomposition:fractionaltime", 0.1); if (repartition->fractionaltime < 0 || repartition->fractionaltime > 1) - error("Invalid DomainDecomposition:fractionaltime, must be in range 0 to 1"); + error( + "Invalid DomainDecomposition:fractionaltime, must be in range 0 to 1"); #else error("SWIFT was not compiled with MPI support"); -- GitLab