[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:54:49 UTC 2009
The following commit has been merged in the upstream branch:
commit efb00f5490338beb0475863a3224e93f1f072e17
Author: Stephane Popinet <popinet at users.sf.net>
Date: Tue Oct 30 12:46:10 2007 +1100
Bug fix for MPI version of gfs_domain_stats_balance()
darcs-hash:20071030014610-d4795-ac33f443357ffe3e1317ea9eecfc1ad2a154c399.gz
diff --git a/src/domain.c b/src/domain.c
index bace6c4..2f7b49a 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1444,6 +1444,7 @@ void gfs_domain_stats_balance (GfsDomain * domain,
gts_range_init (size);
gts_range_init (boundary);
gts_range_init (mpiwait);
+
if (domain->timestep.n > 0)
gts_range_add_value (mpiwait, domain->mpi_wait.sum/domain->timestep.n);
@@ -1451,14 +1452,19 @@ void gfs_domain_stats_balance (GfsDomain * domain,
gts_container_foreach (GTS_CONTAINER (domain), (GtsFunc) box_count, a);
guint i;
for (i = 0; i < a->len; i++) {
- gts_range_add_value (size, g_array_index (a, guint, i));
- g_array_index (a, guint, i) = 0;
+ guint v = g_array_index (a, guint, i);
+ if (v > 0) {
+ gts_range_add_value (size, v);
+ g_array_index (a, guint, i) = 0;
+ }
}
gts_container_foreach (GTS_CONTAINER (domain), (GtsFunc) boundary_size, a);
- for (i = 0; i < a->len; i++)
- gts_range_add_value (boundary, g_array_index (a, guint, i));
+ for (i = 0; i < a->len; i++) {
+ guint v = g_array_index (a, guint, i);
+ if (v > 0)
+ gts_range_add_value (boundary, v);
+ }
#ifdef HAVE_MPI
- g_assert (a->len == 1);
domain_range_reduce (domain, size);
domain_range_reduce (domain, boundary);
domain_range_reduce (domain, mpiwait);
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list