Skip to content

Commit

Permalink
mpi_aggregator: use MPI_STATUS_IGNORE
Browse files Browse the repository at this point in the history
where we're ignoring the status anyway (which is everywhere).
MPI_STATUS_IGNORE added to mpidummy.{h,cpp}
  • Loading branch information
germasch committed Apr 2, 2019
1 parent f391c41 commit 01c3d0f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 2 additions & 0 deletions source/adios2/helper/mpidummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace helper
namespace mpi
{

MPI_Status *MPI_STATUS_IGNORE;

static char mpierrmsg[MPI_MAX_ERROR_STRING];

int MPI_Init(int * /*argc*/, char *** /*argv*/)
Expand Down
2 changes: 2 additions & 0 deletions source/adios2/helper/mpidummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ using MPI_Op = int;

#define MPI_MAX_PROCESSOR_NAME 32

extern MPI_Status *MPI_STATUS_IGNORE;

int MPI_Init(int *argc, char ***argv);
int MPI_Finalize();
int MPI_Initialized(int *flag);
Expand Down
5 changes: 2 additions & 3 deletions source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,20 @@ void MPIAggregator::WaitAbsolutePosition(const int step)
return;
}

MPI_Status status;
const int destination = (step != m_Size - 1) ? step + 1 : 0;

if (m_Rank == destination)
{
helper::CheckMPIReturn(
MPI_Wait(&m_AbsolutePositionRequests[1], &status),
MPI_Wait(&m_AbsolutePositionRequests[1], MPI_STATUS_IGNORE),
", aggregation Irecv Wait absolute position at iteration " +
std::to_string(step) + "\n");
}

if (m_Rank == step)
{
helper::CheckMPIReturn(
MPI_Wait(&m_AbsolutePositionRequests[0], &status),
MPI_Wait(&m_AbsolutePositionRequests[0], MPI_STATUS_IGNORE),
", aggregation Isend Wait absolute position at iteration " +
std::to_string(step) + "\n");
}
Expand Down
16 changes: 6 additions & 10 deletions source/adios2/toolkit/aggregator/mpi/MPIChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ void MPIChain::IExchange(BufferSTL &bufferSTL, const int step)
", aggregation Irecv size at iteration " +
std::to_string(step) + "\n");

MPI_Status receiveStatus;
helper::CheckMPIReturn(
MPI_Wait(&receiveSizeRequest, &receiveStatus),
MPI_Wait(&receiveSizeRequest, MPI_STATUS_IGNORE),
", aggregation waiting for receiver size at iteration " +
std::to_string(step) + "\n");

Expand Down Expand Up @@ -103,24 +102,23 @@ void MPIChain::Wait(const int step)
const bool sender = (m_Rank >= 1 && m_Rank <= endRank) ? true : false;
const bool receiver = (m_Rank < endRank) ? true : false;

MPI_Status status;
if (receiver)
{
helper::CheckMPIReturn(
MPI_Wait(&m_DataRequests[2], &status),
MPI_Wait(&m_DataRequests[2], MPI_STATUS_IGNORE),
", aggregation waiting for receiver data at iteration " +
std::to_string(step) + "\n");
}

if (sender)
{
helper::CheckMPIReturn(
MPI_Wait(&m_DataRequests[0], &status),
MPI_Wait(&m_DataRequests[0], MPI_STATUS_IGNORE),
", aggregation waiting for sender size at iteration " +
std::to_string(step) + "\n");

helper::CheckMPIReturn(
MPI_Wait(&m_DataRequests[1], &status),
MPI_Wait(&m_DataRequests[1], MPI_STATUS_IGNORE),
", aggregation waiting for sender data at iteration " +
std::to_string(step) + "\n");
}
Expand Down Expand Up @@ -159,17 +157,15 @@ void MPIChain::HandshakeLinks()
&receiveRequest),
"Irecv handshake with neighbor, MPIChain aggregator, at Open");

MPI_Status receiveStatus;
helper::CheckMPIReturn(
MPI_Wait(&receiveRequest, &receiveStatus),
MPI_Wait(&receiveRequest, MPI_STATUS_IGNORE),
"Irecv Wait handshake with neighbor, MPIChain aggregator, at Open");
}

if (m_Rank > 0)
{
MPI_Status sendStatus;
helper::CheckMPIReturn(
MPI_Wait(&sendRequest, &sendStatus),
MPI_Wait(&sendRequest, MPI_STATUS_IGNORE),
"Isend wait handshake with neighbor, MPIChain aggregator, at Open");
}
}
Expand Down

0 comments on commit 01c3d0f

Please sign in to comment.