diff --git a/src/axom/lumberjack/MPIUtility.cpp b/src/axom/lumberjack/MPIUtility.cpp index a12f4befde..0859da8ea8 100644 --- a/src/axom/lumberjack/MPIUtility.cpp +++ b/src/axom/lumberjack/MPIUtility.cpp @@ -49,18 +49,18 @@ const char* mpiBlockingReceiveMessages(MPI_Comm comm) return charArray; } -const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag) +const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, int tag) { - const int mpiTag = (tag == false) ? LJ_TAG : tag; + const int mpiTag = (tag == 0) ? LJ_TAG : tag; char* charArray = nullptr; int messageSize = -1; MPI_Status mpiStatus; // Get size and source of MPI message - int mpiFlag = true; + int mpiFlag = 0; MPI_Iprobe(MPI_ANY_SOURCE, tag, comm, &mpiFlag, &mpiStatus); - if (mpiFlag == true) { + if (mpiFlag == 1) { MPI_Get_count(&mpiStatus, MPI_CHAR, &messageSize); // Setup where to receive the char array @@ -83,9 +83,9 @@ const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag) void mpiNonBlockingSendMessages(MPI_Comm comm, int destinationRank, const char* packedMessagesToBeSent, - const int tag) + int tag) { - const int mpiTag = (tag == false) ? LJ_TAG : tag; + const int mpiTag = (tag == 0) ? LJ_TAG : tag; MPI_Request mpiRequest; MPI_Isend(const_cast(packedMessagesToBeSent), strlen(packedMessagesToBeSent), diff --git a/src/axom/lumberjack/MPIUtility.hpp b/src/axom/lumberjack/MPIUtility.hpp index 1842eada49..0fcdd0a926 100644 --- a/src/axom/lumberjack/MPIUtility.hpp +++ b/src/axom/lumberjack/MPIUtility.hpp @@ -38,7 +38,7 @@ const char* mpiBlockingReceiveMessages(MPI_Comm comm); * \param [in] comm The MPI Communicator. ***************************************************************************** */ -const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag = 0); +const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, int tag = 0); /*! ***************************************************************************** @@ -57,7 +57,7 @@ const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag = 0); void mpiNonBlockingSendMessages(MPI_Comm comm, int destinationRank, const char* packedMessagesToBeSent, - const int tag = 0); + int tag = 0); } // end namespace lumberjack } // end namespace axom diff --git a/src/axom/lumberjack/NonBlockingRootCommunicator.cpp b/src/axom/lumberjack/NonCollectiveRootCommunicator.cpp similarity index 68% rename from src/axom/lumberjack/NonBlockingRootCommunicator.cpp rename to src/axom/lumberjack/NonCollectiveRootCommunicator.cpp index a1bc6040a9..d2076a8059 100644 --- a/src/axom/lumberjack/NonBlockingRootCommunicator.cpp +++ b/src/axom/lumberjack/NonCollectiveRootCommunicator.cpp @@ -6,21 +6,21 @@ /*! ****************************************************************************** * - * \file NonBlockingRootCommunicator.cpp + * \file NonCollectiveRootCommunicator.cpp * - * \brief Implementation of the NonBlockingRootCommunicator class. + * \brief Implementation of the NonCollectiveRootCommunicator class. * ****************************************************************************** */ -#include "axom/lumberjack/NonBlockingRootCommunicator.hpp" +#include "axom/lumberjack/NonCollectiveRootCommunicator.hpp" #include "axom/lumberjack/MPIUtility.hpp" namespace axom { namespace lumberjack { -void NonBlockingRootCommunicator::initialize(MPI_Comm comm, int ranksLimit) +void NonCollectiveRootCommunicator::initialize(MPI_Comm comm, int ranksLimit) { m_mpiComm = comm; MPI_Comm_rank(m_mpiComm, &m_mpiCommRank); @@ -28,17 +28,17 @@ void NonBlockingRootCommunicator::initialize(MPI_Comm comm, int ranksLimit) m_ranksLimit = ranksLimit; } -void NonBlockingRootCommunicator::finalize() { } +void NonCollectiveRootCommunicator::finalize() { } -int NonBlockingRootCommunicator::rank() { return m_mpiCommRank; } +int NonCollectiveRootCommunicator::rank() { return m_mpiCommRank; } -void NonBlockingRootCommunicator::ranksLimit(int value) { m_ranksLimit = value; } +void NonCollectiveRootCommunicator::ranksLimit(int value) { m_ranksLimit = value; } -int NonBlockingRootCommunicator::ranksLimit() { return m_ranksLimit; } +int NonCollectiveRootCommunicator::ranksLimit() { return m_ranksLimit; } -int NonBlockingRootCommunicator::numPushesToFlush() { return 1; } +int NonCollectiveRootCommunicator::numPushesToFlush() { return 1; } -void NonBlockingRootCommunicator::push(const char* packedMessagesToBeSent, +void NonCollectiveRootCommunicator::push(const char* packedMessagesToBeSent, std::vector& receivedPackedMessages) { constexpr int mpiTag = 32767; @@ -78,7 +78,7 @@ void NonBlockingRootCommunicator::push(const char* packedMessagesToBeSent, } } -bool NonBlockingRootCommunicator::isOutputNode() +bool NonCollectiveRootCommunicator::isOutputNode() { if(m_mpiCommRank == 0) { diff --git a/src/axom/lumberjack/NonBlockingRootCommunicator.hpp b/src/axom/lumberjack/NonCollectiveRootCommunicator.hpp similarity index 94% rename from src/axom/lumberjack/NonBlockingRootCommunicator.hpp rename to src/axom/lumberjack/NonCollectiveRootCommunicator.hpp index ec432ef22c..fb2ff23c16 100644 --- a/src/axom/lumberjack/NonBlockingRootCommunicator.hpp +++ b/src/axom/lumberjack/NonCollectiveRootCommunicator.hpp @@ -5,15 +5,15 @@ /*! ******************************************************************************* - * \file NonBlockingRootCommunicator.hpp + * \file NonCollectiveRootCommunicator.hpp * * \brief This file contains the class definition of the - * NonBlockingRootCommunicator. + * NonCollectiveRootCommunicator. ******************************************************************************* */ -#ifndef NONBLOCKINGROOTCOMMUNICATOR_HPP -#define NONBLOCKINGROOTCOMMUNICATOR_HPP +#ifndef NONCOLLECTIVEROOTCOMMUNICATOR_HPP +#define NONCOLLECTIVEROOTCOMMUNICATOR_HPP #include "axom/lumberjack/Lumberjack.hpp" #include "axom/lumberjack/Communicator.hpp" @@ -24,13 +24,13 @@ namespace lumberjack { /*! ******************************************************************************* - * \class NonBlockingRootCommunicator + * \class NonCollectiveRootCommunicator * * \brief Based off of RootCommunicator. This communicator pushes messages from any rank to root non-collectively, if any messages are sent. ******************************************************************************* */ -class NonBlockingRootCommunicator : public axom::lumberjack::Communicator +class NonCollectiveRootCommunicator : public axom::lumberjack::Communicator { public: /*!