Commit 30ea62d4 authored by William F Godoy's avatar William F Godoy
Browse files

Enable memory runtime parameters using XML config file

Picking up config.xml from examples/heatTransfer/write/config.xml from
./build/bin/heatTransfer_write_adios2
parent b63784ba
......@@ -16,6 +16,8 @@ if(ADIOS2_HAVE_MPI)
PRIVATE ${MPI_C_INCLUDE_PATH}
)
target_link_libraries(heatTransfer_write_adios2 adios2 ${MPI_C_LIBRARIES})
target_compile_definitions(heatTransfer_write_adios2 PRIVATE
-DDEFAULT_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/config.xml)
if(ADIOS2_HAVE_ADIOS1)
find_package(ADIOS1 REQUIRED)
......
......@@ -14,6 +14,13 @@
#include <adios2.h>
#define str_helper(X) #X
#define str(X) str_helper(X)
#ifndef DEFAULT_CONFIG
#define DEFAULT_CONFIG config.xml
#endif
#define DEFAULT_CONFIG_STR str(DEFAULT_CONFIG)
static int rank_saved;
adios2::ADIOS *ad = nullptr;
std::shared_ptr<adios2::Engine> bpWriter;
......@@ -24,7 +31,8 @@ IO::IO(const Settings &s, MPI_Comm comm)
{
rank_saved = s.rank;
m_outputfilename = s.outputfile + ".bp";
ad = new adios2::ADIOS("config.xml", comm, adios2::DebugON);
ad = new adios2::ADIOS(std::string(DEFAULT_CONFIG_STR), comm,
adios2::DebugON);
// Define method for engine creation
......
<?xml version="1.0"?>
<!-- Config XML file fo the heatTransfer_write_adios2 executable from
IO_adios2.cpp -->
<!-- Config XML file fo the heatTransfer_write_adios2 executable in .
build/bin from IO_adios2.cpp -->
<adios-config>
<io name="output">
<engine type="BPFileWriter">
<!-- for vectorized memory operations -->
<parameter key="Threads" value="1"/>
<!-- for vectorized memory operations, make sure your system
enables threads-->
<parameter key="Threads" value="2"/>
<!-- Microseconds (default), Milliseconds, Seconds,
Minutes, Hours -->
......@@ -17,12 +18,15 @@
(applications might choose an optimal value) -->
<!--<parameter key="InitialBufferSize" value="16Kb"/> -->
<!-- XXKb, XXMb, or XXXGb supported, default=Unlimited or
maximum at each time step
<!-- XXKb, XXMb, or XXXGb supported, default=Unlimited (until
fails), maximum at each time step
(applications might choose an optimal value) -->
<!-- <parameter key="MaxBufferSize" value="50Mb"/> -->
<!-- <parameter key="MaxBufferSize" value="2Gb"/> -->
<!-- exponential growth factor > 1, default = 1.05 -->
<!-- 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>
......@@ -34,7 +38,8 @@
<!-- For read/write, Microseconds (default), Milliseconds, Seconds,
Minutes, Hours. open/close always in Microseconds -->
<parameter key="ProfileUnits" value="Milliseconds"/>
<parameter key="ProfileUnits" value="Microseconds"/>
</transport>
</io>
</adios-config>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment