Skip to content
Snippets Groups Projects
Commit ba12399b authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Fix clang-tidy issues with ADIOS.{h,cpp}

parent b24c63d5
No related branches found
No related tags found
1 merge request!21Fix clang tidy errors
Language: Cpp
BasedOnStyle: LLVM
BreakBeforeBraces: Allman
Language: Cpp
BasedOnStyle: LLVM
BreakBeforeBraces: Allman
IndentCaseLabels: true
ConstructorInitializerIndentWidth: 0
Checks: -*,cppcoreguidelines-*,google-*,llvm-*,misc-*,modernize-*,performance-*,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-array-to-pointer-decay
CheckOptions:
- key: google-runtime-int.TypeSuffix
value: _t
......@@ -60,21 +60,21 @@ public:
/**
* @brief Serial constructor for config file, only allowed and compiled in
* libadios_nompi.a
* @param configFileName passed to m_ConfigFile
* @param config XML config file
* @param debugMode true: on throws exceptions and do additional checks,
* false: off (faster, but unsafe)
*/
ADIOS(const std::string configFileName, const Verbose verbose = Verbose::WARN,
ADIOS(std::string config, const Verbose verbose = Verbose::WARN,
const bool debugMode = false);
/**
* @brief Parallel constructor for XML config file and MPI
* @param configFileName passed to m_XMLConfigFile
* @param config XML config file
* @param mpiComm MPI communicator ...const to be discussed
* @param debugMode true: on, false: off (faster, but unsafe)
*/
ADIOS(const std::string configFileName, MPI_Comm mpiComm,
ADIOS(std::string config, MPI_Comm mpiComm,
const Verbose verbose = Verbose::WARN, const bool debugMode = false);
/**
......@@ -85,7 +85,7 @@ public:
ADIOS(MPI_Comm mpiComm, const Verbose verbose = Verbose::WARN,
const bool debugMode = false);
~ADIOS(); ///< empty, using STL containers for memory management
~ADIOS() = default;
void InitMPI(); ///< sets rank and size in m_rank and m_Size, respectively.
......@@ -98,7 +98,7 @@ public:
* @return
*/
template <class T>
inline Variable<T> &DefineVariable(const std::string name,
inline Variable<T> &DefineVariable(const std::string &name,
const Dims dimensions = Dims{1},
const Dims globalDimensions = Dims(),
const Dims globalOffsets = Dims())
......@@ -107,14 +107,14 @@ public:
name + " in call to DefineVariable\n");
}
template <class T> inline Variable<T> &GetVariable(const std::string name)
template <class T> inline Variable<T> &GetVariable(const std::string &name)
{
throw std::invalid_argument("ERROR: type not supported for variable " +
name + " in call to GetVariable\n");
}
template <class T>
VariableCompound &DefineVariableCompound(const std::string name,
VariableCompound &DefineVariableCompound(const std::string &name,
const Dims dimensions = Dims{1},
const Dims globalDimensions = Dims(),
const Dims globalOffsets = Dims())
......@@ -128,7 +128,7 @@ public:
return m_Compound.at(size);
}
VariableCompound &GetVariableCompound(const std::string name);
VariableCompound &GetVariableCompound(const std::string &name);
/**
* Declares a new method. If the method is defined in the user config file,
......@@ -139,7 +139,7 @@ public:
* Use method.isUserDefined() to distinguish between the two cases.
* @param methodName must be unique
*/
Method &DeclareMethod(const std::string methodName);
Method &DeclareMethod(const std::string &methodName);
/**
* @brief Open to Write, Read. Creates a new engine from previously defined
......@@ -157,8 +157,8 @@ public:
* @return Derived class of base Engine depending on Method parameters,
* shared_ptr for potential flexibility
*/
std::shared_ptr<Engine> Open(const std::string streamName,
const std::string accessMode, MPI_Comm mpiComm,
std::shared_ptr<Engine> Open(const std::string &streamName,
const std::string &accessMode, MPI_Comm mpiComm,
const Method &method,
const IOMode iomode = IOMode::INDEPENDENT,
const float timeout_sec = 0.0);
......@@ -178,8 +178,8 @@ public:
* @return Derived class of base Engine depending on Method parameters,
* shared_ptr for potential flexibility
*/
std::shared_ptr<Engine> Open(const std::string streamName,
const std::string accessMode,
std::shared_ptr<Engine> Open(const std::string &streamName,
const std::string &accessMode,
const Method &method,
const IOMode iomode = IOMode::INDEPENDENT,
const float timeout_sec = 0.0);
......@@ -198,9 +198,9 @@ public:
* @return Derived class of base Engine depending on Method parameters,
* shared_ptr for potential flexibility
*/
std::shared_ptr<Engine> Open(const std::string streamName,
const std::string accessMode, MPI_Comm mpiComm,
const std::string methodName,
std::shared_ptr<Engine> Open(const std::string &streamName,
const std::string &accessMode, MPI_Comm mpiComm,
const std::string &methodName,
const IOMode iomode = IOMode::INDEPENDENT,
const float timeout_sec = 0.0);
......@@ -218,9 +218,9 @@ public:
* @return Derived class of base Engine depending on Method parameters,
* shared_ptr for potential flexibility
*/
std::shared_ptr<Engine> Open(const std::string streamName,
const std::string accessMode,
const std::string methodName,
std::shared_ptr<Engine> Open(const std::string &streamName,
const std::string &accessMode,
const std::string &methodName,
const IOMode iomode = IOMode::INDEPENDENT,
const float timeout_sec = 0.0);
......@@ -239,7 +239,7 @@ public:
* shared_ptr for potential flexibility
*/
std::shared_ptr<Engine>
OpenFileReader(const std::string fileName, MPI_Comm mpiComm,
OpenFileReader(const std::string &fileName, MPI_Comm mpiComm,
const Method &method,
const IOMode iomode = IOMode::INDEPENDENT);
......@@ -259,8 +259,8 @@ public:
* shared_ptr for potential flexibility
*/
std::shared_ptr<Engine>
OpenFileReader(const std::string fileName, MPI_Comm mpiComm,
const std::string methodName,
OpenFileReader(const std::string &fileName, MPI_Comm mpiComm,
const std::string &methodName,
const IOMode iomode = IOMode::INDEPENDENT);
/**
......@@ -322,7 +322,8 @@ protected: // no const to allow default empty and copy constructors
* @param groupName unique name, passed for thrown exception only
* @param hint adds information to thrown exception
*/
void CheckVariableInput(const std::string name, const Dims &dimensions) const;
void CheckVariableInput(const std::string &name,
const Dims &dimensions) const;
/**
* Checks for variable name, if not found throws an invalid exception
......@@ -333,7 +334,7 @@ protected: // no const to allow default empty and copy constructors
void CheckVariableName(
std::map<std::string,
std::pair<std::string, unsigned int>>::const_iterator itVariable,
const std::string name, const std::string hint) const;
const std::string &name, const std::string &hint) const;
/**
* @brief Checks for method existence in m_Methods, if failed throws
......@@ -343,9 +344,10 @@ protected: // no const to allow default empty and copy constructors
* @param hint adds information to thrown exception
*/
void CheckMethod(std::map<std::string, Method>::const_iterator itMethod,
const std::string methodName, const std::string hint) const;
const std::string &methodName,
const std::string &hint) const;
template <class T> unsigned int GetVariableIndex(const std::string name)
template <class T> unsigned int GetVariableIndex(const std::string &name)
{
auto itVariable = m_Variables.find(name);
CheckVariableName(
......@@ -359,7 +361,7 @@ protected: // no const to allow default empty and copy constructors
// template specializations of DefineVariable:
template <>
inline Variable<char> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -372,7 +374,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<unsigned char> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -386,7 +388,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<short> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -399,7 +401,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<unsigned short> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -413,7 +415,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<int> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -426,7 +428,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<unsigned int> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -440,7 +442,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<long int> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -453,7 +455,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<unsigned long int> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -467,7 +469,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<long long int> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -481,7 +483,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<unsigned long long int> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -496,7 +498,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<float> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -509,7 +511,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<double> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -522,7 +524,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<long double> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -536,7 +538,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<std::complex<float>> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -551,7 +553,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<std::complex<double>> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -566,7 +568,7 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
template <>
inline Variable<std::complex<long double>> &
ADIOS::DefineVariable(const std::string name, const Dims dimensions,
ADIOS::DefineVariable(const std::string &name, const Dims dimensions,
const Dims globalDimensions, const Dims globalOffsets)
{
CheckVariableInput(name, dimensions);
......@@ -580,96 +582,97 @@ ADIOS::DefineVariable(const std::string name, const Dims dimensions,
}
// Get template specialization
template <> inline Variable<char> &ADIOS::GetVariable(const std::string name)
template <> inline Variable<char> &ADIOS::GetVariable(const std::string &name)
{
return m_Char.at(GetVariableIndex<char>(name));
}
template <>
inline Variable<unsigned char> &ADIOS::GetVariable(const std::string name)
inline Variable<unsigned char> &ADIOS::GetVariable(const std::string &name)
{
return m_UChar.at(GetVariableIndex<unsigned char>(name));
}
template <> inline Variable<short> &ADIOS::GetVariable(const std::string name)
template <> inline Variable<short> &ADIOS::GetVariable(const std::string &name)
{
return m_Short.at(GetVariableIndex<short>(name));
}
template <>
inline Variable<unsigned short> &ADIOS::GetVariable(const std::string name)
inline Variable<unsigned short> &ADIOS::GetVariable(const std::string &name)
{
return m_UShort.at(GetVariableIndex<unsigned short>(name));
}
template <> inline Variable<int> &ADIOS::GetVariable(const std::string name)
template <> inline Variable<int> &ADIOS::GetVariable(const std::string &name)
{
return m_Int.at(GetVariableIndex<int>(name));
}
template <>
inline Variable<unsigned int> &ADIOS::GetVariable(const std::string name)
inline Variable<unsigned int> &ADIOS::GetVariable(const std::string &name)
{
return m_UInt.at(GetVariableIndex<unsigned int>(name));
}
template <>
inline Variable<long int> &ADIOS::GetVariable(const std::string name)
inline Variable<long int> &ADIOS::GetVariable(const std::string &name)
{
return m_LInt.at(GetVariableIndex<unsigned int>(name));
}
template <>
inline Variable<unsigned long int> &ADIOS::GetVariable(const std::string name)
inline Variable<unsigned long int> &ADIOS::GetVariable(const std::string &name)
{
return m_ULInt.at(GetVariableIndex<unsigned long int>(name));
}
template <>
inline Variable<long long int> &ADIOS::GetVariable(const std::string name)
inline Variable<long long int> &ADIOS::GetVariable(const std::string &name)
{
return m_LLInt.at(GetVariableIndex<long long int>(name));
}
template <>
inline Variable<unsigned long long int> &
ADIOS::GetVariable(const std::string name)
ADIOS::GetVariable(const std::string &name)
{
return m_ULLInt.at(GetVariableIndex<unsigned long long int>(name));
}
template <> inline Variable<float> &ADIOS::GetVariable(const std::string name)
template <> inline Variable<float> &ADIOS::GetVariable(const std::string &name)
{
return m_Float.at(GetVariableIndex<float>(name));
}
template <> inline Variable<double> &ADIOS::GetVariable(const std::string name)
template <> inline Variable<double> &ADIOS::GetVariable(const std::string &name)
{
return m_Double.at(GetVariableIndex<double>(name));
}
template <>
inline Variable<long double> &ADIOS::GetVariable(const std::string name)
inline Variable<long double> &ADIOS::GetVariable(const std::string &name)
{
return m_LDouble.at(GetVariableIndex<long double>(name));
}
template <>
inline Variable<std::complex<float>> &ADIOS::GetVariable(const std::string name)
inline Variable<std::complex<float>> &
ADIOS::GetVariable(const std::string &name)
{
return m_CFloat.at(GetVariableIndex<std::complex<float>>(name));
}
template <>
inline Variable<std::complex<double>> &
ADIOS::GetVariable(const std::string name)
ADIOS::GetVariable(const std::string &name)
{
return m_CDouble.at(GetVariableIndex<std::complex<double>>(name));
}
template <>
inline Variable<std::complex<long double>> &
ADIOS::GetVariable(const std::string name)
ADIOS::GetVariable(const std::string &name)
{
return m_CLDouble.at(GetVariableIndex<std::complex<long double>>(name));
}
......
......@@ -35,65 +35,69 @@
namespace adios
{
ADIOS::ADIOS(const Verbose verbose, const bool debugMode)
: m_DebugMode{debugMode}
ADIOS::ADIOS(const Verbose /*verbose*/, const bool debugMode)
: m_DebugMode{debugMode}
{
InitMPI();
}
ADIOS::ADIOS(const std::string configFileName, const Verbose verbose,
ADIOS::ADIOS(std::string config, const Verbose /*verbose*/,
const bool debugMode)
: m_ConfigFile{configFileName}, m_DebugMode{debugMode}
: m_ConfigFile{std::move(config)}, m_DebugMode{debugMode}
{
InitMPI();
// InitXML( m_ConfigFile, m_MPIComm, m_DebugMode, m_Transforms );
}
ADIOS::ADIOS(const std::string xmlConfigFile, MPI_Comm mpiComm,
const Verbose verbose, const bool debugMode)
: m_MPIComm{mpiComm}, m_ConfigFile{xmlConfigFile}, m_DebugMode{debugMode}
ADIOS::ADIOS(std::string config, MPI_Comm mpiComm, const Verbose /*verbose*/,
const bool debugMode)
: m_MPIComm{mpiComm}, m_ConfigFile{std::move(config)}, m_DebugMode{debugMode}
{
InitMPI();
// InitXML( m_XMLConfigFile, m_MPIComm, m_DebugMode, m_HostLanguage,
// m_Transforms, m_Groups );
}
ADIOS::ADIOS(MPI_Comm mpiComm, const Verbose verbose, const bool debugMode)
: m_MPIComm{mpiComm}, m_DebugMode{debugMode}
ADIOS::ADIOS(MPI_Comm mpiComm, const Verbose /*verbose*/, const bool debugMode)
: m_MPIComm{mpiComm}, m_DebugMode{debugMode}
{
InitMPI();
}
ADIOS::~ADIOS() {}
// ADIOS::~ADIOS() {}
void ADIOS::InitMPI()
{
if (m_DebugMode == true)
{
if (m_MPIComm == MPI_COMM_NULL)
{
throw std::ios_base::failure(
"ERROR: engine communicator is MPI_COMM_NULL,"
" in call to ADIOS Open or Constructor\n");
}
}
MPI_Comm_rank(m_MPIComm, &m_RankMPI);
MPI_Comm_size(m_MPIComm, &m_SizeMPI);
}
Method &ADIOS::DeclareMethod(const std::string methodName)
Method &ADIOS::DeclareMethod(const std::string &methodName)
{
if (m_DebugMode == true)
{
if (m_Methods.count(methodName) == 1)
{
throw std::invalid_argument("ERROR: method " + methodName +
" already declared, from DeclareMethod\n");
}
}
m_Methods.emplace(methodName, Method(methodName, m_DebugMode));
return m_Methods.at(methodName);
}
std::shared_ptr<Engine> ADIOS::Open(const std::string name,
const std::string accessMode,
std::shared_ptr<Engine> ADIOS::Open(const std::string &name,
const std::string &accessMode,
MPI_Comm mpiComm, const Method &method,
const IOMode iomode,
const float timeout_sec)
......@@ -101,9 +105,11 @@ std::shared_ptr<Engine> ADIOS::Open(const std::string name,
if (m_DebugMode == true)
{
if (m_EngineNames.count(name) == 1) // Check if Engine already exists
{
throw std::invalid_argument(
"ERROR: engine name " + name +
" already created by Open, in call from Open.\n");
}
}
m_EngineNames.insert(name);
......@@ -179,16 +185,18 @@ std::shared_ptr<Engine> ADIOS::Open(const std::string name,
else
{
if (m_DebugMode == true)
{
throw std::invalid_argument("ERROR: method type " + type +
" not supported for " + name +
", in call to Open\n");
}
}
return nullptr; // if debug mode is off
}
std::shared_ptr<Engine> ADIOS::Open(const std::string streamName,
const std::string accessMode,
std::shared_ptr<Engine> ADIOS::Open(const std::string &streamName,
const std::string &accessMode,
const Method &method, const IOMode iomode,
const float timeout_sec)
{
......@@ -196,9 +204,9 @@ std::shared_ptr<Engine> ADIOS::Open(const std::string streamName,
}
std::shared_ptr<Engine>
ADIOS::Open(const std::string name, const std::string accessMode,
MPI_Comm mpiComm, const std::string methodName, const IOMode iomode,
const float timeout_sec)
ADIOS::Open(const std::string &name, const std::string &accessMode,
MPI_Comm mpiComm, const std::string &methodName,
const IOMode iomode, const float timeout_sec)
{
auto itMethod = m_Methods.find(methodName);
......@@ -210,26 +218,26 @@ ADIOS::Open(const std::string name, const std::string accessMode,
return Open(name, accessMode, mpiComm, itMethod->second, iomode, timeout_sec);
}
std::shared_ptr<Engine> ADIOS::Open(const std::string name,
const std::string accessMode,
const std::string methodName,
std::shared_ptr<Engine> ADIOS::Open(const std::string &name,
const std::string &accessMode,
const std::string &methodName,
const IOMode iomode,
const float timeout_sec)
{
return Open(name, accessMode, m_MPIComm, methodName, iomode, timeout_sec);
}
std::shared_ptr<Engine> ADIOS::OpenFileReader(const std::string name,
MPI_Comm mpiComm,
std::shared_ptr<Engine> ADIOS::OpenFileReader(const std::string &name,
MPI_Comm /*mpiComm*/,
const Method &method,
const IOMode iomode)
{
return Open(name, "r", m_MPIComm, method, iomode);
}
std::shared_ptr<Engine> ADIOS::OpenFileReader(const std::string name,
MPI_Comm mpiComm,
const std::string methodName,
std::shared_ptr<Engine> ADIOS::OpenFileReader(const std::string &name,
MPI_Comm /*mpiComm*/,
const std::string &methodName,
const IOMode iomode)
{
auto itMethod = m_Methods.find(methodName);
......@@ -242,7 +250,7 @@ std::shared_ptr<Engine> ADIOS::OpenFileReader(const std::string name,
return Open(name, "r", m_MPIComm, itMethod->second, iomode);
}
VariableCompound &ADIOS::GetVariableCompound(const std::string name)
VariableCompound &ADIOS::GetVariableCompound(const std::string &name)
{
return m_Compound.at(GetVariableIndex<void>(name));
}
......@@ -257,93 +265,118 @@ void ADIOS::MonitorVariables(std::ostream &logStream)
const std::string type(variablePair.second.first);
if (type == GetType<char>())
{
GetVariable<char>(name).Monitor(logStream);
}
else if (type == GetType<unsigned char>())
{
GetVariable<unsigned char>(name).Monitor(logStream);
}
else if (type == GetType<short>())
{
GetVariable<short>(name).Monitor(logStream);
}
else if (type == GetType<unsigned short>())
{
GetVariable<unsigned short>(name).Monitor(logStream);
}
else if (type == GetType<int>())
{
GetVariable<int>(name).Monitor(logStream);
}
else if (type == GetType<unsigned int>())
{
GetVariable<unsigned int>(name).Monitor(logStream);
}
else if (type == GetType<long int>())
{
GetVariable<long int>(name).Monitor(logStream);
}
else if (type == GetType<unsigned long int>())
{
GetVariable<unsigned long int>(name).Monitor(logStream);
}
else if (type == GetType<long long int>())
{
GetVariable<long long int>(name).Monitor(logStream);
}
else if (type == GetType<unsigned long long int>())
{
GetVariable<unsigned long long int>(name).Monitor(logStream);
}
else if (type == GetType<float>())
{
GetVariable<float>(name).Monitor(logStream);
}
else if (type == GetType<double>())
{
GetVariable<double>(name).Monitor(logStream);
}
else if (type == GetType<long double>())
{
GetVariable<long double>(name).Monitor(logStream);
}
else if (type == GetType<std::complex<float>>())
{
GetVariable<std::complex<float>>(name).Monitor(logStream);
}
else if (type == GetType<std::complex<double>>())
{
GetVariable<std::complex<double>>(name).Monitor(logStream);
}
else if (type == GetType<std::complex<long double>>())
{
GetVariable<std::complex<long double>>(name).Monitor(logStream);
}
}
}
// PRIVATE FUNCTIONS BELOW
void ADIOS::CheckVariableInput(const std::string name,
void ADIOS::CheckVariableInput(const std::string &name,
const Dims &dimensions) const
{
if (m_DebugMode == true)
{
if (m_Variables.count(name) == 1)
{
throw std::invalid_argument(
"ERROR: variable " + name +
" already exists, in call to DefineVariable\n");
}
if (dimensions.empty() == true)
{
throw std::invalid_argument(
"ERROR: variable " + name +
" dimensions can't be empty, in call to DefineVariable\n");
}
}
}
void ADIOS::CheckVariableName(
std::map<std::string, std::pair<std::string, unsigned int>>::const_iterator
itVariable,
const std::string name, const std::string hint) const
const std::string &name, const std::string &hint) const
{
if (m_DebugMode == true)
{
if (itVariable == m_Variables.end())
{
throw std::invalid_argument("ERROR: variable " + name +
" does not exist " + hint + "\n");
}
}
}
void ADIOS::CheckMethod(std::map<std::string, Method>::const_iterator itMethod,
const std::string methodName,
const std::string hint) const
const std::string &methodName,
const std::string &hint) const
{
if (itMethod == m_Methods.end())
{
throw std::invalid_argument("ERROR: method " + methodName + " not found " +
hint + "\n");
}
}
} // end namespace
} // end namespace adios
......@@ -47,6 +47,7 @@ if(ADIOS_USE_ADIOS1)
engine/adios1/ADIOS1Reader.cpp
engine/adios1/ADIOS1Writer.cpp
)
target_compile_definitions(adios2 PRIVATE HAS_ADIOS1)
target_link_libraries(adios2 PRIVATE adios::adios)
endif()
......@@ -57,11 +58,13 @@ if(ADIOS_USE_DataMan)
engine/dataman/DataManWriter.cpp
transport/wan/MdtmMan.cpp
)
target_compile_definitions(adios2 PRIVATE HAS_DATAMAN)
target_link_libraries(adios2 PRIVATE DataMan::DataMan)
endif()
if(ADIOS_USE_BZip2)
find_package(BZip2 REQUIRED)
target_sources(adios2 PRIVATE transform/BZip2.cpp)
target_compile_definitions(adios2 PRIVATE HAS_BZIP2)
target_link_libraries(adios2 PRIVATE BZip2::BZip2)
endif()
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