Skip to content
Snippets Groups Projects
Commit 26b99d75 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Formatting

parent 02a50a86
Branches
Tags
1 merge request!290Only repartition when required
This commit is part of merge request !290. Comments created here will be created in the context of that merge request.
......@@ -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),
......
......@@ -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);
}
......@@ -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 */
......@@ -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);
}
......
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment