Skip to content
Snippets Groups Projects
Commit 57efee95 authored by Anna Wellmann's avatar Anna Wellmann
Browse files

Refactor and reformat index rearrangement for streams

parent ab2e1bc8
No related branches found
No related tags found
1 merge request!104Add Communication Hiding to GPU version
......@@ -339,7 +339,7 @@ void GridGenerator::initalValuesDomainDecompostion()
builder->getReceiveIndices(para->getParH(level)->recvProcessNeighborX[j].index, direction,
level);
if (level != builder->getNumberOfGridLevels() - 1 && para->useReducedCommunicationAfterFtoC)
indexRearrangement->initCommunicationArraysForCommAfterFinetoCoarseX(level, j, direction);
indexRearrangement->initCommunicationArraysForCommAfterFinetoCoarseX(level, j, direction);
////////////////////////////////////////////////////////////////////////////////////////
cudaMemoryManager->cudaCopyProcessNeighborXIndex(level, j);
////////////////////////////////////////////////////////////////////////////////////////
......@@ -408,7 +408,7 @@ void GridGenerator::initalValuesDomainDecompostion()
builder->getReceiveIndices(para->getParH(level)->recvProcessNeighborY[j].index, direction,
level);
if (level != builder->getNumberOfGridLevels() - 1 && para->useReducedCommunicationAfterFtoC)
indexRearrangement->initCommunicationArraysForCommAfterFinetoCoarseY(level, j, direction);
indexRearrangement->initCommunicationArraysForCommAfterFinetoCoarseY(level, j, direction);
////////////////////////////////////////////////////////////////////////////////////////
cudaMemoryManager->cudaCopyProcessNeighborYIndex(level, j);
////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -40,18 +40,18 @@ public:
private:
// communication after coarse to fine
void copyProcessNeighborToCommAfterFtoCX(const uint &level, int j);
void copyProcessNeighborToCommAfterFtoCY(const uint &level, int j);
void copyProcessNeighborToCommAfterFtoCZ(const uint &level, int j);
void copyProcessNeighborToCommAfterFtoCX(const uint &level, int indexOfProcessNeighbor);
void copyProcessNeighborToCommAfterFtoCY(const uint &level, int indexOfProcessNeighbor);
void copyProcessNeighborToCommAfterFtoCZ(const uint &level, int indexOfProcessNeighbor);
void reorderSendIndicesForCommAfterFtoCX(int direction, int level, int j,
void reorderSendIndicesForCommAfterFtoCX(int direction, int level, int indexOfProcessNeighbor,
std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
void reorderSendIndicesForCommAfterFtoCY(int direction, int level, int j,
void reorderSendIndicesForCommAfterFtoCY(int direction, int level, int indexOfProcessNeighbor,
std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
void reorderSendIndicesForCommAfterFtoCZ(int direction, int level, int j,
void reorderSendIndicesForCommAfterFtoCZ(int direction, int level, int indexOfProcessNeighbor,
std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
void reorderSendIndicesForCommAfterFtoC(int *sendIndices, int &numberOfSendNeighborsAfterFtoC, int direction,
int level, int j, std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
int level, std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
bool isSparseIndexInICellFCC(uint sizeOfICellFCC, int sparseIndexSend, int level);
void aggregateNodesInICellCFC(int level, std::vector<uint> &nodesCFC);
......@@ -65,20 +65,20 @@ private:
std::vector<int> &sendOrReceiveIndicesAfterFtoC,
std::vector<int> &sendOrIndicesOther);
void reorderRecvIndicesForCommAfterFtoCX(int direction, int level, int j,
void reorderRecvIndicesForCommAfterFtoCX(int direction, int level, int indexOfProcessNeighbor,
std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
void reorderRecvIndicesForCommAfterFtoCY(int direction, int level, int j,
void reorderRecvIndicesForCommAfterFtoCY(int direction, int level, int indexOfProcessNeighbor,
std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
void reorderRecvIndicesForCommAfterFtoCZ(int direction, int level, int j,
void reorderRecvIndicesForCommAfterFtoCZ(int direction, int level, int indexOfProcessNeighbor,
std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
void reorderRecvIndicesForCommAfterFtoC(int *recvIndices, int &numberOfRecvNeighborsAfterFtoC, int direction,
int level, int j, std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
int level, std::vector<uint> &sendIndicesForCommAfterFtoCPositions);
// split interpolation cells
void getGridInterfaceIndicesBorderBulkCF(int level);
void getGridInterfaceIndicesBorderBulkFC(int level);
friend class IndexRearrangementForStreamsTest;
};
#endif
......@@ -2674,7 +2674,7 @@ bool Parameter::findIndexInSendNodesYZ(int level, int index, int &indexOfProcess
return false;
}
void Parameter::initNumberOfProcessNeighborsAfterFtoCX(int level)
void Parameter::initProcessNeighborsAfterFtoCX(int level)
{
this->getParH(level)->sendProcessNeighborsAfterFtoCX.resize(
this->getParH(level)->sendProcessNeighborX.size());
......@@ -2686,7 +2686,7 @@ void Parameter::initNumberOfProcessNeighborsAfterFtoCX(int level)
this->getParH(level)->recvProcessNeighborsAfterFtoCX.size());
}
void Parameter::initNumberOfProcessNeighborsAfterFtoCY(int level)
void Parameter::initProcessNeighborsAfterFtoCY(int level)
{
this->getParH(level)->sendProcessNeighborsAfterFtoCY.resize(
this->getParH(level)->sendProcessNeighborY.size());
......@@ -2698,7 +2698,7 @@ void Parameter::initNumberOfProcessNeighborsAfterFtoCY(int level)
this->getParH(level)->recvProcessNeighborsAfterFtoCY.size());
}
void Parameter::initNumberOfProcessNeighborsAfterFtoCZ(int level)
void Parameter::initProcessNeighborsAfterFtoCZ(int level)
{
this->getParH(level)->sendProcessNeighborsAfterFtoCZ.resize(
this->getParH(level)->sendProcessNeighborZ.size());
......
......@@ -900,9 +900,9 @@ public:
std::unique_ptr<CudaStreamManager> &getStreamManager();
bool getKernelNeedsFluidNodeIndicesToRun();
void initNumberOfProcessNeighborsAfterFtoCX(int level);
void initNumberOfProcessNeighborsAfterFtoCY(int level);
void initNumberOfProcessNeighborsAfterFtoCZ(int level);
void initProcessNeighborsAfterFtoCX(int level);
void initProcessNeighborsAfterFtoCY(int level);
void initProcessNeighborsAfterFtoCZ(int level);
void findEdgeNodesCommMultiGPU();
bool useReducedCommunicationAfterFtoC{ true };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment