diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp index 5bc4255bddf187676c2c118d34f8f75fe6dc2eb9..64561db4dee74673c525d88bb15b1333565af829 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.cpp @@ -24,7 +24,7 @@ void IndexRearrangementForStreams::initCommunicationArraysForCommAfterFinetoCoar initSendIndicesForCommAfterFToCX(level, indexOfProcessNeighbor, direction); std::cout << "mpi send and receive "; - std::vector<uint> recvIndicesForCommAfterFtoCPositions = receive_sendForCommAfterFtoCX( + std::vector<uint> recvIndicesForCommAfterFtoCPositions = exchangeIndicesForCommAfterFtoCX( level, indexOfProcessNeighbor, sendIndicesForCommAfterFtoCPositions); std::cout << "reorder receive indices "; @@ -44,7 +44,7 @@ void IndexRearrangementForStreams::initCommunicationArraysForCommAfterFinetoCoar initSendIndicesForCommAfterFToCY(level, indexOfProcessNeighbor, direction); std::cout << "mpi send and receive "; - std::vector<uint> recvIndicesForCommAfterFtoCPositions = receive_sendForCommAfterFtoCY( + std::vector<uint> recvIndicesForCommAfterFtoCPositions = exchangeIndicesForCommAfterFtoCY( level, indexOfProcessNeighbor, sendIndicesForCommAfterFtoCPositions); std::cout << "reorder receive indices "; @@ -64,7 +64,7 @@ void IndexRearrangementForStreams::initCommunicationArraysForCommAfterFinetoCoar initSendIndicesForCommAfterFToCZ(level, indexOfProcessNeighbor, direction); std::cout << "mpi send and receive "; - std::vector<uint> recvIndicesForCommAfterFtoCPositions = receive_sendForCommAfterFtoCZ( + std::vector<uint> recvIndicesForCommAfterFtoCPositions = exchangeIndicesForCommAfterFtoCZ( level, indexOfProcessNeighbor, sendIndicesForCommAfterFtoCPositions); std::cout << "reorder receive indices "; @@ -111,7 +111,7 @@ std::vector<uint> IndexRearrangementForStreams::initSendIndicesForCommAfterFToCZ return sendIndicesForCommAfterFtoCPositions; } -std::vector<uint> IndexRearrangementForStreams::receive_sendForCommAfterFtoCX( +std::vector<uint> IndexRearrangementForStreams::exchangeIndicesForCommAfterFtoCX( uint level, int indexOfProcessNeighbor, std::vector<uint> &sendIndicesForCommAfterFtoCPositions) const { // fill the receive vector with zeros as placeholders (0 is never a valid fluid node) @@ -131,7 +131,7 @@ std::vector<uint> IndexRearrangementForStreams::receive_sendForCommAfterFtoCX( return recvIndicesForCommAfterFtoCPositions; } -std::vector<uint> IndexRearrangementForStreams::receive_sendForCommAfterFtoCY( +std::vector<uint> IndexRearrangementForStreams::exchangeIndicesForCommAfterFtoCY( uint level, int indexOfProcessNeighbor, std::vector<uint> &sendIndicesForCommAfterFtoCPositions) const { // fill the receive vector with zeros as placeholders (0 is never a valid fluid node) @@ -151,7 +151,7 @@ std::vector<uint> IndexRearrangementForStreams::receive_sendForCommAfterFtoCY( return recvIndicesForCommAfterFtoCPositions; } -std::vector<uint> IndexRearrangementForStreams::receive_sendForCommAfterFtoCZ( +std::vector<uint> IndexRearrangementForStreams::exchangeIndicesForCommAfterFtoCZ( uint level, int indexOfProcessNeighbor, std::vector<uint> &sendIndicesForCommAfterFtoCPositions) const { // fill the receive vector with zeros as placeholders (0 is never a valid fluid node) diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h index 9a0f391ae3ef99cb8f31a35aaef81d2d0c6a8f54..c8abeaff932f72bbf074961e39127e3d8fa8d12c 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h @@ -52,11 +52,11 @@ protected: //! \brief send sendIndicesForCommAfterFtoCPositions to receiving process and receive //! recvIndicesForCommAfterFtoCPositions from neighboring process - std::vector<uint> receive_sendForCommAfterFtoCX(uint level, int indexOfProcessNeighbor, + std::vector<uint> exchangeIndicesForCommAfterFtoCX(uint level, int indexOfProcessNeighbor, std::vector<uint> &sendIndicesForCommAfterFtoCPositions) const; - std::vector<uint> receive_sendForCommAfterFtoCY(uint level, int indexOfProcessNeighbor, + std::vector<uint> exchangeIndicesForCommAfterFtoCY(uint level, int indexOfProcessNeighbor, std::vector<uint> &sendIndicesForCommAfterFtoCPositions) const; - std::vector<uint> receive_sendForCommAfterFtoCZ(uint level, int indexOfProcessNeighbor, + std::vector<uint> exchangeIndicesForCommAfterFtoCZ(uint level, int indexOfProcessNeighbor, std::vector<uint> &sendIndicesForCommAfterFtoCPositions) const; //! \brief Initializes the send indices for the communication after the interpolation from fine to coarse @@ -131,9 +131,9 @@ private: // used for tests friend class IndexRearrangementForStreamsTest_reorderSendIndices; - friend class IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX; - friend class IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY; - friend class IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ; + friend class IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCX; + friend class IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCY; + friend class IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCZ; }; #endif diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp index 236523b90ab97842fc7b0cdd9e53396af493e1d6..112133e330d2817f184c9c13687f322c306a6d78 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreamsTest.cpp @@ -161,7 +161,7 @@ TEST_F(IndexRearrangementForStreamsTest_reorderSendIndices, reorderSendIndicesFo } ////////////////////////////////////////////////////////////////////////// -// Test receive_sendForCommAfterFtoC +// Test exchangeIndicesForCommAfterFtoC ////////////////////////////////////////////////////////////////////////// class CommunicationRoutineDouble : public vf::gpu::CommunicationRoutine @@ -188,7 +188,7 @@ private: std::vector<uint> receivedIndices; }; -class IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX : public testing::Test +class IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCX : public testing::Test { public: @@ -200,7 +200,7 @@ public: protected: std::vector<uint> act() { - return sut->receive_sendForCommAfterFtoCX(level, indexOfProcessNeighbor, + return sut->exchangeIndicesForCommAfterFtoCX(level, indexOfProcessNeighbor, sendIndicesForCommAfterFtoCPositions); } @@ -233,7 +233,7 @@ private: }; }; -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, emptyRecvInX) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCX, emptyRecvInX) { CommunicationRoutineDouble communicator; communicator.setReceivedIndices(std::vector<uint>()); @@ -243,7 +243,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, emptyRecv EXPECT_THAT(recvIndicesForCommAfterFtoCPositions.size(), testing::Eq(0)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, zeroRecvIndexX) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCX, zeroRecvIndexX) { CommunicationRoutineDouble communicator; communicator.setReceivedIndices({ 0 }); @@ -253,7 +253,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, zeroRecvI EXPECT_THAT(recvIndicesForCommAfterFtoCPositions.size(), testing::Eq(0)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, oneRecvIndexX) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCX, oneRecvIndexX) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10 }; @@ -267,7 +267,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, oneRecvIn EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, threeRecvIndicesX) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCX, threeRecvIndicesX) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10, 20, 30 }; @@ -281,7 +281,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, threeRecv EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, sixRecvIndicesX) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCX, sixRecvIndicesX) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10, 20, 30, 40, 50, 60 }; @@ -295,7 +295,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCX, sixRecvIn EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -class IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY : public testing::Test +class IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCY : public testing::Test { public: @@ -307,7 +307,7 @@ public: protected: std::vector<uint> act() { - return sut->receive_sendForCommAfterFtoCY(level, indexOfProcessNeighbor, + return sut->exchangeIndicesForCommAfterFtoCY(level, indexOfProcessNeighbor, sendIndicesForCommAfterFtoCPositions); } @@ -340,7 +340,7 @@ private: }; }; -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, emptyRecvInY) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCY, emptyRecvInY) { CommunicationRoutineDouble communicator; communicator.setReceivedIndices(std::vector<uint>()); @@ -350,7 +350,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, emptyRecv EXPECT_THAT(recvIndicesForCommAfterFtoCPositions.size(), testing::Eq(0)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, zeroRecvIndexY) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCY, zeroRecvIndexY) { CommunicationRoutineDouble communicator; communicator.setReceivedIndices({ 0 }); @@ -360,7 +360,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, zeroRecvI EXPECT_THAT(recvIndicesForCommAfterFtoCPositions.size(), testing::Eq(0)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, oneRecvIndexY) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCY, oneRecvIndexY) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10 }; @@ -374,7 +374,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, oneRecvIn EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, threeRecvIndicesY) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCY, threeRecvIndicesY) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10, 20, 30 }; @@ -388,7 +388,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, threeRecv EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, sixRecvIndicesY) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCY, sixRecvIndicesY) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10, 20, 30, 40, 50, 60 }; @@ -402,7 +402,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCY, sixRecvIn EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -class IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ : public testing::Test +class IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCZ : public testing::Test { public: @@ -414,7 +414,7 @@ public: protected: std::vector<uint> act() { - return sut->receive_sendForCommAfterFtoCZ(level, indexOfProcessNeighbor, + return sut->exchangeIndicesForCommAfterFtoCZ(level, indexOfProcessNeighbor, sendIndicesForCommAfterFtoCPositions); } @@ -447,7 +447,7 @@ private: }; }; -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, emptyRecvInZ) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCZ, emptyRecvInZ) { CommunicationRoutineDouble communicator; communicator.setReceivedIndices(std::vector<uint>()); @@ -457,7 +457,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, emptyRecv EXPECT_THAT(recvIndicesForCommAfterFtoCPositions.size(), testing::Eq(0)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, zeroRecvIndexZ) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCZ, zeroRecvIndexZ) { CommunicationRoutineDouble communicator; communicator.setReceivedIndices({ 0 }); @@ -467,7 +467,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, zeroRecvI EXPECT_THAT(recvIndicesForCommAfterFtoCPositions.size(), testing::Eq(0)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, oneRecvIndexZ) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCZ, oneRecvIndexZ) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10 }; @@ -481,7 +481,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, oneRecvIn EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, threeRecvIndicesZ) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCZ, threeRecvIndicesZ) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10, 20, 30 }; @@ -495,7 +495,7 @@ TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, threeRecv EXPECT_THAT(recvIndicesForCommAfterFtoCPositions, testing::Eq(expected)); } -TEST_F(IndexRearrangementForStreamsTest_receive_sendForCommAfterFtoCZ, sixRecvIndicesZ) +TEST_F(IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoCZ, sixRecvIndicesZ) { CommunicationRoutineDouble communicator; std::vector<uint> expected = { 10, 20, 30, 40, 50, 60 };