Skip to content

Commit

Permalink
Revert "Merge pull request CompFUSE#209 from PDoakORNL/prevent_multiG…
Browse files Browse the repository at this point in the history
…PU_tests"

This reverts commit f3ac453, reversing
changes made to 0460fba.
  • Loading branch information
gbalduzz committed Aug 3, 2020
1 parent 740973d commit bdc474c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 46 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.")
Expand Down
19 changes: 3 additions & 16 deletions cmake/dca_testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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} "$<TARGET_FILE:${name}>")
${MPIEXEC_PREFLAGS})
target_link_libraries(${name} ${MPI_C_LIBRARIES})
else()
if (TEST_RUNNER)
Expand Down
23 changes: 0 additions & 23 deletions test/cvdlauncher.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit bdc474c

Please sign in to comment.