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

Fix heatTransfer codes for refactored classes

parent d96fd39f
No related branches found
No related tags found
1 merge request!124Refactor
......@@ -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<unsigned int>("gndx");
bpWriterSettings.DefineVariable<unsigned int>("gndy");
varGndx = &bpio.DefineVariable<unsigned int>("gndx");
bpio.DefineVariable<unsigned int>("gndy");
// define T as 2D global array
varT = &bpWriterSettings.DefineVariable<double>(
varT = &bpio.DefineVariable<double>(
"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)
{
......
......@@ -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<unsigned int>("gndx", true);
varGndx = &(ad->DefineVariable<unsigned int>("gndx"));
ad->DefineVariable<unsigned int>("gndy");
varGndx = &h5io.DefineVariable<unsigned int>("gndx");
h5io.DefineVariable<unsigned int>("gndy");
// define T as 2D global array
varT = &(ad->DefineArray<double>(
varT = &h5io.DefineVariable<double>(
"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");
......
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