Skip to content
Snippets Groups Projects
Commit a544ee05 authored by William F Godoy's avatar William F Godoy
Browse files

Fixing errors from github merged version

Fixed conflicts for clean compilation
Fixed clang-format
Adding free in C example
parent fde327af
No related branches found
No related tags found
1 merge request!229Initial C bindings
...@@ -53,6 +53,8 @@ int main(int argc, char *argv[]) ...@@ -53,6 +53,8 @@ int main(int argc, char *argv[])
adios2_close(engineH); adios2_close(engineH);
adios2_finalize(adiosH); adios2_finalize(adiosH);
free(myFloats);
MPI_Finalize(); MPI_Finalize();
return 0; return 0;
......
...@@ -91,7 +91,8 @@ IO::DefineVariableCompound(const std::string &name, const size_t sizeOfVariable, ...@@ -91,7 +91,8 @@ IO::DefineVariableCompound(const std::string &name, const size_t sizeOfVariable,
{ {
if (m_DebugMode) if (m_DebugMode)
{ {
if (VariableExists(name)) auto itVariable = m_Variables.find(name);
if (!IsEnd(itVariable, m_Variables))
{ {
throw std::invalid_argument("ERROR: variable " + name + throw std::invalid_argument("ERROR: variable " + name +
" exists in IO object " + m_Name + " exists in IO object " + m_Name +
......
...@@ -140,7 +140,7 @@ public: ...@@ -140,7 +140,7 @@ public:
template <class T> template <class T>
Variable<T> &DefineVariable(const std::string &name, const Dims &shape = {}, Variable<T> &DefineVariable(const std::string &name, const Dims &shape = {},
const Dims &start = {}, const Dims &count = {}, const Dims &start = {}, const Dims &count = {},
const bool constantShape = false); const bool constantDims = false);
/** /**
* Define a Variable of primitive data type for I/O. * Define a Variable of primitive data type for I/O.
...@@ -159,8 +159,8 @@ public: ...@@ -159,8 +159,8 @@ public:
const Dims &shape = Dims{}, const Dims &shape = Dims{},
const Dims &start = Dims{}, const Dims &start = Dims{},
const Dims &count = Dims{}, const Dims &count = Dims{},
const bool constantShape = false); const bool constantDims = false);
VariableCompound &DefineVariableCompound(const std::string &name, VariableCompound &DefineVariableCompound(const std::string &name,
const size_t sizeOfVariable, const size_t sizeOfVariable,
const Dims &shape = Dims{}, const Dims &shape = Dims{},
......
...@@ -28,7 +28,7 @@ namespace adios2 ...@@ -28,7 +28,7 @@ namespace adios2
template <class T> template <class T>
Variable<T> &IO::DefineVariable(const std::string &name, const Dims &shape, Variable<T> &IO::DefineVariable(const std::string &name, const Dims &shape,
const Dims &start, const Dims &count, const Dims &start, const Dims &count,
const bool constantShape) const bool constantDims)
{ {
if (m_DebugMode) if (m_DebugMode)
{ {
......
...@@ -24,7 +24,7 @@ namespace adios2 ...@@ -24,7 +24,7 @@ namespace adios2
template <> \ template <> \
Variable<T>::Variable(const std::string &name, const Dims &shape, \ Variable<T>::Variable(const std::string &name, const Dims &shape, \
const Dims &start, const Dims &count, \ const Dims &start, const Dims &count, \
const bool constantShape, const bool debugMode) \ const bool constantDims, const bool debugMode) \
: VariableBase(name, GetType<T>(), sizeof(T), shape, start, count, \ : VariableBase(name, GetType<T>(), sizeof(T), shape, start, count, \
constantDims, debugMode) \ constantDims, debugMode) \
{ \ { \
......
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