Skip to content

Commit

Permalink
Merge pull request #431 from ValeevGroup/430-ut-array_suitetiles_of_a…
Browse files Browse the repository at this point in the history
…rrays_non_unit_blocking-times-out-w-pthreads-and-2-ranks

[unit] set MAD_NUM_THREADS when running w >1 rank
  • Loading branch information
evaleev authored Oct 31, 2023
2 parents c131618 + edcb91b commit 58f15d1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ endif (TARGET range-v3::range-v3)
add_test(tiledarray/unit/build "${CMAKE_COMMAND}" --build ${PROJECT_BINARY_DIR} --target ${executable})
set_tests_properties(tiledarray/unit/build PROPERTIES FIXTURES_SETUP TA_UNIT_TESTS_EXEC)

# N.B. some CUDA unit tests require TA_CUDA_NUM_STREAMS=1 for now
set(TA_UNIT_TESTS_ENVIRONMENT "MAD_NUM_THREADS=2;TA_CUDA_NUM_STREAMS=1")

# Add a test(s)
if(ENABLE_MPI)
set (${executable}_np_1_args --run_test=!@distributed)
Expand All @@ -165,22 +168,19 @@ if(ENABLE_MPI)
$<TARGET_FILE:${executable}> --log_level=unit_scope ${${executable}_np_${p}_args}
${MPIEXEC_POSTFLAGS}
)
# N.B. some CUDA unit tests require TA_CUDA_NUM_STREAMS=1 for now
if (p GREATER 1)
set(TA_UNIT_TESTS_ENVIRONMENT "${TA_UNIT_TESTS_ENVIRONMENT};TA_UT_DISTRIBUTED=1")
endif()
set_tests_properties(tiledarray/unit/run-np-${p}
PROPERTIES FIXTURES_REQUIRED TA_UNIT_TESTS_EXEC
ENVIRONMENT "MAD_NUM_THREADS=2;TA_CUDA_NUM_STREAMS=1"
ENVIRONMENT "${TA_UNIT_TESTS_ENVIRONMENT}"
)

if (p GREATER 1)
set_tests_properties(tiledarray/unit/run-np-${p} PROPERTIES ENVIRONMENT TA_UT_DISTRIBUTED=1)
endif()
endforeach(p)
else()
add_test(NAME tiledarray/unit/run-np-1
COMMAND ${executable})
# N.B. some CUDA unit tests require TA_CUDA_NUM_STREAMS=1 for now
set_tests_properties(tiledarray/unit/run-np-1
PROPERTIES FIXTURES_REQUIRED TA_UNIT_TESTS_EXEC
ENVIRONMENT "MAD_NUM_THREADS=2;TA_CUDA_NUM_STREAMS=1"
ENVIRONMENT "${TA_UNIT_TESTS_ENVIRONMENT}"
)
endif()

0 comments on commit 58f15d1

Please sign in to comment.