[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 2489163dd5ed9fcb5892864bd3afb89300893e74
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Thu Jan 8 13:05:31 2009 +1100

    OutputTime also outputs real elapsed time
    
    darcs-hash:20090108020531-d4795-98927bce83680146e38003c8d87c00f7f5302a2b.gz

diff --git a/src/output.c b/src/output.c
index 44f6966..add20cd 100644
--- a/src/output.c
+++ b/src/output.c
@@ -464,6 +464,7 @@ void gfs_output_file_close (GfsOutputFile * file)
 static void time_destroy (GtsObject * o)
 {
   gfs_clock_destroy (GFS_OUTPUT_TIME (o)->clock);
+  g_timer_destroy (GFS_OUTPUT_TIME (o)->timer);
 
   (* GTS_OBJECT_CLASS (gfs_output_time_class ())->parent_class->destroy) (o);  
 }
@@ -471,13 +472,17 @@ static void time_destroy (GtsObject * o)
 static gboolean time_event (GfsEvent * event, GfsSimulation * sim)
 {
   if ((* GFS_EVENT_CLASS (gfs_output_class())->event) (event, sim)) {
-    if (!GFS_OUTPUT_TIME (event)->clock->started)
-      gfs_clock_start (GFS_OUTPUT_TIME (event)->clock);
+    GfsOutputTime * t = GFS_OUTPUT_TIME (event);
+    if (!t->clock->started) {
+      gfs_clock_start (t->clock);
+      g_timer_start (t->timer);
+    }
     fprintf (GFS_OUTPUT (event)->file->fp,
-	     "step: %7u t: %15.8f dt: %13.6e cpu: %15.8f\n",
+	     "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 (GFS_OUTPUT_TIME (event)->clock));
+	     gfs_clock_elapsed (t->clock),
+	     g_timer_elapsed (t->timer, NULL));
     return TRUE;
   }
   return FALSE;
@@ -492,6 +497,7 @@ static void gfs_output_time_class_init (GfsEventClass * klass)
 static void gfs_output_time_init (GfsOutputTime * time)
 {
   time->clock = gfs_clock_new ();
+  time->timer = g_timer_new ();
 }
 
 GfsOutputClass * gfs_output_time_class (void)
diff --git a/src/output.h b/src/output.h
index ea968e4..159d596 100644
--- a/src/output.h
+++ b/src/output.h
@@ -79,6 +79,7 @@ struct _GfsOutputTime {
 
   /*< public >*/
   GfsClock * clock;
+  GTimer * timer;
 };
 
 #define GFS_OUTPUT_TIME(obj)            GTS_OBJECT_CAST (obj,\

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list