From bdc474c40e02075474450d90334d1b7801ac93ec Mon Sep 17 00:00:00 2001 From: gbalduzz Date: Mon, 3 Aug 2020 12:19:17 +0200 Subject: [PATCH] Revert "Merge pull request #209 from PDoakORNL/prevent_multiGPU_tests" This reverts commit f3ac453e7c29b67f700ef7b7bbb468e109d9af48, reversing changes made to 0460fba9b80811781897e3311e582556cd754eff. --- CMakeLists.txt | 6 ----- cmake/dca_testing.cmake | 19 +++------------ test/cvdlauncher.sh | 23 ------------------- .../accumulation/tp/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 46 deletions(-) delete mode 100755 test/cvdlauncher.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 60faffad6..0ceb497a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,11 +147,7 @@ set(DCA_LIBS cuda_utils ) -set(SYSTEM_GPU_COUNT 0) - if (DCA_HAVE_CUDA) - EXECUTE_PROCESS(COMMAND bash -c "nvidia-smi -L | awk 'BEGIN { num_gpu=0;} /GPU/ { num_gpu++;} END { printf(\"%d\", num_gpu) }'" - OUTPUT_VARIABLE SYSTEM_GPU_COUNT) list(APPEND DCA_LIBS blas_kernels dnfft_kernels @@ -171,8 +167,6 @@ option(DCA_WITH_TESTS_EXTENSIVE "Build DCA++'s extensive tests." OFF) option(DCA_WITH_TESTS_PERFORMANCE "Build DCA++'s performance tests. (Only in Release mode.)" OFF) option(DCA_WITH_TESTS_STOCHASTIC "Build DCA++'s stochastic tests." OFF) -set(DCA_TEST_GPU_COUNT "${SYSTEM_GPU_COUNT}" CACHE INTEGER "Number of GPUs available on one node for one test.") - set(TEST_RUNNER "" CACHE STRING "Command for executing (MPI) programs.") set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "Flag used by TEST_RUNNER to specify the number of processes.") set(MPIEXEC_PREFLAGS "" CACHE STRING "Flags to pass to TEST_RUNNER directly before the executable to run.") diff --git a/cmake/dca_testing.cmake b/cmake/dca_testing.cmake index 225d24602..3e1ea64b1 100644 --- a/cmake/dca_testing.cmake +++ b/cmake/dca_testing.cmake @@ -24,7 +24,7 @@ include(CMakeParseArguments) # MPI or CUDA may be given to indicate that the test requires these libraries. MPI_NUMPROC is the # number of MPI processes to use for a test with MPI, the default value is 1. function(dca_add_gtest name) - set(options FAST EXTENSIVE STOCHASTIC PERFORMANCE GTEST_MAIN MPI CUDA CUDA_CVD) + set(options FAST EXTENSIVE STOCHASTIC PERFORMANCE GTEST_MAIN MPI CUDA) set(oneValueArgs MPI_NUMPROC) set(multiValueArgs INCLUDE_DIRS SOURCES LIBS) cmake_parse_arguments(DCA_ADD_GTEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -82,14 +82,6 @@ function(dca_add_gtest name) return() endif() - if (DCA_ADD_GTEST_CUDA_CVD AND NOT DCA_HAVE_CUDA ) - return() - endif() - - if (DCA_ADD_GTEST_CUDA_CVD AND (DCA_TEST_GPU_COUNT LESS 3) ) - return() - endif() - add_executable(${name} ${name}.cpp ${DCA_ADD_GTEST_SOURCES}) # Create a macro with the project source dir. We use this as the root path for reading files in @@ -104,7 +96,7 @@ function(dca_add_gtest name) target_link_libraries(${name} gtest ${DCA_ADD_GTEST_LIBS}) endif() - if (DCA_ADD_GTEST_CUDA OR DCA_ADD_GTEST_CUDA_CVD) + if (DCA_ADD_GTEST_CUDA) target_include_directories(${name} PRIVATE ${CUDA_TOOLKIT_INCLUDE}) target_link_libraries(${name} ${DCA_CUDA_LIBS}) target_compile_definitions(${name} PRIVATE DCA_HAVE_CUDA) @@ -113,11 +105,6 @@ function(dca_add_gtest name) target_compile_definitions(${name} PRIVATE DCA_HAVE_MAGMA) endif() cuda_add_cublas_to_target(${name}) - # a less hacky way to do this would be good but this is used to test - # development only feature distributed G4 at the moment. - if (DCA_ADD_GTEST_CUDA_CVD) - set(CVD_LAUNCHER "${PROJECT_SOURCE_DIR}/test/cvdlauncher.sh") - endif() endif() target_include_directories(${name} PRIVATE @@ -131,7 +118,7 @@ function(dca_add_gtest name) add_test(NAME ${name} COMMAND ${TEST_RUNNER} ${MPIEXEC_NUMPROC_FLAG} ${DCA_ADD_GTEST_MPI_NUMPROC} - ${MPIEXEC_PREFLAGS} ${SMPIARGS_FLAG_MPI_CVD} ${CVD_LAUNCHER} "$") + ${MPIEXEC_PREFLAGS}) target_link_libraries(${name} ${MPI_C_LIBRARIES}) else() if (TEST_RUNNER) diff --git a/test/cvdlauncher.sh b/test/cvdlauncher.sh deleted file mode 100755 index e1316772f..000000000 --- a/test/cvdlauncher.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# simple wrapper setting CUDA_VISIBLE_DEVICES for jobs - -let ngpus=6; -export cmd=$1 -if [ ! -z $CUDA_VISIBLE_DEVICES ] -then - let gpu=$CUDA_VISIBLE_DEVICES - let mydevice=$gpu - let gpu_start=$gpu+1 - for ((g=$gpu_start; g<$ngpus; g++)) - do - mydevice=${mydevice},$g - done - - for ((g=0; g<$gpu; g++)) - do - mydevice=${mydevice},$g - done - export CUDA_VISIBLE_DEVICES=$mydevice -fi -shift -$cmd $* diff --git a/test/integration/cluster_solver/shared_tools/accumulation/tp/CMakeLists.txt b/test/integration/cluster_solver/shared_tools/accumulation/tp/CMakeLists.txt index 9f8824837..3f36117b2 100644 --- a/test/integration/cluster_solver/shared_tools/accumulation/tp/CMakeLists.txt +++ b/test/integration/cluster_solver/shared_tools/accumulation/tp/CMakeLists.txt @@ -1,5 +1,5 @@ dca_add_gtest(ringG_tp_accumulator_gpu_test - CUDA_CVD + CUDA MPI MPI_NUMPROC 3 GTEST_MAIN INCLUDE_DIRS ${DCA_INCLUDE_DIRS};${PROJECT_SOURCE_DIR}