From e79fc480c1bd88dfad08284892fff5569c7ada59 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Mon, 5 Jun 2017 09:28:01 -0400 Subject: [PATCH] Fix heatTransfer codes for refactored classes --- examples/heatTransfer/write/IO_adios2.cpp | 12 +++++----- examples/heatTransfer/write/IO_ph5_adios2.cpp | 22 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/examples/heatTransfer/write/IO_adios2.cpp b/examples/heatTransfer/write/IO_adios2.cpp index 59dce8339f..8d7612a063 100644 --- a/examples/heatTransfer/write/IO_adios2.cpp +++ b/examples/heatTransfer/write/IO_adios2.cpp @@ -28,8 +28,8 @@ IO::IO(const Settings &s, MPI_Comm comm) // Define method for engine creation - adios::IO &bpWriterSettings = ad->DeclareIO("output"); - if (!bpWriterSettings.InConfigFile()) + adios::IO &bpio = ad->DeclareIO("output"); + if (!bpio.InConfigFile()) { // if not defined by user, we can change the default settings // BPFileWriter is the default engine @@ -39,11 +39,11 @@ IO::IO(const Settings &s, MPI_Comm comm) // Passing parameters to the transport } - varGndx = &bpWriterSettings.DefineVariable("gndx"); - bpWriterSettings.DefineVariable("gndy"); + varGndx = &bpio.DefineVariable("gndx"); + bpio.DefineVariable("gndy"); // define T as 2D global array - varT = &bpWriterSettings.DefineVariable( + varT = &bpio.DefineVariable( "T", // Global dimensions {s.gndx, s.gndy}, @@ -58,7 +58,7 @@ IO::IO(const Settings &s, MPI_Comm comm) // varT.AddTransform( tr,"accuracy=0.001" ); // for ZFP bpWriter = - bpWriterSettings.Open(m_outputfilename, adios::OpenMode::w, comm); + bpio.Open(m_outputfilename, adios::OpenMode::w, comm); if (!bpWriter) { diff --git a/examples/heatTransfer/write/IO_ph5_adios2.cpp b/examples/heatTransfer/write/IO_ph5_adios2.cpp index e694d9f291..480f21d185 100644 --- a/examples/heatTransfer/write/IO_ph5_adios2.cpp +++ b/examples/heatTransfer/write/IO_ph5_adios2.cpp @@ -24,46 +24,44 @@ IO::IO(const Settings &s, MPI_Comm comm) { rank_saved = s.rank; m_outputfilename = s.outputfile + ".h5"; - // adios::ADIOS adios(comm, adios::Verbose::INFO, false); - ad = new adios::ADIOS(comm, adios::Verbose::INFO, false); + ad = new adios::ADIOS(comm, adios::DebugOFF); // Define method for engine creation // 1. Get method def from config file or define new one - adios::Method &h5writerSettings = ad->DeclareMethod("output"); - if (!h5writerSettings.IsUserDefined()) + adios::IO &h5io = ad->DeclareIO("output"); + if (!h5io.InConfigFile()) { // if not defined by user, we can change the default settings // BPFileWriter is the default engine - h5writerSettings.SetEngine("HDF5Writer"); + h5io.SetEngine("HDF5Writer"); // Allow an extra thread for data processing const std::string aggregatorsParam("Aggregators=" + std::to_string((s.nproc + 1) / 2)); - h5writerSettings.SetParameters("have_metadata_file=yes", - aggregatorsParam); + h5io.SetParameters("have_metadata_file=yes", aggregatorsParam); } // ad->DefineScalar("gndx", true); - varGndx = &(ad->DefineVariable("gndx")); - ad->DefineVariable("gndy"); + varGndx = &h5io.DefineVariable("gndx"); + h5io.DefineVariable("gndy"); // define T as 2D global array - varT = &(ad->DefineArray( + varT = &h5io.DefineVariable( "T", // Global dimensions {s.gndx, s.gndy}, // starting offset of the local array in the global space {s.offsx, s.offsy}, // local size, could be defined later using SetSelection() - {s.ndx, s.ndy})); + {s.ndx, s.ndy}); // add transform to variable // adios::Transform tr = adios::transform::BZIP2( ); // varT.AddTransform( tr, "" ); // varT.AddTransform( tr,"accuracy=0.001" ); // for ZFP - h5writer = ad->Open(m_outputfilename, "w", comm, h5writerSettings); + h5writer = h5io.Open(m_outputfilename, adios::OpenMode::w, comm); if (h5writer == nullptr) throw std::ios_base::failure("ERROR: failed to open ADIOS h5writer\n");