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

Remove operations #2868

Merged
merged 2 commits into from
Sep 15, 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: 8 additions & 0 deletions bindings/CXX11/adios2/cxx11/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ namespace adios2
} \
\
template <> \
void Variable<T>::RemoveOperations() \
{ \
helper::CheckForNullptr(m_Variable, \
"in call to Variable<T>::RemoveOperations"); \
m_Variable->RemoveOperations(); \
} \
\
template <> \
std::pair<T, T> Variable<T>::MinMax(const size_t step) const \
{ \
helper::CheckForNullptr(m_Variable, "in call to Variable<T>::MinMax"); \
Expand Down
6 changes: 6 additions & 0 deletions bindings/CXX11/adios2/cxx11/Variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ class Variable
*/
std::vector<Operation> Operations() const;

/**
* Removes all current Operations associated with AddOperation.
* Provides the posibility to apply or not operators on a step basis.
*/
void RemoveOperations();

/**
* Read mode only: return minimum and maximum values for current variable at
* a step. For streaming mode (BeginStep/EndStep): use default (leave empty)
Expand Down
2 changes: 2 additions & 0 deletions source/adios2/core/VariableBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ size_t VariableBase::AddOperation(Operator &op,
return m_Operations.size() - 1;
}

void VariableBase::RemoveOperations() noexcept { m_Operations.clear(); }

void VariableBase::SetOperationParameter(const size_t operationID,
const std::string key,
const std::string value)
Expand Down
6 changes: 6 additions & 0 deletions source/adios2/core/VariableBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ class VariableBase
size_t AddOperation(core::Operator &op,
const Params &parameters = Params()) noexcept;

/**
* Removes all current Operations associated with AddOperation.
* Provides the posibility to apply or not operators on a step basis.
*/
void RemoveOperations() noexcept;

/**
* Sets a parameter by key/value in an existing operation from AddOperation
* @param operationID returned handler form AddOperation
Expand Down
1 change: 1 addition & 0 deletions testing/adios2/engine/bp/operations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ endif()
if(ADIOS2_HAVE_ZFP)
bp3_bp4_gtest_add_tests_helper(WriteReadZfp MPI_ALLOW)
bp3_bp4_gtest_add_tests_helper(WriteReadZfpHighLevelAPI MPI_ALLOW)
bp3_bp4_gtest_add_tests_helper(WriteReadZfpRemoveOperations MPI_ALLOW)
bp3_bp4_gtest_add_tests_helper(WriteReadZfpConfig MPI_ALLOW)

gtest_add_tests_helper(ZfpComplex MPI_ALLOW BPWriteRead Engine. "")
Expand Down
Loading