]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add an configuration option
authorMatthias Maier <tamiko@43-1.org>
Thu, 2 Apr 2020 21:21:10 +0000 (16:21 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 4 Apr 2020 06:20:22 +0000 (01:20 -0500)
examples/step-69/step-69.cc
examples/step-69/step-69.prm

index 74750c3444e07c7268e9dbfed4191ba4026e6f58..b75a712b094104c6e4407afdfc11f38556b4db20 100644 (file)
@@ -495,7 +495,8 @@ namespace Step69
     std::string base_name;
     double      t_final;
     double      output_granularity;
-    bool        enable_compute_error;
+
+    bool asynchronous_writeback;
 
     bool resume;
 
@@ -2506,6 +2507,11 @@ namespace Step69
                   output_granularity,
                   "time interval for output");
 
+    asynchronous_writeback = true;
+    add_parameter("asynchronous writeback",
+                  asynchronous_writeback,
+                  "Write out solution in a background thread performing IO");
+
     resume = false;
     add_parameter("resume", resume, "Resume an interrupted computation.");
   }
@@ -2847,7 +2853,14 @@ namespace Step69
     // time stepping in the main loop - the thread will run in the
     // background.
 
-    output_thread = std::move(std::thread(output_worker));
+    if (!asynchronous_writeback)
+      {
+        output_thread = std::move(std::thread(output_worker));
+      }
+    else
+      {
+        output_worker();
+      }
   }
 
 } // namespace Step69
index d2072adf6cc4a32d49a5bd258d6ab5cf8fe7359d..e69826de17a7bbaa3dd5e0059ab7c75f262b2dfe 100644 (file)
@@ -1,17 +1,20 @@
 # Listing of Parameters
 # ---------------------
 subsection A - MainLoop
+  # Write out solution in a background thread performing IO
+  set asynchronous writeback = true
+
   # Base name for all output files
-  set basename           = test
+  set basename               = test
 
   # Final time
-  set final time         = 4
+  set final time             = 4
 
   # time interval for output
-  set output granularity = 0.02
+  set output granularity     = 0.02
 
   # Resume an interrupted computation.
-  set resume             = false
+  set resume                 = false
 end
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.