Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JiakunYan committed Nov 8, 2024
1 parent 0775cf7 commit 191742e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
14 changes: 10 additions & 4 deletions cmake_modules/AddLCI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function(add_lci_executable name)
endfunction()

function(add_lci_test name)
cmake_parse_arguments(ARG "" "" "COMMANDS;LABELS;SOURCES;DEPENDENCIES"
${ARGN})
cmake_parse_arguments(
ARG "" "" "COMMANDS;LABELS;SOURCES;DEPENDENCIES;ENVIRONMENT" ${ARGN})

add_lci_executable(${name} ${ARG_SOURCES})
target_include_directories(${name} PRIVATE ${CMAKE_SOURCE_DIR}/src/include)
Expand All @@ -47,11 +47,15 @@ function(add_lci_test name)
string(REPLACE " " ";" TEST_COMMAND ${TEST_COMMAND})
add_test(NAME ${test_name} COMMAND ${TEST_COMMAND})
set_property(TEST ${test_name} PROPERTY LABELS ${ARG_LABELS})
if(ENVIRONMENT)
set_tests_properties(${test_name} PROPERTIES ENVIRONMENT ${ENVIRONMENT})
endif()
endwhile()
endfunction()

function(add_lci_tests)
cmake_parse_arguments(ARG "" "" "COMMANDS;LABELS;TESTS;DEPENDENCIES" ${ARGN})
cmake_parse_arguments(
ARG "" "" "COMMANDS;LABELS;TESTS;DEPENDENCIES;ENVIRONMENT" ${ARGN})
foreach(name ${ARG_TESTS})
string(REGEX REPLACE "\\.[^.]*$" "" name_without_ext ${name})
add_lci_test(
Expand All @@ -63,6 +67,8 @@ function(add_lci_tests)
COMMANDS
${ARG_COMMANDS}
DEPENDENCIES
${ARG_DEPENDENCIES})
${ARG_DEPENDENCIES}
ENVIRONMENT
${ENVIRONMENT})
endforeach()
endfunction()
2 changes: 1 addition & 1 deletion lci/api/lci_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#cmakedefine01 LCI_IBV_ENABLE_TD_DEFAULT
#cmakedefine01 LCI_ENABLE_PRG_NET_ENDPOINT_DEFAULT
#define LCI_RDV_PROTOCOL_DEFAULT "@LCI_RDV_PROTOCOL_DEFAULT@"
#define LCI_MAX_SINGLE_MESSAGE_SIZE_DEFAULT "@LCI_MAX_SINGLE_MESSAGE_SIZE_DEFAULT@"
#define LCI_MAX_SINGLE_MESSAGE_SIZE_DEFAULT @LCI_MAX_SINGLE_MESSAGE_SIZE_DEFAULT@

#define LCI_CQ_MAX_POLL 16
#define LCI_SERVER_MAX_ENDPOINTS 8
Expand Down
5 changes: 5 additions & 0 deletions lci/runtime/rendezvous.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ static inline void LCII_handle_rtr(LCI_endpoint_t ep, LCII_packet_t* packet)
LCII_PCOUNTER_START(rtr_put_timer);
if (nrdmas > 1 || LCI_RDV_PROTOCOL == LCI_RDV_WRITE ||
rdv_type == LCII_RDV_IOVEC) {
if (lbuffer->length > LCI_MAX_SINGLE_MESSAGE_SIZE) {
LCI_DBG_Log(LCI_LOG_TRACE, "rdv",
"Splitting a large message of %lu bytes\n",
lbuffer->length);
}
for (size_t offset = 0; offset < lbuffer->length;
offset += LCI_MAX_SINGLE_MESSAGE_SIZE) {
char* address = (char*)lbuffer->address + offset;
Expand Down
12 changes: 10 additions & 2 deletions tests/lcit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ add_lci_tests(
"${SRUN_EXE} -n 2 ${SRUN_EXTRA_ARG} [TARGET] --op 1s --nthreads 4 --nsteps 10"
"${SRUN_EXE} -n 2 ${SRUN_EXTRA_ARG} [TARGET] --op 1m --nthreads 4 --nsteps 10"
"${SRUN_EXE} -n 2 ${SRUN_EXTRA_ARG} [TARGET] --op 1l --nthreads 4 --nsteps 10"
"export LCI_MAX_SINGLE_MESSAGE_SIZE=1000 ; ${SRUN_EXE} -n 2 ${SRUN_EXTRA_ARG} [TARGET] --op 2l --min-msg-size=1000 --max-msg-size=4001 --nsteps 1"
"export LCI_MAX_SINGLE_MESSAGE_SIZE=1000 ; ${SRUN_EXE} -n 2 ${SRUN_EXTRA_ARG} [TARGET] --op 1l --min-msg-size=1000 --max-msg-size=4001 --nsteps 1"
)

add_lci_tests(
Expand All @@ -45,3 +43,13 @@ add_lci_tests(
"${SRUN_EXE} -n 3 ${SRUN_EXTRA_ARG} [TARGET] --op 1m --nthreads 3 --send-window 1 --recv-window 100 --nsteps 10"
"${SRUN_EXE} -n 3 ${SRUN_EXTRA_ARG} [TARGET] --op 1l --nthreads 3 --send-window 1 --recv-window 100 --nsteps 10"
)

add_lci_tests(
TESTS
lcit_pt2pt.cpp
LABELS
lcit.bigmsg
COMMANDS
"${SRUN_EXE} -n 2 ${SRUN_EXTRA_ARG} env LCI_MAX_SINGLE_MESSAGE_SIZE=1002 [TARGET] --op 2l --min-msg-size=1001 --max-msg-size=4004 --nsteps 1"
"${SRUN_EXE} -n 2 ${SRUN_EXTRA_ARG} env LCI_MAX_SINGLE_MESSAGE_SIZE=1002 [TARGET] --op 1l --min-msg-size=1001 --max-msg-size=4004 --nsteps 1"
)

0 comments on commit 191742e

Please sign in to comment.