diff --git a/examples/basics/joinedArray/joinedArray_write.cpp b/examples/basics/joinedArray/joinedArray_write.cpp index c4a7f11274d5232aed6fd0aecde2dc1b63e3553f..359eba24417642d6b0fd064ea7211d1199af5292 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 9c6cb435672911c27ea40357b29da55979a5359a..74a74a3b6f3111515fca63802c55ae573d411bc2 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 50ef831f82405b3847a91412923525c9993a2d0b..b9fb6df8b91fa68447f43867588b58dec5dfa484 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 a6cdea9039b77245ebb959eae1708e8c395c5533..b4f8c9feba5189d151af53db10877d6ec49331c5 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 48e3f55cee20c81b5e6ca741f179da161cca9b9e..9cf59fa59357fd04005208e1f698dbb1d5ca4a9e 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 fe76301a8c82095995ef3bde1225b6571436a5a1..c0e6163aecec9913729eb1cff7f28a125a1206b3 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 56cd16dbba573016586f54b8cac104013d449255..01514213be071b20259aace5def51c576cf96ed3 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 a478dfc4aa800ea71909e2901992e1639a4712e5..9ec9c273f27ee96057dca77035bf8a5c26e5289a 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 96902ecf904d599041db1e9f916aa2930acb065e..400a59348cf1d54ff56d71e5c39e649456f607a8 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 e84d343d16abc6036b737ef6aa642016a26c6ffd..ca0130a0870523fc54d2ce078b9a33ad981ae710 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 7820fb89d32d9778a5f18cf5760814489aa6450c..c476e1e47e3dadb6a0dd4170d9f65263f9553268 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 a0833fa1075a15ba70b7461123c73d8b13e61db7..fdd1bd3147d18461a83bb61660158f9929fcec0b 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 a4cd949f00bc9a40005a914dac5ccbe510ebde09..b0960a123a13a5c23eb4dfa3c4c90cbebb2ed7b8 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 2d9b331e3fd455112812045c040453793ac49a4a..733daeb68a670cf779221d2b0ddba31c1ec3dadc 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 51c3f42fb7104224afe569caf06442786fa9c86d..861cbaa08dcdd8de565b93b0d400793c8fea50b7 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 198ce250b8d40e8ba552c134a203f5906ff3e673..c3e6d9b5f59d2bf82eeb0bc4ab5c33384a20013d 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 ccf63a3f10dcfe03b0b0ea29319ffc62e27bf15c..884c87bac9ade874dc36e5e8092e8c0793248a4a 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 b6c2bcf1b59682d7826b6eb0e99db61598dfa820..03eb1fea1ced566f86d3ac50aacee200715b9d5f 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 8e2796e00746796153fbe2a679ea8dc0e6c28470..24b2145d357ddf35130955581a46a28d5e86c4f5 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 91647096a4cb2593e832a3e6e0e027a91d2a2b7c..cbc37006ba3f3c1330cdae6535d9f63fa11ba933 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 0467776090eea491391f11bf73707b12bb3a9fbb..52749f68c73b2383ebe0eac801daea52560623e6 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 76e2248ae8e07545e8fb0f6a1123ee347cf8af65..b7feec1d8a0d0d9fac65b25c822a2d650ee539e4 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 174e7f608f4f2654450fe3b74565d67daad1b6a1..a51342d622c1e1c2f894b84667a963e8aa0d92e9 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 5603b89b5dd5560887b6acf9f234ffba5976960c..c618f59213983537c0e854e40244d55d8450dd4c 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 678c9c52f89283905f878f84cea5b1584b2e4a52..539a7c2a476e9ffa83922ceb9675c440cbd1ed59 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 b1e633095cc74c9ae35eedffe7b88fa43108dd9a..bf92ccc3b4d2bce1247fb98a01c9c2afb72ba2c2 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 6d5d374ea0236f21b67e0664933743e060ac5e21..22e066dd1684716bccd1c0c1356eac8048408a67 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 8ca1b3ca56b6aab2a9897bd2b032ccd01fd2d78c..0c64d76694829914ba18e85c7cf61ef2ca7d4af9 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 61a7d569f8c231f2e2fbc0bbe0a75881ae86d161..9b275262ce08b830ba62e610e5909bf61c9158c4 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 ea729058e53931a2007f237b9cb6d517b75005dc..fc4a2ba7817830350a0725022ab376e7ce048d24 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 3d6e869471425354f7c9d75ba06522c487acdb0c..a628ce506e70140658ebcc9a24e7cc1200172650 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 7640cd3bd8a2a15d0e84b5ded2db13ff79bc6d72..bc6bc8e6a762863ef3bf42db761e0075c8a0cab5 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 c8aaf2b11a47ce8329382827799e2110af081a37..963832fb493fd8d9fda14c85b4000f881e65637d 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 d3b66f25ec22a9fd0f63a250495c528c17cfa728..0b6afcbd720bdf545a8a050f532d65a106a00a7c 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 91ba991e491adb5d8993e685b5168f7f8864a4da..a1657e19182d580261e5e1ef297b064ec73ad817 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 c4177f01bfdcbee8dfe3f0b5aff1ba1d395079d2..5954c0ebe43beebf229668fbf3088ce7161d66b4 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 b0faea3cc6ff3f80effa4526bf912bb14c542bd6..44a3e3041538f180dec2da50ef06fe68966fc698 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"}});