From f5dea6905046ee762b9c7cf20442c2018822112f Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki <pnorbert@ornl.gov> Date: Thu, 7 Dec 2017 14:46:44 -0500 Subject: [PATCH] Names of engines in Open: BPFile, DataMan, HDF5, ADIOS1. Case insensitive. --- .../basics/joinedArray/joinedArray_write.cpp | 2 +- .../experimental/api/StreamingAsyncWrite.cpp | 2 +- .../multistep/reader_allsteps.cpp | 2 +- .../multistep/reader_stepping.cpp | 2 +- .../multistep/writer_multistep.cpp | 2 +- examples/heatTransfer/heat_adios1.xml | 4 +- examples/heatTransfer/heat_bpfile.xml | 4 +- examples/heatTransfer/heat_hdf5.xml | 5 +- examples/heatTransfer/read/ReadSettings.cpp | 6 +- examples/heatTransfer/read/heatRead.cpp | 4 +- .../read_fileonly/heatRead_a2h5.cpp | 6 +- .../read_fileonly/heatRead_adios2.cpp | 4 +- examples/heatTransfer/write/IO_adios2.cpp | 2 +- examples/heatTransfer/write/IO_h5mixer.cpp | 2 +- examples/heatTransfer/write/IO_ph5_adios2.cpp | 4 +- .../hello/adios1Writer/helloADIOS1Writer.cpp | 2 +- .../adios1Writer/helloADIOS1Writer_nompi.cpp | 2 +- .../bpFlushWriter/helloBPFlushWriter.cpp | 2 +- .../datamanReader/helloDataManReader.cpp | 2 +- .../helloDataManReader_nompi.cpp | 2 +- .../datamanWriter/helloDataManWriter.cpp | 2 +- .../helloDataManWriter_nompi.cpp | 2 +- examples/hello/hdf5Writer/helloHDF5Writer.cpp | 3 +- .../hdf5Writer/helloHDF5Writer_nompi.cpp | 3 +- examples/hello/sstReader/helloSstReader.cpp | 2 +- examples/hello/sstWriter/helloSstWriter.cpp | 2 +- source/adios2/core/IO.cpp | 106 +++++++----------- .../adios2/bindings/C/TestBPWriteTypes.cpp | 2 +- testing/adios2/engine/bp/CMakeLists.txt | 4 +- .../engine/bp/TestBPWriteProfilingJSON.cpp | 2 +- testing/adios2/engine/bp/TestBPWriteRead.cpp | 6 +- .../engine/bp/TestBPWriteReadADIOS2.cpp | 6 +- .../bp/TestBPWriteReadAsStreamADIOS2.cpp | 12 +- .../engine/bp/TestBPWriteReadAttributes.cpp | 4 +- .../bp/TestBPWriteReadAttributesADIOS2.cpp | 9 +- .../engine/bp/TestBPWriteReadfstream.cpp | 6 +- .../adios2/engine/bp/TestBPWriteReadstdio.cpp | 6 +- 37 files changed, 106 insertions(+), 132 deletions(-) diff --git a/examples/basics/joinedArray/joinedArray_write.cpp b/examples/basics/joinedArray/joinedArray_write.cpp index c4a7f1127..359eba244 100644 --- a/examples/basics/joinedArray/joinedArray_write.cpp +++ b/examples/basics/joinedArray/joinedArray_write.cpp @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) // Get io settings from the config file or // create one with default settings here adios2::IO &io = adios.DeclareIO("Output"); - // io.SetEngine("ADIOS1Writer"); + // io.SetEngine("ADIOS1"); // io.AddTransport("File", {{"library", "MPI"}}); /* diff --git a/examples/experimental/api/StreamingAsyncWrite.cpp b/examples/experimental/api/StreamingAsyncWrite.cpp index 9c6cb4356..74a74a3b6 100644 --- a/examples/experimental/api/StreamingAsyncWrite.cpp +++ b/examples/experimental/api/StreamingAsyncWrite.cpp @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) /*** IO class object: settings and factory of Settings: Variables, * Parameters, Transports, and Execution: Engines */ adios2::IO &streamingIO = adios.DeclareIO("StreamingWrite"); - streamingIO.SetEngine("DataManWriter"); + streamingIO.SetEngine("DataMan"); auto wanStream = streamingIO.AddTransport( "WAN", {{"IPAddress", "127.0.0.1"}, {"Port", "22"}}); diff --git a/examples/experimental/multistep/reader_allsteps.cpp b/examples/experimental/multistep/reader_allsteps.cpp index 50ef831f8..b9fb6df8b 100644 --- a/examples/experimental/multistep/reader_allsteps.cpp +++ b/examples/experimental/multistep/reader_allsteps.cpp @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) { // if not defined by user, we can change the default settings bpReaderSettings.SetEngine( - "ADIOS1Reader"); // BP is the default engine + "ADIOS1"); // BPFile is the default engine // see only one step at a time bpReaderSettings.SetParameters({{"OpenAsFile", "yes"}}); } diff --git a/examples/experimental/multistep/reader_stepping.cpp b/examples/experimental/multistep/reader_stepping.cpp index a6cdea903..b4f8c9feb 100644 --- a/examples/experimental/multistep/reader_stepping.cpp +++ b/examples/experimental/multistep/reader_stepping.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { // if not defined by user, we can change the default settings bpReaderSettings.SetEngine( - "ADIOS1Reader"); // BP is the default engine + "ADIOS1"); // BPFile is the default engine // see only one step at a time // this is default, nothing to be done } diff --git a/examples/experimental/multistep/writer_multistep.cpp b/examples/experimental/multistep/writer_multistep.cpp index 48e3f55ce..9cf59fa59 100644 --- a/examples/experimental/multistep/writer_multistep.cpp +++ b/examples/experimental/multistep/writer_multistep.cpp @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) if (!bpWriterSettings.InConfigFile()) { // if not defined by user, we can change the default settings - bpWriterSettings.SetEngine("ADIOS1Writer"); + bpWriterSettings.SetEngine("ADIOS1"); // ISO-POSIX file is the default transport // Passing parameters to the transport bpWriterSettings.AddTransport("file" diff --git a/examples/heatTransfer/heat_adios1.xml b/examples/heatTransfer/heat_adios1.xml index fe76301a8..c0e6163ae 100644 --- a/examples/heatTransfer/heat_adios1.xml +++ b/examples/heatTransfer/heat_adios1.xml @@ -11,7 +11,7 @@ ====================================--> <io name="writer"> - <engine type="ADIOS1Writer"> + <engine type="ADIOS1"> <!-- for vectorized memory operations, make sure your system enables threads--> @@ -42,7 +42,7 @@ ====================================--> <io name="reader"> - <engine type="ADIOS1Reader"> + <engine type="ADIOS1"> <!-- for vectorized memory operations, make sure your system enables threads--> diff --git a/examples/heatTransfer/heat_bpfile.xml b/examples/heatTransfer/heat_bpfile.xml index 56cd16dbb..01514213b 100644 --- a/examples/heatTransfer/heat_bpfile.xml +++ b/examples/heatTransfer/heat_bpfile.xml @@ -11,7 +11,7 @@ ====================================--> <io name="writer"> - <engine type="BPFileWriter"> + <engine type="BPFile"> <!-- for vectorized memory operations, make sure your system enables threads--> @@ -57,7 +57,7 @@ ====================================--> <io name="reader"> - <engine type="BPFileReader"> + <engine type="BPFile"> <!-- for vectorized memory operations, make sure your system enables threads--> diff --git a/examples/heatTransfer/heat_hdf5.xml b/examples/heatTransfer/heat_hdf5.xml index a478dfc4a..9ec9c273f 100644 --- a/examples/heatTransfer/heat_hdf5.xml +++ b/examples/heatTransfer/heat_hdf5.xml @@ -11,7 +11,7 @@ ====================================--> <io name="writer"> - <engine type="HDF5Writer"> + <engine type="HDF5"> <!-- for vectorized memory operations, make sure your system enables threads--> @@ -57,8 +57,7 @@ ====================================--> <io name="reader"> - <!-- <engine type="BPFileReader"> --> - <engine type="HDF5Reader"> + <engine type="HDF5"> <!-- for vectorized memory operations, make sure your system enables threads--> diff --git a/examples/heatTransfer/read/ReadSettings.cpp b/examples/heatTransfer/read/ReadSettings.cpp index 96902ecf9..400a59348 100644 --- a/examples/heatTransfer/read/ReadSettings.cpp +++ b/examples/heatTransfer/read/ReadSettings.cpp @@ -64,13 +64,13 @@ void ReadSettings::DecomposeArray(int gndx, int gndy) size_t offsy = ndy * posy; if (posx == npx - 1) { - // right-most processes need to read all the rest of columns - ndx = gndy - ndx * (npx - 1); + // right-most processes need to read all the rest of rows + ndx = gndx - ndx * (npx - 1); } if (posy == npy - 1) { - // bottom processes need to read all the rest of rows + // bottom processes need to read all the rest of columns ndy = gndy - ndy * (npy - 1); } readsize.push_back(ndx); diff --git a/examples/heatTransfer/read/heatRead.cpp b/examples/heatTransfer/read/heatRead.cpp index e84d343d1..ca0130a08 100644 --- a/examples/heatTransfer/read/heatRead.cpp +++ b/examples/heatTransfer/read/heatRead.cpp @@ -69,8 +69,8 @@ int main(int argc, char *argv[]) if (!bpReaderIO.InConfigFile()) { // if not defined by user, we can change the default settings - // BPFileWriter is the default engine - bpReaderIO.SetEngine("ADIOS1Reader"); + // BPFile is the default engine + bpReaderIO.SetEngine("ADIOS1"); bpReaderIO.SetParameters({{"num_threads", "2"}}); // ISO-POSIX file output is the default transport (called "File") diff --git a/examples/heatTransfer/read_fileonly/heatRead_a2h5.cpp b/examples/heatTransfer/read_fileonly/heatRead_a2h5.cpp index 7820fb89d..c476e1e47 100644 --- a/examples/heatTransfer/read_fileonly/heatRead_a2h5.cpp +++ b/examples/heatTransfer/read_fileonly/heatRead_a2h5.cpp @@ -55,9 +55,9 @@ int main(int argc, char *argv[]) if (!h5ReaderIO.InConfigFile()) { // if not defined by user, we can change the default settings - // BPFileWriter is the default engine - // h5ReaderIO.SetEngine("ADIOS1Reader"); - h5ReaderIO.SetEngine("HDF5Reader"); + // BPFile is the default engine + // h5ReaderIO.SetEngine("ADIOS1"); + h5ReaderIO.SetEngine("HDF5"); // h5ReaderIO.SetParameters({{"num_threads", "2"}}); // ISO-POSIX file is the default transport diff --git a/examples/heatTransfer/read_fileonly/heatRead_adios2.cpp b/examples/heatTransfer/read_fileonly/heatRead_adios2.cpp index a0833fa10..fdd1bd314 100644 --- a/examples/heatTransfer/read_fileonly/heatRead_adios2.cpp +++ b/examples/heatTransfer/read_fileonly/heatRead_adios2.cpp @@ -53,8 +53,8 @@ int main(int argc, char *argv[]) if (!bpReaderIO.InConfigFile()) { // if not defined by user, we can change the default settings - // BPFileWriter is the default engine - bpReaderIO.SetEngine("ADIOS1Reader"); + // BPFile is the default engine + bpReaderIO.SetEngine("ADIOS1"); bpReaderIO.SetParameters({{"num_threads", "2"}}); bpReaderIO.SetParameter("OpenAsFile", "true"); diff --git a/examples/heatTransfer/write/IO_adios2.cpp b/examples/heatTransfer/write/IO_adios2.cpp index a4cd949f0..b0960a123 100644 --- a/examples/heatTransfer/write/IO_adios2.cpp +++ b/examples/heatTransfer/write/IO_adios2.cpp @@ -29,7 +29,7 @@ IO::IO(const Settings &s, MPI_Comm comm) if (!bpio.InConfigFile()) { // if not defined by user, we can change the default settings - // BPFileWriter is the default engine + // BPFile is the default engine // ISO-POSIX file is the default transport } diff --git a/examples/heatTransfer/write/IO_h5mixer.cpp b/examples/heatTransfer/write/IO_h5mixer.cpp index 2d9b331e3..733daeb68 100644 --- a/examples/heatTransfer/write/IO_h5mixer.cpp +++ b/examples/heatTransfer/write/IO_h5mixer.cpp @@ -46,7 +46,7 @@ IO::IO(const Settings &s, MPI_Comm comm) if (!h5io.InConfigFile()) { // if not defined by user, we can change the default settings - // BPFileWriter is the default engine + // BPFile is the default engine // Allow an extra thread for data processing // ISO-POSIX file is the default transport diff --git a/examples/heatTransfer/write/IO_ph5_adios2.cpp b/examples/heatTransfer/write/IO_ph5_adios2.cpp index 51c3f42fb..861cbaa08 100644 --- a/examples/heatTransfer/write/IO_ph5_adios2.cpp +++ b/examples/heatTransfer/write/IO_ph5_adios2.cpp @@ -32,8 +32,8 @@ IO::IO(const Settings &s, MPI_Comm comm) if (!h5io.InConfigFile()) { // if not defined by user, we can change the default settings - // BPFileWriter is the default engine - h5io.SetEngine("HDF5Writer"); + // BPFile is the default engine + h5io.SetEngine("HDF5"); } varGndx = &h5io.DefineVariable<unsigned int>("gndx"); diff --git a/examples/hello/adios1Writer/helloADIOS1Writer.cpp b/examples/hello/adios1Writer/helloADIOS1Writer.cpp index 198ce250b..c3e6d9b5f 100644 --- a/examples/hello/adios1Writer/helloADIOS1Writer.cpp +++ b/examples/hello/adios1Writer/helloADIOS1Writer.cpp @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) /*** IO class object: settings and factory of Settings: Variables, * Parameters, Transports, and Execution: Engines */ adios2::IO &adios1IO = adios.DeclareIO("ADIOS1IO"); - adios1IO.SetEngine("ADIOS1Writer"); + adios1IO.SetEngine("ADIOS1"); adios1IO.AddTransport("file", {{"library", "MPI"}}); /** global array : name, { shape (total) }, { start (local) }, { count diff --git a/examples/hello/adios1Writer/helloADIOS1Writer_nompi.cpp b/examples/hello/adios1Writer/helloADIOS1Writer_nompi.cpp index ccf63a3f1..884c87bac 100644 --- a/examples/hello/adios1Writer/helloADIOS1Writer_nompi.cpp +++ b/examples/hello/adios1Writer/helloADIOS1Writer_nompi.cpp @@ -27,7 +27,7 @@ int main(int argc, char *argv[]) /*** IO class object: settings and factory of Settings: Variables, * Parameters, Transports, and Execution: Engines */ adios2::IO &adios1IO = adios.DeclareIO("ADIOS1IO"); - adios1IO.SetEngine("ADIOS1Writer"); + adios1IO.SetEngine("ADIOS1"); adios1IO.AddTransport("file"); /** global array : name, { shape (total) }, { start (local) }, { count diff --git a/examples/hello/bpFlushWriter/helloBPFlushWriter.cpp b/examples/hello/bpFlushWriter/helloBPFlushWriter.cpp index b6c2bcf1b..03eb1fea1 100644 --- a/examples/hello/bpFlushWriter/helloBPFlushWriter.cpp +++ b/examples/hello/bpFlushWriter/helloBPFlushWriter.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) /*** IO class object: settings and factory of Settings: Variables, * Parameters, Transports, and Execution: Engines */ adios2::IO &bpIO = adios.DeclareIO("BPFile_N2N_Flush"); - bpIO.SetEngine("BPFileWriter"); + bpIO.SetEngine("BPFile"); // bpIO.SetParameters({{"MaxBufferSize", "9Mb"}, // {"BufferGrowthFactor", "1.5"}, diff --git a/examples/hello/datamanReader/helloDataManReader.cpp b/examples/hello/datamanReader/helloDataManReader.cpp index 8e2796e00..24b2145d3 100644 --- a/examples/hello/datamanReader/helloDataManReader.cpp +++ b/examples/hello/datamanReader/helloDataManReader.cpp @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) UserCallBack)); adios2::IO &dataManIO = adios.DeclareIO("WAN"); - dataManIO.SetEngine("DataManReader"); + dataManIO.SetEngine("DataMan"); dataManIO.SetParameters( {{"Transport", "zmq"}, {"TransportType", "wan"}, {"Format", "bp"}}); dataManIO.AddOperator(callbackFloat); // propagate to all Engines diff --git a/examples/hello/datamanReader/helloDataManReader_nompi.cpp b/examples/hello/datamanReader/helloDataManReader_nompi.cpp index 91647096a..cbc37006b 100644 --- a/examples/hello/datamanReader/helloDataManReader_nompi.cpp +++ b/examples/hello/datamanReader/helloDataManReader_nompi.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) adios2::ADIOS adios(adios2::DebugON); adios2::IO &dataManIO = adios.DeclareIO("WAN"); - dataManIO.SetEngine("DataManReader"); + dataManIO.SetEngine("DataMan"); dataManIO.SetParameters({{"real_time", "yes"}, {"method_type", "stream"}, {"method", "dump"}}); diff --git a/examples/hello/datamanWriter/helloDataManWriter.cpp b/examples/hello/datamanWriter/helloDataManWriter.cpp index 046777609..52749f68c 100644 --- a/examples/hello/datamanWriter/helloDataManWriter.cpp +++ b/examples/hello/datamanWriter/helloDataManWriter.cpp @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) adios2::ADIOS adios(MPI_COMM_WORLD, adios2::DebugON); adios2::IO &dataManIO = adios.DeclareIO("WANIO"); - dataManIO.SetEngine("DataManWriter"); + dataManIO.SetEngine("DataMan"); dataManIO.SetParameters({ {"Compression", "no"}, {"Transport", "zmq"}, diff --git a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp index 76e2248ae..b7feec1d8 100644 --- a/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp +++ b/examples/hello/datamanWriter/helloDataManWriter_nompi.cpp @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) { adios2::ADIOS adios(adios2::DebugON); adios2::IO &dataManIO = adios.DeclareIO("WANIO"); - dataManIO.SetEngine("DataManWriter"); + dataManIO.SetEngine("DataMan"); dataManIO.SetParameters( {{"compress", "no"}, {"method", "dump"}, {"type", "wan"}}); diff --git a/examples/hello/hdf5Writer/helloHDF5Writer.cpp b/examples/hello/hdf5Writer/helloHDF5Writer.cpp index 174e7f608..a51342d62 100644 --- a/examples/hello/hdf5Writer/helloHDF5Writer.cpp +++ b/examples/hello/hdf5Writer/helloHDF5Writer.cpp @@ -36,8 +36,7 @@ int main(int argc, char *argv[]) /*** IO class object: settings and factory of Settings: Variables, * Parameters, Transports, and Execution: Engines */ adios2::IO &hdf5IO = adios.DeclareIO("HDFFileIO"); - hdf5IO.SetEngine("HDF5Writer"); - hdf5IO.AddTransport("File"); + hdf5IO.SetEngine("HDF5"); /** global array : name, { shape (total) }, { start (local) }, { count * (local) }, all are constant dimensions */ diff --git a/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp b/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp index 5603b89b5..c618f5921 100644 --- a/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp +++ b/examples/hello/hdf5Writer/helloHDF5Writer_nompi.cpp @@ -29,8 +29,7 @@ int main(int argc, char *argv[]) /*** IO class object: settings and factory of Settings: Variables, * Parameters, Transports, and Execution: Engines */ adios2::IO &hdf5IO = adios.DeclareIO("HDFFileIO"); - hdf5IO.SetEngine("HDF5Writer"); - hdf5IO.AddTransport("file"); + hdf5IO.SetEngine("HDF5"); /** global array : name, { shape (total) }, { start (local) }, { count * (local) }, all are constant dimensions */ diff --git a/examples/hello/sstReader/helloSstReader.cpp b/examples/hello/sstReader/helloSstReader.cpp index 678c9c52f..539a7c2a4 100644 --- a/examples/hello/sstReader/helloSstReader.cpp +++ b/examples/hello/sstReader/helloSstReader.cpp @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) adios2::ADIOS adios(MPI_COMM_WORLD, adios2::DebugON); adios2::IO &sstIO = adios.DeclareIO("WAN"); - sstIO.SetEngine("SstReader"); + sstIO.SetEngine("Sst"); sstIO.SetParameters({{"real_time", "yes"}, {"method_type", "stream"}, {"method", "dump"}}); diff --git a/examples/hello/sstWriter/helloSstWriter.cpp b/examples/hello/sstWriter/helloSstWriter.cpp index b1e633095..bf92ccc3b 100644 --- a/examples/hello/sstWriter/helloSstWriter.cpp +++ b/examples/hello/sstWriter/helloSstWriter.cpp @@ -30,7 +30,7 @@ int main(int argc, char *argv[]) { adios2::ADIOS adios(MPI_COMM_WORLD, adios2::DebugON); adios2::IO &sstIO = adios.DeclareIO("WANIO"); - sstIO.SetEngine("SstWriter"); + sstIO.SetEngine("Sst"); sstIO.SetParameters({{"peer-to-peer", "yes"}, {"real_time", "yes"}, {"compress", "no"}, diff --git a/source/adios2/core/IO.cpp b/source/adios2/core/IO.cpp index 6d5d374ea..22e066dd1 100644 --- a/source/adios2/core/IO.cpp +++ b/source/adios2/core/IO.cpp @@ -313,24 +313,22 @@ Engine &IO::Open(const std::string &name, const Mode mode, MPI_Comm mpiComm) } std::shared_ptr<Engine> engine; - - const bool isDefaultWriter = - m_EngineType.empty() && (mode == Mode::Write || mode == Mode::Append) - ? true - : false; - - const bool isDefaultReader = - m_EngineType.empty() && (mode == Mode::Read) ? true : false; - - if (isDefaultWriter || m_EngineType == "BPFileWriter") + const bool isDefaultEngine = m_EngineType.empty() ? true : false; + std::string engineTypeLC = m_EngineType; + if (!isDefaultEngine) { - engine = std::make_shared<BPFileWriter>(*this, name, mode, mpiComm); + std::transform(engineTypeLC.begin(), engineTypeLC.end(), + engineTypeLC.begin(), ::tolower); } - else if (isDefaultReader || m_EngineType == "BPFileReader") + + if (isDefaultEngine || engineTypeLC == "bpfile") { - engine = std::make_shared<BPFileReader>(*this, name, mode, mpiComm); + if (mode == Mode::Read) + engine = std::make_shared<BPFileReader>(*this, name, mode, mpiComm); + else + engine = std::make_shared<BPFileWriter>(*this, name, mode, mpiComm); } - else if (m_EngineType == "HDFMixer") + else if (engineTypeLC == "hdfmixer") { #ifdef ADIOS2_HAVE_HDF5 #if H5_VERSION_GE(1, 11, 0) @@ -341,86 +339,62 @@ Engine &IO::Open(const std::string &name, const Mode mode, MPI_Comm mpiComm) #endif #else throw std::invalid_argument("ERROR: this version didn't compile with " - "HDF5 library, can't use HDF5\n"); + "HDF5 library, can't use HDF5 engine\n"); #endif } - else if (m_EngineType == "DataManWriter") + else if (engineTypeLC == "dataman") { #ifdef ADIOS2_HAVE_DATAMAN - engine = std::make_shared<DataManWriter>(*this, name, mode, mpiComm); + if (mode == Mode::Read) + engine = + std::make_shared<DataManReader>(*this, name, mode, mpiComm); + else + engine = + std::make_shared<DataManWriter>(*this, name, mode, mpiComm); #else throw std::invalid_argument( "ERROR: this version didn't compile with " - "DataMan library, can't Open DataManWriter\n"); -#endif - } - else if (m_EngineType == "DataManReader") - { -#ifdef ADIOS2_HAVE_DATAMAN - engine = std::make_shared<DataManReader>(*this, name, mode, mpiComm); -#else - throw std::invalid_argument( - "ERROR: this version didn't compile with " - "DataMan library, can't Open DataManReader\n"); -#endif - } - else if (m_EngineType == "SstWriter") - { -#ifdef ADIOS2_HAVE_SST - engine = std::make_shared<SstWriter>(*this, name, mode, mpiComm); -#else - throw std::invalid_argument("ERROR: this version didn't compile with " - "Sst library, can't Open SstWriter\n"); + "DataMan library, can't use DataMan engine\n"); #endif } - else if (m_EngineType == "SstReader") + else if (engineTypeLC == "sst") { #ifdef ADIOS2_HAVE_SST - engine = std::make_shared<SstReader>(*this, name, mode, mpiComm); + if (mode == Mode::Read) + engine = std::make_shared<SstReader>(*this, name, mode, mpiComm); + else + engine = std::make_shared<SstWriter>(*this, name, mode, mpiComm); #else throw std::invalid_argument("ERROR: this version didn't compile with " - "Sst library, can't Open SstReader\n"); + "Sst library, can't use Sst engine\n"); #endif } - else if (m_EngineType == "ADIOS1Writer") + else if (engineTypeLC == "adios1") { #ifdef ADIOS2_HAVE_ADIOS1 - engine = std::make_shared<ADIOS1Writer>(*this, name, mode, mpiComm); + if (mode == Mode::Read) + engine = std::make_shared<ADIOS1Reader>(*this, name, mode, mpiComm); + else + engine = std::make_shared<ADIOS1Writer>(*this, name, mode, mpiComm); #else throw std::invalid_argument( "ERROR: this version didn't compile with ADIOS " - "1.x library, can't Open ADIOS1Writer\n"); -#endif - } - else if (m_EngineType == "ADIOS1Reader") - { -#ifdef ADIOS2_HAVE_ADIOS1 - engine = std::make_shared<ADIOS1Reader>(*this, name, mode, mpiComm); -#else - throw std::invalid_argument( - "ERROR: this version didn't compile with ADIOS " - "1.x library, can't Open ADIOS1Reader\n"); -#endif - } - else if (m_EngineType == "HDF5Writer") - { -#ifdef ADIOS2_HAVE_HDF5 - engine = std::make_shared<HDF5WriterP>(*this, name, mode, mpiComm); -#else - throw std::invalid_argument("ERROR: this version didn't compile with " - "HDF5 library, can't use HDF5\n"); + "1.x library, can't use ADIOS1 engine\n"); #endif } - else if (m_EngineType == "HDF5Reader") + else if (engineTypeLC == "hdf5") { #ifdef ADIOS2_HAVE_HDF5 - engine = std::make_shared<HDF5ReaderP>(*this, name, mode, mpiComm); + if (mode == Mode::Read) + engine = std::make_shared<HDF5ReaderP>(*this, name, mode, mpiComm); + else + engine = std::make_shared<HDF5WriterP>(*this, name, mode, mpiComm); #else throw std::invalid_argument("ERROR: this version didn't compile with " - "HDF5 library, can't use HDF5\n"); + "HDF5 library, can't use HDF5 engine\n"); #endif } - else if (m_EngineType == "PluginEngine") + else if (engineTypeLC == "pluginengine") { engine = std::make_shared<PluginEngine>(*this, name, mode, mpiComm); } diff --git a/testing/adios2/bindings/C/TestBPWriteTypes.cpp b/testing/adios2/bindings/C/TestBPWriteTypes.cpp index 8ca1b3ca5..0c64d7669 100644 --- a/testing/adios2/bindings/C/TestBPWriteTypes.cpp +++ b/testing/adios2/bindings/C/TestBPWriteTypes.cpp @@ -39,7 +39,7 @@ TEST_F(BPWriteTypes, ADIOS2BPWriteTypes) // IO adios2_IO *ioH = adios2_declare_io(adiosH, "CArrayTypes"); // Set engine parameters - adios2_set_engine(ioH, "BPFileWriter"); + adios2_set_engine(ioH, "BPFile"); adios2_set_parameter(ioH, "ProfileUnits", "Microseconds"); adios2_set_parameter(ioH, "Threads", "1"); diff --git a/testing/adios2/engine/bp/CMakeLists.txt b/testing/adios2/engine/bp/CMakeLists.txt index 61a7d569f..9b275262c 100644 --- a/testing/adios2/engine/bp/CMakeLists.txt +++ b/testing/adios2/engine/bp/CMakeLists.txt @@ -29,8 +29,8 @@ if (ADIOS2_HAVE_ADIOS1) add_executable(TestBPWriteRead TestBPWriteRead.cpp) target_link_libraries(TestBPWriteRead adios2 gtest adios1::adios) -# add_executable(TestBPWriteReadAttributes TestBPWriteReadAttributes.cpp) -# target_link_libraries(TestBPWriteReadAttributes adios2 gtest adios1::adios) + add_executable(TestBPWriteReadAttributes TestBPWriteReadAttributes.cpp) + target_link_libraries(TestBPWriteReadAttributes adios2 gtest adios1::adios) add_executable(TestBPWriteReadstdio TestBPWriteReadstdio.cpp) target_link_libraries(TestBPWriteReadstdio adios2 gtest adios1::adios) diff --git a/testing/adios2/engine/bp/TestBPWriteProfilingJSON.cpp b/testing/adios2/engine/bp/TestBPWriteProfilingJSON.cpp index ea729058e..fc4a2ba78 100644 --- a/testing/adios2/engine/bp/TestBPWriteProfilingJSON.cpp +++ b/testing/adios2/engine/bp/TestBPWriteProfilingJSON.cpp @@ -94,7 +94,7 @@ TEST_F(BPWriteProfilingJSONTest, DISABLED_ADIOS2BPWriteProfilingJSON) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.SetParameters({{"Threads", "2"}}); io.AddTransport("file", {{"Library", "POSIX"}}); diff --git a/testing/adios2/engine/bp/TestBPWriteRead.cpp b/testing/adios2/engine/bp/TestBPWriteRead.cpp index 3d6e86947..a628ce506 100644 --- a/testing/adios2/engine/bp/TestBPWriteRead.cpp +++ b/testing/adios2/engine/bp/TestBPWriteRead.cpp @@ -86,7 +86,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read1D8) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); @@ -402,7 +402,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read2D2x4) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); adios2::Engine &engine = io.Open(fname, adios2::Mode::Write); @@ -701,7 +701,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read2D4x2) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); diff --git a/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp b/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp index 7640cd3bd..bc6bc8e6a 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadADIOS2.cpp @@ -86,7 +86,7 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead1D8) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); @@ -389,7 +389,7 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead2D2x4) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); adios2::Engine &bpWriter = io.Open(fname, adios2::Mode::Write); @@ -688,7 +688,7 @@ TEST_F(BPWriteReadTestADIOS2, ADIOS2BPWriteRead2D4x2) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); diff --git a/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp b/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp index c8aaf2b11..963832fb4 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp @@ -100,7 +100,7 @@ TEST_F(BPWriteReadAsStreamTestADIOS2, ADIOS2BPWriteRead1D8) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); @@ -349,7 +349,7 @@ TEST_F(BPWriteReadAsStreamTestADIOS2, ADIOS2BPWriteRead2D2x4) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); adios2::Engine &bpWriter = io.Open(fname, adios2::Mode::Write); @@ -601,7 +601,7 @@ TEST_F(BPWriteReadAsStreamTestADIOS2, ADIOS2BPWriteRead2D4x2) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); @@ -850,7 +850,7 @@ TEST_F(BPWriteReadAsStreamTestADIOS2, ADIOS2BPWriteRead1D8MissingPerformGets) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); @@ -1097,7 +1097,7 @@ TEST_F(BPWriteReadAsStreamTestADIOS2, ADIOS2BPWriteRead2D2x4MissingPerformGets) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); adios2::Engine &bpWriter = io.Open(fname, adios2::Mode::Write); @@ -1349,7 +1349,7 @@ TEST_F(BPWriteReadAsStreamTestADIOS2, ADIOS2BPWriteRead2D4x2MissingPerformGets) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); diff --git a/testing/adios2/engine/bp/TestBPWriteReadAttributes.cpp b/testing/adios2/engine/bp/TestBPWriteReadAttributes.cpp index d3b66f25e..0b6afcbd7 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadAttributes.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadAttributes.cpp @@ -97,7 +97,7 @@ TEST_F(BPWriteReadAttributeTest, ADIOS2BPWriteADIOS1ReadSingleTypes) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); @@ -244,7 +244,7 @@ TEST_F(BPWriteReadAttributeTest, ADIOS2BPWriteADIOS1ReadArrayTypes) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); diff --git a/testing/adios2/engine/bp/TestBPWriteReadAttributesADIOS2.cpp b/testing/adios2/engine/bp/TestBPWriteReadAttributesADIOS2.cpp index 91ba991e4..a1657e191 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadAttributesADIOS2.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadAttributesADIOS2.cpp @@ -77,8 +77,8 @@ TEST_F(BPWriteReadAttributeTestADIOS2, ADIOS2BPWriteReadSingleTypes) io.DefineAttribute<float>(r32_Single, currentTestData.R32.front()); io.DefineAttribute<double>(r64_Single, currentTestData.R64.front()); - io.SetEngine("BPFileWriter"); - io.AddTransport("file"); + io.SetEngine("BPFile"); + io.AddTransport("File"); adios2::Engine &engine = io.Open(fName, adios2::Mode::Write); // only attributes are written @@ -87,6 +87,9 @@ TEST_F(BPWriteReadAttributeTestADIOS2, ADIOS2BPWriteReadSingleTypes) { adios2::IO &ioRead = adios.DeclareIO("ioRead"); + // ioRead.SetEngine("ADIOS1"); + // ioRead.AddTransport("File"); + // ioRead.SetParameter("OpenAsFile", "true"); adios2::Engine &bpRead = ioRead.Open(fName, adios2::Mode::Read); @@ -249,7 +252,7 @@ TEST_F(BPWriteReadAttributeTestADIOS2, ADIOS2BPWriteReadArrayTypes) io.DefineAttribute<double>(r64_Array, currentTestData.R64.data(), currentTestData.R64.size()); - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file"); adios2::Engine &engine = io.Open(fName, adios2::Mode::Write); diff --git a/testing/adios2/engine/bp/TestBPWriteReadfstream.cpp b/testing/adios2/engine/bp/TestBPWriteReadfstream.cpp index c4177f01b..5954c0ebe 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadfstream.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadfstream.cpp @@ -84,7 +84,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read1D8fstream) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file", {{"Library", "fstream"}}); // QUESTION: It seems that BPFilterWriter cannot overwrite existing @@ -376,7 +376,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read2D2x4fstream) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file", {{"Library", "fstream"}}); adios2::Engine &engine = io.Open(fname, adios2::Mode::Write); @@ -674,7 +674,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read2D4x2fstream) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); io.AddTransport("file", {{"Library", "fstream"}}); adios2::Engine &engine = io.Open(fname, adios2::Mode::Write); diff --git a/testing/adios2/engine/bp/TestBPWriteReadstdio.cpp b/testing/adios2/engine/bp/TestBPWriteReadstdio.cpp index b0faea3cc..44a3e3041 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadstdio.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadstdio.cpp @@ -84,7 +84,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read1D8stdio) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); #ifdef ADIOS2_HAVE_MPI io.AddTransport("file", {{"Library", "stdio"}}); @@ -381,7 +381,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read2D2x4stdio) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); #ifdef ADIOS2_HAVE_MPI io.AddTransport("file", {{"Library", "stdio"}}); #else @@ -685,7 +685,7 @@ TEST_F(BPWriteReadTest, ADIOS2BPWriteADIOS1Read2D4x2stdio) } // Create the BP Engine - io.SetEngine("BPFileWriter"); + io.SetEngine("BPFile"); #ifdef ADIOS2_HAVE_MPI io.AddTransport("file", {{"Library", "stdio"}}); -- GitLab