Unverified Commit f3ac453e authored by Peter Doak's avatar Peter Doak Committed by GitHub
Browse files

Merge pull request #209 from PDoakORNL/prevent_multiGPU_tests

Don't run multi GPU test if enough GPU's aren't present
parents 0460fba9 79b4a635
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -147,7 +147,11 @@ 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
@@ -167,6 +171,8 @@ 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.")
+5 −1
Original line number Diff line number Diff line
@@ -86,6 +86,10 @@ function(dca_add_gtest name)
    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