Skip to content
Snippets Groups Projects
Unverified Commit 238e56aa authored by williamfgc's avatar williamfgc Committed by GitHub
Browse files

Merge pull request #336 from guj/1204

1204
parents 622212de 06c0bd5f
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0"?>
<!-- Config XML file fo the
- heatTransfer_write_adios2
- heatTransfer_read
executables in build/bin -->
<adios-config>
<!--====================================
Configuration for the Writer
====================================-->
<io name="writer">
<engine type="HDF5Writer">
<!-- for vectorized memory operations, make sure your system
enables threads-->
<parameter key="Threads" value="2"/>
<!-- Microseconds (default), Milliseconds, Seconds,
Minutes, Hours -->
<parameter key="ProfileUnits" value="Microseconds"/>
<!-- XXKb, XXMb, or XXXGb supported, default=16Kb
(applications might choose an optimal value) -->
<parameter key="InitialBufferSize" value="16Kb"/>
<!-- XXKb, XXMb, or XXXGb supported, default=Unlimited (until
fails), maximum at each time step
(applications might choose an optimal value) -->
<!-- <parameter key="MaxBufferSize" value="2Gb"/> -->
<!-- exponential growth factor > 1, default = 1.05
1.05 is good for a few large variables, for many small
variables increase the value to 1.5 to 2
(optimal value is application dependent)-->
<!-- <parameter key="BufferGrowthFactor" value="1.05"/> -->
</engine>
<transport type="File">
<!-- POSIX, stdio (C FILE*), fstream (C++) -->
<parameter key="Library" value="POSIX"/>
<!-- For read/write, Microseconds (default), Milliseconds, Seconds,
Minutes, Hours. open/close always in Microseconds -->
<parameter key="ProfileUnits" value="Microseconds"/>
</transport>
</io>
<!--====================================
Configuration for the Reader
====================================-->
<io name="reader">
<!-- <engine type="BPFileReader"> -->
<engine type="HDF5Reader">
<!-- for vectorized memory operations, make sure your system
enables threads-->
<parameter key="Threads" value="2"/>
<!-- Microseconds (default), Milliseconds, Seconds,
Minutes, Hours -->
<parameter key="ProfileUnits" value="Microseconds"/>
</engine>
<transport type="File">
<!-- POSIX, stdio (C FILE*), fstream (C++) -->
<parameter key="Library" value="POSIX"/>
<!-- For read/write, Microseconds (default), Milliseconds, Seconds,
Minutes, Hours. open/close always in Microseconds -->
<parameter key="ProfileUnits" value="Microseconds"/>
</transport>
</io>
</adios-config>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Distributed under the OSI-approved Apache License, Version 2.0. See * Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details. * accompanying file Copyright.txt for details.
* *
* IO_ADIOS2.cpp * IO_h5mixer.cpp
* *
* Created on: Feb 2017 * Created on: Feb 2017
* Author: Norbert Podhorszki * Author: Norbert Podhorszki
...@@ -50,7 +50,7 @@ IO::IO(const Settings &s, MPI_Comm comm) ...@@ -50,7 +50,7 @@ IO::IO(const Settings &s, MPI_Comm comm)
// Define method for engine creation // Define method for engine creation
adios2::IO &h5io = ad->DeclareIO("output"); adios2::IO &h5io = ad->DeclareIO("writer");
if (!h5io.InConfigFile()) if (!h5io.InConfigFile())
{ {
// if not defined by user, we can change the default settings // if not defined by user, we can change the default settings
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Distributed under the OSI-approved Apache License, Version 2.0. See * Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details. * accompanying file Copyright.txt for details.
* *
* IO_ADIOS2.cpp * IO_ph5.cpp
* *
* Created on: Feb 2017 * Created on: Feb 2017
* Author: Norbert Podhorszki * Author: Norbert Podhorszki
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Distributed under the OSI-approved Apache License, Version 2.0. See * Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details. * accompanying file Copyright.txt for details.
* *
* IO_ADIOS2.cpp * IO_ph5_adios2.cpp
* *
* Created on: Feb 2017 * Created on: Feb 2017
* Author: Norbert Podhorszki * Author: Norbert Podhorszki
...@@ -37,7 +37,7 @@ IO::IO(const Settings &s, MPI_Comm comm) ...@@ -37,7 +37,7 @@ IO::IO(const Settings &s, MPI_Comm comm)
// Define method for engine creation // Define method for engine creation
// 1. Get method def from config file or define new one // 1. Get method def from config file or define new one
adios2::IO &h5io = ad->DeclareIO("output"); adios2::IO &h5io = ad->DeclareIO("writer");
if (!h5io.InConfigFile()) if (!h5io.InConfigFile())
{ {
// if not defined by user, we can change the default settings // if not defined by user, we can change the default settings
...@@ -69,7 +69,7 @@ IO::IO(const Settings &s, MPI_Comm comm) ...@@ -69,7 +69,7 @@ IO::IO(const Settings &s, MPI_Comm comm)
IO::~IO() IO::~IO()
{ {
h5writer->Close(); h5writer->Close();
// delete ad; delete ad;
} }
void IO::write(int step, const HeatTransfer &ht, const Settings &s, void IO::write(int step, const HeatTransfer &ht, const Settings &s,
......
...@@ -46,7 +46,28 @@ void HDF5WriterP::Init() ...@@ -46,7 +46,28 @@ void HDF5WriterP::Init()
", in call to ADIOS Open or HDF5Writer constructor\n"); ", in call to ADIOS Open or HDF5Writer constructor\n");
} }
#ifdef NEVER
m_H5File.Init(m_Name, m_MPIComm, true); m_H5File.Init(m_Name, m_MPIComm, true);
#else
// enforce .h5 ending
std::string suffix = ".h5";
std::string wrongSuffix = ".bp";
int ss = m_Name.size();
int wpos = m_Name.find(wrongSuffix);
if (wpos == ss - wrongSuffix.size())
{
// is a file with .bp ending
std::string updatedName = m_Name.substr(0, wpos) + suffix;
m_H5File.Init(updatedName, m_MPIComm, true);
}
else
{
m_H5File.Init(m_Name, m_MPIComm, true);
}
#endif
} }
#define declare_type(T) \ #define declare_type(T) \
......
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