From ef674319c664d06199052f14fa76a4f6f1a3180b Mon Sep 17 00:00:00 2001
From: Norbert Podhorszki <pnorbert@ornl.gov>
Date: Fri, 24 Mar 2017 13:56:08 -0400
Subject: [PATCH] Fixes to API branch after merging groupless branch into it

---
 doc/API_design/API_example_use.cpp            | 16 ++--
 examples/heatTransfer/IO_adios2.cpp           |  6 +-
 examples/hello/bpWriter/helloBPWriter.cpp     |  4 +-
 .../hello/bpWriter/helloBPWriter_nompi.cpp    |  2 +-
 .../helloDataManWriter_nompi.cpp              | 13 ++-
 include/ADIOS.h                               | 40 ++++----
 include/ADIOSTypes.h                          | 29 ++++++
 include/ADIOS_CPP.h                           |  2 +-
 include/capsule/shmem/ShmSystemV.h            |  1 -
 include/core/Engine.h                         | 94 +++++++++++--------
 include/core/Method.h                         | 21 +++--
 include/engine/bp/BPFileReader.h              |  3 +-
 include/engine/bp/BPFileWriter.h              |  5 +-
 include/engine/dataman/DataManReader.h        |  4 +-
 include/engine/dataman/DataManWriter.h        |  4 +-
 include/format/BP1Writer.h                    | 14 +--
 include/functions/adiosTemplates.h            | 34 ++++---
 src/ADIOS.cpp                                 | 58 ++++++++----
 src/core/Engine.cpp                           | 12 ++-
 src/core/Method.cpp                           | 27 +++++-
 src/engine/bp/BPFileReader.cpp                |  5 +-
 src/engine/bp/BPFileWriter.cpp                |  5 +-
 src/engine/dataman/DataManReader.cpp          |  4 +-
 src/engine/dataman/DataManWriter.cpp          |  4 +-
 24 files changed, 257 insertions(+), 150 deletions(-)
 create mode 100644 include/ADIOSTypes.h

diff --git a/doc/API_design/API_example_use.cpp b/doc/API_design/API_example_use.cpp
index ce85124cb..57333e030 100644
--- a/doc/API_design/API_example_use.cpp
+++ b/doc/API_design/API_example_use.cpp
@@ -41,12 +41,12 @@ int main( int argc, char* argv[])
     {
         // if not defined by user, we can change the default settings
         wmethod.SetEngine( "BP" ); // BP is the default engine
-        wmethod.SetAvailableCores( 1 ); // no threading for data processing (except for staging)
+        wmethod.AllowThreads( 1 ); // no threading for data processing (except for staging)
         wmethod.AddTransport( "File", "lucky=yes" ); // ISO-POSIX file is the default transport
         wmethod.AddTransport( "Staging" ); //"The" staging method developed in ECP
         wmethod.SetParameters("have_metadata_file","yes" ); // Passing parameters to the engine
         wmethod.SetParameters( "Aggregation", (nproc+1)/2 ); // number of aggregators
-        wmethod.SetParameters( "verbose", adios::WARN ); // Verbosity level for this engine and what it calls
+        wmethod.SetParameters( "verbose", adios::Verbose::WARN ); // Verbosity level for this engine and what it calls
     }
 
 
@@ -64,7 +64,7 @@ int main( int argc, char* argv[])
 
     // open...write.write.write...advance...write.write.write...advance... ...close  cycle
     // "w" create/overwrite on open, "a" append at open, "u" open for update (does not increase step), "r" open for read.
-    std::shared_ptr<adios::Engine> writer = adios.Open( "myNumbers.bp", "w", comm, wmethod, adios::INDEPENDENT_IO);
+    std::shared_ptr<adios::Engine> writer = adios.Open( "myNumbers.bp", "w", comm, wmethod, adios::IOMode::INDEPENDENT);
 
     if( writer == nullptr )
         throw std::ios_base::failure( "ERROR: failed to open ADIOS writer\n" );
@@ -102,7 +102,7 @@ int main( int argc, char* argv[])
         // When Advance() returns, user can overwrite its Zero Copy variables.
         // Internal buffer is freed only if there are no Zero Copy variables and there is no time aggregation going on
         writer->Advance(); // same as AppendMode
-        writer->Advance( adios::APPEND ); // append new step at next write
+        writer->Advance( adios::APPEND, 0.0 ); // append new step at next write
         writer->Advance( adios::UPDATE ); // do not increase step;
 
         // When AdvanceAsync returns, user need to wait for notification that he can overwrite the Zero Copy variables.
@@ -126,7 +126,7 @@ int main( int argc, char* argv[])
         rmethod.SetEngine( "BP" ); // BP is the default engine
         rmethod.AddTransport( "Staging" ); //"The" staging method developed in ECP
         rmethod.SetParameters( "Aggregation", (nproc+1)/2 ); // number of aggregators
-        rmethod.SetParameters( "verbose", adios::WARN ); // Verbosity level for this engine and what it calls
+        rmethod.SetParameters( "verbose", adios::Verbose::WARN ); // Verbosity level for this engine and what it calls
     }
 
     // 1. Open a stream, where every reader can see everything in a stream (so that they can read a global array)
@@ -139,7 +139,7 @@ int main( int argc, char* argv[])
 
         // Open a stream
         std::shared_ptr<adios::Engine> reader =
-                adios.Open( "filename.bp", "r", comm, rmethod, adios::COLLECTIVE_IO,
+                adios.Open( "filename.bp", "r", comm, rmethod, adios::IOMode::COLLECTIVE,
                             /*timeout_sec=*/ 300.0); // wait this long for the stream, return error afterwards
 
         /* Variable names are available as a vector of strings */
@@ -206,7 +206,7 @@ int main( int argc, char* argv[])
 
         // Open a stream
         std::shared_ptr<adios::Engine> reader =
-                adios.Open( "filename.bp", "r", comm, rmethod, adios::INDEPENDENT_IO,
+                adios.Open( "filename.bp", "r", comm, rmethod, adios::IOMode::INDEPENDENT,
                            /*timeout_sec=*/ 300.0 ); // wait this long for the stream, return error afterwards
 
         while( true )
@@ -240,7 +240,7 @@ int main( int argc, char* argv[])
 
         // Open a stream
         std::shared_ptr<adios::Engine> reader =
-                adios.Open( "filename.bp", "r", comm, rmethod, adios::INDEPENDENT_IO );
+                adios.Open( "filename.bp", "r", comm, rmethod, adios::IOMode::INDEPENDENT );
 
         while( true )
         {
diff --git a/examples/heatTransfer/IO_adios2.cpp b/examples/heatTransfer/IO_adios2.cpp
index 8290337c8..9d27e7c39 100644
--- a/examples/heatTransfer/IO_adios2.cpp
+++ b/examples/heatTransfer/IO_adios2.cpp
@@ -19,7 +19,7 @@ IO::IO( const Settings& s, MPI_Comm comm )
 {
     rank_saved = s.rank;
     m_outputfilename = s.outputfile + ".bp";
-    ad = new adios::ADIOS( "adios2.xml", comm, adios::INFO );
+    ad = new adios::ADIOS( "adios2.xml", comm, adios::Verbose::INFO );
 
     //Define method for engine creation
     // 1. Get method def from config file or define new one
@@ -29,7 +29,7 @@ IO::IO( const Settings& s, MPI_Comm comm )
     {
         // if not defined by user, we can change the default settings
         bpWriterSettings.SetEngine( "BP" ); // BP is the default engine
-        bpWriterSettings.SetAvailableCores( 2); // no threading for data processing (except for staging)
+        bpWriterSettings.AllowThreads( 1 ); // allow 1 extra thread for data processing
         bpWriterSettings.AddTransport( "File", "lucky=yes" ); // ISO-POSIX file is the default transport
                                                               // Passing parameters to the transport
         bpWriterSettings.SetParameters("have_metadata_file","yes" ); // Passing parameters to the engine
@@ -51,7 +51,7 @@ IO::IO( const Settings& s, MPI_Comm comm )
     //varT.AddTransform( tr, "" );
     // varT.AddTransform( tr,"accuracy=0.001" );  // for ZFP
 
-    bpWriter = ad->Open( m_outputfilename, "w", comm, bpWriterSettings, adios::COLLECTIVE_IO);
+    bpWriter = ad->Open( m_outputfilename, "w", comm, bpWriterSettings, adios::IOMode::COLLECTIVE);
 
     if( bpWriter == nullptr )
         throw std::ios_base::failure( "ERROR: failed to open ADIOS bpWriter\n" );
diff --git a/examples/hello/bpWriter/helloBPWriter.cpp b/examples/hello/bpWriter/helloBPWriter.cpp
index b962d524a..063dae3e1 100644
--- a/examples/hello/bpWriter/helloBPWriter.cpp
+++ b/examples/hello/bpWriter/helloBPWriter.cpp
@@ -23,7 +23,7 @@ int main( int argc, char* argv [] )
     int rank;
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     const bool adiosDebug = true;
-    adios::ADIOS adios( MPI_COMM_WORLD, adiosDebug );
+    adios::ADIOS adios( MPI_COMM_WORLD, adios::Verbose::INFO, adiosDebug );
 
     //Application variable
     std::vector<double> myDoubles = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
@@ -59,7 +59,7 @@ int main( int argc, char* argv [] )
 
         //Create engine smart pointer due to polymorphism,
         //Open returns a smart pointer to Engine containing the Derived class Writer
-        auto bpWriter = adios.Open( "myDoubles.bp", "w", bpWriterSettings );
+        auto bpWriter = adios.Open( "myDoubles.bp", "w", bpWriterSettings, adios::IOMode::COLLECTIVE );
 
         if( bpWriter == nullptr )
             throw std::ios_base::failure( "ERROR: couldn't create bpWriter at Open\n" );
diff --git a/examples/hello/bpWriter/helloBPWriter_nompi.cpp b/examples/hello/bpWriter/helloBPWriter_nompi.cpp
index 89eb754a1..c78fd0878 100644
--- a/examples/hello/bpWriter/helloBPWriter_nompi.cpp
+++ b/examples/hello/bpWriter/helloBPWriter_nompi.cpp
@@ -45,7 +45,7 @@ int main( int argc, char* argv [] )
 
         //Create engine smart pointer due to polymorphism,
         //Open returns a smart pointer to Engine containing the Derived class Writer
-        auto bpFileWriter = adios.Open( "myDoubles_nompi.bp", "w", bpWriterSettings );
+        auto bpFileWriter = adios.Open( "myDoubles_nompi.bp", "w", bpWriterSettings, adios::IOMode::COLLECTIVE );
 
         if( bpFileWriter == nullptr )
             throw std::ios_base::failure( "ERROR: couldn't create bpWriter at Open\n" );
diff --git a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp
index 107e313de..afb8966cc 100644
--- a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp
+++ b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp
@@ -37,10 +37,15 @@ int main( int argc, char* argv [] )
 //        auto& ioMyCFloats = adios.DefineVariable<std::complex<float>>( "myCFloats", {3} );
 
         //Define method for engine creation, it is basically straight-forward parameters
-        adios::Method& datamanSettings = adios.DeclareMethod( "WAN", "DataManWriter" ); //default method type is Writer
-        datamanSettings.SetParameters( "real_time=yes", "method_type=stream", "method=dump", "monitoring=yes", "local_ip=127.0.0.1", "remote_ip=127.0.0.1", "local_port=12306", "remote_port=12307" );
-//        datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" );
-        //datamanSettings.AddTransport( "ZeroMQ", "localIP=128.0.0.0.1.1", "remoteIP=128.0.0.0.2.1", "tolerances=1,2,3" ); not yet supported , will throw an exception
+        adios::Method& datamanSettings = adios.DeclareMethod( "WAN" );
+        if( ! datamanSettings.isUserDefined())
+        {
+            // if not defined by user, we can change the default settings
+            datamanSettings.SetEngine( "DataManWriter" );
+            datamanSettings.SetParameters( "real_time=yes", "method_type=stream", "method=dump", "monitoring=yes", "local_ip=127.0.0.1", "remote_ip=127.0.0.1", "local_port=12306", "remote_port=12307" );
+            //datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" );
+            //datamanSettings.AddTransport( "ZeroMQ", "localIP=128.0.0.0.1.1", "remoteIP=128.0.0.0.2.1", "tolerances=1,2,3" ); not yet supported , will throw an exception
+        }
 
         //Create engine smart pointer to DataMan Engine due to polymorphism,
         //Open returns a smart pointer to Engine containing the Derived class DataMan
diff --git a/include/ADIOS.h b/include/ADIOS.h
index 86f983e6e..b91898773 100644
--- a/include/ADIOS.h
+++ b/include/ADIOS.h
@@ -24,6 +24,7 @@
   #include <mpi.h>
 #endif
 
+#include "ADIOSTypes.h"
 #include "core/Transform.h"
 #include "core/Variable.h"
 #include "core/VariableCompound.h"
@@ -35,19 +36,6 @@
 namespace adios
 {
 
-/** Use these values in Dims() when defining variables
- */
-enum {
-    VARYING_DIMENSION = -1,//!< VARYING_DIMENSION
-    LOCAL_VALUE = 0,       //!< LOCAL_VALUE
-    GLOBAL_VALUE = 1       //!< GLOBAL_VALUE
-};
-
-typedef enum { ERROR = 0, WARN = 1, INFO = 2, DEBUG = 3 } VerboseFlag;
-
-typedef enum { INDEPENDENT_IO = 0, COLLECTIVE_IO = 1 } IOMode;
-
-
 class Engine;
 
 /**
@@ -68,7 +56,7 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
     /**
      * @brief ADIOS empty constructor. Used for non XML config file API calls.
      */
-    ADIOS( const adios::VerboseFlag verbose = WARN, const bool debugMode = false );
+    ADIOS( const Verbose verbose = Verbose::WARN, const bool debugMode = false );
 
 
     /**
@@ -76,7 +64,7 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
      * @param configFileName passed to m_ConfigFile
      * @param debugMode true: on throws exceptions and do additional checks, false: off (faster, but unsafe)
      */
-    ADIOS( const std::string configFileName, const adios::VerboseFlag verbose = WARN, const bool debugMode = false );
+    ADIOS( const std::string configFileName, const Verbose verbose = Verbose::WARN, const bool debugMode = false );
 
     /**
      * @brief Parallel constructor for XML config file and MPI
@@ -85,7 +73,7 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
      * @param debugMode true: on, false: off (faster, but unsafe)
      */
 
-    ADIOS( const std::string configFileName, MPI_Comm mpiComm, const adios::VerboseFlag verbose = WARN, const bool debugMode = false );
+    ADIOS( const std::string configFileName, MPI_Comm mpiComm, const Verbose verbose = Verbose::WARN, const bool debugMode = false );
 
 
     /**
@@ -93,7 +81,7 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
      * @param mpiComm MPI communicator passed to m_MPIComm*
      * @param debugMode true: on, false: off (faster)
      */
-    ADIOS(  MPI_Comm mpiComm, const adios::VerboseFlag verbose = WARN, const bool debugMode = false );
+    ADIOS(  MPI_Comm mpiComm, const Verbose verbose = Verbose::WARN, const bool debugMode = false );
 
 
 
@@ -146,9 +134,8 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
      * Otherwise it will create and return a new Method with default settings.
      * Use method.isUserDefined() to distinguish between the two cases.
      * @param methodName must be unique
-     * @param type supported type : "BP" (default), "DataMan"...future: "Sirius"
      */
-    Method& DeclareMethod( const std::string methodName, const std::string type = "" );
+    Method& DeclareMethod( const std::string methodName );
 
 
     /**
@@ -213,9 +200,22 @@ public: // PUBLIC Constructors and Functions define the User Interface with ADIO
      * @param iomode Independent or collective open/advance by writers/readers? Write() operations are always independent.
      * @return Derived class of base Engine depending on Method parameters, shared_ptr for potential flexibility
      */
-    std::shared_ptr<Engine> OpenFileReader( const std::string streamName, MPI_Comm mpiComm,
+    std::shared_ptr<Engine> OpenFileReader( const std::string fileName, MPI_Comm mpiComm,
                                             const Method& method, const IOMode iomode );
 
+    /**
+     * @brief Open to Read all steps from a file. No streaming, advancing is possible here. All steps in the file
+     * are immediately available for reading. Creates a new engine from previously defined method.
+     * Version required by the XML config file implementation, searches method inside ADIOS through a unique name.
+     * @param fileName file name
+     * @param mpiComm option to modify communicator from ADIOS class constructor
+     * @param methodName used to search method object inside ADIOS object
+      * @param iomode Independent or collective open/advance by writers/readers? Write() operations are always independent.
+     * @return Derived class of base Engine depending on Method parameters, shared_ptr for potential flexibility
+     */
+    std::shared_ptr<Engine> OpenFileReader( const std::string fileName, MPI_Comm mpiComm,
+                                            const std::string methodName, const IOMode iomode );
+
     /**
      * @brief Dumps groups information to a file stream or standard output.
      * Note that either the user closes this fileStream or it's closed at the end.
diff --git a/include/ADIOSTypes.h b/include/ADIOSTypes.h
new file mode 100644
index 000000000..28761e003
--- /dev/null
+++ b/include/ADIOSTypes.h
@@ -0,0 +1,29 @@
+/*
+ * ADIOS_Types.h
+ *
+ *  Created on: Mar 23, 2017
+ *      Author: pnb
+ */
+
+#ifndef ADIOS_TYPES_H_
+#define ADIOS_TYPES_H_
+
+namespace adios
+{
+
+/** Use these values in Dims() when defining variables
+ */
+enum {
+    VARYING_DIMENSION = -1,//!< VARYING_DIMENSION
+    LOCAL_VALUE = 0,       //!< LOCAL_VALUE
+    GLOBAL_VALUE = 1       //!< GLOBAL_VALUE
+};
+
+enum class Verbose { ERROR = 0, WARN = 1, INFO = 2, DEBUG = 3 };
+
+enum class IOMode { INDEPENDENT = 0, COLLECTIVE = 1 };
+
+} //end namespace
+
+
+#endif /* ADIOS_TYPES_H_ */
diff --git a/include/ADIOS_CPP.h b/include/ADIOS_CPP.h
index d0327b264..7032eed67 100644
--- a/include/ADIOS_CPP.h
+++ b/include/ADIOS_CPP.h
@@ -8,7 +8,7 @@
 #ifndef ADIOS_CPP_H_
 #define ADIOS_CPP_H_
 
-
+#include "ADIOSTypes.h"
 #include "ADIOS.h"
 #include "core/Method.h"
 
diff --git a/include/capsule/shmem/ShmSystemV.h b/include/capsule/shmem/ShmSystemV.h
index d5506879e..d13621c17 100644
--- a/include/capsule/shmem/ShmSystemV.h
+++ b/include/capsule/shmem/ShmSystemV.h
@@ -27,7 +27,6 @@ public:
      * @param dataSize size of allocated memory segment for data
      * @param metadataSize size of allocated memory segment for metadata
      * @param debugMode true: extra checks, slower
-     * @param cores threaded operations
      */
     ShmSystemV( const std::string accessMode, const int rankMPI, const std::string pathName,
                 const size_t dataSize, const size_t metadataSize, const bool debugMode = false );
diff --git a/include/core/Engine.h b/include/core/Engine.h
index 430451dd8..7a176b2f4 100644
--- a/include/core/Engine.h
+++ b/include/core/Engine.h
@@ -24,6 +24,7 @@
   #include <mpi.h>
 #endif
 
+#include "ADIOSTypes.h"
 #include "ADIOS.h"
 #include "core/Method.h"
 #include "core/Variable.h"
@@ -73,11 +74,11 @@ public:
      * @param mpiComm
      * @param method
      * @param debugMode
-     * @param cores
+     * @param nthreads
      * @param endMessage
      */
     Engine( ADIOS& adios, const std::string engineType, const std::string name, const std::string accessMode,
-            MPI_Comm mpiComm, const Method& method, const bool debugMode, const unsigned int cores,
+            MPI_Comm mpiComm, const Method& method, const bool debugMode, const unsigned int nthreads,
             const std::string endMessage );
 
     virtual ~Engine( );
@@ -247,24 +248,24 @@ public:
     }
 
     /**
-      * Unallocated version, ADIOS will allocate space for incoming data
-      * @param variable
-      */
-     template< class T >
-     void Read( Variable<T>& variable )
-     {
-         Read( variable, nullptr );
-     }
-
-     /**
-       * Unallocated version, ADIOS will allocate space for incoming data
-       * @param variableName
-       */
-      template< class T >
-      void Read( const std::string variableName )
-      {
-          Read( variableName, nullptr );
-      }
+     * Unallocated version, ADIOS will allocate space for incoming data
+     * @param variable
+     */
+    template< class T >
+    void Read( Variable<T>& variable )
+    {
+        Read( variable, nullptr );
+    }
+
+    /**
+     * Unallocated version, ADIOS will allocate space for incoming data
+     * @param variableName
+     */
+    template< class T >
+    void Read( const std::string variableName )
+    {
+        Read( variableName, nullptr );
+    }
 
 
     virtual void Read( Variable<double>& variable,                    const double* values );
@@ -317,10 +318,21 @@ public:
     }
 
     /**
-     * Single value version using string as variable handlers
+     * Unallocated version, ADIOS will allocate space for incoming data
+     * @param variableName
      */
-    void ScheduleRead();
+    void ScheduleRead( const std::string variableName )
+    {
+        ScheduleRead( variableName, nullptr );
+    }
 
+    /**
+     * Unallocated unspecified version, ADIOS will receive any variable and will allocate space for incoming data
+     */
+    void ScheduleRead( )
+    {
+        ScheduleRead( nullptr, nullptr );
+    }
 
     virtual void ScheduleRead( Variable<double>& variable,                    const double* values );
 
@@ -366,24 +378,24 @@ public:
      * @param readIn if true: reads the full variable and payload, allocating values in memory, if false: internal payload is nullptr
      * @return success: it returns a pointer to the internal stored variable object in ADIOS class, failure: nullptr
      */
-    virtual Variable<void> InquireVariable( const std::string name, const bool readIn = true );
-    virtual Variable<char> InquireVariableChar( const std::string name, const bool readIn = true );
-    virtual Variable<unsigned char> InquireVariableUChar( const std::string name, const bool readIn = true );
-    virtual Variable<short> InquireVariableShort( const std::string name, const bool readIn = true );
-    virtual Variable<unsigned short> InquireVariableUShort( const std::string name, const bool readIn = true );
-    virtual Variable<int> InquireVariableInt( const std::string name, const bool readIn = true );
-    virtual Variable<unsigned int> InquireVariableUInt( const std::string name, const bool readIn = true );
-    virtual Variable<long int> InquireVariableLInt( const std::string name, const bool readIn = true );
-    virtual Variable<unsigned long int> InquireVariableULInt( const std::string name, const bool readIn = true );
-    virtual Variable<long long int> InquireVariableLLInt( const std::string name, const bool readIn = true );
-    virtual Variable<unsigned long long int> InquireVariableULLInt( const std::string name, const bool readIn = true );
-    virtual Variable<float> InquireVariableFloat( const std::string name, const bool readIn = true );
-    virtual Variable<double> InquireVariableDouble( const std::string name, const bool readIn = true );
-    virtual Variable<long double> InquireVariableLDouble( const std::string name, const bool readIn = true );
-    virtual Variable<std::complex<float>> InquireVariableCFloat( const std::string name, const bool readIn = true );
-    virtual Variable<std::complex<double>> InquireVariableCDouble( const std::string name, const bool readIn = true );
-    virtual Variable<std::complex<long double>> InquireVariableCLDouble( const std::string name, const bool readIn = true );
-    virtual VariableCompound InquireVariableCompound( const std::string name, const bool readIn = true );
+    virtual Variable<void>* InquireVariable( const std::string name, const bool readIn = true );
+    virtual Variable<char>* InquireVariableChar( const std::string name, const bool readIn = true );
+    virtual Variable<unsigned char>* InquireVariableUChar( const std::string name, const bool readIn = true );
+    virtual Variable<short>* InquireVariableShort( const std::string name, const bool readIn = true );
+    virtual Variable<unsigned short>* InquireVariableUShort( const std::string name, const bool readIn = true );
+    virtual Variable<int>* InquireVariableInt( const std::string name, const bool readIn = true );
+    virtual Variable<unsigned int>* InquireVariableUInt( const std::string name, const bool readIn = true );
+    virtual Variable<long int>* InquireVariableLInt( const std::string name, const bool readIn = true );
+    virtual Variable<unsigned long int>* InquireVariableULInt( const std::string name, const bool readIn = true );
+    virtual Variable<long long int>* InquireVariableLLInt( const std::string name, const bool readIn = true );
+    virtual Variable<unsigned long long int>* InquireVariableULLInt( const std::string name, const bool readIn = true );
+    virtual Variable<float>* InquireVariableFloat( const std::string name, const bool readIn = true );
+    virtual Variable<double>* InquireVariableDouble( const std::string name, const bool readIn = true );
+    virtual Variable<long double>* InquireVariableLDouble( const std::string name, const bool readIn = true );
+    virtual Variable<std::complex<float>>* InquireVariableCFloat( const std::string name, const bool readIn = true );
+    virtual Variable<std::complex<double>>* InquireVariableCDouble( const std::string name, const bool readIn = true );
+    virtual Variable<std::complex<long double>>* InquireVariableCLDouble( const std::string name, const bool readIn = true );
+    virtual VariableCompound* InquireVariableCompound( const std::string name, const bool readIn = true );
 
 
     /** Return the names of all variables present in a stream/file opened for reading
@@ -400,7 +412,7 @@ protected:
     ADIOS& m_ADIOS; ///< reference to ADIOS object that creates this Engine at Open
     std::vector< std::shared_ptr<Transport> > m_Transports; ///< transports managed
     const bool m_DebugMode = false; ///< true: additional checks, false: by-pass checks
-    unsigned int m_Cores = 1;
+    unsigned int m_nThreads = 0;
     const std::string m_EndMessage; ///< added to exceptions to improve debugging
     std::set<std::string> m_WrittenVariables; ///< contains the names of the variables that are being written
 
diff --git a/include/core/Method.h b/include/core/Method.h
index 28db604fb..0c42b9a91 100644
--- a/include/core/Method.h
+++ b/include/core/Method.h
@@ -14,6 +14,7 @@
 #include <map>
 /// \endcond
 
+#include "ADIOSTypes.h"
 #include "functions/adiosFunctions.h"
 
 namespace adios
@@ -34,8 +35,10 @@ class Method
 
 public:
 
-    const std::string m_Type; ///< Method type
+    const std::string m_Name; ///< Method name (as defined in XML)
     const bool m_DebugMode = false; ///< true: on, throws exceptions and do additional checks, false: off, faster, but unsafe
+    int m_nThreads;
+    std::string m_Type; ///< Method's engine type
     std::map<std::string, std::string> m_Parameters; ///< method parameters
     std::vector< std::map<std::string, std::string> > m_TransportParameters; ///< each is a separate Transport containing their own parameters
 
@@ -61,12 +64,15 @@ public:
 
 
     /**
-     * Tell how many cores the engine can use for its operations.
-     * If only 1 core is specified, no extra threads will be created during the ADIOS calls, except
-     * that staging always creates an extra thread for communication.
-     * @param number of cores, minimum 1 is required
+     * Set how many threads the engine can use for its operations (e.g. file io, compression, staging).
+     * If 1 is allowed, no extra threads will be created during the ADIOS calls for asynchronous operations.
+     * Note that some transports may require and use extra thread(s). See their documentation for their
+     * requirements. E.g. some staging transports always create an extra thread for communication.
+     * Set this parameter like you set it for OpenMP, i.e. count one thread for the main process that calls
+     * ADIOS functions.
+     * @param number of threads, minimum 1 is required
      */
-    void SetAvailableCores( const int nCores );
+    void AllowThreads( const int nThreads );
 
     /**
      * Sets parameters for the method in "parameter=value" format
@@ -94,8 +100,11 @@ public:
     void SetReadMultiplexPattern( const ReadMultiplexPattern pattern );  // How to split stream content among readers
     void SetStreamOpenMode( const StreamOpenMode mode);  // In Read mode, should Open() wait for the first step appear  (default)
 
+    void SetVerbose( const Verbose verbose = Verbose::WARN ) { m_Verbose = verbose; };
+    Verbose GetVerbose( ) { return m_Verbose; };
 
 private:
+    Verbose m_Verbose = Verbose::WARN;
 
     void AddTransportParameters( const std::string type, const std::vector<std::string>& parameters );
 
diff --git a/include/engine/bp/BPFileReader.h b/include/engine/bp/BPFileReader.h
index 7693d57a7..445713c97 100644
--- a/include/engine/bp/BPFileReader.h
+++ b/include/engine/bp/BPFileReader.h
@@ -35,7 +35,8 @@ public:
      * @param hostLanguage
      */
     BPFileReader( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                   const Method& method, const bool debugMode = false, const unsigned int cores = 1 );
+                   const Method& method, const IOMode iomode, const float timeout_sec,
+                   const bool debugMode = false, const unsigned int nthreads = 1 );
 
     ~BPFileReader( );
 
diff --git a/include/engine/bp/BPFileWriter.h b/include/engine/bp/BPFileWriter.h
index 969d54b19..ce965a6cb 100644
--- a/include/engine/bp/BPFileWriter.h
+++ b/include/engine/bp/BPFileWriter.h
@@ -33,7 +33,8 @@ public:
      * @param debugMode
      */
     BPFileWriter( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                  const Method& method, const bool debugMode = false, const unsigned int cores = 1 );
+                  const Method& method, const IOMode iomode, const float timeout_sec,
+                  const bool debugMode = false, const unsigned int nthreads = 1 );
 
     ~BPFileWriter( );
 
@@ -139,7 +140,7 @@ private:
         }
         else //Write data to buffer
         {
-            m_BP1Writer.WriteVariablePayload( variable, m_Buffer, m_Cores );
+            m_BP1Writer.WriteVariablePayload( variable, m_Buffer, m_nThreads );
         }
 
         variable.m_AppValues = nullptr; //setting pointer to null as not needed after write
diff --git a/include/engine/dataman/DataManReader.h b/include/engine/dataman/DataManReader.h
index 0daf7f318..c61213233 100644
--- a/include/engine/dataman/DataManReader.h
+++ b/include/engine/dataman/DataManReader.h
@@ -34,10 +34,10 @@ public:
      * @param mpiComm
      * @param method
      * @param debugMode
-     * @param cores
+     * @param nthreads
      */
     DataManReader( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                   const Method& method, const bool debugMode = false, const unsigned int cores = 1 );
+                   const Method& method, const bool debugMode = false, const unsigned int nthreads = 1 );
 
     ~DataManReader( );
 
diff --git a/include/engine/dataman/DataManWriter.h b/include/engine/dataman/DataManWriter.h
index 66116bb42..455583a06 100644
--- a/include/engine/dataman/DataManWriter.h
+++ b/include/engine/dataman/DataManWriter.h
@@ -37,10 +37,10 @@ public:
      * @param mpiComm
      * @param method
      * @param debugMode
-     * @param cores
+     * @param nthreads
      */
     DataManWriter( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                   const Method& method, const bool debugMode = false, const unsigned int cores = 1 );
+                   const Method& method, const bool debugMode = false, const unsigned int nthreads = 1 );
 
     ~DataManWriter( );
 
diff --git a/include/format/BP1Writer.h b/include/format/BP1Writer.h
index 32521f498..763d55f7e 100644
--- a/include/format/BP1Writer.h
+++ b/include/format/BP1Writer.h
@@ -36,7 +36,7 @@ class BP1Writer : public BP1
 
 public:
 
-    unsigned int m_Cores = 1;  ///< number of cores for thread operations in large array (min,max)
+    unsigned int m_Threads = 1;  ///< number of threads for thread operations in large array (min,max)
     unsigned int m_Verbosity = 0; ///< statistics verbosity, can change if redefined in Engine method.
     float m_GrowthFactor = 1.5; ///< memory growth factor, can change if redefined in Engine method.
     const std::uint8_t m_Version = 3; ///< BP format version
@@ -314,11 +314,11 @@ public:
      * @param buffer
      */
     template< class T >
-    void WriteVariablePayload( const Variable<T>& variable, capsule::STLVector& buffer, const unsigned int cores = 1 ) const noexcept
+    void WriteVariablePayload( const Variable<T>& variable, capsule::STLVector& buffer, const unsigned int nthreads = 1 ) const noexcept
     {
         std::size_t payloadSize = variable.PayLoadSize(); //not using const due to memcpy inside Memcpythreads
         //EXPENSIVE part, might want to use threads if large, serial for now
-        MemcpyThreads( &buffer.m_Data[buffer.m_DataPosition], variable.m_AppValues, payloadSize, cores );
+        MemcpyThreads( &buffer.m_Data[buffer.m_DataPosition], variable.m_AppValues, payloadSize, nthreads );
         //update indices
         buffer.m_DataPosition += payloadSize;
         buffer.m_DataAbsolutePosition += payloadSize;
@@ -404,7 +404,7 @@ private:
         T min, max;
         const std::size_t valuesSize = variable.TotalSize();
         if( valuesSize >= 10000000 ) //ten million? this needs actual results //here we can make decisions for threads based on valuesSize
-            GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Cores ); //here we can add cores from constructor
+            GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Threads ); //here we can add threads from constructor
         else
             GetMinMax( variable.m_AppValues, valuesSize, min, max );
 
@@ -485,7 +485,7 @@ void BP1Writer::WriteMinMax<std::complex<float>>( const Variable<std::complex<fl
     float min, max;
     const std::size_t valuesSize = variable.TotalSize();
     if( valuesSize >= 10000000 ) //ten million? this needs actual results //here we can make decisions for threads based on valuesSize
-        GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Cores ); //here we can add cores from constructor
+        GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Threads ); //here we can add threads from constructor
     else
         GetMinMax( variable.m_AppValues, valuesSize, min, max );
 
@@ -500,7 +500,7 @@ void BP1Writer::WriteMinMax<std::complex<double>>( const Variable<std::complex<d
     double min, max;
     const std::size_t valuesSize = variable.TotalSize();
     if( valuesSize >= 10000000 ) //ten million? this needs actual results //here we can make decisions for threads based on valuesSize
-        GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Cores ); //here we can add cores from constructor
+        GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Threads ); //here we can add threads from constructor
     else
         GetMinMax( variable.m_AppValues, valuesSize, min, max );
 
@@ -516,7 +516,7 @@ void BP1Writer::WriteMinMax<std::complex<long double>>( const Variable<std::comp
     long double min, max;
     const std::size_t valuesSize = variable.TotalSize();
     if( valuesSize >= 10000000 ) //ten million? this needs actual results //here we can make decisions for threads based on valuesSize
-        GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Cores ); //here we can add cores from constructor
+        GetMinMax( variable.m_AppValues, valuesSize, min, max, m_Threads ); //here we can add threads from constructor
     else
         GetMinMax( variable.m_AppValues, valuesSize, min, max );
 
diff --git a/include/functions/adiosTemplates.h b/include/functions/adiosTemplates.h
index 22bad9f6f..78285d949 100644
--- a/include/functions/adiosTemplates.h
+++ b/include/functions/adiosTemplates.h
@@ -74,10 +74,10 @@ bool IsTypeAlias( const std::string type,
  * @param size of the values array
  * @param min from values
  * @param max from values
- * @param cores threaded version not yet implemented
+ * @param nthreads threaded version not yet implemented
  */
 template<class T> inline
-void GetMinMax( const T* values, const std::size_t size, T& min, T& max, const unsigned int cores = 1 ) noexcept
+void GetMinMax( const T* values, const std::size_t size, T& min, T& max, const unsigned int nthreads = 1 ) noexcept
 {
     min = values[0];
     max = min;
@@ -101,10 +101,10 @@ void GetMinMax( const T* values, const std::size_t size, T& min, T& max, const u
  * @param size of the values array
  * @param min modulus from values
  * @param max modulus from values
- * @param cores
+ * @param nthreads
  */
 template<class T> inline
-void GetMinMax( const std::complex<T>* values, const std::size_t size, T& min, T& max, const unsigned int cores = 1 ) noexcept
+void GetMinMax( const std::complex<T>* values, const std::size_t size, T& min, T& max, const unsigned int nthreads = 1 ) noexcept
 {
 
     min = std::norm( values[0] );
@@ -134,31 +134,35 @@ void GetMinMax( const std::complex<T>* values, const std::size_t size, T& min, T
  * threaded version of std::memcpy
  * @param dest
  * @param source
- * @param count total number of bytest (as in memcpy)
- * @param cores
+ * @param count total number of bytes (as in memcpy)
+ * @param nthreads
  */
 template<class T, class U>
-void MemcpyThreads( T* destination, const U* source, std::size_t count, const unsigned int cores = 1 )
+void MemcpyThreads( T* destination, const U* source, std::size_t count, const unsigned int nthreads = 1 )
 {
-    if( cores == 1 )
+    // do not decompose tasks to less than 4MB pieces
+    const std::size_t minBlockSize = 4194304;
+    const std::size_t maxNThreads = std::max( (std::size_t)nthreads, count / minBlockSize );
+
+    if( maxNThreads == 1)
     {
         std::memcpy( destination, source, count );
         return;
     }
 
-    const std::size_t stride =  count/cores;
-    const std::size_t remainder = count % cores;
+    const std::size_t stride =  count/maxNThreads;
+    const std::size_t remainder = count % maxNThreads;
     const std::size_t last = stride + remainder;
 
     std::vector<std::thread> memcpyThreads;
-    memcpyThreads.reserve( cores );
+    memcpyThreads.reserve( maxNThreads );
 
-    for( unsigned int core = 0; core < cores; ++core )
+    for( unsigned int t = 0; t < maxNThreads; ++t )
     {
-        const size_t initialDestination = stride * core / sizeof(T);
-        const size_t initialSource = stride * core / sizeof(U);
+        const size_t initialDestination = stride * t / sizeof(T);
+        const size_t initialSource = stride * t / sizeof(U);
 
-        if( core == cores-1 )
+        if( t == maxNThreads-1 )
             memcpyThreads.push_back( std::thread( std::memcpy, &destination[initialDestination], &source[initialSource], last ) );
         else
             memcpyThreads.push_back( std::thread( std::memcpy, &destination[initialDestination], &source[initialSource], stride ) );
diff --git a/src/ADIOS.cpp b/src/ADIOS.cpp
index 0d4eefce3..6e17fcd13 100644
--- a/src/ADIOS.cpp
+++ b/src/ADIOS.cpp
@@ -28,14 +28,14 @@ namespace adios
 {
 
 
-ADIOS::ADIOS( const bool debugMode ):
+ADIOS::ADIOS( const Verbose verbose, const bool debugMode ):
     m_DebugMode{ debugMode }
 {
     InitMPI( );
 }
 
 
-ADIOS::ADIOS( const std::string configFileName, const bool debugMode ):
+ADIOS::ADIOS( const std::string configFileName, const Verbose verbose, const bool debugMode ):
     m_ConfigFile{ configFileName },
     m_DebugMode{ debugMode }
 {
@@ -45,7 +45,7 @@ ADIOS::ADIOS( const std::string configFileName, const bool debugMode ):
 
 
 
-ADIOS::ADIOS( const std::string xmlConfigFile, MPI_Comm mpiComm, const bool debugMode  ):
+ADIOS::ADIOS( const std::string xmlConfigFile, MPI_Comm mpiComm, const Verbose verbose, const bool debugMode  ):
     m_MPIComm{ mpiComm },
     m_ConfigFile{ xmlConfigFile },
 	m_DebugMode{ debugMode }
@@ -55,7 +55,7 @@ ADIOS::ADIOS( const std::string xmlConfigFile, MPI_Comm mpiComm, const bool debu
 }
 
 
-ADIOS::ADIOS( MPI_Comm mpiComm, const bool debugMode ):
+ADIOS::ADIOS( MPI_Comm mpiComm, const Verbose verbose, const bool debugMode ):
     m_MPIComm{ mpiComm },
     m_DebugMode{ debugMode }
 {
@@ -81,20 +81,20 @@ void ADIOS::InitMPI( )
 }
 
 
-Method& ADIOS::DeclareMethod( const std::string methodName, const std::string type )
+Method& ADIOS::DeclareMethod( const std::string methodName )
 {
     if( m_DebugMode == true )
     {
         if( m_Methods.count( methodName ) == 1 )
             throw std::invalid_argument( "ERROR: method " + methodName + " already declared, from DeclareMethod\n" );
     }
-    m_Methods.emplace( methodName, Method( type, m_DebugMode ) );
+    m_Methods.emplace( methodName, Method( methodName, m_DebugMode ) );
     return m_Methods.at( methodName );
 }
 
 
 std::shared_ptr<Engine> ADIOS::Open( const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                                     const Method& method, const unsigned int cores )
+                                     const Method& method, const IOMode iomode, const float timeout_sec )
 {
     if( m_DebugMode == true )
     {
@@ -113,21 +113,21 @@ std::shared_ptr<Engine> ADIOS::Open( const std::string name, const std::string a
 
     if( isDefaultWriter || type == "BPFileWriter" || type == "bpfilewriter" )
     {
-        return std::make_shared<BPFileWriter>( *this, name, accessMode, mpiComm, method, m_DebugMode, cores );
+        return std::make_shared<BPFileWriter>( *this, name, accessMode, mpiComm, method, iomode, timeout_sec, m_DebugMode, method.m_nThreads );
     }
     else if( isDefaultReader || type == "BPReader" || type == "bpreader" )
     {
-        return std::make_shared<BPFileReader>( *this, name, accessMode, mpiComm, method, m_DebugMode, cores );
+        return std::make_shared<BPFileReader>( *this, name, accessMode, mpiComm, method, iomode, timeout_sec, m_DebugMode, method.m_nThreads );
     }
     else if( type == "SIRIUS" || type == "sirius" || type == "Sirius" )
     {
         //not yet supported
-        //return std::make_shared<engine::DataMan>( name, accessMode, mpiComm, method, m_DebugMode, cores, m_HostLanguage );
+        //return std::make_shared<engine::DataMan>( *this, name, accessMode, mpiComm, method, iomode, timeout_sec, m_DebugMode, method.m_nThreads );
     }
     else if( type == "DataManWriter" )
     {
         #ifdef HAVE_DATAMAN
-        return std::make_shared<DataManWriter>( *this, name, accessMode, mpiComm, method, m_DebugMode, cores );
+        return std::make_shared<DataManWriter>( *this, name, accessMode, mpiComm, method, iomode, timeout_sec, m_DebugMode, method.m_nThreads );
         #else
         throw std::invalid_argument( "ERROR: this version didn't compile with Dataman library, can't Open DataManWriter\n" );
         #endif
@@ -136,14 +136,14 @@ std::shared_ptr<Engine> ADIOS::Open( const std::string name, const std::string a
     else if( type == "DataManReader" )
     {
         #ifdef HAVE_DATAMAN
-        return std::make_shared<DataManReader>( *this, name, accessMode, mpiComm, method, m_DebugMode, cores );
+        return std::make_shared<DataManReader>( *this, name, accessMode, mpiComm, method, iomode, timeout_sec, m_DebugMode, method.m_nThreads );
         #else
         throw std::invalid_argument( "ERROR: this version didn't compile with Dataman library, can't Open DataManReader\n" );
         #endif
     }
     else if( type == "Vis" )
     {
-        //return std::make_shared<Vis>( *this, name, accessMode, mpiComm, method, m_DebugMode, cores );
+        //return std::make_shared<Vis>( *this, name, accessMode, mpiComm, method, iomode, timeout_sec, m_DebugMode, method.m_nThreads );
     }
     else
     {
@@ -155,15 +155,15 @@ std::shared_ptr<Engine> ADIOS::Open( const std::string name, const std::string a
 }
 
 
-std::shared_ptr<Engine> ADIOS::Open( const std::string streamName, const std::string accessMode, const Method& method,
-                                     const unsigned int cores )
+std::shared_ptr<Engine> ADIOS::Open( const std::string streamName, const std::string accessMode,
+                                     const Method& method, const IOMode iomode, const float timeout_sec )
 {
-    return Open( streamName, accessMode, m_MPIComm, method, cores );
+    return Open( streamName, accessMode, m_MPIComm, method, iomode, timeout_sec );
 }
 
 
 std::shared_ptr<Engine> ADIOS::Open( const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                                     const std::string methodName, const unsigned int cores )
+                                     const std::string methodName, const IOMode iomode, const float timeout_sec )
 {
     auto itMethod = m_Methods.find( methodName );
 
@@ -172,16 +172,34 @@ std::shared_ptr<Engine> ADIOS::Open( const std::string name, const std::string a
         CheckMethod( itMethod, methodName, " in call to Open\n" );
     }
 
-    return Open( name, accessMode, mpiComm, itMethod->second, cores );
+    return Open( name, accessMode, mpiComm, itMethod->second, iomode, timeout_sec );
 }
 
 
 std::shared_ptr<Engine> ADIOS::Open( const std::string name, const std::string accessMode,
-                                     const std::string methodName, const unsigned int cores )
+                                     const std::string methodName, const IOMode iomode, const float timeout_sec )
 {
-    return Open( name, accessMode, m_MPIComm, methodName, cores );
+    return Open( name, accessMode, m_MPIComm, methodName, iomode, timeout_sec );
 }
 
+std::shared_ptr<Engine> ADIOS::OpenFileReader( const std::string name, MPI_Comm mpiComm,
+                                         const Method& method, const IOMode iomode )
+{
+    return Open( name, "r", m_MPIComm, method, iomode );
+}
+
+std::shared_ptr<Engine> ADIOS::OpenFileReader( const std::string name, MPI_Comm mpiComm,
+                                               const std::string methodName, const IOMode iomode )
+{
+    auto itMethod = m_Methods.find( methodName );
+
+    if( m_DebugMode == true )
+    {
+        CheckMethod( itMethod, methodName, " in call to Open\n" );
+    }
+
+    return Open( name, "r", m_MPIComm, itMethod->second, iomode );
+}
 
 VariableCompound& ADIOS::GetVariableCompound( const std::string name )
 {
diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp
index feb562b92..db6002cf5 100644
--- a/src/core/Engine.cpp
+++ b/src/core/Engine.cpp
@@ -16,7 +16,7 @@ namespace adios
 
 
 Engine::Engine( ADIOS& adios, const std::string engineType, const std::string name, const std::string accessMode,
-                MPI_Comm mpiComm, const Method& method, const bool debugMode, const unsigned int cores,
+                MPI_Comm mpiComm, const Method& method, const bool debugMode, const unsigned int nthreads,
                 const std::string endMessage ):
     m_MPIComm{ mpiComm },
     m_EngineType{ engineType },
@@ -25,7 +25,7 @@ Engine::Engine( ADIOS& adios, const std::string engineType, const std::string na
     m_Method{ method },
     m_ADIOS{ adios },
     m_DebugMode{ debugMode },
-    m_Cores{ cores },
+    m_nThreads{ nthreads },
     m_EndMessage( endMessage )
 {
     if( m_DebugMode == true )
@@ -82,7 +82,10 @@ void Engine::Write( const std::string variableName, const std::complex<double>*
 void Engine::Write( const std::string variableName, const std::complex<long double>* values ){ }
 void Engine::Write( const std::string variableName, const void* values ){ }
 
-void Engine::Advance(){ }
+void Engine::Advance( float timeout_sec ){ }
+void Engine::Advance( AdvanceMode mode, float timeout_sec ){ }
+void Engine::AdvanceAsync ( AdvanceMode mode, std::function<void( std::shared_ptr<adios::Engine> )> callback ){ }
+
 
 void Engine::Close( const int transportIndex ){ }
 
@@ -106,6 +109,9 @@ Variable<std::complex<double>>* Engine::InquireVariableCDouble( const std::strin
 Variable<std::complex<long double>>* Engine::InquireVariableCLDouble( const std::string name, const bool readIn ){ return nullptr; }
 VariableCompound* Engine::InquireVariableCompound( const std::string name, const bool readIn ){ return nullptr;  }
 
+void Engine::Read( Variable<double>& variable,                    const double* values ){ }
+void Engine::ScheduleRead( Variable<double>& variable,                    const double* values ){ }
+void Engine::Release( ){ }
 
 //PROTECTED
 void Engine::Init( )
diff --git a/src/core/Method.cpp b/src/core/Method.cpp
index de56042a0..6d795e81d 100644
--- a/src/core/Method.cpp
+++ b/src/core/Method.cpp
@@ -14,15 +14,36 @@ namespace adios
 {
 
 
-Method::Method( const std::string type, const bool debugMode ):
-    m_Type{ type },
+Method::Method( const std::string name, const bool debugMode ):
+    m_Name{ name },
     m_DebugMode{ debugMode }
-{ }
+{
+    // m_Type can stay empty (forcing the choice of the default engine)
+    m_nThreads = 1;
+}
 
 
 Method::~Method( )
 { }
 
+bool MethodisUserDefined()
+{
+    return false; //TODO: check if XML has the method defined
+}
+
+void Method::SetEngine( const std::string type )
+{
+    m_Type = type;
+}
+
+void Method::AllowThreads( const int nThreads )
+{
+    if (nThreads > 1)
+        m_nThreads = nThreads;
+    else
+        m_nThreads = 1;
+}
+
 
 //PRIVATE Functions
 void Method::AddTransportParameters( const std::string type, const std::vector<std::string>& parameters )
diff --git a/src/engine/bp/BPFileReader.cpp b/src/engine/bp/BPFileReader.cpp
index c7cda0efa..edff32aad 100644
--- a/src/engine/bp/BPFileReader.cpp
+++ b/src/engine/bp/BPFileReader.cpp
@@ -22,8 +22,9 @@ namespace adios
 {
 
 BPFileReader::BPFileReader( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                    const Method& method, const bool debugMode, const unsigned int cores ):
-    Engine( adios, "BPFileReader", name, accessMode, mpiComm, method, debugMode, cores, " BPFileReader constructor (or call to ADIOS Open).\n" ),
+                    const Method& method, const IOMode iomode, const float timeout_sec,
+                    const bool debugMode, const unsigned int nthreads ):
+    Engine( adios, "BPFileReader", name, accessMode, mpiComm, method, debugMode, nthreads, " BPFileReader constructor (or call to ADIOS Open).\n" ),
     m_Buffer( accessMode, m_RankMPI, m_DebugMode )
 {
     Init( );
diff --git a/src/engine/bp/BPFileWriter.cpp b/src/engine/bp/BPFileWriter.cpp
index d717e6d01..0e90ca926 100644
--- a/src/engine/bp/BPFileWriter.cpp
+++ b/src/engine/bp/BPFileWriter.cpp
@@ -18,8 +18,9 @@ namespace adios
 
 
 BPFileWriter::BPFileWriter( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                            const Method& method, const bool debugMode, const unsigned int cores ):
-    Engine( adios, "BPFileWriter", name, accessMode, mpiComm, method, debugMode, cores, " BPFileWriter constructor (or call to ADIOS Open).\n" ),
+                            const Method& method, const IOMode iomode, const float timeout_sec,
+                            const bool debugMode, const unsigned int nthreads ):
+    Engine( adios, "BPFileWriter", name, accessMode, mpiComm, method, debugMode, nthreads, " BPFileWriter constructor (or call to ADIOS Open).\n" ),
     m_Buffer{ capsule::STLVector( accessMode, m_RankMPI, m_DebugMode ) },
     m_BP1Aggregator{ format::BP1Aggregator( m_MPIComm, debugMode ) },
     m_MaxBufferSize{ m_Buffer.m_Data.max_size() }
diff --git a/src/engine/dataman/DataManReader.cpp b/src/engine/dataman/DataManReader.cpp
index 4c9569be5..e7fc8f5f6 100644
--- a/src/engine/dataman/DataManReader.cpp
+++ b/src/engine/dataman/DataManReader.cpp
@@ -23,8 +23,8 @@ namespace adios
 {
 
 DataManReader::DataManReader( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                              const Method& method, const bool debugMode, const unsigned int cores ):
-    Engine( adios, "DataManReader", name, accessMode, mpiComm, method, debugMode, cores, " DataManReader constructor (or call to ADIOS Open).\n" ),
+                              const Method& method, const bool debugMode, const unsigned int nthreads ):
+    Engine( adios, "DataManReader", name, accessMode, mpiComm, method, debugMode, nthreads, " DataManReader constructor (or call to ADIOS Open).\n" ),
     m_Buffer( accessMode, m_RankMPI, m_DebugMode )
 {
     Init( );
diff --git a/src/engine/dataman/DataManWriter.cpp b/src/engine/dataman/DataManWriter.cpp
index 1c83e9858..bdbd5942e 100644
--- a/src/engine/dataman/DataManWriter.cpp
+++ b/src/engine/dataman/DataManWriter.cpp
@@ -23,8 +23,8 @@ namespace adios
 
 
 DataManWriter::DataManWriter( ADIOS& adios, const std::string name, const std::string accessMode, MPI_Comm mpiComm,
-                              const Method& method, const bool debugMode, const unsigned int cores ):
-    Engine( adios, "DataManWriter", name, accessMode, mpiComm, method, debugMode, cores, " DataManWriter constructor (or call to ADIOS Open).\n" ),
+                              const Method& method, const bool debugMode, const unsigned int nthreads ):
+    Engine( adios, "DataManWriter", name, accessMode, mpiComm, method, debugMode, nthreads, " DataManWriter constructor (or call to ADIOS Open).\n" ),
     m_Buffer( accessMode, m_RankMPI, m_DebugMode )
 {
     Init( );
-- 
GitLab