Skip to content

Commit

Permalink
Bugfix for false positive of the tagging tape for MPI reduce operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxSagebaum committed Apr 3, 2024
1 parent 9b6b905 commit f24b03f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/codi/tapes/tagging/tagTapeBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -223,7 +224,7 @@ namespace codi {

/// Checks if the tag is correct. Errors are set on the ValidationIndicator object.
CODI_INLINE void verifyTag(ValidationIndicator<Real, Tag>& vi, Tag const& tag) const {
if (PassiveTag != tag) {
if (PassiveTag != tag && InvalidTag != tag) {
vi.isActive = true;
if (tag != curTag) {
vi.hasError = true;
Expand Down
2 changes: 1 addition & 1 deletion include/codi/tapes/tagging/tagTapeReverse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ namespace codi {

/// -1 tag.
Identifier getInvalidIndex() const {
return Identifier(-1);
return Identifier(Base::InvalidTag);
}

/// Verify tag.
Expand Down

0 comments on commit f24b03f

Please sign in to comment.