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

Fix windows mpi builds #3142

Merged
merged 1 commit into from
Mar 29, 2022
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: 4 additions & 4 deletions source/adios2/engine/ssc/SscReaderNaive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ StepStatus SscReaderNaive::BeginStep(const StepMode stepMode,

++m_CurrentStep;

size_t globalSize;
int globalSize;

if (m_ReaderRank == 0)
{
MPI_Recv(&globalSize, 1, MPI_UNSIGNED_LONG_LONG,
m_WriterMasterStreamRank, 0, m_StreamComm, MPI_STATUS_IGNORE);
MPI_Recv(&globalSize, 1, MPI_INT, m_WriterMasterStreamRank, 0,
m_StreamComm, MPI_STATUS_IGNORE);
m_Buffer.resize(globalSize);
// MPI_Recv(m_Buffer.data(), globalSize, MPI_CHAR,
// m_WriterMasterStreamRank, 0, m_StreamComm, MPI_STATUS_IGNORE);
Expand All @@ -51,7 +51,7 @@ StepStatus SscReaderNaive::BeginStep(const StepMode stepMode,
std::memcpy(m_Buffer.data(), tmp.data(), globalSize);
}

MPI_Bcast(&globalSize, 1, MPI_UNSIGNED_LONG_LONG, 0, m_ReaderComm);
MPI_Bcast(&globalSize, 1, MPI_INT, 0, m_ReaderComm);
if (m_ReaderRank != 0)
{
m_Buffer.resize(globalSize);
Expand Down
13 changes: 6 additions & 7 deletions source/adios2/engine/ssc/SscWriterNaive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ void SscWriterNaive::EndStep(const bool writerLocked)
std::vector<int> localSizes(m_WriterSize);
MPI_Gather(&localSize, 1, MPI_INT, localSizes.data(), 1, MPI_INT, 0,
m_WriterComm);
size_t globalSize =
std::accumulate(localSizes.begin(), localSizes.end(), 0);
int globalSize = std::accumulate(localSizes.begin(), localSizes.end(), 0);
ssc::Buffer globalBuffer(globalSize);

std::vector<int> displs(m_WriterSize);
Expand All @@ -73,8 +72,8 @@ void SscWriterNaive::EndStep(const bool writerLocked)

if (m_WriterRank == 0)
{
MPI_Send(&globalSize, 1, MPI_UNSIGNED_LONG_LONG,
m_ReaderMasterStreamRank, 0, m_StreamComm);
MPI_Send(&globalSize, 1, MPI_INT, m_ReaderMasterStreamRank, 0,
m_StreamComm);
MPI_Send(globalBuffer.data(), globalSize, MPI_CHAR,
m_ReaderMasterStreamRank, 0, m_StreamComm);
}
Expand All @@ -83,12 +82,12 @@ void SscWriterNaive::EndStep(const bool writerLocked)
void SscWriterNaive::Close(const int transportIndex)
{

uint64_t globalSize = 1;
int globalSize = 1;
ssc::Buffer globalBuffer(globalSize);
if (m_WriterRank == 0)
{
MPI_Send(&globalSize, 1, MPI_UNSIGNED_LONG_LONG,
m_ReaderMasterStreamRank, 0, m_StreamComm);
MPI_Send(&globalSize, 1, MPI_INT, m_ReaderMasterStreamRank, 0,
m_StreamComm);
MPI_Send(globalBuffer.data(), globalSize, MPI_CHAR,
m_ReaderMasterStreamRank, 0, m_StreamComm);
}
Expand Down