Skip to content
Snippets Groups Projects
Commit 6d54482e authored by Podhorszki, Norbert's avatar Podhorszki, Norbert
Browse files

fixed dataman example for new API

parent 8639310e
No related branches found
No related tags found
1 merge request!8Integrate groupless
...@@ -38,19 +38,24 @@ int main( int argc, char* argv [] ) ...@@ -38,19 +38,24 @@ int main( int argc, char* argv [] )
int rank; int rank;
MPI_Comm_rank( MPI_COMM_WORLD, &rank ); MPI_Comm_rank( MPI_COMM_WORLD, &rank );
const bool adiosDebug = true; const bool adiosDebug = true;
adios::ADIOS adios( MPI_COMM_WORLD, adiosDebug ); adios::ADIOS adios( MPI_COMM_WORLD, adios::Verbose::WARN, adiosDebug );
try try
{ {
//Define method for engine creation, it is basically straight-forward parameters //Define method for engine creation, it is basically straight-forward parameters
adios::Method& datamanSettings = adios.DeclareMethod( "WAN", "DataManReader" ); //default method type is BPWriter adios::Method& datamanSettings = adios.DeclareMethod( "WAN" );
datamanSettings.SetParameters( "peer-to-peer=yes" ); if( ! datamanSettings.isUserDefined())
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 // 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, //Create engine smart pointer to DataManReader Engine due to polymorphism,
//Open returns a smart pointer to Engine containing the Derived class DataManReader //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 ) if( datamanReader == nullptr )
throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" ); throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" );
......
...@@ -27,19 +27,24 @@ void getcb( const void *data, std::string doid, std::string var, std::string dty ...@@ -27,19 +27,24 @@ void getcb( const void *data, std::string doid, std::string var, std::string dty
int main( int argc, char* argv [] ) int main( int argc, char* argv [] )
{ {
const bool adiosDebug = true; const bool adiosDebug = true;
adios::ADIOS adios( adiosDebug ); adios::ADIOS adios( adios::Verbose::WARN, adiosDebug );
try try
{ {
//Define method for engine creation, it is basically straight-forward parameters //Define method for engine creation, it is basically straight-forward parameters
adios::Method& datamanSettings = adios.DeclareMethod( "WAN", "DataManReader" ); //default method type is BPWriter adios::Method& datamanSettings = adios.DeclareMethod( "WAN" );
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" ); if( ! datamanSettings.isUserDefined())
// 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 // 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, //Create engine smart pointer to DataManReader Engine due to polymorphism,
//Open returns a smart pointer to Engine containing the Derived class DataManReader //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 ) if( datamanReader == nullptr )
throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" ); throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" );
......
...@@ -23,7 +23,7 @@ int main( int argc, char* argv [] ) ...@@ -23,7 +23,7 @@ int main( int argc, char* argv [] )
int rank; int rank;
MPI_Comm_rank( MPI_COMM_WORLD, &rank ); MPI_Comm_rank( MPI_COMM_WORLD, &rank );
const bool adiosDebug = true; const bool adiosDebug = true;
adios::ADIOS adios( MPI_COMM_WORLD, adiosDebug ); adios::ADIOS adios( MPI_COMM_WORLD, adios::Verbose::WARN, adiosDebug );
//Application variable //Application variable
std::vector<double> myDoubles = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; std::vector<double> myDoubles = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
...@@ -42,21 +42,26 @@ int main( int argc, char* argv [] ) ...@@ -42,21 +42,26 @@ int main( int argc, char* argv [] )
auto ioMyCFloats = adios.DefineVariable<std::complex<float>>( "myCFloats", {3} ); auto ioMyCFloats = adios.DefineVariable<std::complex<float>>( "myCFloats", {3} );
//Define method for engine creation, it is basically straight-forward parameters //Define method for engine creation, it is basically straight-forward parameters
adios::Method& datamanSettings = adios.DeclareMethod( "WAN", "DataManWriter" ); //default method type is Writer adios::Method& datamanSettings = adios.DeclareMethod( "WAN" );
datamanSettings.SetParameters( "peer-to-peer=yes", "real_time=yes", "compress=no" ); if( ! datamanSettings.isUserDefined())
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" ); // if not defined by user, we can change the default settings
//datamanSettings.AddTransport( "file", "name=myfile.bp", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); datamanSettings.SetEngine("DatamanWriter");
//datamanSettings.AddTransport( "Mdtm", "localIP=128.0.0.0.1", "remoteIP=128.0.0.0.2", "tolerances=1,2,3" ); datamanSettings.SetParameters( "peer-to-peer=yes", "real_time=yes", "compress=no" );
//datamanSettings.AddTransport( "ZeroMQ", "localIP=128.0.0.0.1", "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.1", "remoteIP=128.0.0.0.2.1", "tolerances=1,2,3" ); not yet supported, will throw an exception //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, //Create engine smart pointer to DataMan Engine due to polymorphism,
//Open returns a smart pointer to Engine containing the Derived class DataMan //Open returns a smart pointer to Engine containing the Derived class DataMan
//adios::DataManWriter datamanWriter; //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 ) if( datamanWriter == nullptr )
throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" ); throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" );
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
int main( int argc, char* argv [] ) int main( int argc, char* argv [] )
{ {
const bool adiosDebug = true; const bool adiosDebug = true;
adios::ADIOS adios( adiosDebug ); adios::ADIOS adios( adios::Verbose::WARN, adiosDebug );
//Application variable //Application variable
std::vector<float> myFloats = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; std::vector<float> myFloats = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
...@@ -49,7 +49,7 @@ int main( int argc, char* argv [] ) ...@@ -49,7 +49,7 @@ int main( int argc, char* argv [] )
//Create engine smart pointer to DataMan Engine due to polymorphism, //Create engine smart pointer to DataMan Engine due to polymorphism,
//Open returns a smart pointer to Engine containing the Derived class DataMan //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 ) if( datamanWriter == nullptr )
throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" ); throw std::ios_base::failure( "ERROR: failed to create DataMan I/O engine at Open\n" );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment