Skip to content

Commit

Permalink
Merge pull request #953 from pnorbert/fix_bcast
Browse files Browse the repository at this point in the history
Fix bcast
  • Loading branch information
eisenhauer committed Oct 25, 2018
2 parents 2d86df2 + 16425f1 commit 599d95b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flake8.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
max-line-length = 80
max-complexity = 50
format = pylint
ignore = F403,F405,F999
ignore = F403,F405,F999,W504
exclude = thirdparty/
15 changes: 13 additions & 2 deletions source/adios2/helper/adiosMPIFunctions.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,19 @@ void BroadcastVector(std::vector<char> &vector, MPI_Comm mpiComm,
vector.resize(inputSize);
}

MPI_Bcast(vector.data(), static_cast<int>(inputSize), MPI_CHAR, rankSource,
mpiComm);
const int MAXBCASTSIZE = 1073741824;
size_t blockSize = (inputSize > MAXBCASTSIZE ? MAXBCASTSIZE : inputSize);
size_t sent = 0;
size_t pos = 0;
char *buffer = vector.data();
while (inputSize > 0)
{
MPI_Bcast(buffer, static_cast<int>(blockSize), MPI_CHAR, rankSource,
mpiComm);
buffer += blockSize;
inputSize -= blockSize;
blockSize = (inputSize > MAXBCASTSIZE ? MAXBCASTSIZE : inputSize);
}
}

// GatherArrays specializations
Expand Down
2 changes: 1 addition & 1 deletion source/utils/adios_iotest/processConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ std::vector<std::string> LineToWords(const std::string &line)
bool isComment(std::string &s)
{
bool comment = false;
if (s[0] == '#' || s[0] == '%' || s[0] == '/')
if (!s.compare(0, 1, "#") || !s.compare(0, 1, "%"))
{
comment = true;
}
Expand Down
2 changes: 1 addition & 1 deletion source/utils/adios_reorganize/Reorganize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void Reorganize::Run()
print0("Write method parameters = ", wmethodparams);

#ifdef ADIOS2_HAVE_MPI
core::ADIOS adios(MPI_COMM_SELF, true, "C++");
core::ADIOS adios(MPI_COMM_WORLD, true, "C++");
#else
core::ADIOS adios(true, "C++");
#endif
Expand Down

0 comments on commit 599d95b

Please sign in to comment.