diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23826bce213a8c1156522500058c1debdfb41c68..cef13bb5a4c06418d1f79890dd428ff7a1c0bf47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -244,6 +244,8 @@ gpu_numerical_tests: - linux before_script: + - mkdir /testdata && cd /testdata + - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.rz.tu-bs.de/iRMB/VirtualFluids_dev.git - export CCACHE_BASEDIR=$CI_PROJECT_DIR - export CCACHE_DIR=$CI_PROJECT_DIR/cache - ccache -s @@ -253,7 +255,7 @@ gpu_numerical_tests: - cmake .. -DBUILD_VF_CPU=ON -DBUILD_VF_GPU=ON - -DVF.BUILD_NUMERIC_TESTS=ON + -BUILD_NUMERIC_TESTS=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fd7dfff17385b7079c0d285b4f326677f65b736..1830f48173209915b23fe1abeeec8e915dcaac00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,13 @@ set (VF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) option(BUILD_VF_CPU "Build VirtualFluids cpu variant" OFF) option(BUILD_VF_GPU "Build VirtualFluids gpu variant" OFF) +# vf gpu +option(BUILD_VF_GPU "Build VirtualFluids GPU" ON ) +option(BUILD_VF_GKS "Build VirtualFluids GKS" OFF ) +option(BUILD_VF_TRAFFIC "Build VirtualFluids Traffic" OFF) +option(BUILD_JSONCPP "Builds json cpp " OFF) +option(BUILD_NUMERIC_TESTS "Build numeric tests" OFF) + option(BUILD_VF_UNIT_TESTS "Build VirtualFluids unit tests" OFF) option(BUILD_VF_CLANG_TIDY "Add the clang tidy checks to the targets" OFF) option(BUILD_VF_INCLUDE_WHAT_YOU_USE "Add IWYU to the targets" OFF) @@ -99,5 +106,7 @@ endif() # 3rd Party Libraries ################################################################################# if(BUILD_VF_UNIT_TESTS) - add_subdirectory(${VF_THIRD_DIR}/googletest) + if(NOT BUILD_NUMERIC_TESTS) # in this case googletest is already included. + add_subdirectory(${VF_THIRD_DIR}/googletest) + endif() endif() diff --git a/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp b/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp index 5ad743fa1258e865908bc47669fee05d7fe22327..aa2768f631b6159db4a31f09ec8bdfe48f307112 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/ConfigFileReaderNT.cpp @@ -23,9 +23,9 @@ ConfigFileReader::ConfigFileReader(const std::string aFilePath) : myFilePath(aFi // If PATH_NUMERICAL_TESTS is not defined, the grid definitions for the tests needs to be placed in the project root // directories. #ifdef PATH_NUMERICAL_TESTS - pathNumericalTests = TOSTRING(PATH_NUMERICAL_TESTS); + pathNumericalTests = TOSTRING(PATH_NUMERICAL_TESTS) + std::string("/"); #else - pathNumericalTests = "./"; + pathNumericalTests = TOSTRING(SOURCE_ROOT) + std::string("/"); #endif std::cout << pathNumericalTests << "\n"; } @@ -413,21 +413,21 @@ int ConfigFileReader::calcNumberOfSimulations(std::shared_ptr<input::Input> inpu int counter = 0; int tgvCounterU0 = calcNumberOfSimulationGroup(input, "TaylorGreenVortexUx"); - tgvCounterU0 *= StringUtil::toDoubleVector(input->getValue("ux_TGV_Ux")).size(); + tgvCounterU0 *= int(StringUtil::toDoubleVector(input->getValue("ux_TGV_Ux")).size()); counter += tgvCounterU0; int tgvCounterV0 = calcNumberOfSimulationGroup(input, "TaylorGreenVortexUz"); ; - tgvCounterV0 *= StringUtil::toDoubleVector(input->getValue("uz_TGV_Uz")).size(); + tgvCounterV0 *= int(StringUtil::toDoubleVector(input->getValue("uz_TGV_Uz")).size()); counter += tgvCounterV0; int swCounter = calcNumberOfSimulationGroup(input, "ShearWave"); ; - swCounter *= StringUtil::toDoubleVector(input->getValue("u0_SW")).size(); + swCounter *= int(StringUtil::toDoubleVector(input->getValue("u0_SW")).size()); counter += swCounter; - counter *= StringUtil::toDoubleVector(input->getValue("Viscosity")).size(); - counter *= configData->kernelsToTest.size(); + counter *= int(StringUtil::toDoubleVector(input->getValue("Viscosity")).size()); + counter *= int(configData->kernelsToTest.size()); return counter; } diff --git a/apps/gpu/tests/NumericalTests/configK15_nu10tm2.txt b/apps/gpu/tests/NumericalTests/configK15_nu10tm2.txt index c1592b7e04373da66d053d86dd2d054516a94f29..c060683835cfde234fd101b5940e7c338daa228a 100644 --- a/apps/gpu/tests/NumericalTests/configK15_nu10tm2.txt +++ b/apps/gpu/tests/NumericalTests/configK15_nu10tm2.txt @@ -1,7 +1,7 @@ ################################################## # GPU Mapping # ################################################## -Devices="1" +Devices="0" ################################################## # Basic Simulation Parameter # diff --git a/gpu.cmake b/gpu.cmake index d1d5415081aa131868c0bc2ee047e8a140eb9a78..bc2fab3fdc13217732a0b9a812664ddab3507877 100644 --- a/gpu.cmake +++ b/gpu.cmake @@ -7,14 +7,6 @@ #SET(CUDA_CUT_INCLUDE_DIR "/cluster/cuda/9.0/include;/cluster/cuda/9.0/samples/common/inc" CACHE PATH "CUDA_CUT_INCLUDE_DIR") #SET(CUDA_SAMPLE_INCLUDE_DIR "/cluster/cuda/9.0/samples/common/inc" CACHE PATH "CUDA_CUT_INCLUDE_DIR") -############################################################# -### OPTIONS ### -############################################################# -option(VF.BUILD_VF_GPU "Build VirtualFluids GPU" ON ) -option(VF.BUILD_VF_GKS "Build VirtualFluids GKS" OFF ) -option(VF.BUILD_VF_TRAFFIC "Build VirtualFluids Traffic" OFF) -option(VF.BUILD_JSONCPP "Builds json cpp " OFF) -option(VF.BUILD_NUMERIC_TESTS "Build numeric tests" OFF) ############################################################# @@ -135,6 +127,12 @@ ENDIF() ############################################################# if(VF.BUILD_NUMERIC_TESTS) + + # PATH_NUMERICAL_TESTS can be passed to cmake e.g. cmake .. -DPATH_NUMERICAL_TESTS=/data/ + if(PATH_NUMERICAL_TESTS) + LIST(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") + endif() + add_subdirectory(3rdParty/fftw/fftw-3.3.7) add_subdirectory(3rdParty/googletest) add_subdirectory(apps/gpu/tests/NumericalTests)