Skip to content

Commit 926fd00

Browse files
committed
fixed tag and flag comparison type, renamed NonBlockingRootCommunicator to NonCollectiveRootCommunicator
1 parent 4835c73 commit 926fd00

4 files changed

+25
-25
lines changed

src/axom/lumberjack/MPIUtility.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ const char* mpiBlockingReceiveMessages(MPI_Comm comm)
4949
return charArray;
5050
}
5151

52-
const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag)
52+
const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, int tag)
5353
{
54-
const int mpiTag = (tag == false) ? LJ_TAG : tag;
54+
const int mpiTag = (tag == 0) ? LJ_TAG : tag;
5555
char* charArray = nullptr;
5656
int messageSize = -1;
5757
MPI_Status mpiStatus;
5858

5959
// Get size and source of MPI message
60-
int mpiFlag = true;
60+
int mpiFlag = 0;
6161
MPI_Iprobe(MPI_ANY_SOURCE, tag, comm, &mpiFlag, &mpiStatus);
6262

63-
if (mpiFlag == true) {
63+
if (mpiFlag == 1) {
6464
MPI_Get_count(&mpiStatus, MPI_CHAR, &messageSize);
6565

6666
// Setup where to receive the char array
@@ -83,9 +83,9 @@ const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag)
8383
void mpiNonBlockingSendMessages(MPI_Comm comm,
8484
int destinationRank,
8585
const char* packedMessagesToBeSent,
86-
const int tag)
86+
int tag)
8787
{
88-
const int mpiTag = (tag == false) ? LJ_TAG : tag;
88+
const int mpiTag = (tag == 0) ? LJ_TAG : tag;
8989
MPI_Request mpiRequest;
9090
MPI_Isend(const_cast<char*>(packedMessagesToBeSent),
9191
strlen(packedMessagesToBeSent),

src/axom/lumberjack/MPIUtility.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const char* mpiBlockingReceiveMessages(MPI_Comm comm);
3838
* \param [in] comm The MPI Communicator.
3939
*****************************************************************************
4040
*/
41-
const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag = 0);
41+
const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, int tag = 0);
4242

4343
/*!
4444
*****************************************************************************
@@ -57,7 +57,7 @@ const char* mpiNonBlockingReceiveMessages(MPI_Comm comm, const int tag = 0);
5757
void mpiNonBlockingSendMessages(MPI_Comm comm,
5858
int destinationRank,
5959
const char* packedMessagesToBeSent,
60-
const int tag = 0);
60+
int tag = 0);
6161
} // end namespace lumberjack
6262
} // end namespace axom
6363

src/axom/lumberjack/NonBlockingRootCommunicator.cpp src/axom/lumberjack/NonCollectiveRootCommunicator.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,39 @@
66
/*!
77
******************************************************************************
88
*
9-
* \file NonBlockingRootCommunicator.cpp
9+
* \file NonCollectiveRootCommunicator.cpp
1010
*
11-
* \brief Implementation of the NonBlockingRootCommunicator class.
11+
* \brief Implementation of the NonCollectiveRootCommunicator class.
1212
*
1313
******************************************************************************
1414
*/
1515

16-
#include "axom/lumberjack/NonBlockingRootCommunicator.hpp"
16+
#include "axom/lumberjack/NonCollectiveRootCommunicator.hpp"
1717
#include "axom/lumberjack/MPIUtility.hpp"
1818

1919
namespace axom
2020
{
2121
namespace lumberjack
2222
{
23-
void NonBlockingRootCommunicator::initialize(MPI_Comm comm, int ranksLimit)
23+
void NonCollectiveRootCommunicator::initialize(MPI_Comm comm, int ranksLimit)
2424
{
2525
m_mpiComm = comm;
2626
MPI_Comm_rank(m_mpiComm, &m_mpiCommRank);
2727
MPI_Comm_size(m_mpiComm, &m_mpiCommSize);
2828
m_ranksLimit = ranksLimit;
2929
}
3030

31-
void NonBlockingRootCommunicator::finalize() { }
31+
void NonCollectiveRootCommunicator::finalize() { }
3232

33-
int NonBlockingRootCommunicator::rank() { return m_mpiCommRank; }
33+
int NonCollectiveRootCommunicator::rank() { return m_mpiCommRank; }
3434

35-
void NonBlockingRootCommunicator::ranksLimit(int value) { m_ranksLimit = value; }
35+
void NonCollectiveRootCommunicator::ranksLimit(int value) { m_ranksLimit = value; }
3636

37-
int NonBlockingRootCommunicator::ranksLimit() { return m_ranksLimit; }
37+
int NonCollectiveRootCommunicator::ranksLimit() { return m_ranksLimit; }
3838

39-
int NonBlockingRootCommunicator::numPushesToFlush() { return 1; }
39+
int NonCollectiveRootCommunicator::numPushesToFlush() { return 1; }
4040

41-
void NonBlockingRootCommunicator::push(const char* packedMessagesToBeSent,
41+
void NonCollectiveRootCommunicator::push(const char* packedMessagesToBeSent,
4242
std::vector<const char*>& receivedPackedMessages)
4343
{
4444
constexpr int mpiTag = 32767;
@@ -78,7 +78,7 @@ void NonBlockingRootCommunicator::push(const char* packedMessagesToBeSent,
7878
}
7979
}
8080

81-
bool NonBlockingRootCommunicator::isOutputNode()
81+
bool NonCollectiveRootCommunicator::isOutputNode()
8282
{
8383
if(m_mpiCommRank == 0)
8484
{

src/axom/lumberjack/NonBlockingRootCommunicator.hpp src/axom/lumberjack/NonCollectiveRootCommunicator.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
/*!
77
*******************************************************************************
8-
* \file NonBlockingRootCommunicator.hpp
8+
* \file NonCollectiveRootCommunicator.hpp
99
*
1010
* \brief This file contains the class definition of the
11-
* NonBlockingRootCommunicator.
11+
* NonCollectiveRootCommunicator.
1212
*******************************************************************************
1313
*/
1414

15-
#ifndef NONBLOCKINGROOTCOMMUNICATOR_HPP
16-
#define NONBLOCKINGROOTCOMMUNICATOR_HPP
15+
#ifndef NONCOLLECTIVEROOTCOMMUNICATOR_HPP
16+
#define NONCOLLECTIVEROOTCOMMUNICATOR_HPP
1717

1818
#include "axom/lumberjack/Lumberjack.hpp"
1919
#include "axom/lumberjack/Communicator.hpp"
@@ -24,13 +24,13 @@ namespace lumberjack
2424
{
2525
/*!
2626
*******************************************************************************
27-
* \class NonBlockingRootCommunicator
27+
* \class NonCollectiveRootCommunicator
2828
*
2929
* \brief Based off of RootCommunicator. This communicator pushes
3030
messages from any rank to root non-collectively, if any messages are sent.
3131
*******************************************************************************
3232
*/
33-
class NonBlockingRootCommunicator : public axom::lumberjack::Communicator
33+
class NonCollectiveRootCommunicator : public axom::lumberjack::Communicator
3434
{
3535
public:
3636
/*!

0 commit comments

Comments
 (0)