[SCM] Gerris Flow Solver branch, upstream, updated. e8f73a07832050124d2b8bf6c6f35b33180e65a8
Stephane Popinet
popinet at users.sf.net
Tue Nov 24 12:24:21 UTC 2009
The following commit has been merged in the upstream branch:
commit 63b2cd27229a5340fa2d63f7263223f43ba5bf40
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed Jul 8 14:46:50 2009 +1000
OutputTime reports average CPU time for parallel runs
darcs-hash:20090708044650-d4795-a46053285e379a9a850c00de3b9f7ac22170a92a.gz
diff --git a/src/output.c b/src/output.c
index acffe06..c30cb32 100644
--- a/src/output.c
+++ b/src/output.c
@@ -491,11 +491,21 @@ static gboolean time_event (GfsEvent * event, GfsSimulation * sim)
gfs_clock_start (t->clock);
g_timer_start (t->timer);
}
+ gdouble cpu = gfs_clock_elapsed (t->clock);
+#ifdef HAVE_MPI
+ GfsDomain * domain = GFS_DOMAIN (sim);
+ if (domain->pid >= 0) {
+ gfs_all_reduce (domain, cpu, MPI_DOUBLE, MPI_SUM);
+ int size;
+ MPI_Comm_size (MPI_COMM_WORLD, &size);
+ cpu /= size;
+ }
+#endif
fprintf (GFS_OUTPUT (event)->file->fp,
"step: %7u t: %15.8f dt: %13.6e cpu: %15.8f real: %15.8f\n",
sim->time.i, sim->time.t,
sim->advection_params.dt,
- gfs_clock_elapsed (t->clock),
+ cpu,
g_timer_elapsed (t->timer, NULL));
return TRUE;
}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list