From 03e63505e6ec122e581ff7c2ab00e3cbe680aa50 Mon Sep 17 00:00:00 2001
From: wfg <wfg@pc0098504.ornl.gov>
Date: Tue, 10 Jan 2017 18:02:57 -0500
Subject: [PATCH] Added DataMan template

Added example/hello/dataman with API examples
Changed mpidummy.h due to an error in Titan compilation with g++
---
 Makefile                                    |   3 +-
 examples/hello/dataman/Makefile             |  35 +++
 examples/hello/dataman/helloDataMan.cpp     |  93 +++++++
 examples/hello/dataman/helloDataMan_OOP.cpp |  87 ++++++
 include/ADIOS.h                             |   5 +-
 include/capsule/Heap.h                      |   4 +-
 include/capsule/ShmSystemV.h                |   4 +-
 include/core/Capsule.h                      |   4 +-
 include/core/Engine.h                       |   8 +
 include/core/Group.h                        |   4 +-
 include/engine/DataMan.h                    |  83 ++++++
 include/engine/SingleBP.h                   |   5 -
 src/ADIOS.cpp                               |   8 +-
 src/capsule/Heap.cpp                        |   4 +-
 src/capsule/ShmSystemV.cpp                  |   4 +-
 src/core/Engine.cpp                         |   1 +
 src/core/Group.cpp                          |   4 +-
 src/engine/DataMan.cpp                      | 280 ++++++++++++++++++++
 src/mpidummy.cpp                            |   2 +-
 19 files changed, 610 insertions(+), 28 deletions(-)
 create mode 100644 examples/hello/dataman/Makefile
 create mode 100644 examples/hello/dataman/helloDataMan.cpp
 create mode 100644 examples/hello/dataman/helloDataMan_OOP.cpp
 create mode 100644 include/engine/DataMan.h
 create mode 100644 src/engine/DataMan.cpp

diff --git a/Makefile b/Makefile
index c8d5cfbae..680082923 100644
--- a/Makefile
+++ b/Makefile
@@ -13,8 +13,7 @@ AR:=$(SYS_BIN)/ar
 MPICC:=$(SYS_BIN)/mpic++
 LIBS:= -L$(SYS_LIB) -L$(LOCAL_LIB)
 
-CFLAGS:=-c -Wall -O0 -g -Wpedantic -Woverloaded-virtual -std=c++11
-#CFLAGS:=-c -Wall -O3 -Wpedantic -Woverloaded-virtual -std=c++14
+CFLAGS:=-c -Wall -Wpedantic -Woverloaded-virtual -std=c++11 -O0 -g
 ARFLAGS:=rcs
 
 #ADIOS 
diff --git a/examples/hello/dataman/Makefile b/examples/hello/dataman/Makefile
new file mode 100644
index 000000000..88896bd67
--- /dev/null
+++ b/examples/hello/dataman/Makefile
@@ -0,0 +1,35 @@
+# Makefile for testing purposes, will build libadios.a 
+# Created on: Oct 4, 2016
+#     Author: wfg
+
+
+BASE_NAME=helloDataMan_OOP
+     
+TOOL_DIR=/usr/bin
+
+CC=$(TOOL_DIR)/g++ # Compiling with mpicc for now
+MPICC=$(TOOL_DIR)/mpic++
+AR=$(TOOL_DIR)/ar
+
+#ADIOS LOCATION
+ADIOS_DIR=../../..
+ADIOS_LIB=$(ADIOS_DIR)/lib/libadios.a
+ADIOS_NOMPI_LIB=$(ADIOS_DIR)/lib/libadios_nompi.a
+
+ADIOS_INCLUDE=-I$(ADIOS_DIR)/include
+
+
+#FLAGS
+CFLAGS=-Wall -O0 -g -Wpedantic -std=c++11
+
+all: mpi
+
+mpi: $(ADIOS_LIB) $(ADIOS_HFiles)
+	$(MPICC) $(CFLAGS) $(ADIOS_INCLUDE) -DHAVE_MPI $(BASE_NAME).cpp -o $(BASE_NAME)_mpi $(ADIOS_LIB)
+	
+nompi: $(ADIOS_NOMPI_LIB) $(NoMPI_HFiles)
+	$(CC) $(CFLAGS) $(ADIOS_INCLUDE) $(BASE_NAME).cpp -o $(BASE_NAME)_nompi $(ADIOS_NOMPI_LIB)
+
+clean:
+	rm *_mpi; rm *_nompi
+     
diff --git a/examples/hello/dataman/helloDataMan.cpp b/examples/hello/dataman/helloDataMan.cpp
new file mode 100644
index 000000000..43991600c
--- /dev/null
+++ b/examples/hello/dataman/helloDataMan.cpp
@@ -0,0 +1,93 @@
+/*
+ * helloADIOSNoXML_OOP.cpp
+ *
+ *  Created on: Jan 9, 2017
+ *      Author: wfg
+ */
+
+#include <vector>
+#include <iostream>
+
+#ifdef HAVE_MPI
+    #include <mpi.h>
+#else
+    #include "mpidummy.h"
+    using adios::MPI_Init;
+    using adios::MPI_Comm_rank;
+    using adios::MPI_Finalize;
+#endif
+
+
+#include "ADIOS.h"
+
+
+int main( int argc, char* argv [] )
+{
+    MPI_Init( &argc, &argv );
+    int rank;
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    const bool adiosDebug = true;
+
+    //Application variable
+    std::vector<double> myInts = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+    int myIntsSize = 10;
+
+    try
+    {
+        //Define group and variables
+        adios::ADIOS adios( MPI_COMM_WORLD, adiosDebug );
+        const std::string groupName( "ints" );
+        adios.DeclareGroup( groupName );
+        adios.DefineVariable( groupName, "myIntsSize", "int" );
+        adios.DefineVariable( groupName, "myInts", "double", "myIntsSize" );
+
+        //Define method
+        const std::string methodName( "singleBP" );
+        adios.DeclareMethod( methodName, "singleBP" );
+        adios.AddCapsule( methodName, "Heap" );
+        adios.AddTransport( methodName, "POSIX", "fname=myfile.bp" );
+        adios.AddTransport( methodName, "TCP_IP", "fname=myfile.tcp" );
+
+        //Create engine handler and Write
+        int handler = adios.Open( "myInts.bp", "w", methodName );
+        adios.SetDefaultGroup( handler, groupName );
+
+        double varDouble = 10.;
+        adios.Write( handler, "myIntsSize", &varDouble );
+        adios.Write( handler, "myInts", &myInts.front() );
+        adios.Write( 10, "myInts", &myInts.front() );
+        adios.Close( handler );
+    }
+    catch( std::invalid_argument& e )
+    {
+        if( rank == 0 )
+        {
+            std::cout << "Invalid argument exception, STOPPING PROGRAM\n";
+            std::cout << e.what() << "\n";
+        }
+    }
+    catch( std::ios_base::failure& e )
+    {
+        if( rank == 0 )
+        {
+            std::cout << "System exception, STOPPING PROGRAM\n";
+            std::cout << e.what() << "\n";
+        }
+    }
+    catch( std::exception& e )
+    {
+        if( rank == 0 )
+        {
+            std::cout << "Exception, STOPPING PROGRAM\n";
+            std::cout << e.what() << "\n";
+        }
+    }
+
+    MPI_Finalize( );
+
+    return 0;
+
+}
+
+
+
diff --git a/examples/hello/dataman/helloDataMan_OOP.cpp b/examples/hello/dataman/helloDataMan_OOP.cpp
new file mode 100644
index 000000000..2be3296e7
--- /dev/null
+++ b/examples/hello/dataman/helloDataMan_OOP.cpp
@@ -0,0 +1,87 @@
+/*
+ * helloADIOSNoXML_OOP.cpp
+ *
+ *  Created on: Jan 9, 2017
+ *      Author: wfg
+ */
+
+#include <vector>
+#include <iostream>
+
+#ifdef HAVE_MPI
+    #include <mpi.h>
+#else
+    #include "mpidummy.h"
+    using adios::MPI_Init;
+    using adios::MPI_Comm_rank;
+    using adios::MPI_Finalize;
+#endif
+
+
+#include "ADIOS_OOP.h"
+
+
+int main( int argc, char* argv [] )
+{
+    MPI_Init( &argc, &argv );
+    int rank;
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    const bool adiosDebug = true;
+
+    //Application variable
+    std::vector<double> myInts = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+    int myIntsSize = static_cast<int>( myInts.size() );
+
+    try
+    {
+        //Define group and variables
+        adios::Group group( adiosDebug );
+        group.DefineVariable( "myIntsSize", "int" ); //define size as scalar
+        group.DefineVariable( "myInts",     "double", "myIntsSize" ); //define variable with associate size
+
+        //Define method
+        adios::Method method( "DataMan", adiosDebug );
+        method.AddCapsule( "Heap" );
+        method.AddTransport( "POSIX", "have_metadata_file=0" ); //option to save to file
+        method.AddTransport( "TCP_IP", "fname=myfile.tcp" ); //here you can add as many options as you want in the format "parameter=value"
+
+        //Create engine and Write
+        adios::engine::DataMan dataMan( "myMessage", "w", MPI_COMM_WORLD, method, adiosDebug );
+        dataMan.SetDefaultGroup( group );
+        dataMan.Write( "myIntsSize", &myIntsSize  ); //issue hello
+        dataMan.Write( "myInts", &myInts.front() ); //issue hello
+        dataMan.Close( );
+    }
+    catch( std::invalid_argument& e )
+    {
+        if( rank == 0 )
+        {
+            std::cout << "Invalid argument exception, STOPPING PROGRAM\n";
+            std::cout << e.what() << "\n";
+        }
+    }
+    catch( std::ios_base::failure& e )
+    {
+        if( rank == 0 )
+        {
+            std::cout << "System exception, STOPPING PROGRAM\n";
+            std::cout << e.what() << "\n";
+        }
+    }
+    catch( std::exception& e )
+    {
+        if( rank == 0 )
+        {
+            std::cout << "Exception, STOPPING PROGRAM\n";
+            std::cout << e.what() << "\n";
+        }
+    }
+
+    MPI_Finalize( );
+
+    return 0;
+
+}
+
+
+
diff --git a/include/ADIOS.h b/include/ADIOS.h
index 04c92fda0..60a5247e1 100644
--- a/include/ADIOS.h
+++ b/include/ADIOS.h
@@ -170,7 +170,7 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
      * @param cores optional parameter for threaded operations
      * @return handler to created engine
      */
-    const unsigned int Open( const std::string streamName, const std::string accessMode, MPI_Comm mpiComm,
+    unsigned int Open( const std::string streamName, const std::string accessMode, MPI_Comm mpiComm,
                              const std::string methodName, const unsigned int cores = 1 );
 
 
@@ -182,7 +182,7 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
      * @param cores optional parameter for threaded operations
      * @return handler to created engine
      */
-    const unsigned int Open( const std::string streamName, const std::string accessMode, const std::string methodName,
+    unsigned int Open( const std::string streamName, const std::string accessMode, const std::string methodName,
                              const unsigned int cores = 1 );
 
 
@@ -307,6 +307,7 @@ private:
     void CheckGroup( std::map< std::string, Group >::const_iterator itGroup,
                      const std::string groupName, const std::string hint ) const;
 
+
     /**
      * @brief Checks for method existence in m_Methods, if failed throws std::invalid_argument exception
      * @param itMethod m_Methods iterator, usually from find function
diff --git a/include/capsule/Heap.h b/include/capsule/Heap.h
index d16d04df3..8618d0eeb 100644
--- a/include/capsule/Heap.h
+++ b/include/capsule/Heap.h
@@ -38,8 +38,8 @@ public:
     char* GetData( );
     char* GetMetadata( );
 
-    const std::size_t GetDataSize( ) const;
-    const std::size_t GetMetadataSize( ) const;
+    std::size_t GetDataSize( ) const;
+    std::size_t GetMetadataSize( ) const;
 
     void ResizeData( const std::size_t size );
     void ResizeMetadata( const std::size_t size );
diff --git a/include/capsule/ShmSystemV.h b/include/capsule/ShmSystemV.h
index c7e1f2c6c..72b7ee854 100644
--- a/include/capsule/ShmSystemV.h
+++ b/include/capsule/ShmSystemV.h
@@ -38,8 +38,8 @@ public:
     char* GetData( ); ///< return the pointer to the raw data buffer
     char* GetMetadata( ); ///< return the pointer to the raw metadata buffer
 
-    const std::size_t GetDataSize( ) const; ///< get current data buffer size
-    const std::size_t GetMetadataSize( ) const; ///< get current metadata buffer size
+    std::size_t GetDataSize( ) const; ///< get current data buffer size
+    std::size_t GetMetadataSize( ) const; ///< get current metadata buffer size
 
     void WriteData( const std::size_t first, const char* data, const std::size_t size );
     void WriteData( const std::size_t first, const unsigned char* data, const std::size_t size );
diff --git a/include/core/Capsule.h b/include/core/Capsule.h
index ac3bf4b4b..5dc08cf60 100644
--- a/include/core/Capsule.h
+++ b/include/core/Capsule.h
@@ -43,8 +43,8 @@ public:
     virtual char* GetData( ) = 0; ///< return the pointer to the raw data buffer
     virtual char* GetMetadata( ) = 0; ///< return the pointer to the raw metadata buffer
 
-    virtual const std::size_t GetDataSize( ) const = 0; ///< get current data buffer size
-    virtual const std::size_t GetMetadataSize( ) const = 0; ///< get current metadata buffer size
+    virtual std::size_t GetDataSize( ) const = 0; ///< get current data buffer size
+    virtual std::size_t GetMetadataSize( ) const = 0; ///< get current metadata buffer size
 
     virtual void ResizeData( const std::size_t size ); ///< resize data buffer
     virtual void ResizeMetadata( const std::size_t size ); ///< resize metadata buffer
diff --git a/include/core/Engine.h b/include/core/Engine.h
index 208736cba..e91c979cc 100644
--- a/include/core/Engine.h
+++ b/include/core/Engine.h
@@ -95,6 +95,14 @@ public:
     virtual void Write( Group& group, const std::string variableName, const double* values ) = 0;
     virtual void Write( Group& group, const std::string variableName, const long double* values ) = 0;
 
+    /**
+     * @brief Write functions can be overridden by derived classes. Base class behavior is to:
+     * 1) Write to Variable values (m_Values) using the pointer to default group *m_Group set with SetDefaultGroup function
+     * 2) Transform the data
+     * 3) Write to all capsules -> data and metadata
+     * @param variableName
+     * @param values coming from user app
+     */
     virtual void Write( const std::string variableName, const char* values ) = 0;
     virtual void Write( const std::string variableName, const unsigned char* values ) = 0;
     virtual void Write( const std::string variableName, const short* values ) = 0;
diff --git a/include/core/Group.h b/include/core/Group.h
index 72b27220f..006698e8c 100644
--- a/include/core/Group.h
+++ b/include/core/Group.h
@@ -161,7 +161,7 @@ private:
      * @param globalOffsetsCSV comma separated variables defining global offsets (e.g. "oNx,oNY,oNz")
      * @return -1 if not global --> both inputs are empty, otherwise index in m_GlobalBounds if exist or create a new element in m_GlobalBounds;
      */
-    const int SetGlobalBounds( const std::string globalDimensionsCSV, const std::string globalOffsetsCSV ) noexcept;
+    int SetGlobalBounds( const std::string globalDimensionsCSV, const std::string globalOffsetsCSV ) noexcept;
 
 
     /**
@@ -171,7 +171,7 @@ private:
      * @param variableName  variable to be searched in m_SetVariables
      * @return variable value
      */
-    const unsigned long long int GetIntVariableValue( const std::string variableName ) const;
+    unsigned long long int GetIntVariableValue( const std::string variableName ) const;
 
 };
 
diff --git a/include/engine/DataMan.h b/include/engine/DataMan.h
new file mode 100644
index 000000000..ddbd91b3f
--- /dev/null
+++ b/include/engine/DataMan.h
@@ -0,0 +1,83 @@
+/*
+ * DataMan.h
+ *
+ *  Created on: Jan 10, 2017
+ *      Author: wfg
+ */
+
+#ifndef DATAMAN_H_
+#define DATAMAN_H_
+
+
+#include "core/Engine.h"
+
+
+namespace adios
+{
+namespace engine
+{
+
+
+class DataMan : public Engine
+{
+
+public:
+
+    /**
+     * Constructor for single BP capsule engine, writes in BP format into a single heap capsule
+     * @param name unique name given to the engine
+     * @param accessMode
+     * @param mpiComm
+     * @param method
+     * @param debugMode
+     */
+    DataMan( const std::string name, const std::string accessMode, MPI_Comm mpiComm,
+              const Method& method, const bool debugMode = false, const unsigned int cores = 1 );
+
+    ~DataMan( );
+
+    void Write( Group& group, const std::string variableName, const char* values );
+    void Write( Group& group, const std::string variableName, const unsigned char* values );
+    void Write( Group& group, const std::string variableName, const short* values );
+    void Write( Group& group, const std::string variableName, const unsigned short* values );
+    void Write( Group& group, const std::string variableName, const int* values );
+    void Write( Group& group, const std::string variableName, const unsigned int* values );
+    void Write( Group& group, const std::string variableName, const long int* values );
+    void Write( Group& group, const std::string variableName, const unsigned long int* values );
+    void Write( Group& group, const std::string variableName, const long long int* values );
+    void Write( Group& group, const std::string variableName, const unsigned long long int* values );
+    void Write( Group& group, const std::string variableName, const float* values );
+    void Write( Group& group, const std::string variableName, const double* values );
+    void Write( Group& group, const std::string variableName, const long double* values );
+
+    void Write( const std::string variableName, const char* values );
+    void Write( const std::string variableName, const unsigned char* values );
+    void Write( const std::string variableName, const short* values );
+    void Write( const std::string variableName, const unsigned short* values );
+    void Write( const std::string variableName, const int* values );
+    void Write( const std::string variableName, const unsigned int* values );
+    void Write( const std::string variableName, const long int* values );
+    void Write( const std::string variableName, const unsigned long int* values );
+    void Write( const std::string variableName, const long long int* values );
+    void Write( const std::string variableName, const unsigned long long int* values );
+    void Write( const std::string variableName, const float* values );
+    void Write( const std::string variableName, const double* values );
+    void Write( const std::string variableName, const long double* values );
+
+private:
+
+    void Init( );
+    void InitCapsules( );
+    void InitTransports( );
+
+};
+
+
+} //end namespace engine
+} //end namespace adios
+
+
+
+
+
+#endif /* DATAMAN_H_ */
diff --git a/include/engine/SingleBP.h b/include/engine/SingleBP.h
index 52706956b..346978149 100644
--- a/include/engine/SingleBP.h
+++ b/include/engine/SingleBP.h
@@ -72,11 +72,6 @@ private:
 };
 
 
-
-
-
-
-
 } //end namespace engine
 } //end namespace adios
 
diff --git a/src/ADIOS.cpp b/src/ADIOS.cpp
index 8b650933c..fd25ef8df 100644
--- a/src/ADIOS.cpp
+++ b/src/ADIOS.cpp
@@ -99,8 +99,8 @@ void ADIOS::DeclareMethod( const std::string methodName, const std::string type
 }
 
 
-const unsigned int ADIOS::Open( const std::string name, const std::string accessMode,
-                                MPI_Comm mpiComm, const std::string methodName, const unsigned int cores )
+unsigned int ADIOS::Open( const std::string name, const std::string accessMode,
+                          MPI_Comm mpiComm, const std::string methodName, const unsigned int cores )
 {
     auto itMethod = m_Methods.find( methodName );
 
@@ -137,8 +137,8 @@ const unsigned int ADIOS::Open( const std::string name, const std::string access
 }
 
 
-const unsigned int ADIOS::Open( const std::string streamName, const std::string accessMode, const std::string methodName,
-                                const unsigned int cores )
+unsigned int ADIOS::Open( const std::string streamName, const std::string accessMode, const std::string methodName,
+                          const unsigned int cores )
 {
     return Open( streamName, accessMode, m_MPIComm, methodName, cores );
 }
diff --git a/src/capsule/Heap.cpp b/src/capsule/Heap.cpp
index 7706601ad..d9ebaefaf 100644
--- a/src/capsule/Heap.cpp
+++ b/src/capsule/Heap.cpp
@@ -38,13 +38,13 @@ char* Heap::GetMetadata( )
 }
 
 
-const std::size_t Heap::GetDataSize( ) const
+std::size_t Heap::GetDataSize( ) const
 {
     return m_Data.size( );
 }
 
 
-const std::size_t Heap::GetMetadataSize( ) const
+std::size_t Heap::GetMetadataSize( ) const
 {
     return m_Metadata.size();
 }
diff --git a/src/capsule/ShmSystemV.cpp b/src/capsule/ShmSystemV.cpp
index 0ed5cef2b..87d515173 100644
--- a/src/capsule/ShmSystemV.cpp
+++ b/src/capsule/ShmSystemV.cpp
@@ -58,13 +58,13 @@ char* ShmSystemV::GetMetadata( )
 }
 
 
-const std::size_t ShmSystemV::GetDataSize( ) const
+std::size_t ShmSystemV::GetDataSize( ) const
 {
     return m_DataSize;
 }
 
 
-const std::size_t ShmSystemV::GetMetadataSize( ) const
+std::size_t ShmSystemV::GetMetadataSize( ) const
 {
     return m_MetadataSize;
 }
diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp
index 90d5cd98c..3f1dfc30f 100644
--- a/src/core/Engine.cpp
+++ b/src/core/Engine.cpp
@@ -40,6 +40,7 @@ void Engine::SetDefaultGroup( Group& group )
     m_Group = &group;
 }
 
+
 //PROTECTED
 const unsigned int Engine::PreSetVariable( Group& group, const std::string variableName,
                                            const std::set<std::string>& types,
diff --git a/src/core/Group.cpp b/src/core/Group.cpp
index 21164d622..efce46fd9 100644
--- a/src/core/Group.cpp
+++ b/src/core/Group.cpp
@@ -239,7 +239,7 @@ void Group::DefineAttribute( const std::string attributeName, const std::string
 }
 
 
-const unsigned long long int Group::GetIntVariableValue( const std::string variableName ) const
+unsigned long long int Group::GetIntVariableValue( const std::string variableName ) const
 {
     if( m_DebugMode == true )
     {
@@ -428,7 +428,7 @@ void Group::ParseXMLGroup( const std::string& xmlGroup, std::vector< std::shared
 }
 
 
-const int Group::SetGlobalBounds( const std::string globalDimensionsCSV, const std::string globalOffsetsCSV ) noexcept
+int Group::SetGlobalBounds( const std::string globalDimensionsCSV, const std::string globalOffsetsCSV ) noexcept
 {
     if( globalDimensionsCSV.empty() || globalOffsetsCSV.empty() )
         return -1;
diff --git a/src/engine/DataMan.cpp b/src/engine/DataMan.cpp
new file mode 100644
index 000000000..a9a68cf2b
--- /dev/null
+++ b/src/engine/DataMan.cpp
@@ -0,0 +1,280 @@
+/*
+ * DataMan.cpp
+ *
+ *  Created on: Jan 10, 2017
+ *      Author: wfg
+ */
+
+#include <iostream>
+
+#include "engine/DataMan.h"
+#include "core/Support.h"
+
+//supported capsules
+#include "capsule/Heap.h"
+
+//supported transports
+#include "transport/POSIX.h"
+#include "transport/FStream.h"
+#include "transport/File.h"
+
+
+namespace adios
+{
+namespace engine
+{
+
+DataMan::DataMan( const std::string streamName, const std::string accessMode, const MPI_Comm mpiComm,
+                  const Method& method, const bool debugMode, const unsigned int cores ):
+    Engine( "SingleBP", streamName, accessMode, mpiComm, method, debugMode, cores, " SingleBP constructor (or call to ADIOS Open).\n" )
+{
+    Init( );
+}
+
+
+DataMan::~DataMan( )
+{ }
+
+
+void DataMan::Init( )
+{
+    InitCapsules( );
+    InitTransports( );
+}
+
+
+void DataMan::Write( Group& group, const std::string variableName, const char* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const unsigned char* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const short* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const unsigned short* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const int* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const unsigned int* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const long int* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const unsigned long int* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const long long int* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const unsigned long long int* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const float* values )
+{
+
+}
+
+void DataMan::Write( Group& group, const std::string variableName, const double* values )
+{
+
+}
+
+
+void DataMan::Write( Group& group, const std::string variableName, const long double* values )
+{
+
+}
+
+
+void DataMan::Write( const std::string variableName, const char* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const unsigned char* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const short* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const unsigned short* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const int* values )
+{
+    auto index = PreSetVariable( *m_Group, variableName, Support::DatatypesAliases.at("int"), " from call to Write int*" );
+    std::cout << "Hello from DataMan Write integer with index " << index << "\n";
+
+}
+
+void DataMan::Write( const std::string variableName, const unsigned int* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const long int* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const unsigned long int* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const long long int* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const unsigned long long int* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const float* values )
+{
+
+}
+
+void DataMan::Write( const std::string variableName, const double* values )
+{
+    auto index = PreSetVariable( *m_Group, variableName, Support::DatatypesAliases.at("double"), " from call to Write double*" );
+    std::cout << "Hello from Data Write double with index " << index << "\n";
+}
+
+
+void DataMan::Write( const std::string variableName, const long double* values )
+{
+
+}
+
+
+void DataMan::InitCapsules( )
+{
+    if( m_DebugMode == true )
+    {
+        if( m_Method.m_CapsuleParameters.size() > 1 )
+        {
+            throw std::invalid_argument( "ERROR: SingleBP engine only allows one heap buffer, in " + m_Name +
+                                         m_EndMessage );
+        }
+        else if( m_Method.m_CapsuleParameters.size() == 1 )
+        {
+            auto itType = m_Method.m_CapsuleParameters[0].find( "buffer" );
+
+            if( m_DebugMode == true )
+                CheckParameter( itType, m_Method.m_CapsuleParameters[0], " capsule buffer",
+                                ", in " + m_Name + m_EndMessage );
+
+            if( !( itType->second == "Heap" || itType->second == "HEAP" ) )
+                throw std::invalid_argument( "ERROR: SingleBP doesn't support Capsule of buffer type " +
+                                              itType->second + " in " + m_Name + m_EndMessage );
+        }
+    }
+    //Create single capsule of type heap
+    m_Capsules.push_back( std::make_shared<Heap>( m_AccessMode, m_RankMPI, m_Cores ) );
+}
+
+
+
+void DataMan::InitTransports( )
+{
+    std::set< std::string > transportStreamNames; //used to check for name conflict between transports
+
+    const unsigned int transportsSize = m_Method.m_TransportParameters.size();
+
+    for( const auto& parameters : m_Method.m_TransportParameters )
+    {
+        auto itTransport = parameters.find( "transport" );
+        if( m_DebugMode == true )
+            CheckParameter( itTransport, parameters, "transport", ", in " + m_Name + m_EndMessage );
+
+
+        if( itTransport->second == "POSIX" )
+        {
+            m_Transports.push_back( std::make_shared<POSIX>( m_MPIComm, m_DebugMode ) );
+        }
+        else if( itTransport->second == "File" )
+        {
+            m_Transports.push_back( std::make_shared<File>( m_MPIComm, m_DebugMode ) );
+        }
+        else if( itTransport->second == "FStream" )
+        {
+            m_Transports.push_back( std::make_shared<FStream>( m_MPIComm, m_DebugMode ) );
+        }
+        else if( itTransport->second == "MPIFile" )
+        {
+            //m_Transports.push_back( std::make_shared<MPIFile>( m_MPIComm, m_DebugMode ) ); not yet supported
+        }
+        else
+        {
+            if( m_DebugMode == true )
+                throw std::invalid_argument( "ERROR: transport + " + itTransport->second + " not supported, in " +
+                                              m_Name + m_EndMessage );
+        }
+        //name
+        if( transportsSize > 1 )
+        {
+            auto itName = parameters.find( "name" ); //first check name
+
+            if( m_DebugMode == true )
+                CheckParameter( itName, parameters, "name", " in transport " + itTransport->second +
+                                ", in " + m_Name + m_EndMessage );
+
+            m_Transports.back()->Open( itName->second, m_AccessMode );
+        }
+        else if( transportsSize == 1 )
+        {
+            auto itName = parameters.find( "name" );
+
+            if( itName == parameters.end() ) //take streamName
+                m_Transports.back()->Open( m_Name, m_AccessMode );
+            else
+                m_Transports.back()->Open( m_Name, m_AccessMode );
+
+        }
+        else if( transportsSize == 0 )
+        {
+            if( m_DebugMode == true )
+                throw std::invalid_argument( "ERROR: transport not defined for engine " + m_Name + m_EndMessage );
+        }
+    }
+}
+
+
+} //end namespace engine
+} //end namespace adios
+
+
+
diff --git a/src/mpidummy.cpp b/src/mpidummy.cpp
index 6c2bb66f0..3a3de22a2 100644
--- a/src/mpidummy.cpp
+++ b/src/mpidummy.cpp
@@ -197,7 +197,7 @@ int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_
     uint64_t bytes_read;
     bytes_read = read (fh, buf, bytes_to_read);
     if (bytes_read != bytes_to_read) {
-        snprintf(mpierrmsg, MPI_MAX_ERROR_STRING, "could not read %" PRIu64 " bytes. read only: %" PRIu64 "\n", bytes_to_read, bytes_read);
+        snprintf(mpierrmsg, MPI_MAX_ERROR_STRING, "could not read %lu bytes. read only: %lu \n", bytes_to_read, bytes_read);
         return -2;
     }
     *status = bytes_read;
-- 
GitLab