diff --git a/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp b/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp index 0c870d1cd76e019f045b0ff3aa5ac260799d41d5..324e0dbb4f37788f83c42614b7aeb0923e86a0f8 100644 --- a/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp +++ b/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp @@ -83,6 +83,10 @@ void updateGrid27(Parameter *para, vf::gpu::Communicator *comm, CudaMemoryManage para->getParD(level)->intFCBulk.ICellFCF, para->getParD(level)->intFCBulk.kFC, -1); + if (para->useReducedCommunicationAfterFtoC) { + prepareExchangeMultiGPU(para, level, -1); // TODO + exchangeMultiGPU(para, comm, cudaManager, level, -1); // TODO + } prepareExchangeMultiGPU(para, level, -1); exchangeMultiGPU(para, comm, cudaManager, level, -1); diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp index ed1db24c54a312b7884efa00a3445e75eaf50d9b..328954fb8852d37fb885aa2c8a5321dfc4083d00 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp @@ -336,7 +336,7 @@ void GridGenerator::initalValuesDomainDecompostion() builder->getSendIndices(para->getParH(level)->sendProcessNeighborX[j].index, direction, level); builder->getReceiveIndices(para->getParH(level)->recvProcessNeighborX[j].index, direction, level); - if (level != builder->getNumberOfGridLevels() - 1) + if (level != builder->getNumberOfGridLevels() - 1 && para->useReducedCommunicationAfterFtoC) initCommunicationArraysForCommAfterFinetoCoarseX(level, j, direction); //////////////////////////////////////////////////////////////////////////////////////// cudaMemoryManager->cudaCopyProcessNeighborXIndex(level, j); @@ -405,7 +405,7 @@ void GridGenerator::initalValuesDomainDecompostion() builder->getSendIndices(para->getParH(level)->sendProcessNeighborY[j].index, direction, level); builder->getReceiveIndices(para->getParH(level)->recvProcessNeighborY[j].index, direction, level); - if (level != builder->getNumberOfGridLevels() - 1) + if (level != builder->getNumberOfGridLevels() - 1 && para->useReducedCommunicationAfterFtoC) initCommunicationArraysForCommAfterFinetoCoarseY(level, j, direction); //////////////////////////////////////////////////////////////////////////////////////// cudaMemoryManager->cudaCopyProcessNeighborYIndex(level, j); @@ -474,7 +474,7 @@ void GridGenerator::initalValuesDomainDecompostion() builder->getSendIndices(para->getParH(level)->sendProcessNeighborZ[j].index, direction, level); builder->getReceiveIndices(para->getParH(level)->recvProcessNeighborZ[j].index, direction, level); - if (level != builder->getNumberOfGridLevels() - 1) + if (level != builder->getNumberOfGridLevels() - 1 && para->useReducedCommunicationAfterFtoC) initCommunicationArraysForCommAfterFinetoCoarseZ(level, j, direction); //////////////////////////////////////////////////////////////////////////////////////// cudaMemoryManager->cudaCopyProcessNeighborZIndex(level, j); diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h index 0592ba9455a3498fb74e613a4e4c46ef302e90ff..191e5493184e11de89c94a1593a467ab5061a7e0 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h @@ -866,7 +866,7 @@ private: std::function<void(real, real, real, real &, real &, real &, real &)> initialCondition; // cuda streams - bool useStreams { false }; + bool useStreams{ false }; std::unique_ptr<CudaStreamManager> cudaStreamManager; public: @@ -886,6 +886,8 @@ public: bool findIndexInSendNodesXZ(int level, int index); void findCornerNodesYZ(int level); bool findIndexInSendNodesYZ(int level, int index); + + bool useReducedCommunicationAfterFtoC{ true }; }; #endif