From 5baed6ed47d97ec325c57f0b5e39d0e5b230783b Mon Sep 17 00:00:00 2001 From: Anna Wellmann <a.wellmann@tu-braunschweig.de> Date: Tue, 2 May 2023 16:35:50 +0200 Subject: [PATCH] Remove test as it does not really test Parameter --- .../Parameter/ParameterTest.cpp | 58 ------------------- 1 file changed, 58 deletions(-) diff --git a/src/gpu/VirtualFluids_GPU/Parameter/ParameterTest.cpp b/src/gpu/VirtualFluids_GPU/Parameter/ParameterTest.cpp index 6073a4d6d..bed52dc97 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/ParameterTest.cpp +++ b/src/gpu/VirtualFluids_GPU/Parameter/ParameterTest.cpp @@ -250,64 +250,6 @@ TEST(ParameterTest, whenCreatingParameterClassWithGridRefinement_afterCallingIni EXPECT_THAT(para->getParH(1), testing::Ne(nullptr)); } -class MockCommunicator : public vf::gpu::Communicator -{ -public: - void waitAll() override {}; - int getPID() const override - { - return 0; - }; - int getNumberOfProcess() const override - { - return 1; - }; - void exchngData(float *sbuf_t, float *rbuf_t, float *sbuf_b, float *rbuf_b, int count) override {}; - ////////////////////////////////////////////////////////////////////////// - void exchngDataGPU(real *sbuf, int count_s, real *rbuf, int count_r, int nb_rank) override {}; - void nbRecvDataGPU(real *rbuf, int count_r, int nb_rank) override {}; - void nbSendDataGPU(real *sbuf, int count_s, int nb_rank) override {}; - void waitallGPU() override {}; - void sendDataGPU(real *sbuf, int count_s, int nb_rank) override {}; - void waitGPU(int id) override {}; - void resetRequest() override {}; - ////////////////////////////////////////////////////////////////////////// - int mapCudaDevice(const int &rank, const int &size, const std::vector<unsigned int> &devices, const int &maxdev) override - { - return 0; - }; - double reduceSum(double quantityPerProcess) override - { - return 0; - }; - ////////////////////////////////////////////////////////////////////////// - void receive_send(uint *buffer_receive, int size_buffer_recv, int neighbor_rank_recv, uint *buffer_send, int size_buffer_send, int neighbor_rank_send) const override {}; - -}; - -TEST(ParameterTest, whenCreatingParameterClassWithGridRefinement_afterCallingSimulationConstructor_shouldNotThrow) -{ - spdlog::set_level(spdlog::level::warn); // avoids logger spam in output - - auto para = std::make_shared<Parameter>(); - para->setMaxLevel(2); - - SPtr<CudaMemoryManager> cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); - MockCommunicator communicator = MockCommunicator(); - auto gridFactory = GridFactory::make(); - auto gridBuilder = MultipleGridBuilder::makeShared(gridFactory); - SPtr<GridProvider> gridGenerator = - std::make_shared<MockGridGenerator>(gridBuilder, para, cudaMemoryManager, communicator); - BoundaryConditionFactory bcFactory = BoundaryConditionFactory(); - GridScalingFactory scalingFactory = GridScalingFactory(); - - EXPECT_THAT(para->getParH(1), testing::Eq(nullptr)); // Parameter initialization incomplete - // Simulation() calls para->initLBMSimulationParameter() --> that function completes the initialization of Parameter - Simulation sim(para, cudaMemoryManager, communicator, *gridGenerator, &bcFactory, &scalingFactory); - EXPECT_THAT(para->getParH(1), testing::Ne(nullptr)); - EXPECT_NO_THROW(cudaMemoryManager->cudaAllocLevelForcing(1)); // throws if para->getParH(1) is a null pointer -} - class ParameterTestCumulantK17 : public testing::Test { protected: -- GitLab