diff --git a/examples/hello/datamanReader/helloDataManReader.cpp b/examples/hello/datamanReader/helloDataManReader.cpp index 7ae42ff2ddb7ba85c04e5ea5da3a776fed2d754f..44c597fac60393711b9add221229dfbc42bcc41c 100644 --- a/examples/hello/datamanReader/helloDataManReader.cpp +++ b/examples/hello/datamanReader/helloDataManReader.cpp @@ -38,19 +38,24 @@ 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::WARN, adiosDebug ); try { //Define method for engine creation, it is basically straight-forward parameters - adios::Method& datamanSettings = adios.DeclareMethod( "WAN", "DataManReader" ); //default method type is BPWriter - datamanSettings.SetParameters( "peer-to-peer=yes" ); - 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( "DataManReader" ); + datamanSettings.SetParameters( "peer-to-peer=yes" ); + 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 DataManReader Engine due to polymorphism, //Open returns a smart pointer to Engine containing the Derived class DataManReader - auto datamanReader = adios.Open( "myDoubles.bp", "r", datamanSettings ); + auto datamanReader = adios.Open( "myDoubles.bp", "r", datamanSettings, adios::IOMode::INDEPENDENT ); if( datamanReader == nullptr ) throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" ); diff --git a/examples/hello/datamanReader/helloDataManReader_nompi.cpp b/examples/hello/datamanReader/helloDataManReader_nompi.cpp index c08ce009176755732c088366607c9de58c2a6f9b..56e3ba1ae9465651f25990a6909bc3495a5e7fa0 100644 --- a/examples/hello/datamanReader/helloDataManReader_nompi.cpp +++ b/examples/hello/datamanReader/helloDataManReader_nompi.cpp @@ -27,19 +27,24 @@ void getcb( const void *data, std::string doid, std::string var, std::string dty int main( int argc, char* argv [] ) { const bool adiosDebug = true; - adios::ADIOS adios( adiosDebug ); + adios::ADIOS adios( adios::Verbose::WARN, adiosDebug ); try { //Define method for engine creation, it is basically straight-forward parameters - adios::Method& datamanSettings = adios.DeclareMethod( "WAN", "DataManReader" ); //default method type is BPWriter - datamanSettings.SetParameters( "real_time=yes", "method_type=stream", "method=zmq", "local_ip=127.0.0.1", "remote_ip=127.0.0.1", "local_port=12307", "remote_port=12306" ); -// 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( "DataManReader" ); + datamanSettings.SetParameters( "real_time=yes", "method_type=stream", "method=zmq", "local_ip=127.0.0.1", "remote_ip=127.0.0.1", "local_port=12307", "remote_port=12306" ); + //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 DataManReader Engine due to polymorphism, //Open returns a smart pointer to Engine containing the Derived class DataManReader - auto datamanReader = adios.Open( "myDoubles.bp", "r", datamanSettings ); + auto datamanReader = adios.Open( "myDoubles.bp", "r", datamanSettings, adios::IOMode::INDEPENDENT ); if( datamanReader == nullptr ) throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" ); diff --git a/examples/hello/datamanWriter/helloDataManWriter.cpp b/examples/hello/datamanWriter/helloDataManWriter.cpp index d4b4dee1f25464bfd3bf8e8ebf77a1adebe7dc97..942fdf11e3f1ff3f26c0e48c59ce4b11c6e55d3a 100644 --- a/examples/hello/datamanWriter/helloDataManWriter.cpp +++ b/examples/hello/datamanWriter/helloDataManWriter.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::WARN, adiosDebug ); //Application variable std::vector<double> myDoubles = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; @@ -42,21 +42,26 @@ 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( "peer-to-peer=yes", "real_time=yes", "compress=no" ); - datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); - //datamanSettings.AddTransport( "file", "name=myfile.bp", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); - //datamanSettings.AddTransport( "file", "name=myfile.bp", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); - //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", "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( "peer-to-peer=yes", "real_time=yes", "compress=no" ); + datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); + //datamanSettings.AddTransport( "file", "name=myfile.bp", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); + //datamanSettings.AddTransport( "file", "name=myfile.bp", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); + //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", "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 //adios::DataManWriter datamanWriter; - auto datamanWriter = adios.Open( "myDoubles.bp", "w", datamanSettings ); + auto datamanWriter = adios.Open( "myDoubles.bp", "w", datamanSettings, adios::IOMode::INDEPENDENT ); if( datamanWriter == nullptr ) throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" ); diff --git a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp index afb8966ccbeb1d72a0312a942aea705eea05ab7d..e9bec44d83101ddadc3ce50085925f8d17a304bb 100644 --- a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp +++ b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp @@ -14,7 +14,7 @@ int main( int argc, char* argv [] ) { const bool adiosDebug = true; - adios::ADIOS adios( adiosDebug ); + adios::ADIOS adios( adios::Verbose::WARN, adiosDebug ); //Application variable std::vector<float> myFloats = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; @@ -49,7 +49,7 @@ int main( int argc, char* argv [] ) //Create engine smart pointer to DataMan Engine due to polymorphism, //Open returns a smart pointer to Engine containing the Derived class DataMan - auto datamanWriter = adios.Open( "myDoubles.bp", "w", datamanSettings ); + auto datamanWriter = adios.Open( "myDoubles.bp", "w", datamanSettings, adios::IOMode::INDEPENDENT ); if( datamanWriter == nullptr ) throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" );