Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Info to BPInfo #2652

Merged
merged 1 commit into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bindings/CXX11/adios2/cxx11/Engine.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ namespace
template <class T>
static std::vector<typename Variable<T>::Info>
ToBlocksInfo(const std::vector<typename core::Variable<
typename TypeInfo<T>::IOType>::Info> &coreBlocksInfo)
typename TypeInfo<T>::IOType>::BPInfo> &coreBlocksInfo)
{
using IOType = typename TypeInfo<T>::IOType;

std::vector<typename Variable<T>::Info> blocksInfo;
blocksInfo.reserve(coreBlocksInfo.size());

for (const typename core::Variable<IOType>::Info &coreBlockInfo :
for (const typename core::Variable<IOType>::BPInfo &coreBlockInfo :
coreBlocksInfo)
{
typename Variable<T>::Info blockInfo;
Expand Down Expand Up @@ -294,7 +294,7 @@ Engine::AllStepsBlocksInfo(const Variable<T> variable) const
variable.m_Variable,
"for variable in call to Engine::AllStepsBlocksInfo");

const std::map<size_t, std::vector<typename core::Variable<IOType>::Info>>
const std::map<size_t, std::vector<typename core::Variable<IOType>::BPInfo>>
coreAllStepsBlockInfo =
m_Engine->AllStepsBlocksInfo(*variable.m_Variable);

Expand All @@ -304,7 +304,7 @@ Engine::AllStepsBlocksInfo(const Variable<T> variable) const
for (const auto &pair : coreAllStepsBlockInfo)
{
const size_t step = pair.first;
const std::vector<typename core::Variable<IOType>::Info>
const std::vector<typename core::Variable<IOType>::BPInfo>
&coreBlocksInfo = pair.second;

allStepsBlocksInfo[step] = ToBlocksInfo<T>(coreBlocksInfo);
Expand Down
4 changes: 2 additions & 2 deletions bindings/CXX11/adios2/cxx11/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ namespace adios2
template <> \
const T *Variable<T>::Info::Data() const \
{ \
const core::Variable<T>::Info *coreInfo = \
reinterpret_cast<const core::Variable<T>::Info *>(m_Info); \
const core::Variable<T>::BPInfo *coreInfo = \
reinterpret_cast<const core::Variable<T>::BPInfo *>(m_Info); \
\
return m_Info ? (coreInfo->BufferP ? coreInfo->BufferP \
: coreInfo->BufferV.data()) \
Expand Down
6 changes: 3 additions & 3 deletions bindings/CXX11/adios2/cxx11/Variable.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ namespace
template <class T>
std::vector<typename Variable<T>::Info>
ToBlocksInfo(const std::vector<typename core::Variable<
typename TypeInfo<T>::IOType>::Info> &coreBlocksInfo)
typename TypeInfo<T>::IOType>::BPInfo> &coreBlocksInfo)
{
using IOType = typename TypeInfo<T>::IOType;

std::vector<typename Variable<T>::Info> blocksInfo;
blocksInfo.reserve(coreBlocksInfo.size());

for (const typename core::Variable<IOType>::Info &coreBlockInfo :
for (const typename core::Variable<IOType>::BPInfo &coreBlockInfo :
coreBlocksInfo)
{
typename Variable<T>::Info blockInfo;
Expand Down Expand Up @@ -69,7 +69,7 @@ Variable<T>::DoAllStepsBlocksInfo()
"in call to Variable<T>::AllStepsBlocksInfo");

// PRIVATE INPUT
const std::vector<std::vector<typename core::Variable<IOType>::Info>>
const std::vector<std::vector<typename core::Variable<IOType>::BPInfo>>
coreAllStepsBlocksInfo = m_Variable->AllStepsBlocksInfo();

// PUBLIC OUTPUT
Expand Down
30 changes: 15 additions & 15 deletions source/adios2/core/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ ADIOS2_FOREACH_STDTYPE_1ARG(declare_type)
{ \
ThrowUp("DoGetDeferred"); \
} \
typename Variable<T>::Info *Engine::DoGetBlockSync(Variable<T> &v) \
typename Variable<T>::BPInfo *Engine::DoGetBlockSync(Variable<T> &v) \
{ \
return nullptr; \
} \
typename Variable<T>::Info *Engine::DoGetBlockDeferred(Variable<T> &v) \
typename Variable<T>::BPInfo *Engine::DoGetBlockDeferred(Variable<T> &v) \
{ \
return nullptr; \
}
Expand All @@ -139,25 +139,25 @@ ADIOS2_FOREACH_STDTYPE_1ARG(declare_type)
#undef declare_type

#define declare_type(T) \
std::map<size_t, std::vector<typename Variable<T>::Info>> \
std::map<size_t, std::vector<typename Variable<T>::BPInfo>> \
Engine::DoAllStepsBlocksInfo(const Variable<T> &variable) const \
{ \
ThrowUp("DoAllStepsBlocksInfo"); \
return std::map<size_t, std::vector<typename Variable<T>::Info>>(); \
return std::map<size_t, std::vector<typename Variable<T>::BPInfo>>(); \
} \
\
std::vector<std::vector<typename Variable<T>::Info>> \
std::vector<std::vector<typename Variable<T>::BPInfo>> \
Engine::DoAllRelativeStepsBlocksInfo(const Variable<T> &variable) const \
{ \
ThrowUp("DoAllRelativeStepsBlocksInfo"); \
return std::vector<std::vector<typename Variable<T>::Info>>(); \
return std::vector<std::vector<typename Variable<T>::BPInfo>>(); \
} \
\
std::vector<typename Variable<T>::Info> Engine::DoBlocksInfo( \
std::vector<typename Variable<T>::BPInfo> Engine::DoBlocksInfo( \
const Variable<T> &variable, const size_t step) const \
{ \
ThrowUp("DoBlocksInfo"); \
return std::vector<typename Variable<T>::Info>(); \
return std::vector<typename Variable<T>::BPInfo>(); \
} \
std::vector<size_t> Engine::DoGetAbsoluteSteps( \
const Variable<T> &variable) const \
Expand Down Expand Up @@ -223,21 +223,21 @@ void Engine::CheckOpenModes(const std::set<Mode> &modes,
template void Engine::Get<T>(const std::string &, std::vector<T> &, \
const Mode); \
\
template typename Variable<T>::Info *Engine::Get<T>(Variable<T> &, \
const Mode); \
template typename Variable<T>::Info *Engine::Get<T>(const std::string &, \
const Mode); \
template typename Variable<T>::BPInfo *Engine::Get<T>(Variable<T> &, \
const Mode); \
template typename Variable<T>::BPInfo *Engine::Get<T>(const std::string &, \
const Mode); \
\
template Variable<T> &Engine::FindVariable( \
const std::string &variableName, const std::string hint); \
\
template std::map<size_t, std::vector<typename Variable<T>::Info>> \
template std::map<size_t, std::vector<typename Variable<T>::BPInfo>> \
Engine::AllStepsBlocksInfo(const Variable<T> &) const; \
\
template std::vector<std::vector<typename Variable<T>::Info>> \
template std::vector<std::vector<typename Variable<T>::BPInfo>> \
Engine::AllRelativeStepsBlocksInfo(const Variable<T> &) const; \
\
template std::vector<typename Variable<T>::Info> Engine::BlocksInfo( \
template std::vector<typename Variable<T>::BPInfo> Engine::BlocksInfo( \
const Variable<T> &, const size_t) const; \
template std::vector<size_t> Engine::GetAbsoluteSteps(const Variable<T> &) \
const;
Expand Down
37 changes: 19 additions & 18 deletions source/adios2/core/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ class Engine
* </pre>
*/
template <class T>
typename Variable<T>::Info *Get(Variable<T> &variable,
const Mode launch = Mode::Deferred);
typename Variable<T>::BPInfo *Get(Variable<T> &variable,
const Mode launch = Mode::Deferred);

/**
* @brief Get version for block selection that accepts a variableName as
Expand All @@ -341,8 +341,8 @@ class Engine
* </pre>
*/
template <class T>
typename Variable<T>::Info *Get(const std::string &variableName,
const Mode launch = Mode::Deferred);
typename Variable<T>::BPInfo *Get(const std::string &variableName,
const Mode launch = Mode::Deferred);

template <class T>
void Get(core::Variable<T> &, T **) const;
Expand Down Expand Up @@ -390,7 +390,7 @@ class Engine
* </pre>
*/
template <class T>
std::map<size_t, std::vector<typename Variable<T>::Info>>
std::map<size_t, std::vector<typename Variable<T>::BPInfo>>
AllStepsBlocksInfo(const Variable<T> &variable) const;

/**
Expand All @@ -400,7 +400,7 @@ class Engine
* @return
*/
template <class T>
std::vector<std::vector<typename Variable<T>::Info>>
std::vector<std::vector<typename Variable<T>::BPInfo>>
AllRelativeStepsBlocksInfo(const Variable<T> &variable) const;

/**
Expand All @@ -413,7 +413,7 @@ class Engine
* found it returns an empty vector
*/
template <class T>
std::vector<typename Variable<T>::Info>
std::vector<typename Variable<T>::BPInfo>
BlocksInfo(const Variable<T> &variable, const size_t step) const;

/**
Expand Down Expand Up @@ -494,8 +494,8 @@ class Engine
#define declare_type(T) \
virtual void DoGetSync(Variable<T> &, T *); \
virtual void DoGetDeferred(Variable<T> &, T *); \
virtual typename Variable<T>::Info *DoGetBlockSync(Variable<T> &); \
virtual typename Variable<T>::Info *DoGetBlockDeferred(Variable<T> &);
virtual typename Variable<T>::BPInfo *DoGetBlockSync(Variable<T> &); \
virtual typename Variable<T>::BPInfo *DoGetBlockDeferred(Variable<T> &);
ADIOS2_FOREACH_STDTYPE_1ARG(declare_type)
#undef declare_type

Expand All @@ -512,13 +512,13 @@ class Engine
const std::string hint);

#define declare_type(T) \
virtual std::map<size_t, std::vector<typename Variable<T>::Info>> \
virtual std::map<size_t, std::vector<typename Variable<T>::BPInfo>> \
DoAllStepsBlocksInfo(const Variable<T> &variable) const; \
\
virtual std::vector<std::vector<typename Variable<T>::Info>> \
virtual std::vector<std::vector<typename Variable<T>::BPInfo>> \
DoAllRelativeStepsBlocksInfo(const Variable<T> &variable) const; \
\
virtual std::vector<typename Variable<T>::Info> DoBlocksInfo( \
virtual std::vector<typename Variable<T>::BPInfo> DoBlocksInfo( \
const Variable<T> &variable, const size_t step) const; \
virtual std::vector<size_t> DoGetAbsoluteSteps( \
const Variable<T> &variable) const;
Expand Down Expand Up @@ -592,21 +592,22 @@ class Engine
extern template void Engine::Get<T>(const std::string &, std::vector<T> &, \
const Mode); \
\
extern template typename Variable<T>::Info *Engine::Get<T>(Variable<T> &, \
const Mode); \
extern template typename Variable<T>::Info *Engine::Get<T>( \
extern template typename Variable<T>::BPInfo *Engine::Get<T>( \
Variable<T> &, const Mode); \
extern template typename Variable<T>::BPInfo *Engine::Get<T>( \
const std::string &, const Mode); \
\
extern template Variable<T> &Engine::FindVariable( \
const std::string &variableName, const std::string hint); \
\
extern template std::map<size_t, std::vector<typename Variable<T>::Info>> \
extern template std::map<size_t, \
std::vector<typename Variable<T>::BPInfo>> \
Engine::AllStepsBlocksInfo(const Variable<T> &) const; \
\
extern template std::vector<std::vector<typename Variable<T>::Info>> \
extern template std::vector<std::vector<typename Variable<T>::BPInfo>> \
Engine::AllRelativeStepsBlocksInfo(const Variable<T> &) const; \
\
extern template std::vector<typename Variable<T>::Info> \
extern template std::vector<typename Variable<T>::BPInfo> \
Engine::BlocksInfo(const Variable<T> &, const size_t) const; \
\
extern template std::vector<size_t> Engine::GetAbsoluteSteps( \
Expand Down
16 changes: 8 additions & 8 deletions source/adios2/core/Engine.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ void Engine::Get(const std::string &variableName, std::vector<T> &dataV,

// Get
template <class T>
typename Variable<T>::Info *Engine::Get(Variable<T> &variable,
const Mode launch)
typename Variable<T>::BPInfo *Engine::Get(Variable<T> &variable,
const Mode launch)
{
typename Variable<T>::Info *info = nullptr;
typename Variable<T>::BPInfo *info = nullptr;
switch (launch)
{
case Mode::Deferred:
Expand All @@ -182,28 +182,28 @@ typename Variable<T>::Info *Engine::Get(Variable<T> &variable,
}

template <class T>
typename Variable<T>::Info *Engine::Get(const std::string &variableName,
const Mode launch)
typename Variable<T>::BPInfo *Engine::Get(const std::string &variableName,
const Mode launch)
{
return Get(FindVariable<T>(variableName, "in call to Get"), launch);
}

template <class T>
std::map<size_t, std::vector<typename Variable<T>::Info>>
std::map<size_t, std::vector<typename Variable<T>::BPInfo>>
Engine::AllStepsBlocksInfo(const Variable<T> &variable) const
{
return DoAllStepsBlocksInfo(variable);
}

template <class T>
std::vector<std::vector<typename Variable<T>::Info>>
std::vector<std::vector<typename Variable<T>::BPInfo>>
Engine::AllRelativeStepsBlocksInfo(const Variable<T> &variable) const
{
return DoAllRelativeStepsBlocksInfo(variable);
}

template <class T>
std::vector<typename Variable<T>::Info>
std::vector<typename Variable<T>::BPInfo>
Engine::BlocksInfo(const Variable<T> &variable, const size_t step) const
{
return DoBlocksInfo(variable, step);
Expand Down
6 changes: 3 additions & 3 deletions source/adios2/core/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ namespace core
} \
\
template <> \
typename Variable<T>::Info &Variable<T>::SetBlockInfo( \
typename Variable<T>::BPInfo &Variable<T>::SetBlockInfo( \
const T *data, const size_t stepsStart, \
const size_t stepsCount) noexcept \
{ \
Info info; \
BPInfo info; \
info.Shape = m_Shape; \
info.Start = m_Start; \
info.Count = m_Count; \
Expand Down Expand Up @@ -102,7 +102,7 @@ namespace core
} \
\
template <> \
std::vector<std::vector<typename Variable<T>::Info>> \
std::vector<std::vector<typename Variable<T>::BPInfo>> \
Variable<T>::AllStepsBlocksInfo() const \
{ \
return DoAllStepsBlocksInfo(); \
Expand Down
12 changes: 6 additions & 6 deletions source/adios2/core/Variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Variable : public VariableBase
/** current value */
T m_Value = T();

struct Info
struct BPInfo
{
/** Contains (seek) read information for available [step][blockID],
* used in Read mode only,
Expand Down Expand Up @@ -109,7 +109,7 @@ class Variable : public VariableBase
};

/** use for multiblock info */
std::vector<Info> m_BlocksInfo;
std::vector<BPInfo> m_BlocksInfo;

using Span = core::Span<T>;

Expand All @@ -122,8 +122,8 @@ class Variable : public VariableBase

~Variable<T>() = default;

Info &SetBlockInfo(const T *data, const size_t stepsStart,
const size_t stepsCount = 1) noexcept;
BPInfo &SetBlockInfo(const T *data, const size_t stepsStart,
const size_t stepsCount = 1) noexcept;

void SetData(const T *data) noexcept;

Expand All @@ -143,7 +143,7 @@ class Variable : public VariableBase

T Max(const size_t step = adios2::DefaultSizeT) const;

std::vector<std::vector<typename Variable<T>::Info>>
std::vector<std::vector<typename Variable<T>::BPInfo>>
AllStepsBlocksInfo() const;

private:
Expand All @@ -155,7 +155,7 @@ class Variable : public VariableBase

std::pair<T, T> DoMinMax(const size_t step) const;

std::vector<std::vector<typename Variable<T>::Info>>
std::vector<std::vector<typename Variable<T>::BPInfo>>
DoAllStepsBlocksInfo() const;

void CheckRandomAccess(const size_t step, const std::string hint) const;
Expand Down
Loading