From bdf08705b0fd6011e07d388d57b5d91a655ada98 Mon Sep 17 00:00:00 2001
From: Norbert Podhorszki <pnorbert@ornl.gov>
Date: Fri, 1 Dec 2017 19:28:21 -0500
Subject: [PATCH] writer uses command line config file as well

---
 examples/heatTransfer/heat.xml            |  2 +-
 examples/heatTransfer/write/IO_adios2.cpp | 12 +-----
 examples/heatTransfer/write/config.xml    | 46 -----------------------
 3 files changed, 3 insertions(+), 57 deletions(-)
 delete mode 100644 examples/heatTransfer/write/config.xml

diff --git a/examples/heatTransfer/heat.xml b/examples/heatTransfer/heat.xml
index 56cd16dbb..8bc1a7f81 100644
--- a/examples/heatTransfer/heat.xml
+++ b/examples/heatTransfer/heat.xml
@@ -11,7 +11,7 @@
         ====================================-->
 
     <io name="writer">
-        <engine type="BPFileWriter">
+        <engine type="ADIOS1Writer">
             
             <!-- for vectorized memory operations, make sure your system 
                  enables threads--> 
diff --git a/examples/heatTransfer/write/IO_adios2.cpp b/examples/heatTransfer/write/IO_adios2.cpp
index e7b877f49..9dcd3b533 100644
--- a/examples/heatTransfer/write/IO_adios2.cpp
+++ b/examples/heatTransfer/write/IO_adios2.cpp
@@ -14,13 +14,6 @@
 
 #include <adios2.h>
 
-#define str_helper(X) #X
-#define str(X) str_helper(X)
-#ifndef DEFAULT_CONFIG
-#define DEFAULT_CONFIG config.xml
-#endif
-#define DEFAULT_CONFIG_STR str(DEFAULT_CONFIG)
-
 adios2::ADIOS *ad = nullptr;
 adios2::Engine *bpWriter = nullptr;
 adios2::Variable<double> *varT = nullptr;
@@ -29,12 +22,11 @@ adios2::Variable<unsigned int> *varGndx = nullptr;
 IO::IO(const Settings &s, MPI_Comm comm)
 {
     m_outputfilename = s.outputfile + ".bp";
-    ad = new adios2::ADIOS(std::string(DEFAULT_CONFIG_STR), comm,
-                           adios2::DebugON);
+    ad = new adios2::ADIOS(s.configfile, comm, adios2::DebugON);
 
     // Define method for engine creation
 
-    adios2::IO &bpio = ad->DeclareIO("output");
+    adios2::IO &bpio = ad->DeclareIO("writer");
     if (!bpio.InConfigFile())
     {
         // if not defined by user, we can change the default settings
diff --git a/examples/heatTransfer/write/config.xml b/examples/heatTransfer/write/config.xml
deleted file mode 100644
index d8a57767f..000000000
--- a/examples/heatTransfer/write/config.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!-- Config XML file fo the  heatTransfer_write_adios2 executable in .
-     build/bin from IO_adios2.cpp -->
-
-<adios-config>
-    <io name="output">
-        <engine type="BPFileWriter">
-            
-            <!-- for vectorized memory operations, make sure your system 
-                 enables threads--> 
-            <parameter key="Threads" value="2"/>
-
-            <!-- Microseconds (default), Milliseconds, Seconds, 
-                 Minutes, Hours -->
-            <parameter key="ProfileUnits" value="Microseconds"/>
-
-            <!-- XXKb, XXMb, or XXXGb supported, default=16Kb 
-                (applications might choose an optimal value) -->
-            <parameter key="InitialBufferSize" value="16Kb"/> 
-            
-            <!-- XXKb, XXMb, or XXXGb supported, default=Unlimited (until 
-                 fails), maximum at each time step  
-                (applications might choose an optimal value) -->
-            <!-- <parameter key="MaxBufferSize" value="2Gb"/> -->
-
-            <!-- exponential growth factor > 1, default = 1.05 
-                 1.05  is good for a few large variables, for many small
-                 variables increase the value to 1.5 to 2 
-                 (optimal value is application dependent)--> 
-            <!-- <parameter key="BufferGrowthFactor" value="1.05"/> -->
-            
-        </engine>
-
-        <transport type="File">
-            
-            <!-- POSIX, stdio (C FILE*), fstream (C++) -->
-            <parameter key="Library" value="POSIX"/>
-            
-            <!-- For read/write, Microseconds (default), Milliseconds, Seconds, 
-                 Minutes, Hours. open/close always in Microseconds -->
-            <parameter key="ProfileUnits" value="Microseconds"/>
-            
-        </transport>
-        
-    </io>
-</adios-config>
-- 
GitLab