diff --git a/src/axom/lumberjack/MPIUtility.cpp b/src/axom/lumberjack/MPIUtility.cpp index 6f7063b205..161adaa032 100644 --- a/src/axom/lumberjack/MPIUtility.cpp +++ b/src/axom/lumberjack/MPIUtility.cpp @@ -14,7 +14,6 @@ */ #include "axom/lumberjack/MPIUtility.hpp" - #include namespace axom diff --git a/src/axom/lumberjack/NonCollectiveRootCommunicator.cpp b/src/axom/lumberjack/NonCollectiveRootCommunicator.cpp index 37f374e495..f74d9cadef 100644 --- a/src/axom/lumberjack/NonCollectiveRootCommunicator.cpp +++ b/src/axom/lumberjack/NonCollectiveRootCommunicator.cpp @@ -96,4 +96,4 @@ bool NonCollectiveRootCommunicator::isOutputNode() int NonCollectiveRootCommunicator::mpiTag() const { return m_mpiTag; } } // end namespace lumberjack -} // end namespace axom \ No newline at end of file +} // end namespace axom diff --git a/src/axom/lumberjack/tests/lumberjack_NonCollectiveRootCommunicator.hpp b/src/axom/lumberjack/tests/lumberjack_NonCollectiveRootCommunicator.hpp index 52f4813862..8a08672f8c 100644 --- a/src/axom/lumberjack/tests/lumberjack_NonCollectiveRootCommunicator.hpp +++ b/src/axom/lumberjack/tests/lumberjack_NonCollectiveRootCommunicator.hpp @@ -23,8 +23,16 @@ TEST(lumberjack_NonCollectiveRootCommunicator, noncollective_communication) std::vector receivedPackedMessages; - // send message only from even ranks - if((c.rank() % 2) == 0) + // send message only from even ranks that are non-zero + if((c.rank() % 2) == 0 && c.rank() != 0) + { + c.push(message.c_str(), receivedPackedMessages); + } + + MPI_Barrier(MPI_COMM_WORLD); + + // receive messages from rank 0 after barrier + if(c.rank() == 0) { c.push(message.c_str(), receivedPackedMessages); } @@ -51,7 +59,7 @@ TEST(lumberjack_NonCollectiveRootCommunicator, noncollective_communication) } if(!found) { - std::cout << "Error: Message not received:" << currMessage << std::endl; + std::cout << "Error: Message not received: " << currMessage << std::endl; } EXPECT_EQ(found, true); } @@ -95,4 +103,4 @@ TEST(lumberjack_NonCollectiveRootCommunicator, multiple_communicators) c2.finalize(); MPI_Barrier(MPI_COMM_WORLD); -} \ No newline at end of file +}