From f3475afa96df0795a8f8954a74445de36c2f2028 Mon Sep 17 00:00:00 2001 From: Anna Wellmann <a.wellmann@tu-braunschweig.de> Date: Tue, 21 Sep 2021 16:35:42 +0200 Subject: [PATCH] Fix datatype warnings in pipeline --- .../grid/GridBuilder/GridBuilder.h | 8 +++---- .../grid/GridBuilder/LevelGridBuilder.cpp | 22 ++++++++++++------- .../grid/GridBuilder/LevelGridBuilder.h | 8 +++---- .../VirtualFluids_GPU/Parameter/Parameter.h | 12 +++++----- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h b/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h index 78a4fa174..7f4be24b9 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h +++ b/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h @@ -86,16 +86,16 @@ public: virtual uint getNumberOfReceiveIndices( int direction, uint level ) = 0; virtual void getSendIndices( int* sendIndices, int direction, int level ) = 0; virtual void getReceiveIndices( int* sendIndices, int direction, int level ) = 0; - virtual void reorderSendIndexForCommAfterFtoC(int *sendIndices, int &numberOfSendNeighborsAfterFtoC, + virtual void reorderSendIndexForCommAfterFtoC(int *sendIndices, uint &numberOfSendNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level) = 0; - virtual void reorderRecvIndexForCommAfterFtoC(int *recvIndices, int &numberOfRecvNeighborsAfterFtoC, + virtual void reorderRecvIndexForCommAfterFtoC(int *recvIndices, uint &numberOfRecvNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level) = 0; - virtual void getAndReorderSendIndices(int *sendIndices, int &numberOfSendNeighborsAfterFtoC, uint *iCellFCCBorder, + virtual void getAndReorderSendIndices(int *sendIndices, uint &numberOfSendNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level, bool sendIndicesNeedToBeReordered) = 0; - virtual void getAndReorderReceiveIndices(int *recvIndices, int &numberOfRecvNeighborsAfterFtoC, + virtual void getAndReorderReceiveIndices(int *recvIndices, uint &numberOfRecvNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level, bool receiveIndicesNeedToBeReordered) = 0; diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp index acc2f872b..2ccf96b4e 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp +++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp @@ -266,7 +266,7 @@ GRIDGENERATOR_EXPORT void LevelGridBuilder::getReceiveIndices(int * receiveIndic } } GRIDGENERATOR_EXPORT void LevelGridBuilder::getAndReorderSendIndices(int *sendIndices, - int &numberOfSendNeighborsAfterFtoC, + uint &numberOfSendNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level, bool sendIndicesNeedToBeReordered) @@ -277,7 +277,7 @@ GRIDGENERATOR_EXPORT void LevelGridBuilder::getAndReorderSendIndices(int *sendIn sizeOfICellFCCBorder, direction, level); } GRIDGENERATOR_EXPORT void LevelGridBuilder::getAndReorderReceiveIndices(int *recvIndices, - int &numberOfRecvNeighborsAfterFtoC, + uint &numberOfRecvNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level, bool receiveIndicesNeedToBeReordered) @@ -288,7 +288,7 @@ GRIDGENERATOR_EXPORT void LevelGridBuilder::getAndReorderReceiveIndices(int *rec sizeOfICellFCCBorder, direction, level); } -GRIDGENERATOR_EXPORT void LevelGridBuilder::reorderSendIndexForCommAfterFtoC(int *sendIndices, int &numberOfSendNeighborsAfterFtoC, +GRIDGENERATOR_EXPORT void LevelGridBuilder::reorderSendIndexForCommAfterFtoC(int *sendIndices, uint &numberOfSendNeighborsAfterFtoC, uint* iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level) { @@ -316,11 +316,14 @@ GRIDGENERATOR_EXPORT void LevelGridBuilder::reorderSendIndexForCommAfterFtoC(int // check if sparse index is in ICellFCC border isInICellFCCBorder = false; - for (uint j = 0; j < sizeOfICellFCCBorder; j++) - if (iCellFCCBorder[j] == sparseIndexSend) { + for (uint j = 0; j < sizeOfICellFCCBorder; j++) { + if (sparseIndexSend < 0) + continue; + if (iCellFCCBorder[j] == (uint) sparseIndexSend) { isInICellFCCBorder = true; break; } + } // add index to corresponding vector if (isInICellFCCBorder) @@ -344,7 +347,7 @@ GRIDGENERATOR_EXPORT void LevelGridBuilder::reorderSendIndexForCommAfterFtoC(int std::cout << "correct number of nodes?: " << numberOfNodesIsCorrect << std::endl; } -GRIDGENERATOR_EXPORT void LevelGridBuilder::reorderRecvIndexForCommAfterFtoC(int *recvIndices, int &numberOfRecvNeighborsAfterFtoC, +GRIDGENERATOR_EXPORT void LevelGridBuilder::reorderRecvIndexForCommAfterFtoC(int *recvIndices, uint &numberOfRecvNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level) { @@ -374,11 +377,14 @@ GRIDGENERATOR_EXPORT void LevelGridBuilder::reorderRecvIndexForCommAfterFtoC(int // check if sparse index is in ICellFCC border isInICellFCCBorder = false; - for (uint j = 0; j < sizeOfICellFCCBorder; j++) - if (iCellFCCBorder[j] == sparseIndexRecv) { + for (uint j = 0; j < sizeOfICellFCCBorder; j++) { + if (sparseIndexRecv < 0) + continue; + if (iCellFCCBorder[j] == (uint) sparseIndexRecv) { isInICellFCCBorder = true; break; } + } // add index to corresponding vector if (isInICellFCCBorder) diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h index 8c3fe9256..ba4b09986 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h +++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h @@ -149,17 +149,17 @@ public: GRIDGENERATOR_EXPORT uint getNumberOfReceiveIndices( int direction, uint level ) override; GRIDGENERATOR_EXPORT void getSendIndices( int* sendIndices, int direction, int level ) override; GRIDGENERATOR_EXPORT void getReceiveIndices( int* sendIndices, int direction, int level ) override; - GRIDGENERATOR_EXPORT void getAndReorderSendIndices(int *sendIndices, int &numberOfSendNeighborsAfterFtoC, + GRIDGENERATOR_EXPORT void getAndReorderSendIndices(int *sendIndices, uint &numberOfSendNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level, bool sendIndicesNeedToBeReordered) override; - GRIDGENERATOR_EXPORT void getAndReorderReceiveIndices(int *recvIndices, int &numberOfRecvNeighborsAfterFtoC, + GRIDGENERATOR_EXPORT void getAndReorderReceiveIndices(int *recvIndices, uint &numberOfRecvNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level, bool receiveIndicesNeedToBeReordered) override; - GRIDGENERATOR_EXPORT void reorderSendIndexForCommAfterFtoC(int *sendIndices, int &numberOfSendNeighborsAfterFtoC, + GRIDGENERATOR_EXPORT void reorderSendIndexForCommAfterFtoC(int *sendIndices, uint &numberOfSendNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level) override; - GRIDGENERATOR_EXPORT void reorderRecvIndexForCommAfterFtoC(int *recvIndices, int &numberOfRecvNeighborsAfterFtoC, + GRIDGENERATOR_EXPORT void reorderRecvIndexForCommAfterFtoC(int *recvIndices, uint &numberOfRecvNeighborsAfterFtoC, uint *iCellFCCBorder, uint sizeOfICellFCCBorder, int direction, int level) override; diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h index f0ff5e722..d5583df04 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h @@ -294,12 +294,12 @@ struct LBMSimulationParameter std::vector<ProcessNeighbor27> recvProcessNeighborY; std::vector<ProcessNeighbor27> recvProcessNeighborZ; - std::vector<int> numberOfSendProcessNeighborsAfterFtoCX; - std::vector<int> numberOfSendProcessNeighborsAfterFtoCY; - std::vector<int> numberOfSendProcessNeighborsAfterFtoCZ; - std::vector<int> numberOfRecvProcessNeighborsAfterFtoCX; - std::vector<int> numberOfRecvProcessNeighborsAfterFtoCY; - std::vector<int> numberOfRecvProcessNeighborsAfterFtoCZ; + std::vector<uint> numberOfSendProcessNeighborsAfterFtoCX; + std::vector<uint> numberOfSendProcessNeighborsAfterFtoCY; + std::vector<uint> numberOfSendProcessNeighborsAfterFtoCZ; + std::vector<uint> numberOfRecvProcessNeighborsAfterFtoCX; + std::vector<uint> numberOfRecvProcessNeighborsAfterFtoCY; + std::vector<uint> numberOfRecvProcessNeighborsAfterFtoCZ; /////////////////////////////////////////////////////// // 3D domain decomposition convection diffusion std::vector<ProcessNeighbor27> sendProcessNeighborADX; -- GitLab