diff --git a/cmake_modules/AddLCI.cmake b/cmake_modules/AddLCI.cmake index e45e1293..f933c0d9 100644 --- a/cmake_modules/AddLCI.cmake +++ b/cmake_modules/AddLCI.cmake @@ -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) @@ -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( @@ -63,6 +67,8 @@ function(add_lci_tests) COMMANDS ${ARG_COMMANDS} DEPENDENCIES - ${ARG_DEPENDENCIES}) + ${ARG_DEPENDENCIES} + ENVIRONMENT + ${ENVIRONMENT}) endforeach() endfunction() diff --git a/lci/api/lci_config.h.in b/lci/api/lci_config.h.in index 661303fe..ad3c6c23 100644 --- a/lci/api/lci_config.h.in +++ b/lci/api/lci_config.h.in @@ -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 diff --git a/lci/runtime/rendezvous.h b/lci/runtime/rendezvous.h index bc9beac1..ecbceb9d 100644 --- a/lci/runtime/rendezvous.h +++ b/lci/runtime/rendezvous.h @@ -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; diff --git a/tests/lcit/CMakeLists.txt b/tests/lcit/CMakeLists.txt index 7b54dacb..7881dee1 100644 --- a/tests/lcit/CMakeLists.txt +++ b/tests/lcit/CMakeLists.txt @@ -45,3 +45,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" +)