diff --git a/examples/hello/timeBP/timeBPWriter.cpp b/examples/hello/timeBP/timeBPWriter.cpp index d2411293f58b5b9c3b7420338b87c73483da168d..23cbe74844198be92ab1f0d9f06cc661e7a34ae6 100644 --- a/examples/hello/timeBP/timeBPWriter.cpp +++ b/examples/hello/timeBP/timeBPWriter.cpp @@ -48,13 +48,13 @@ int main(int argc, char *argv[]) { // Define variable and local size adios::Variable<double> &ioMyDoubles = - adios.DefineLocalArray<double>("myDoubles", false, {Nx}); + adios.DefineVariable<double>("myDoubles", {}, {}, {Nx}); - adios::Variable<float> &ioMyMatrix = - adios.DefineLocalArray<float>("myMatrix", true, {rows, columns}); + adios::Variable<float> &ioMyMatrix = adios.DefineVariable<float>( + "myMatrix", {adios::JoinedDim, columns}, {}, {rows, columns}); adios::Variable<float> &ioMyMatrix2 = - adios.DefineLocalArray<float>("myMatrix2", false, {rows, columns}); + adios.DefineVariable<float>("myMatrix2", {}, {}, {rows, columns}); // Define method for engine creation, it is basically straight-forward // parameters diff --git a/examples/hello/timeBP/timeBPWriter_nompi.cpp b/examples/hello/timeBP/timeBPWriter_nompi.cpp index 3b8735fa61d4a5977417d69d4395153341bab377..3b27b9bdb1762199c5e5ab4f3c8bb5ff98119bfa 100644 --- a/examples/hello/timeBP/timeBPWriter_nompi.cpp +++ b/examples/hello/timeBP/timeBPWriter_nompi.cpp @@ -40,11 +40,11 @@ int main(int /*argc*/, char ** /*argv*/) { // Define variable and local size adios::Variable<double> &ioMyDoubles = - adios.DefineVariable<double>("myDoubles", {Nx}); - adios::Variable<float> &ioMyMatrix = - adios.DefineVariable<float>("myMatrix", {rows, columns}); + adios.DefineVariable<double>("myDoubles", {}, {}, {Nx}); + adios::Variable<float> &ioMyMatrix = adios.DefineVariable<float>( + "myMatrix", {adios::JoinedDim, columns}, {}, {rows, columns}); adios::Variable<float> &ioMyMatrix2 = - adios.DefineVariable<float>("myMatrix2", {rows, columns}); + adios.DefineVariable<float>("myMatrix2", {}, {}, {rows, columns}); // Define method for engine creation, it is basically straight-forward // parameters diff --git a/source/adios2/ADIOS.h b/source/adios2/ADIOS.h index 89a3d7eaa9789d9807c3b96841007a6c3cc1731f..7baca649e921e489468badb322008f9994e3ba7c 100644 --- a/source/adios2/ADIOS.h +++ b/source/adios2/ADIOS.h @@ -104,7 +104,7 @@ public: template <class T> Variable<T> &DefineVariable(const std::string &name, const Dims shape = {}, const Dims start = {}, const Dims count = {}, - bool constantShape = false); + const bool constantShape = false); template <class T> Variable<T> &DefineLocalValue(const std::string &name) @@ -370,7 +370,7 @@ protected: // no const to allow default empty and copy constructors #define declare_template_instantiation(T) \ extern template Variable<T> &ADIOS::DefineVariable<T>( \ const std::string &name, const Dims, const Dims, const Dims, \ - bool constantShape); \ + const bool constantShape); \ \ extern template Variable<T> &ADIOS::GetVariable<T>(const std::string &); diff --git a/source/adios2/ADIOS.tcc b/source/adios2/ADIOS.tcc index 1f44b7ee66286c0b19a1cf4405523913180002b6..c6262014bec86553c5157487b5c97a4a559c950d 100644 --- a/source/adios2/ADIOS.tcc +++ b/source/adios2/ADIOS.tcc @@ -122,7 +122,7 @@ ADIOS::GetVariableMap() template <typename T> Variable<T> &ADIOS::DefineVariable(const std::string &name, const Dims shape, const Dims start, const Dims count, - bool constantShape) + const bool constantShape) { auto &variableMap = GetVariableMap<T>(); CheckVariableInput(name, shape); diff --git a/source/adios2/ADIOSTypes.h b/source/adios2/ADIOSTypes.h index f20d8a27888f5c1bf6ce60c3a0d7abb76e6183ac..b460d41f4e5932e4c3fe4180e968e1a99e1bd664 100644 --- a/source/adios2/ADIOSTypes.h +++ b/source/adios2/ADIOSTypes.h @@ -14,6 +14,7 @@ #include <complex> #include <cstddef> #include <cstdint> +#include <limits> #include <type_traits> #include "adios2/ADIOSConfig.h" @@ -115,9 +116,9 @@ struct TypeInfo<T, typename std::enable_if<std::is_same< }; const size_t UnknownDim = 0; -const size_t JoinedDim = SIZE_MAX - 1; -const size_t IrregularDim = JoinedDim - 1; +const size_t JoinedDim = std::numeric_limits<size_t>::max() - 1; const size_t LocalValueDim = JoinedDim - 1; +const size_t IrregularDim = JoinedDim - 2; const bool ConstantShape = true; enum class VarClass