Skip to content

Commit

Permalink
bp: workaround for char overflow in bp vers
Browse files Browse the repository at this point in the history
BP files bits assigned to the minor version of ADIOS2 is
a single character long, when moving to adios 2.10.0 we
run into an ASCII overflow here. This patch uses the next ASCII
character after '9' for minor versions after 9. This will buy us
sometime to resolve this issue.
  • Loading branch information
vicentebolea committed Dec 29, 2023
1 parent 3f91c41 commit b7f8d61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/adios2/engine/bp5/BP5Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,8 @@ void BP5Writer::MakeHeader(std::vector<char> &buffer, size_t &position, const st
}

const std::string majorVersion(std::to_string(ADIOS2_VERSION_MAJOR));
const std::string minorVersion(std::to_string(ADIOS2_VERSION_MINOR));
const char minorVersionChar = '0' + ADIOS2_VERSION_MINOR;
const std::string minorVersion(1, minorVersionChar);
const std::string patchVersion(std::to_string(ADIOS2_VERSION_PATCH));

// byte 0-31: Readable tag
Expand Down
3 changes: 2 additions & 1 deletion source/adios2/toolkit/format/bp/BPSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ void BPSerializer::PutMinifooter(const uint64_t pgIndexStart, const uint64_t var
};

const std::string majorVersion(std::to_string(ADIOS2_VERSION_MAJOR));
const std::string minorVersion(std::to_string(ADIOS2_VERSION_MINOR));
const char minorVersionChar = '0' + ADIOS2_VERSION_MINOR;
const std::string minorVersion(1, minorVersionChar);
const std::string patchVersion(std::to_string(ADIOS2_VERSION_PATCH));

const std::string versionLongTag("ADIOS-BP v" + majorVersion + "." + minorVersion + "." +
Expand Down
3 changes: 2 additions & 1 deletion source/adios2/toolkit/format/bp/bp4/BP4Serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ void BP4Serializer::MakeHeader(BufferSTL &b, const std::string fileType, const b
}

const std::string majorVersion(std::to_string(ADIOS2_VERSION_MAJOR));
const std::string minorVersion(std::to_string(ADIOS2_VERSION_MINOR));
const char minorVersionChar = '0' + ADIOS2_VERSION_MINOR;
const std::string minorVersion(1, minorVersionChar);
const std::string patchVersion(std::to_string(ADIOS2_VERSION_PATCH));

// byte 0-31: Readable tag
Expand Down

0 comments on commit b7f8d61

Please sign in to comment.