From 01c3d0fa070b9115495ed1d460bf1a6b8e9a4857 Mon Sep 17 00:00:00 2001 From: Kai Germaschewski Date: Mon, 1 Apr 2019 14:42:54 -0400 Subject: [PATCH] mpi_aggregator: use MPI_STATUS_IGNORE where we're ignoring the status anyway (which is everywhere). MPI_STATUS_IGNORE added to mpidummy.{h,cpp} --- source/adios2/helper/mpidummy.cpp | 2 ++ source/adios2/helper/mpidummy.h | 2 ++ .../toolkit/aggregator/mpi/MPIAggregator.cpp | 5 ++--- .../adios2/toolkit/aggregator/mpi/MPIChain.cpp | 16 ++++++---------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/source/adios2/helper/mpidummy.cpp b/source/adios2/helper/mpidummy.cpp index 79b81deeee..d9f5d00974 100644 --- a/source/adios2/helper/mpidummy.cpp +++ b/source/adios2/helper/mpidummy.cpp @@ -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*/) diff --git a/source/adios2/helper/mpidummy.h b/source/adios2/helper/mpidummy.h index 693bb23ad7..54e8f887e2 100644 --- a/source/adios2/helper/mpidummy.h +++ b/source/adios2/helper/mpidummy.h @@ -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); diff --git a/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp b/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp index a379dcf273..018eaece93 100644 --- a/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp +++ b/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp @@ -80,13 +80,12 @@ 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"); } @@ -94,7 +93,7 @@ void MPIAggregator::WaitAbsolutePosition(const int step) 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"); } diff --git a/source/adios2/toolkit/aggregator/mpi/MPIChain.cpp b/source/adios2/toolkit/aggregator/mpi/MPIChain.cpp index 965db5db7c..81f0f52b1a 100644 --- a/source/adios2/toolkit/aggregator/mpi/MPIChain.cpp +++ b/source/adios2/toolkit/aggregator/mpi/MPIChain.cpp @@ -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"); @@ -103,11 +102,10 @@ 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"); } @@ -115,12 +113,12 @@ void MPIChain::Wait(const int step) 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"); } @@ -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"); } }