From f24b03fc7f9cf6c09607a1ffca6af2f893e3da09 Mon Sep 17 00:00:00 2001 From: Max Sagebaum Date: Wed, 3 Apr 2024 13:58:53 +0200 Subject: [PATCH] Bugfix for false positive of the tagging tape for MPI reduce operations. --- include/codi/tapes/tagging/tagTapeBase.hpp | 5 +++-- include/codi/tapes/tagging/tagTapeReverse.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/codi/tapes/tagging/tagTapeBase.hpp b/include/codi/tapes/tagging/tagTapeBase.hpp index c203490a..60a564e0 100644 --- a/include/codi/tapes/tagging/tagTapeBase.hpp +++ b/include/codi/tapes/tagging/tagTapeBase.hpp @@ -85,7 +85,8 @@ namespace codi { /// Callback for a tag error. using TagErrorCallback = void (*)(Tag const& correctTag, Tag const& wrongTag, void* userData); - static Tag constexpr PassiveTag = Tag(0); ///< Tag indicating an inactive value. + static Tag constexpr PassiveTag = Tag(0); ///< Tag indicating an inactive value. + static Tag constexpr InvalidTag = Tag(-1); ///< Tag indicating an invalid value. protected: @@ -223,7 +224,7 @@ namespace codi { /// Checks if the tag is correct. Errors are set on the ValidationIndicator object. CODI_INLINE void verifyTag(ValidationIndicator& vi, Tag const& tag) const { - if (PassiveTag != tag) { + if (PassiveTag != tag && InvalidTag != tag) { vi.isActive = true; if (tag != curTag) { vi.hasError = true; diff --git a/include/codi/tapes/tagging/tagTapeReverse.hpp b/include/codi/tapes/tagging/tagTapeReverse.hpp index 251dd3f1..2eda2ed1 100644 --- a/include/codi/tapes/tagging/tagTapeReverse.hpp +++ b/include/codi/tapes/tagging/tagTapeReverse.hpp @@ -250,7 +250,7 @@ namespace codi { /// -1 tag. Identifier getInvalidIndex() const { - return Identifier(-1); + return Identifier(Base::InvalidTag); } /// Verify tag.