Skip to content

Commit 81e216e

Browse files
committed
ADIOS2: enable stats by default, starting ADIOS2 v2.12.0
This PR ornladios/ADIOS2#4502 changes things a bit performance-wise.
1 parent 485b1c7 commit 81e216e

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

examples/10_streaming_write.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main()
5050
// Iterations can be accessed independently from one another. This more
5151
// restricted mode enables performance optimizations in the backends, and
5252
// more importantly is compatible with streaming I/O.
53-
Series series = Series("electrons.sst", Access::CREATE_LINEAR, R"(
53+
Series series = Series("electrons.bp5", Access::CREATE_LINEAR, R"(
5454
{
5555
"adios2": {
5656
"engine": {

include/openPMD/IO/ADIOS/macros.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
ADIOS2_VERSION_PATCH >= \
3535
2101)
3636

37+
#define openPMD_HAS_ADIOS_2_12 \
38+
(ADIOS2_VERSION_MAJOR * 100 + ADIOS2_VERSION_MINOR >= 212)
39+
3740
#if defined(ADIOS2_HAVE_BP5) || openPMD_HAS_ADIOS_2_10
3841
// ADIOS2 v2.10 no longer defines this
3942
#define openPMD_HAVE_ADIOS2_BP5 1

src/IO/ADIOS/ADIOS2File.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ void ADIOS2File::configure_IO()
718718
std::to_string((uint64_t)MaxShmMB * (uint64_t)1048576));
719719
}
720720
#endif
721+
constexpr int default_stats_level = openPMD_HAS_ADIOS_2_12;
721722
if (notYetConfigured("StatsLevel"))
722723
{
723724
/*
@@ -726,8 +727,8 @@ void ADIOS2File::configure_IO()
726727
* environment variable "OPENPMD_ADIOS2_STATS_LEVEL" be positive.
727728
* The ADIOS2 default was "1" (on).
728729
*/
729-
auto stats_level =
730-
auxiliary::getEnvNum("OPENPMD_ADIOS2_STATS_LEVEL", 0);
730+
auto stats_level = auxiliary::getEnvNum(
731+
"OPENPMD_ADIOS2_STATS_LEVEL", default_stats_level);
731732
m_IO.SetParameter("StatsLevel", std::to_string(stats_level));
732733
}
733734
if (m_impl->realEngineType() == "sst" && notYetConfigured("QueueLimit"))

0 commit comments

Comments
 (0)