[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:53 UTC 2009
The following commit has been merged in the upstream branch:
commit 3fea740eb29931c4f215abb09aab7ad95e2bce8d
Author: Stephane Popinet <popinet at users.sf.net>
Date: Thu Dec 18 09:29:58 2008 +1100
Parallel outputs are only done for files with '%d' format
darcs-hash:20081217222958-d4795-7e214ff7a785d5be56a8b438bd15b6512203db2f.gz
diff --git a/src/event.c b/src/event.c
index 70db959..6d46504 100644
--- a/src/event.c
+++ b/src/event.c
@@ -386,12 +386,6 @@ void gfs_event_init (GfsEvent * event,
g_return_if_fail (event != NULL);
g_return_if_fail (sim != NULL);
- if (GFS_DOMAIN (sim)->pid > 0 &&
- GFS_IS_OUTPUT (event) &&
- (!strcmp (GFS_OUTPUT (event)->format, "stderr") ||
- !strcmp (GFS_OUTPUT (event)->format, "stdout")))
- gfs_output_mute (GFS_OUTPUT (event));
-
if (event->start < 0.) { /* "init" event */
g_assert (GFS_EVENT_CLASS (GTS_OBJECT (event)->klass)->event);
(* GFS_EVENT_CLASS (GTS_OBJECT (event)->klass)->event) (event, sim);
diff --git a/src/output.c b/src/output.c
index 7ba3707..c60803e 100644
--- a/src/output.c
+++ b/src/output.c
@@ -133,6 +133,14 @@ static gboolean gfs_output_event (GfsEvent * event, GfsSimulation * sim)
GfsOutput * output = GFS_OUTPUT (event);
gchar * fname;
+ if (!output->parallel && GFS_DOMAIN (sim)->pid > 0) {
+ if (output->file)
+ output->first_call = FALSE;
+ else
+ gfs_output_mute (output);
+ return (output->file != NULL);
+ }
+
if (!output->dynamic) {
if (output->file) {
fflush (output->file->fp);
@@ -268,9 +276,11 @@ static void gfs_output_read (GtsObject ** o, GtsFile * fp)
format_new (startf, len, ITER));
output->dynamic = TRUE;
}
- else
+ else {
output->formats = g_slist_prepend (output->formats,
format_new (startf, len, PID));
+ output->parallel = TRUE;
+ }
}
else if (gfs_char_in_string (*c, "eEfFgGaA")) {
output->formats = g_slist_prepend (output->formats,
@@ -327,6 +337,7 @@ static void gfs_output_init (GfsOutput * object)
object->format = NULL;
object->formats = NULL;
object->dynamic = FALSE;
+ object->parallel = FALSE;
object->first_call = TRUE;
}
diff --git a/src/output.h b/src/output.h
index 159d596..06bb3ea 100644
--- a/src/output.h
+++ b/src/output.h
@@ -38,7 +38,7 @@ struct _GfsOutput {
GfsOutputFile * file;
gchar * format;
GSList * formats;
- gboolean dynamic, first_call;
+ gboolean dynamic, parallel, first_call;
};
struct _GfsOutputClass {
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list