From b75731eb89c374ebeb0346e32837d46c5e655e19 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 24 Mar 2024 13:50:32 +0000 Subject: [PATCH 01/49] Removed -scan from C++ Traditional API --- srcCpp/connextDDS/RTIDDSImpl.cxx | 23 +-- srcCpp/connextDDS/TSS/CustomQosSupport.cpp | 22 +-- srcCpp/connextDDS/pro/Infrastructure_pro.cxx | 8 - srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx | 3 +- srcCpp/perftest_cpp.cxx | 185 ++---------------- srcCpp/perftest_cpp.h | 4 - srcCppCommon/ParameterManager.cxx | 33 ---- 7 files changed, 16 insertions(+), 262 deletions(-) diff --git a/srcCpp/connextDDS/RTIDDSImpl.cxx b/srcCpp/connextDDS/RTIDDSImpl.cxx index 64ab0fbd..a3c23a13 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.cxx +++ b/srcCpp/connextDDS/RTIDDSImpl.cxx @@ -378,8 +378,7 @@ bool RTIDDSImpl::data_size_related_calculations() _PM->set("batchSize", -2); } } else if (((unsigned long)_PM->get("batchSize") - < _PM->get("dataLen") * 2) - && !_PM->is_set("scan")) { + < _PM->get("dataLen") * 2)) { /* * We don't want to use batching if the batch size is not large * enough to contain at least two samples (in this case we avoid the @@ -417,25 +416,6 @@ bool RTIDDSImpl::data_size_related_calculations() } } - // Manage the parameter: -scan - if (_PM->is_set("scan")) { - const std::vector scanList = - _PM->get_vector("scan"); - - // Check if scan is large data or small data - if (scanList[0] <= (unsigned long long) _maxSynchronousSize - && scanList[scanList.size() - 1] > (unsigned long long)_maxSynchronousSize) { - fprintf(stderr, "The sizes of -scan ["); - for (unsigned int i = 0; i < scanList.size(); i++) { - fprintf(stderr, "%llu ", scanList[i]); - } - fprintf(stderr, - "] should be either all smaller or all bigger than %lld.\n", - _maxSynchronousSize); - return false; - } - } - return true; } @@ -711,7 +691,6 @@ class RTIPublisherBase : public IMessagingWriter bool is_sentinel_size(int size) { return size == perftest_cpp::INITIALIZE_SIZE || size == perftest_cpp::FINISHED_SIZE - || size == perftest_cpp::LENGTH_CHANGED_SIZE || size == 0; } #endif diff --git a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp index ada678f4..bd2a3ea7 100644 --- a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp +++ b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp @@ -172,8 +172,7 @@ bool data_size_related_calculations(QoSBundle* ctx) ctx->pm->set("batchSize", -2); } } else if (((unsigned long)ctx->pm->get("batchSize") - < ctx->pm->get("dataLen") * 2) - && !ctx->pm->is_set("scan")) { + < ctx->pm->get("dataLen") * 2)) { /* * We don't want to use batching if the batch size is not large * enough to contain at least two samples (in this case we avoid the @@ -202,25 +201,6 @@ bool data_size_related_calculations(QoSBundle* ctx) } } - // Manage the parameter: -scan - if (ctx->pm->is_set("scan")) { - const std::vector scanList = - ctx->pm->get_vector("scan"); - - // Check if scan is large data or small data - if (scanList[0] <= (unsigned long long) ctx->maxSynchronousSize - && scanList[scanList.size() - 1] > (unsigned long long)ctx->maxSynchronousSize) { - fprintf(stderr, "The sizes of -scan ["); - for (unsigned int i = 0; i < scanList.size(); i++) { - fprintf(stderr, "%llu ", scanList[i]); - } - fprintf(stderr, - "] should be either all smaller or all bigger than %llu.\n", - *ctx->maxSynchronousSize); - return false; - } - } - return true; } diff --git a/srcCpp/connextDDS/pro/Infrastructure_pro.cxx b/srcCpp/connextDDS/pro/Infrastructure_pro.cxx index ac33026c..31ab227c 100644 --- a/srcCpp/connextDDS/pro/Infrastructure_pro.cxx +++ b/srcCpp/connextDDS/pro/Infrastructure_pro.cxx @@ -549,14 +549,6 @@ bool configureShmemTransport( "dds.transport.shmem.builtin.parent.message_size_max"); unsigned long long datalen = _PM->get("dataLen"); - /* - * If we specify -scan, then we are interested in the highest size. - * Since the vector for scan is sorted, that number should be the last - * element. - */ - if (_PM->is_set("scan")) { - datalen = _PM->get_vector("scan").back(); - } long parentMsgSizeMax = transport.minimumMessageSizeMax; std::ostringstream ss; diff --git a/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx b/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx index c8675dec..a2c568c2 100755 --- a/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx +++ b/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx @@ -90,8 +90,7 @@ bool RTIRawTransportImpl::validate_input() { } if (((unsigned long) _PM->get("batchSize") - < _PM->get("dataLen") * 2) - && !_PM->is_set("scan")) { + < _PM->get("dataLen") * 2)) { /* * We don't want to use batching if the batch size is not large * enough to contain at least two samples (in this case we avoid the diff --git a/srcCpp/perftest_cpp.cxx b/srcCpp/perftest_cpp.cxx index 5ff6be39..2aacd87a 100644 --- a/srcCpp/perftest_cpp.cxx +++ b/srcCpp/perftest_cpp.cxx @@ -72,7 +72,6 @@ extern "C" void RTIAndroid_registerOnPrintf(RTIAndroidOnPrintfMethod onPrintf) { #endif // RTI_PRO bool perftest_cpp::_testCompleted = false; -bool perftest_cpp::_testCompleted_scan = true; // In order to enter into the scan mode const int timeout_wait_for_ack_sec = 0; const unsigned int timeout_wait_for_ack_nsec = 100000000; const Perftest_ProductVersion_t perftest_cpp::_version = {0, 0, 0, 0}; @@ -93,7 +92,6 @@ int main(int argc, char *argv[]) { perftest_cpp::_testCompleted = false; - perftest_cpp::_testCompleted_scan = true; // In order to enter into the scan mode try { perftest_cpp app; @@ -493,13 +491,6 @@ bool perftest_cpp::validate_input() } } - if (_PM.is_set("scan") && _PM.is_set("pubRatebps")) { - fprintf(stderr, - "'-scan' cannot be used with '-pubRatebps', use '-pubRate' " - "instead\n"); - return false; - } - if (_PM.is_set("loadDataFromFile")){ /* * Load a file in memory if realPayload is set. @@ -534,31 +525,7 @@ bool perftest_cpp::validate_input() _threadPriorities.isSet = true; } - // Manage the parameter: -scan - if (_PM.is_set("scan")) { - const std::vector scanList = - _PM.get_vector("scan"); - // Max size of scan - _PM.set("dataLen", scanList[scanList.size() - 1]); - if (_PM.get("executionTime") == 0){ - _PM.set("executionTime", 60); - } - // Check if scan is large data or small data - if (scanList[0] <= (unsigned long long) MAX_BOUNDED_SEQ_SIZE - && scanList[scanList.size() - 1] - > (unsigned long long) MAX_BOUNDED_SEQ_SIZE) { - fprintf(stderr, "The sizes of -scan ["); - for (unsigned int i = 0; i < scanList.size(); i++) { - fprintf(stderr, "%llu ", scanList[i]); - } - fprintf(stderr, - "] should be either all smaller or all bigger than %d.\n", - MAX_BOUNDED_SEQ_SIZE); - return false; - } - } - - // Check if we need to enable the use of unbounded sequences. This works also for -scan + // Check if we need to enable the use of unbounded sequences. if (_PM.get("dataLen") > MAX_BOUNDED_SEQ_SIZE) { if (_PM.get("unbounded") == 0) { _PM.set("unbounded", MAX_BOUNDED_SEQ_SIZE); @@ -671,26 +638,9 @@ void perftest_cpp::print_configuration() << _PM.get("latencyCount") << " samples\n"; - // Scan/Data Sizes + // Data Sizes stringStream << "\tData Size: "; - if (_PM.is_set("scan")) { - const std::vector scanList = - _PM.get_vector("scan"); - for (unsigned long i = 0; i < scanList.size(); i++) { - stringStream << scanList[i]; - if (i == scanList.size() - 1) { - stringStream << ""; - } else { - stringStream << ", "; - } - } - - stringStream << "\n\t(Set the data size on the subscriber" - << " to the maximum data size to achieve best performance)" - << std::endl; - } else { - stringStream << _PM.get("dataLen") << "\n"; - } + stringStream << _PM.get("dataLen") << "\n"; #ifdef PERFTEST_RTI_PRO // Batching @@ -792,11 +742,6 @@ void perftest_cpp::print_configuration() "\n[Warning] CPU consumption feature is not available in this OS.\n"); } - if (_PM.is_set("scan")) { - fprintf(stderr, - "'-scan' is deprecated and will not be supported in future versions.\n"); - } - // We want to expose if we are using or not the unbounded type if (_PM.get("unbounded")) { stringStream << "\n[IMPORTANT]: Using the Unbounded Sequence Type."; @@ -872,7 +817,6 @@ class ThroughputListener : public IMessagingCB std::vector _finished_publishers; CpuMonitor cpu; bool _useCft; - bool change_size; ThroughputListener( @@ -887,7 +831,6 @@ class ThroughputListener : public IMessagingCB bytes_received = 0; missing_packets = 0; end_test = false; - change_size = false; last_data_length = -1; interval_data_length = -1; interval_packets_received = 0; @@ -928,8 +871,7 @@ class ThroughputListener : public IMessagingCB #ifdef DEBUG_PING_PONG printf("-- ProcessMessage ...\n"); #endif - if (message.entity_id >= _num_publishers || - message.entity_id < 0) { + if (message.entity_id >= _num_publishers || message.entity_id < 0) { printf("ProcessMessage: message content no valid. message.entity_id out of bounds\n"); return; } @@ -983,15 +925,6 @@ class ThroughputListener : public IMessagingCB _writer->flush(); } - // Always check if need to reset internals - if (message.size == perftest_cpp::LENGTH_CHANGED_SIZE) - { - print_summary_throughput(message); - change_size = true; - return; - } - - // case where not running a scan if (message.size != last_data_length) { packets_received = 0; bytes_received = 0; @@ -1095,8 +1028,6 @@ class ThroughputListener : public IMessagingCB packets_received = 0; bytes_received = 0; missing_packets = 0; - // length changed only used in scan mode in which case - // there is only 1 publisher with ID 0 _last_seq_num[0] = 0; begin_time = now; } @@ -1237,15 +1168,15 @@ int perftest_cpp::Subscriber() * to send information to the Publisher. This message size will indicate * different things. * - * We will use 3 sizes: INITIALIZE_SIZE, LENGTH_CHANGED_SIZE and FINISHED_SIZE, + * We will use 2 sizes: INITIALIZE_SIZE and FINISHED_SIZE, * msg.data will be used as the payload of such messages, so we choose the * greatest size: */ TestMessage announcement_msg; announcement_msg.entity_id = subID; announcement_msg.size = perftest_cpp::INITIALIZE_SIZE; - announcement_msg.data = new char[LENGTH_CHANGED_SIZE]; - memset(announcement_msg.data, 0, LENGTH_CHANGED_SIZE); + announcement_msg.data = new char[FINISHED_SIZE]; + memset(announcement_msg.data, 0, FINISHED_SIZE); // Send announcement message do { @@ -1287,14 +1218,6 @@ int perftest_cpp::Subscriber() PerftestClock::milliSleep(PERFTEST_DISCOVERY_TIME_MSEC); now = PerftestClock::getInstance().getTime(); - if (reader_listener->change_size) { // ACK change_size - announcement_msg.entity_id = subID; - announcement_msg.size = LENGTH_CHANGED_SIZE; - announcement_writer->send(announcement_msg); - announcement_writer->flush(); - reader_listener->change_size = false; - } - if (reader_listener->end_test) { // ACK end_test announcement_msg.entity_id = subID; announcement_msg.size = FINISHED_SIZE; @@ -1432,8 +1355,7 @@ class AnnouncementListener : public IMessagingCB * being changed. * - If all the subscribers are notified that the test has finished. */ - if ((message.size == perftest_cpp::INITIALIZE_SIZE - || message.size == perftest_cpp::LENGTH_CHANGED_SIZE) + if (message.size == perftest_cpp::INITIALIZE_SIZE && std::find( subscriber_list.begin(), subscriber_list.end(), @@ -1770,10 +1692,6 @@ class LatencyListener : public IMessagingCB // Test finished message case perftest_cpp::FINISHED_SIZE: return; - // Data length is changing size - case perftest_cpp::LENGTH_CHANGED_SIZE: - print_summary_latency(); - return; default: break; } @@ -2087,12 +2005,12 @@ int perftest_cpp::Publisher() } else { message.data = new char[(std::max)( (int) _PM.get("dataLen"), - (int) LENGTH_CHANGED_SIZE)]; + (int) FINISHED_SIZE)]; memset(message.data, 0, (std::max)( (int) _PM.get("dataLen"), - (int) LENGTH_CHANGED_SIZE)); + (int) FINISHED_SIZE)); } if (showCpu && _PM.get("pidMultiPubTest") == 0) { @@ -2151,7 +2069,6 @@ int perftest_cpp::Publisher() PerftestClock::milliSleep(1000); int num_pings = 0; - unsigned int scan_count = 0; int pingID = -1; int current_index_in_batch = 0; int ping_index_in_batch = 0; @@ -2179,10 +2096,8 @@ int perftest_cpp::Publisher() / 100; } - if (_PM.get("executionTime") > 0 - && !_PM.is_set("scan")) { - executionTimeoutThread = - PerftestTimer::getInstance().setTimeout(schedInfo); + if (_PM.get("executionTime") > 0) { + executionTimeoutThread = PerftestTimer::getInstance().setTimeout(schedInfo); if (executionTimeoutThread == NULL) { fprintf(stderr, "Problem creating timeoutThread for executionTime.\n"); return -1; @@ -2201,8 +2116,6 @@ int perftest_cpp::Publisher() * - pubRateMethodSpin * - pubRate * - cacheStats - * - isScan - * - scanList * - isSetPubRate */ const unsigned long long numIter = _PM.get("numIter"); @@ -2217,15 +2130,7 @@ int perftest_cpp::Publisher() const unsigned long pubRate = (unsigned long)_PM.get_pair("pubRate").first; const bool cacheStats = _PM.get("cacheStats"); - const bool isScan = _PM.is_set("scan"); - const std::vector scanList = - _PM.get_vector("scan"); const bool isSetPubRate = _PM.is_set("pubRate"); - - struct PerftestTimer::ScheduleInfo schedInfo_scan = { - (unsigned int)_PM.get("executionTime"), - Timeout_scan - }; const bool useDatafromFile = _PM.is_set("loadDataFromFile"); @@ -2249,7 +2154,7 @@ int perftest_cpp::Publisher() * Main sending loop */ unsigned long long loop = 0; - for (loop = 0; (isScan || (loop < numIter)) && (!_testCompleted); ++loop) { + for (loop = 0; (loop < numIter) && (!_testCompleted); ++loop) { /* This if has been included to perform the control loop that modifies the publication rate according to -pubRate */ @@ -2313,66 +2218,6 @@ int perftest_cpp::Publisher() * always. And the if() is always true. */ if (current_index_in_batch == ping_index_in_batch && !sentPing) { - // If running in scan mode, dataLen under test is changed - // after executionTime - if (isScan && _testCompleted_scan) { - _testCompleted_scan = false; - - // flush anything that was previously sent - writer->flush(); - writer->wait_for_ack( - timeout_wait_for_ack_sec, - timeout_wait_for_ack_nsec); - - if (scan_count == scanList.size()) { - break; // End of scan test - } else { - // Delete any previous thread - if (executionTimeoutThread != NULL) { - PerftestThread_delete(executionTimeoutThread); - } - - // Launch new schedule function - executionTimeoutThread = - PerftestTimer::getInstance().setTimeout(schedInfo_scan); - if (executionTimeoutThread == NULL) { - fprintf(stderr, "Problem creating timeoutThread for executionTime.\n"); - return -1; - } - } - - message.size = LENGTH_CHANGED_SIZE; - // must set latency_ping so that a subscriber sends us - // back the LENGTH_CHANGED_SIZE message - message.latency_ping = num_pings % numSubscribers; - - /* - * If the Throughput topic is reliable, we can send the packet and do - * a wait for acknowledgements. However, if the Throughput topic is - * Best Effort, wait_for_acknowledgments() will return inmediately. - * This would cause that the send() would be exercised too many times, - * in some cases causing the network to be flooded, a lot of packets being - * lost, and potentially CPU starbation for other processes. - * We can prevent this by adding a small sleep() if the test is best - * effort. - */ - announcement_reader_listener->subscriber_list.clear(); - while ((int)announcement_reader_listener->subscriber_list.size() - < numSubscribers) { - writer->send(message, true); - writer->flush(); - writer->wait_for_ack( - timeout_wait_for_ack_sec, - timeout_wait_for_ack_nsec); - } - - message.size = (int)scanList[scan_count++] - OVERHEAD_BYTES; - /* Reset _SamplePerBatch */ - samplesPerBatch = get_samples_per_batch(); - - ping_index_in_batch = 0; - current_index_in_batch = 0; - } // Each time ask a different subscriber to echo back pingID = num_pings % numSubscribers; @@ -2567,7 +2412,3 @@ const ThreadPriorities perftest_cpp::get_thread_priorities() void perftest_cpp::Timeout() { _testCompleted = true; } - -void perftest_cpp::Timeout_scan() { - _testCompleted_scan = true; -} \ No newline at end of file diff --git a/srcCpp/perftest_cpp.h b/srcCpp/perftest_cpp.h index 84d5bfde..9302b4b5 100644 --- a/srcCpp/perftest_cpp.h +++ b/srcCpp/perftest_cpp.h @@ -65,7 +65,6 @@ class perftest_cpp static void Timeout(); - static void Timeout_scan(); public: /* @@ -73,7 +72,6 @@ class perftest_cpp * and so they have to be static */ static bool _testCompleted; - static bool _testCompleted_scan; int subID; bool printIntervals; @@ -85,8 +83,6 @@ class perftest_cpp static const int INITIALIZE_SIZE = 1234; // Flag used to indicate end of test static const int FINISHED_SIZE = 1235; - // Flag used to data packet length is changing - static const int LENGTH_CHANGED_SIZE = 1236; /* * Value used to compare against to check if the latency_min has diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index d60b021f..9dd9e696 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -825,39 +825,6 @@ void ParameterManager::initialize() create("pubRatebps", pubRatebps); #endif - std::vector scanList; - scanList.push_back(32); - scanList.push_back(64); - scanList.push_back(128); - scanList.push_back(256); - scanList.push_back(512); - scanList.push_back(1024); - scanList.push_back(2048); - scanList.push_back(4096); - scanList.push_back(8192); - scanList.push_back(16384); - scanList.push_back(32768); - scanList.push_back(64900); - ParameterVector *scan = - new ParameterVector(scanList); - scan->set_command_line_argument("-scan", "::...:"); - scan->set_description( - "(Deprecated). Run test in scan mode, traversing\n" - "a range of sample data sizes from\n" - "[32,64900] or [64970,2147482620] bytes,\n" - "in the case that you are using large data or not.\n" - "The list of sizes is optional.\n" - "Default values are " - "'32:64:128:256:512:1024:2048:4096:8192:16384:32768:64900'\n" - "Default: Not set"); - scan->set_type(T_VECTOR_NUMERIC); - scan->set_extra_argument(POSSIBLE); - scan->set_range(perftest_cpp::OVERHEAD_BYTES, MAX_PERFTEST_SAMPLE_SIZE); - scan->set_parse_method(SPLIT); - scan->set_group(PUB); - scan->set_supported_middleware(Middleware::ALLDDS); - create("scan", scan); - Parameter *sleep = new Parameter(0); sleep->set_command_line_argument("-sleep", ""); sleep->set_description( From 2412c5049c72d92e48d74776eab5a3aa0ff119a1 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 24 Mar 2024 18:48:47 +0000 Subject: [PATCH 02/49] Add changes to remove the need of 2 idl files --- .gitignore | 1 - build.bat | 66 ------------------- build.sh | 70 +------------------- srcCpp/connextDDS/RTIDDSImpl.h | 3 - srcCpp11/RTIDDSImpl.h | 4 -- srcCppCommon/ParameterManager.cxx | 2 +- srcIdl/perftest.idl | 104 ++++++++++++++++++++++++++---- srcIdl/perftest_ZeroCopy.idl | 94 --------------------------- 8 files changed, 95 insertions(+), 249 deletions(-) delete mode 100644 srcIdl/perftest_ZeroCopy.idl diff --git a/.gitignore b/.gitignore index e97ef500..62521e59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /srcCpp*/perftest.* -/srcC*/perftest_ZeroCopy* /srcC*/perftestPlugin.* /srcC*/perftestSupport.* /srcC*/perftest_publisher.* diff --git a/build.bat b/build.bat index 55f73ceb..e9a9b33a 100755 --- a/build.bat +++ b/build.bat @@ -493,11 +493,6 @@ if !BUILD_CPP! == 1 ( set "additional_header_files=!additional_header_files_custom_type!!additional_header_files!RTIRawTransportImpl.h Parameter.h ParameterManager.h ThreadPriorities.h RTIDDSLoggerDevice.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h Infrastructure_common.h Infrastructure_pro.h PerftestPrinter.h FileDataLoader.h" set "additional_source_files=!additional_source_files_custom_type!!additional_source_files!RTIRawTransportImpl.cxx Parameter.cxx ParameterManager.cxx ThreadPriorities.cxx RTIDDSLoggerDevice.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx Infrastructure_common.cxx Infrastructure_pro.cxx PerftestPrinter.cxx FileDataLoader.cxx" - if !FLATDATA_AVAILABLE! == 1 ( - set "additional_header_files=!additional_header_files! perftest_ZeroCopy.h perftest_ZeroCopyPlugin.h perftest_ZeroCopySupport.h" - set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx perftest_ZeroCopySupport.cxx" - ) - set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -535,33 +530,6 @@ if !BUILD_CPP! == 1 ( exit /b 1 ) - @REM # Generate ZeroCopy types avoiding performance degradation issue - if !FLATDATA_AVAILABLE! == 1 ( - echo[ - echo "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles^ - -platform %architecture%^ - !rtiddsgen_extra_options! !additional_defines_custom_type!^ - -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - - echo[ - echo [INFO]: Generating Zero Copy code - call "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles^ - -platform %architecture%^ - !rtiddsgen_extra_options! !additional_defines_custom_type!^ - -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - if not !ERRORLEVEL! == 0 ( - echo [ERROR]: Failure generating code for %classic_cpp_lang_string%. - call::clean_copied_files - exit /b 1 - ) - ) - call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_publisher.cxx call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_subscriber.cxx @@ -681,11 +649,6 @@ if !BUILD_CPP11! == 1 ( set "additional_header_files=ThreadPriorities.h Parameter.h ParameterManager.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h PerftestPrinter.h" set "additional_source_files=ThreadPriorities.cxx Parameter.cxx ParameterManager.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx PerftestPrinter.cxx" - if !FLATDATA_AVAILABLE! == 1 ( - set "additional_header_files=!additional_header_files! perftest_ZeroCopy.hpp perftest_ZeroCopyPlugin.hpp" - set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx" - ) - set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -725,32 +688,6 @@ if !BUILD_CPP11! == 1 ( exit /b 1 ) - if !FLATDATA_AVAILABLE! == 1 ( - echo[ - echo "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles -platform %architecture%^ - !rtiddsgen_extra_options!^ - -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - - - @REM # Generate Zero Copy types avoiding performance degradation issue - echo[ - echo [INFO]: Generating Zero Copy code - call "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles -platform %architecture%^ - !rtiddsgen_extra_options!^ - -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - if not !ERRORLEVEL! == 0 ( - echo [ERROR]: Failure generating code for %modern_cpp_lang_string%. - call::clean_copied_files - exit /b 1 - ) - ) - call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_publisher.cxx call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_subscriber.cxx @@ -1329,9 +1266,6 @@ GOTO:EOF del %script_location%srcCpp\perftest.* > nul 2>nul del %script_location%srcCpp\perftestPlugin.* > nul 2>nul del %script_location%srcCpp\perftestSupport.* > nul 2>nul - del %script_location%srcCpp\perftest_ZeroCopy.* > nul 2>nul - del %script_location%srcCpp\perftest_ZeroCopyPlugin.* > nul 2>nul - del %script_location%srcCpp\perftest_ZeroCopySupport.* > nul 2>nul del %script_location%srcCpp\perftest_publisher.cxx > nul 2>nul del %script_location%srcCpp\perftest_subscriber.cxx > nul 2>nul del %script_location%srcCpp\perftestApplication.h > nul 2>nul diff --git a/build.sh b/build.sh index 308fe41e..35351512 100755 --- a/build.sh +++ b/build.sh @@ -230,7 +230,6 @@ function clean() rm -f "${script_location}"/srcC*/README_*.txt rm -f "${script_location}"/srcC*/perftest.* - rm -f "${script_location}"/srcC*/perftest_ZeroCopy* rm -f "${script_location}"/srcC*/perftestPlugin.* rm -f "${script_location}"/srcC*/perftestSupport.* rm -f "${script_location}"/srcC*/perftest_publisher.* @@ -718,7 +717,6 @@ function additional_defines_calculation() additional_defines=${additional_defines}" DMAX_DARWIN_SHMEM_SIZE=${darwin_shmem_size}" fi - # Adding RTI_ZEROCOPY_AVAILABLE, RTI_FLATDATA_AVAILABLE and RTI_FLATDATA_MAX_SIZE as defines if [ "${FLATDATA_AVAILABLE}" == "1" ]; then additional_defines=${additional_defines}" DRTI_FLATDATA_AVAILABLE" additional_rtiddsgen_defines_flatdata=" -D RTI_FLATDATA_AVAILABLE" @@ -1012,18 +1010,6 @@ function build_cpp() additional_defines=${additional_defines}" DPERFTEST_FAST_QUEUE" fi - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - additional_header_files="${additional_header_files} \ - perftest_ZeroCopy.h \ - perftest_ZeroCopyPlugin.h \ - perftest_ZeroCopySupport.h" - - additional_source_files="${additional_source_files} \ - perftest_ZeroCopy.cxx \ - perftest_ZeroCopyPlugin.cxx \ - perftest_ZeroCopySupport.cxx" - fi - ############################################################################## # Generate files for srcCpp @@ -1055,29 +1041,6 @@ function build_cpp() fi fi - # Generate ZeroCopy types avoiding performance degradation issue - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - echo -e "${INFO_TAG} Generating Zero Copy code" - rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${classic_cpp_lang_string} \ - ${additional_rtiddsgen_defines} \ - -replace -create typefiles \ - -platform ${platform} \ - ${rtiddsgen_extra_options} ${additional_defines_custom_type} \ - -d \"${classic_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" - - echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" - if [[ "${SKIP_GENERATE}" == "" ]]; then - eval $rtiddsgen_command - if [ "$?" != 0 ]; then - echo -e "${ERROR_TAG} Failure generating code for ${classic_cpp_lang_string}." - clean_copied_files - exit -1 - fi - fi - - rm -rf ${classic_cpp_folder}/makefile_perftest_ZeroCopy_${platform} - fi - cp "${classic_cpp_folder}/perftest_cpp.cxx" \ "${classic_cpp_folder}/perftest_publisher.cxx" cp "${classic_cpp_folder}/perftest_cpp.cxx" \ @@ -1412,17 +1375,6 @@ function build_cpp11() PerftestTransport.cxx \ PerftestPrinter.cxx" - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - additional_header_files="${additional_header_files} \ - perftest_ZeroCopy.hpp \ - perftest_ZeroCopyPlugin.hpp" - - additional_source_files="${additional_source_files} \ - perftest_ZeroCopy.cxx \ - perftest_ZeroCopyPlugin.cxx" - fi - - ############################################################################## # Generate files for srcCpp11 rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ @@ -1455,26 +1407,6 @@ function build_cpp11() exit -1 fi - # Generate Zero Copy types avoiding performance degradation issue - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - echo -e "${INFO_TAG} Generating Zero Copy code" - rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ - ${additional_rtiddsgen_defines} \ - -replace -create typefiles -platform ${platform} \ - ${rtiddsgen_extra_options} \ - -d \"${modern_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" - - echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" - eval $rtiddsgen_command - if [ "$?" != 0 ]; then - echo -e "${ERROR_TAG} Failure generating code for ${modern_cpp_lang_string}." - clean_copied_files - exit -1 - fi - - rm -rf ${modern_cpp_folder}/makefile_perftest_ZeroCopy_${platform} - fi - cp "${modern_cpp_folder}/perftest_cpp.cxx" \ "${modern_cpp_folder}/perftest_publisher.cxx" cp "${modern_cpp_folder}/perftest_cpp.cxx" \ @@ -2066,7 +1998,7 @@ elif [ "${BUILD_MICRO}" -eq "1" ]; then else # Build for ConnextDDS Pro rtiddsgen_executable="$NDDSHOME/bin/rtiddsgen" - classic_cpp_lang_string=C++ + classic_cpp_lang_string=C++98 modern_cpp_lang_string=C++11 java_lang_string=java cs_lang_string=C# diff --git a/srcCpp/connextDDS/RTIDDSImpl.h b/srcCpp/connextDDS/RTIDDSImpl.h index 575088c6..363e3e48 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.h +++ b/srcCpp/connextDDS/RTIDDSImpl.h @@ -20,9 +20,6 @@ #include "MessagingIF.h" #include "perftestSupport.h" -#ifdef RTI_ZEROCOPY_AVAILABLE - #include "perftest_ZeroCopySupport.h" -#endif #include "PerftestTransport.h" #include "Infrastructure_common.h" #ifdef PERFTEST_RTI_PRO diff --git a/srcCpp11/RTIDDSImpl.h b/srcCpp11/RTIDDSImpl.h index 8206f30a..9510cf5f 100644 --- a/srcCpp11/RTIDDSImpl.h +++ b/srcCpp11/RTIDDSImpl.h @@ -18,10 +18,6 @@ #include "PerftestTransport.h" #include -#ifdef RTI_ZEROCOPY_AVAILABLE -#include "perftest_ZeroCopy.hpp" -#endif - #ifdef RTI_DARWIN #include #include diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index d60b021f..c8c43ef0 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -379,7 +379,7 @@ void ParameterManager::initialize() checkconsistency->set_group(GENERAL); checkconsistency->set_supported_middleware(Middleware::RTIDDSPRO); create("checkconsistency", checkconsistency); - #endif + #endif // RTI_ZEROCOPY_AVAILABLE #endif #if defined(RTI_LANGUAGE_CPP_TRADITIONAL) && defined(PERFTEST_CONNEXT_PRO_610) diff --git a/srcIdl/perftest.idl b/srcIdl/perftest.idl index d5badccd..5c6fbe4a 100644 --- a/srcIdl/perftest.idl +++ b/srcIdl/perftest.idl @@ -31,16 +31,6 @@ const string LATENCY_TOPIC_NAME_STRING = "Latency"; const string ANNOUNCEMENT_TOPIC_NAME_STRING = "Announcement"; #endif -/* - * This idl uses prefix annotations. In order to compile with previous versions - * of *Connext DDS Professional* modify the following annotations: - * - * - @final -- Remove it and replace at the - * end with "//@Extensibility FINAL_EXTENSIBILITY" - * - @key -- Remove it and replace it at the end of the member with "//@key" - * - */ - /* * FACE Types need to be inside a FACE::DM module */ @@ -202,4 +192,96 @@ struct TestDataKeyedLarge_FlatData_t { #endif }; -#endif // RTI_FLATDATA_AVAILABLE \ No newline at end of file +#ifdef RTI_ZEROCOPY_AVAILABLE +/* + * ZERO COPY WITH FLATDATA + */ +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestData_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyed_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataLarge_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +#endif // RTI_ZEROCOPY_AVAILABLE + +#endif // RTI_FLATDATA_AVAILABLE + +/* + * This idl uses prefix annotations. In order to compile with previous versions + * of *Connext DDS Professional* modify the following annotations: + * + * - @final -- Remove it and replace at the + * end with "//@Extensibility FINAL_EXTENSIBILITY" + * - @key -- Remove it and replace it at the end of the member with "//@key" + * + */ \ No newline at end of file diff --git a/srcIdl/perftest_ZeroCopy.idl b/srcIdl/perftest_ZeroCopy.idl deleted file mode 100644 index a8b8991e..00000000 --- a/srcIdl/perftest_ZeroCopy.idl +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (c) 2005-2019 Copyright, Real-Time Innovations, Inc. All rights reserved. - * Subject to Eclipse Public License v1.0; see LICENSE.md for details. - */ - -/* - * This file contains the types for Zero Copy used by RTI Perftest. The reason - * why these types are separated from the main idl is because in RTI Connext - * DDS 6.0.0 we will generate a less efficient code for the non-zero-copy types - * if we add zero-copy types in the same idl. This behavior is fixed after 6.0.0 - * This information is covered in bug id: CORE-9693. - */ - -/* We need to use the definitions from the perftest.idl */ -#include "perftest.idl" - -/* - * ZERO COPY WITH FLATDATA - */ -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestData_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyed_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataLarge_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; From 481da2894ea56b3e27545e67faec3128dde6295a Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 24 Mar 2024 18:51:29 +0000 Subject: [PATCH 03/49] Revert "Add changes to remove the need of 2 idl files" This reverts commit 2412c5049c72d92e48d74776eab5a3aa0ff119a1. --- .gitignore | 1 + build.bat | 66 +++++++++++++++++++ build.sh | 70 +++++++++++++++++++- srcCpp/connextDDS/RTIDDSImpl.h | 3 + srcCpp11/RTIDDSImpl.h | 4 ++ srcCppCommon/ParameterManager.cxx | 2 +- srcIdl/perftest.idl | 104 ++++-------------------------- srcIdl/perftest_ZeroCopy.idl | 94 +++++++++++++++++++++++++++ 8 files changed, 249 insertions(+), 95 deletions(-) create mode 100644 srcIdl/perftest_ZeroCopy.idl diff --git a/.gitignore b/.gitignore index 62521e59..e97ef500 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /srcCpp*/perftest.* +/srcC*/perftest_ZeroCopy* /srcC*/perftestPlugin.* /srcC*/perftestSupport.* /srcC*/perftest_publisher.* diff --git a/build.bat b/build.bat index e9a9b33a..55f73ceb 100755 --- a/build.bat +++ b/build.bat @@ -493,6 +493,11 @@ if !BUILD_CPP! == 1 ( set "additional_header_files=!additional_header_files_custom_type!!additional_header_files!RTIRawTransportImpl.h Parameter.h ParameterManager.h ThreadPriorities.h RTIDDSLoggerDevice.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h Infrastructure_common.h Infrastructure_pro.h PerftestPrinter.h FileDataLoader.h" set "additional_source_files=!additional_source_files_custom_type!!additional_source_files!RTIRawTransportImpl.cxx Parameter.cxx ParameterManager.cxx ThreadPriorities.cxx RTIDDSLoggerDevice.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx Infrastructure_common.cxx Infrastructure_pro.cxx PerftestPrinter.cxx FileDataLoader.cxx" + if !FLATDATA_AVAILABLE! == 1 ( + set "additional_header_files=!additional_header_files! perftest_ZeroCopy.h perftest_ZeroCopyPlugin.h perftest_ZeroCopySupport.h" + set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx perftest_ZeroCopySupport.cxx" + ) + set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -530,6 +535,33 @@ if !BUILD_CPP! == 1 ( exit /b 1 ) + @REM # Generate ZeroCopy types avoiding performance degradation issue + if !FLATDATA_AVAILABLE! == 1 ( + echo[ + echo "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles^ + -platform %architecture%^ + !rtiddsgen_extra_options! !additional_defines_custom_type!^ + -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + + echo[ + echo [INFO]: Generating Zero Copy code + call "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles^ + -platform %architecture%^ + !rtiddsgen_extra_options! !additional_defines_custom_type!^ + -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + if not !ERRORLEVEL! == 0 ( + echo [ERROR]: Failure generating code for %classic_cpp_lang_string%. + call::clean_copied_files + exit /b 1 + ) + ) + call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_publisher.cxx call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_subscriber.cxx @@ -649,6 +681,11 @@ if !BUILD_CPP11! == 1 ( set "additional_header_files=ThreadPriorities.h Parameter.h ParameterManager.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h PerftestPrinter.h" set "additional_source_files=ThreadPriorities.cxx Parameter.cxx ParameterManager.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx PerftestPrinter.cxx" + if !FLATDATA_AVAILABLE! == 1 ( + set "additional_header_files=!additional_header_files! perftest_ZeroCopy.hpp perftest_ZeroCopyPlugin.hpp" + set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx" + ) + set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -688,6 +725,32 @@ if !BUILD_CPP11! == 1 ( exit /b 1 ) + if !FLATDATA_AVAILABLE! == 1 ( + echo[ + echo "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles -platform %architecture%^ + !rtiddsgen_extra_options!^ + -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + + + @REM # Generate Zero Copy types avoiding performance degradation issue + echo[ + echo [INFO]: Generating Zero Copy code + call "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles -platform %architecture%^ + !rtiddsgen_extra_options!^ + -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + if not !ERRORLEVEL! == 0 ( + echo [ERROR]: Failure generating code for %modern_cpp_lang_string%. + call::clean_copied_files + exit /b 1 + ) + ) + call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_publisher.cxx call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_subscriber.cxx @@ -1266,6 +1329,9 @@ GOTO:EOF del %script_location%srcCpp\perftest.* > nul 2>nul del %script_location%srcCpp\perftestPlugin.* > nul 2>nul del %script_location%srcCpp\perftestSupport.* > nul 2>nul + del %script_location%srcCpp\perftest_ZeroCopy.* > nul 2>nul + del %script_location%srcCpp\perftest_ZeroCopyPlugin.* > nul 2>nul + del %script_location%srcCpp\perftest_ZeroCopySupport.* > nul 2>nul del %script_location%srcCpp\perftest_publisher.cxx > nul 2>nul del %script_location%srcCpp\perftest_subscriber.cxx > nul 2>nul del %script_location%srcCpp\perftestApplication.h > nul 2>nul diff --git a/build.sh b/build.sh index 35351512..308fe41e 100755 --- a/build.sh +++ b/build.sh @@ -230,6 +230,7 @@ function clean() rm -f "${script_location}"/srcC*/README_*.txt rm -f "${script_location}"/srcC*/perftest.* + rm -f "${script_location}"/srcC*/perftest_ZeroCopy* rm -f "${script_location}"/srcC*/perftestPlugin.* rm -f "${script_location}"/srcC*/perftestSupport.* rm -f "${script_location}"/srcC*/perftest_publisher.* @@ -717,6 +718,7 @@ function additional_defines_calculation() additional_defines=${additional_defines}" DMAX_DARWIN_SHMEM_SIZE=${darwin_shmem_size}" fi + # Adding RTI_ZEROCOPY_AVAILABLE, RTI_FLATDATA_AVAILABLE and RTI_FLATDATA_MAX_SIZE as defines if [ "${FLATDATA_AVAILABLE}" == "1" ]; then additional_defines=${additional_defines}" DRTI_FLATDATA_AVAILABLE" additional_rtiddsgen_defines_flatdata=" -D RTI_FLATDATA_AVAILABLE" @@ -1010,6 +1012,18 @@ function build_cpp() additional_defines=${additional_defines}" DPERFTEST_FAST_QUEUE" fi + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + additional_header_files="${additional_header_files} \ + perftest_ZeroCopy.h \ + perftest_ZeroCopyPlugin.h \ + perftest_ZeroCopySupport.h" + + additional_source_files="${additional_source_files} \ + perftest_ZeroCopy.cxx \ + perftest_ZeroCopyPlugin.cxx \ + perftest_ZeroCopySupport.cxx" + fi + ############################################################################## # Generate files for srcCpp @@ -1041,6 +1055,29 @@ function build_cpp() fi fi + # Generate ZeroCopy types avoiding performance degradation issue + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + echo -e "${INFO_TAG} Generating Zero Copy code" + rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${classic_cpp_lang_string} \ + ${additional_rtiddsgen_defines} \ + -replace -create typefiles \ + -platform ${platform} \ + ${rtiddsgen_extra_options} ${additional_defines_custom_type} \ + -d \"${classic_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" + + echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" + if [[ "${SKIP_GENERATE}" == "" ]]; then + eval $rtiddsgen_command + if [ "$?" != 0 ]; then + echo -e "${ERROR_TAG} Failure generating code for ${classic_cpp_lang_string}." + clean_copied_files + exit -1 + fi + fi + + rm -rf ${classic_cpp_folder}/makefile_perftest_ZeroCopy_${platform} + fi + cp "${classic_cpp_folder}/perftest_cpp.cxx" \ "${classic_cpp_folder}/perftest_publisher.cxx" cp "${classic_cpp_folder}/perftest_cpp.cxx" \ @@ -1375,6 +1412,17 @@ function build_cpp11() PerftestTransport.cxx \ PerftestPrinter.cxx" + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + additional_header_files="${additional_header_files} \ + perftest_ZeroCopy.hpp \ + perftest_ZeroCopyPlugin.hpp" + + additional_source_files="${additional_source_files} \ + perftest_ZeroCopy.cxx \ + perftest_ZeroCopyPlugin.cxx" + fi + + ############################################################################## # Generate files for srcCpp11 rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ @@ -1407,6 +1455,26 @@ function build_cpp11() exit -1 fi + # Generate Zero Copy types avoiding performance degradation issue + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + echo -e "${INFO_TAG} Generating Zero Copy code" + rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ + ${additional_rtiddsgen_defines} \ + -replace -create typefiles -platform ${platform} \ + ${rtiddsgen_extra_options} \ + -d \"${modern_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" + + echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" + eval $rtiddsgen_command + if [ "$?" != 0 ]; then + echo -e "${ERROR_TAG} Failure generating code for ${modern_cpp_lang_string}." + clean_copied_files + exit -1 + fi + + rm -rf ${modern_cpp_folder}/makefile_perftest_ZeroCopy_${platform} + fi + cp "${modern_cpp_folder}/perftest_cpp.cxx" \ "${modern_cpp_folder}/perftest_publisher.cxx" cp "${modern_cpp_folder}/perftest_cpp.cxx" \ @@ -1998,7 +2066,7 @@ elif [ "${BUILD_MICRO}" -eq "1" ]; then else # Build for ConnextDDS Pro rtiddsgen_executable="$NDDSHOME/bin/rtiddsgen" - classic_cpp_lang_string=C++98 + classic_cpp_lang_string=C++ modern_cpp_lang_string=C++11 java_lang_string=java cs_lang_string=C# diff --git a/srcCpp/connextDDS/RTIDDSImpl.h b/srcCpp/connextDDS/RTIDDSImpl.h index 363e3e48..575088c6 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.h +++ b/srcCpp/connextDDS/RTIDDSImpl.h @@ -20,6 +20,9 @@ #include "MessagingIF.h" #include "perftestSupport.h" +#ifdef RTI_ZEROCOPY_AVAILABLE + #include "perftest_ZeroCopySupport.h" +#endif #include "PerftestTransport.h" #include "Infrastructure_common.h" #ifdef PERFTEST_RTI_PRO diff --git a/srcCpp11/RTIDDSImpl.h b/srcCpp11/RTIDDSImpl.h index 9510cf5f..8206f30a 100644 --- a/srcCpp11/RTIDDSImpl.h +++ b/srcCpp11/RTIDDSImpl.h @@ -18,6 +18,10 @@ #include "PerftestTransport.h" #include +#ifdef RTI_ZEROCOPY_AVAILABLE +#include "perftest_ZeroCopy.hpp" +#endif + #ifdef RTI_DARWIN #include #include diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index c8c43ef0..d60b021f 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -379,7 +379,7 @@ void ParameterManager::initialize() checkconsistency->set_group(GENERAL); checkconsistency->set_supported_middleware(Middleware::RTIDDSPRO); create("checkconsistency", checkconsistency); - #endif // RTI_ZEROCOPY_AVAILABLE + #endif #endif #if defined(RTI_LANGUAGE_CPP_TRADITIONAL) && defined(PERFTEST_CONNEXT_PRO_610) diff --git a/srcIdl/perftest.idl b/srcIdl/perftest.idl index 5c6fbe4a..d5badccd 100644 --- a/srcIdl/perftest.idl +++ b/srcIdl/perftest.idl @@ -31,6 +31,16 @@ const string LATENCY_TOPIC_NAME_STRING = "Latency"; const string ANNOUNCEMENT_TOPIC_NAME_STRING = "Announcement"; #endif +/* + * This idl uses prefix annotations. In order to compile with previous versions + * of *Connext DDS Professional* modify the following annotations: + * + * - @final -- Remove it and replace at the + * end with "//@Extensibility FINAL_EXTENSIBILITY" + * - @key -- Remove it and replace it at the end of the member with "//@key" + * + */ + /* * FACE Types need to be inside a FACE::DM module */ @@ -192,96 +202,4 @@ struct TestDataKeyedLarge_FlatData_t { #endif }; -#ifdef RTI_ZEROCOPY_AVAILABLE -/* - * ZERO COPY WITH FLATDATA - */ -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestData_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyed_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataLarge_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -#endif // RTI_ZEROCOPY_AVAILABLE - -#endif // RTI_FLATDATA_AVAILABLE - -/* - * This idl uses prefix annotations. In order to compile with previous versions - * of *Connext DDS Professional* modify the following annotations: - * - * - @final -- Remove it and replace at the - * end with "//@Extensibility FINAL_EXTENSIBILITY" - * - @key -- Remove it and replace it at the end of the member with "//@key" - * - */ \ No newline at end of file +#endif // RTI_FLATDATA_AVAILABLE \ No newline at end of file diff --git a/srcIdl/perftest_ZeroCopy.idl b/srcIdl/perftest_ZeroCopy.idl new file mode 100644 index 00000000..a8b8991e --- /dev/null +++ b/srcIdl/perftest_ZeroCopy.idl @@ -0,0 +1,94 @@ +/* + * (c) 2005-2019 Copyright, Real-Time Innovations, Inc. All rights reserved. + * Subject to Eclipse Public License v1.0; see LICENSE.md for details. + */ + +/* + * This file contains the types for Zero Copy used by RTI Perftest. The reason + * why these types are separated from the main idl is because in RTI Connext + * DDS 6.0.0 we will generate a less efficient code for the non-zero-copy types + * if we add zero-copy types in the same idl. This behavior is fixed after 6.0.0 + * This information is covered in bug id: CORE-9693. + */ + +/* We need to use the definitions from the perftest.idl */ +#include "perftest.idl" + +/* + * ZERO COPY WITH FLATDATA + */ +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestData_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyed_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataLarge_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; From 7309f9e2dd7104be418020169780f2b4438f64e3 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 24 Mar 2024 18:56:41 +0000 Subject: [PATCH 04/49] Remove zero-copy idl --- .gitignore | 1 - build.bat | 66 ------------------- build.sh | 70 +------------------- srcCpp/connextDDS/RTIDDSImpl.h | 3 - srcCpp11/RTIDDSImpl.h | 4 -- srcCppCommon/ParameterManager.cxx | 2 +- srcIdl/perftest.idl | 104 ++++++++++++++++++++++++++---- srcIdl/perftest_ZeroCopy.idl | 94 --------------------------- 8 files changed, 95 insertions(+), 249 deletions(-) delete mode 100644 srcIdl/perftest_ZeroCopy.idl diff --git a/.gitignore b/.gitignore index e97ef500..62521e59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /srcCpp*/perftest.* -/srcC*/perftest_ZeroCopy* /srcC*/perftestPlugin.* /srcC*/perftestSupport.* /srcC*/perftest_publisher.* diff --git a/build.bat b/build.bat index 55f73ceb..e9a9b33a 100755 --- a/build.bat +++ b/build.bat @@ -493,11 +493,6 @@ if !BUILD_CPP! == 1 ( set "additional_header_files=!additional_header_files_custom_type!!additional_header_files!RTIRawTransportImpl.h Parameter.h ParameterManager.h ThreadPriorities.h RTIDDSLoggerDevice.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h Infrastructure_common.h Infrastructure_pro.h PerftestPrinter.h FileDataLoader.h" set "additional_source_files=!additional_source_files_custom_type!!additional_source_files!RTIRawTransportImpl.cxx Parameter.cxx ParameterManager.cxx ThreadPriorities.cxx RTIDDSLoggerDevice.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx Infrastructure_common.cxx Infrastructure_pro.cxx PerftestPrinter.cxx FileDataLoader.cxx" - if !FLATDATA_AVAILABLE! == 1 ( - set "additional_header_files=!additional_header_files! perftest_ZeroCopy.h perftest_ZeroCopyPlugin.h perftest_ZeroCopySupport.h" - set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx perftest_ZeroCopySupport.cxx" - ) - set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -535,33 +530,6 @@ if !BUILD_CPP! == 1 ( exit /b 1 ) - @REM # Generate ZeroCopy types avoiding performance degradation issue - if !FLATDATA_AVAILABLE! == 1 ( - echo[ - echo "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles^ - -platform %architecture%^ - !rtiddsgen_extra_options! !additional_defines_custom_type!^ - -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - - echo[ - echo [INFO]: Generating Zero Copy code - call "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles^ - -platform %architecture%^ - !rtiddsgen_extra_options! !additional_defines_custom_type!^ - -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - if not !ERRORLEVEL! == 0 ( - echo [ERROR]: Failure generating code for %classic_cpp_lang_string%. - call::clean_copied_files - exit /b 1 - ) - ) - call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_publisher.cxx call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_subscriber.cxx @@ -681,11 +649,6 @@ if !BUILD_CPP11! == 1 ( set "additional_header_files=ThreadPriorities.h Parameter.h ParameterManager.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h PerftestPrinter.h" set "additional_source_files=ThreadPriorities.cxx Parameter.cxx ParameterManager.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx PerftestPrinter.cxx" - if !FLATDATA_AVAILABLE! == 1 ( - set "additional_header_files=!additional_header_files! perftest_ZeroCopy.hpp perftest_ZeroCopyPlugin.hpp" - set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx" - ) - set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -725,32 +688,6 @@ if !BUILD_CPP11! == 1 ( exit /b 1 ) - if !FLATDATA_AVAILABLE! == 1 ( - echo[ - echo "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles -platform %architecture%^ - !rtiddsgen_extra_options!^ - -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - - - @REM # Generate Zero Copy types avoiding performance degradation issue - echo[ - echo [INFO]: Generating Zero Copy code - call "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ - !additional_defines_rtiddsgen!^ - !additional_defines_rtiddsgen_flatdata!^ - -replace -create typefiles -platform %architecture%^ - !rtiddsgen_extra_options!^ - -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" - if not !ERRORLEVEL! == 0 ( - echo [ERROR]: Failure generating code for %modern_cpp_lang_string%. - call::clean_copied_files - exit /b 1 - ) - ) - call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_publisher.cxx call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_subscriber.cxx @@ -1329,9 +1266,6 @@ GOTO:EOF del %script_location%srcCpp\perftest.* > nul 2>nul del %script_location%srcCpp\perftestPlugin.* > nul 2>nul del %script_location%srcCpp\perftestSupport.* > nul 2>nul - del %script_location%srcCpp\perftest_ZeroCopy.* > nul 2>nul - del %script_location%srcCpp\perftest_ZeroCopyPlugin.* > nul 2>nul - del %script_location%srcCpp\perftest_ZeroCopySupport.* > nul 2>nul del %script_location%srcCpp\perftest_publisher.cxx > nul 2>nul del %script_location%srcCpp\perftest_subscriber.cxx > nul 2>nul del %script_location%srcCpp\perftestApplication.h > nul 2>nul diff --git a/build.sh b/build.sh index 308fe41e..35351512 100755 --- a/build.sh +++ b/build.sh @@ -230,7 +230,6 @@ function clean() rm -f "${script_location}"/srcC*/README_*.txt rm -f "${script_location}"/srcC*/perftest.* - rm -f "${script_location}"/srcC*/perftest_ZeroCopy* rm -f "${script_location}"/srcC*/perftestPlugin.* rm -f "${script_location}"/srcC*/perftestSupport.* rm -f "${script_location}"/srcC*/perftest_publisher.* @@ -718,7 +717,6 @@ function additional_defines_calculation() additional_defines=${additional_defines}" DMAX_DARWIN_SHMEM_SIZE=${darwin_shmem_size}" fi - # Adding RTI_ZEROCOPY_AVAILABLE, RTI_FLATDATA_AVAILABLE and RTI_FLATDATA_MAX_SIZE as defines if [ "${FLATDATA_AVAILABLE}" == "1" ]; then additional_defines=${additional_defines}" DRTI_FLATDATA_AVAILABLE" additional_rtiddsgen_defines_flatdata=" -D RTI_FLATDATA_AVAILABLE" @@ -1012,18 +1010,6 @@ function build_cpp() additional_defines=${additional_defines}" DPERFTEST_FAST_QUEUE" fi - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - additional_header_files="${additional_header_files} \ - perftest_ZeroCopy.h \ - perftest_ZeroCopyPlugin.h \ - perftest_ZeroCopySupport.h" - - additional_source_files="${additional_source_files} \ - perftest_ZeroCopy.cxx \ - perftest_ZeroCopyPlugin.cxx \ - perftest_ZeroCopySupport.cxx" - fi - ############################################################################## # Generate files for srcCpp @@ -1055,29 +1041,6 @@ function build_cpp() fi fi - # Generate ZeroCopy types avoiding performance degradation issue - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - echo -e "${INFO_TAG} Generating Zero Copy code" - rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${classic_cpp_lang_string} \ - ${additional_rtiddsgen_defines} \ - -replace -create typefiles \ - -platform ${platform} \ - ${rtiddsgen_extra_options} ${additional_defines_custom_type} \ - -d \"${classic_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" - - echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" - if [[ "${SKIP_GENERATE}" == "" ]]; then - eval $rtiddsgen_command - if [ "$?" != 0 ]; then - echo -e "${ERROR_TAG} Failure generating code for ${classic_cpp_lang_string}." - clean_copied_files - exit -1 - fi - fi - - rm -rf ${classic_cpp_folder}/makefile_perftest_ZeroCopy_${platform} - fi - cp "${classic_cpp_folder}/perftest_cpp.cxx" \ "${classic_cpp_folder}/perftest_publisher.cxx" cp "${classic_cpp_folder}/perftest_cpp.cxx" \ @@ -1412,17 +1375,6 @@ function build_cpp11() PerftestTransport.cxx \ PerftestPrinter.cxx" - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - additional_header_files="${additional_header_files} \ - perftest_ZeroCopy.hpp \ - perftest_ZeroCopyPlugin.hpp" - - additional_source_files="${additional_source_files} \ - perftest_ZeroCopy.cxx \ - perftest_ZeroCopyPlugin.cxx" - fi - - ############################################################################## # Generate files for srcCpp11 rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ @@ -1455,26 +1407,6 @@ function build_cpp11() exit -1 fi - # Generate Zero Copy types avoiding performance degradation issue - if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then - echo -e "${INFO_TAG} Generating Zero Copy code" - rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ - ${additional_rtiddsgen_defines} \ - -replace -create typefiles -platform ${platform} \ - ${rtiddsgen_extra_options} \ - -d \"${modern_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" - - echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" - eval $rtiddsgen_command - if [ "$?" != 0 ]; then - echo -e "${ERROR_TAG} Failure generating code for ${modern_cpp_lang_string}." - clean_copied_files - exit -1 - fi - - rm -rf ${modern_cpp_folder}/makefile_perftest_ZeroCopy_${platform} - fi - cp "${modern_cpp_folder}/perftest_cpp.cxx" \ "${modern_cpp_folder}/perftest_publisher.cxx" cp "${modern_cpp_folder}/perftest_cpp.cxx" \ @@ -2066,7 +1998,7 @@ elif [ "${BUILD_MICRO}" -eq "1" ]; then else # Build for ConnextDDS Pro rtiddsgen_executable="$NDDSHOME/bin/rtiddsgen" - classic_cpp_lang_string=C++ + classic_cpp_lang_string=C++98 modern_cpp_lang_string=C++11 java_lang_string=java cs_lang_string=C# diff --git a/srcCpp/connextDDS/RTIDDSImpl.h b/srcCpp/connextDDS/RTIDDSImpl.h index 575088c6..363e3e48 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.h +++ b/srcCpp/connextDDS/RTIDDSImpl.h @@ -20,9 +20,6 @@ #include "MessagingIF.h" #include "perftestSupport.h" -#ifdef RTI_ZEROCOPY_AVAILABLE - #include "perftest_ZeroCopySupport.h" -#endif #include "PerftestTransport.h" #include "Infrastructure_common.h" #ifdef PERFTEST_RTI_PRO diff --git a/srcCpp11/RTIDDSImpl.h b/srcCpp11/RTIDDSImpl.h index 8206f30a..9510cf5f 100644 --- a/srcCpp11/RTIDDSImpl.h +++ b/srcCpp11/RTIDDSImpl.h @@ -18,10 +18,6 @@ #include "PerftestTransport.h" #include -#ifdef RTI_ZEROCOPY_AVAILABLE -#include "perftest_ZeroCopy.hpp" -#endif - #ifdef RTI_DARWIN #include #include diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index d60b021f..c8c43ef0 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -379,7 +379,7 @@ void ParameterManager::initialize() checkconsistency->set_group(GENERAL); checkconsistency->set_supported_middleware(Middleware::RTIDDSPRO); create("checkconsistency", checkconsistency); - #endif + #endif // RTI_ZEROCOPY_AVAILABLE #endif #if defined(RTI_LANGUAGE_CPP_TRADITIONAL) && defined(PERFTEST_CONNEXT_PRO_610) diff --git a/srcIdl/perftest.idl b/srcIdl/perftest.idl index d5badccd..5c6fbe4a 100644 --- a/srcIdl/perftest.idl +++ b/srcIdl/perftest.idl @@ -31,16 +31,6 @@ const string LATENCY_TOPIC_NAME_STRING = "Latency"; const string ANNOUNCEMENT_TOPIC_NAME_STRING = "Announcement"; #endif -/* - * This idl uses prefix annotations. In order to compile with previous versions - * of *Connext DDS Professional* modify the following annotations: - * - * - @final -- Remove it and replace at the - * end with "//@Extensibility FINAL_EXTENSIBILITY" - * - @key -- Remove it and replace it at the end of the member with "//@key" - * - */ - /* * FACE Types need to be inside a FACE::DM module */ @@ -202,4 +192,96 @@ struct TestDataKeyedLarge_FlatData_t { #endif }; -#endif // RTI_FLATDATA_AVAILABLE \ No newline at end of file +#ifdef RTI_ZEROCOPY_AVAILABLE +/* + * ZERO COPY WITH FLATDATA + */ +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestData_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyed_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataLarge_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +#endif // RTI_ZEROCOPY_AVAILABLE + +#endif // RTI_FLATDATA_AVAILABLE + +/* + * This idl uses prefix annotations. In order to compile with previous versions + * of *Connext DDS Professional* modify the following annotations: + * + * - @final -- Remove it and replace at the + * end with "//@Extensibility FINAL_EXTENSIBILITY" + * - @key -- Remove it and replace it at the end of the member with "//@key" + * + */ \ No newline at end of file diff --git a/srcIdl/perftest_ZeroCopy.idl b/srcIdl/perftest_ZeroCopy.idl deleted file mode 100644 index a8b8991e..00000000 --- a/srcIdl/perftest_ZeroCopy.idl +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (c) 2005-2019 Copyright, Real-Time Innovations, Inc. All rights reserved. - * Subject to Eclipse Public License v1.0; see LICENSE.md for details. - */ - -/* - * This file contains the types for Zero Copy used by RTI Perftest. The reason - * why these types are separated from the main idl is because in RTI Connext - * DDS 6.0.0 we will generate a less efficient code for the non-zero-copy types - * if we add zero-copy types in the same idl. This behavior is fixed after 6.0.0 - * This information is covered in bug id: CORE-9693. - */ - -/* We need to use the definitions from the perftest.idl */ -#include "perftest.idl" - -/* - * ZERO COPY WITH FLATDATA - */ -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestData_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyed_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataLarge_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; From 33b613fded2c66b5bb80f7a46fd70483d63da4b7 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 24 Mar 2024 19:08:23 +0000 Subject: [PATCH 05/49] Remove the use of legacy Dynamic Data --- build.bat | 8 -------- build.sh | 9 --------- srcCpp/connextDDS/RTIDDSImpl.cxx | 15 +-------------- srcCppCommon/ParameterManager.cxx | 13 ------------- 4 files changed, 1 insertion(+), 44 deletions(-) diff --git a/build.bat b/build.bat index 55f73ceb..142442d1 100755 --- a/build.bat +++ b/build.bat @@ -46,7 +46,6 @@ set RELEASE_DEBUG=release set STATIC_DYNAMIC=static set USE_SECURE_LIBS=0 set USE_LW_SECURE_LIBS=0 -set LEGACY_DD_IMPL=0 @REM Starting with 5.2.6 (rtiddsgen 2.3.6) the name of the solutions is different set rtiddsgen_version_number_new_solution_name=2.3.6 @@ -145,8 +144,6 @@ if NOT "%1"=="" ( SET RELEASE_DEBUG=debug ) ELSE if "%1"=="--dynamic" ( SET STATIC_DYNAMIC=dynamic - ) ELSE if "%1"=="--legacy-DynamicData" ( - SET LEGACY_DD_IMPL=1 ) ELSE if "%1"=="--secure" ( SET USE_SECURE_LIBS=1 ) ELSE if "%1"=="--lightWeightSecure" ( @@ -398,11 +395,6 @@ if !BUILD_CPP! == 1 ( ) ) - if !LEGACY_DD_IMPL! == 1 ( - echo [INFO]: Allow the use of both legacy and new Dynamic Data Impl. - set "ADDITIONAL_DEFINES=!ADDITIONAL_DEFINES! RTI_LEGACY_DD_IMPL" - ) - set "ADDITIONAL_DEFINES=PERFTEST_RTI_PRO RTI_LANGUAGE_CPP_TRADITIONAL RTI_WIN32" if !USE_SECURE_LIBS! == 1 ( diff --git a/build.sh b/build.sh index 308fe41e..3fb9afa3 100755 --- a/build.sh +++ b/build.sh @@ -59,7 +59,6 @@ RELEASE_DEBUG=release STATIC_DYNAMIC=static USE_SECURE_LIBS=0 USE_LW_SECURE_LIBS=0 -LEGACY_DD_IMPL=0 # Variables for customType custom_type_folder="${idl_location}/customType" @@ -587,11 +586,6 @@ function additional_defines_calculation() additional_defines=${additional_defines}" O0" fi - if [ "${LEGACY_DD_IMPL}" == "1" ]; then - echo -e "${INFO_TAG} Allow the use of both legacy and new Dynamic Data Impl." - additional_defines=${additional_defines}" DRTI_LEGACY_DD_IMPL" - fi - if [ "${RTI_MONITORING_2}" == "1" ]; then echo -e "${INFO_TAG} Adding RTI Monitoring Libraries." additional_rti_libs="rtimonitoring2 ${additional_rti_libs}" @@ -1908,9 +1902,6 @@ while [ "$1" != "" ]; do USE_SECURE_LIBS=1 USE_LW_SECURE_LIBS=1 ;; - --legacy-DynamicData) - LEGACY_DD_IMPL=1 - ;; --monitoring2) RTI_MONITORING_2=1 ;; diff --git a/srcCpp/connextDDS/RTIDDSImpl.cxx b/srcCpp/connextDDS/RTIDDSImpl.cxx index 64ab0fbd..5a7e2719 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.cxx +++ b/srcCpp/connextDDS/RTIDDSImpl.cxx @@ -527,13 +527,7 @@ std::string RTIDDSImpl::print_configuration() // Dynamic Data stringStream << "\tDynamic Data: "; if (_PM->get("dynamicData")) { - stringStream << "Yes"; - #ifdef RTI_LEGACY_DD_IMPL - if (_PM->get("useLegacyDynamicData")) { - stringStream << " (Legacy Implementation)"; - } - #endif - stringStream << "\n"; + stringStream << "Yes\n"; } else { stringStream << "No\n"; } @@ -2813,13 +2807,6 @@ bool RTIDDSImpl::initialize(ParameterManager &PM, perftest_cpp *parent) #ifdef PERFTEST_RTI_PRO - #ifdef RTI_LEGACY_DD_IMPL - // If we are using Dynamic Data, check if we want to use the new or old impl - if (_PM->get("dynamicData") && _PM->get("useLegacyDynamicData")) { - DDS_DynamicData_enable_legacy_impl(); - } - #endif // RTI_LEGACY_DD_IMPL - #ifdef PERFTEST_FAST_QUEUE if (_PM->get("bestEffort") && _PM->get("fastQueue")) { struct NDDS_WriterHistory_Plugin *plugin = NULL; diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index d60b021f..6315a416 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -460,19 +460,6 @@ void ParameterManager::initialize() preallocateFragmentation->set_supported_middleware(Middleware::RTIDDSPRO); create("preallocateFragmentedSamples", preallocateFragmentation); - #ifdef RTI_LANGUAGE_CPP_TRADITIONAL - Parameter *useLegacyDynamicData = new Parameter(false); - useLegacyDynamicData->set_command_line_argument("-useLegacyDynamicData", ""); - useLegacyDynamicData->set_description( - "Use the Legacy Dynamic Data implementation"); - useLegacyDynamicData->set_type(T_BOOL); - useLegacyDynamicData->set_extra_argument(NO); - useLegacyDynamicData->set_group(GENERAL); - useLegacyDynamicData->set_supported_middleware( - Middleware::RTIDDSPRO); - create("useLegacyDynamicData", useLegacyDynamicData); - #endif - Parameter *sendQueueSize = new Parameter(50); sendQueueSize->set_command_line_argument("-sendQueueSize", ""); sendQueueSize->set_description( From cf382fd0683e51ded7c60c9b2c2baff3d7a5b21a Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Tue, 26 Mar 2024 05:13:02 -0700 Subject: [PATCH 06/49] Pull request #94: Disable batchingwhen using PubRate Merge in PERF/rti-perftest from feature/disable-batching-pubrate to develop Squashed commit of the following: commit d32b9d09e3633e3f5b7eed80b1c9e6bd440e9916 Author: Javier Morales-Castro Date: Tue Mar 26 07:54:18 2024 +0000 Apply CR feedback commit 6d3c6bf744f251e5f8735f484bf26715ff7360bf Author: Javier Morales-Castro Date: Sun Mar 24 22:21:55 2024 +0000 Disable batchingwhen using PubRate --- srcCpp/connextDDS/RTIDDSImpl.cxx | 5 +++++ srcCpp/perftest_cpp.cxx | 3 +++ srcCpp11/RTIDDSImpl.cxx | 4 ++++ srcCpp11/perftest_cpp.cxx | 3 +++ srcCs/ConnextDDS/RTIDDSImpl.cs | 4 ++++ srcCs/Perftest.cs | 5 +++++ srcDoc/release_notes.rst | 18 +++++++++++++++++- .../com/rti/perftest/ddsimpl/RTIDDSImpl.java | 9 +++++++++ srcJava/com/rti/perftest/harness/PerfTest.java | 6 ++++++ 9 files changed, 56 insertions(+), 1 deletion(-) diff --git a/srcCpp/connextDDS/RTIDDSImpl.cxx b/srcCpp/connextDDS/RTIDDSImpl.cxx index 5a7e2719..e5c38792 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.cxx +++ b/srcCpp/connextDDS/RTIDDSImpl.cxx @@ -404,6 +404,11 @@ bool RTIDDSImpl::data_size_related_calculations() _PM->set("batchSize", -3); } } + + if ((_PM->is_set("pubRate") || _PM->is_set("pubRateBps")) + && _PM->is_set("batchSize")) { + _PM->set("batchSize", -4); // Disable Batching + } } // Manage parameter -enableTurboMode diff --git a/srcCpp/perftest_cpp.cxx b/srcCpp/perftest_cpp.cxx index 5ff6be39..8a5afbd3 100644 --- a/srcCpp/perftest_cpp.cxx +++ b/srcCpp/perftest_cpp.cxx @@ -715,6 +715,9 @@ void perftest_cpp::print_configuration() } else if (_PM.get("batchSize") == -3) { stringStream << "\t\t BatchSize cannot be used with\n" << "\t\t FlatData and/or Zero-Copy.\n"; + } else if (_PM.get("batchSize") == -4) { + stringStream << "\t\t BatchSize disabled by default.\n" + << "\t\t when using -pubRate.\n"; } } #endif diff --git a/srcCpp11/RTIDDSImpl.cxx b/srcCpp11/RTIDDSImpl.cxx index cb3dac38..92e4e2a3 100755 --- a/srcCpp11/RTIDDSImpl.cxx +++ b/srcCpp11/RTIDDSImpl.cxx @@ -228,6 +228,10 @@ bool RTIDDSImpl::data_size_related_calculations() _PM->set("batchSize", -3); } } + + if (_PM->is_set("pubRate") && _PM->is_set("batchSize")) { + _PM->set("batchSize", -4); // Disable Batching + } } // Manage parameter -enableTurboMode diff --git a/srcCpp11/perftest_cpp.cxx b/srcCpp11/perftest_cpp.cxx index 1c84a931..b45236a1 100755 --- a/srcCpp11/perftest_cpp.cxx +++ b/srcCpp11/perftest_cpp.cxx @@ -657,6 +657,9 @@ void perftest_cpp::print_configuration() } else if (_PM.get("batchSize") == -3) { stringStream << "\t\t BatchSize cannot be used with\n" << "\t\t FlatData.\n"; + } else if (_PM.get("batchSize") == -4) { + stringStream << "\t\t BatchSize disabled by default.\n" + << "\t\t when using -pubRate.\n"; } } diff --git a/srcCs/ConnextDDS/RTIDDSImpl.cs b/srcCs/ConnextDDS/RTIDDSImpl.cs index 44f11e29..2016419c 100755 --- a/srcCs/ConnextDDS/RTIDDSImpl.cs +++ b/srcCs/ConnextDDS/RTIDDSImpl.cs @@ -239,6 +239,10 @@ public bool DataSizeRelatedCalculations() } } } + if (parameters.PubRateSet && parameters.BatchSizeSet) + { + parameters.batchSize = -3; + } if (parameters.EnableTurboMode) { diff --git a/srcCs/Perftest.cs b/srcCs/Perftest.cs index cd03bad2..13f06eeb 100755 --- a/srcCs/Perftest.cs +++ b/srcCs/Perftest.cs @@ -826,6 +826,11 @@ private void PrintConfiguration() sb.Append("\t\t BatchSize cannot be used with\n"); sb.Append("\t\t Large Data.\n"); } + if (batchSize == -3) + { + sb.Append("\t\t BatchSize disabled by default.\n"); + sb.Append("\t\t when using -pubRate.\n"); + } } // Publication Rate diff --git a/srcDoc/release_notes.rst b/srcDoc/release_notes.rst index f297c1b4..6c67cf70 100644 --- a/srcDoc/release_notes.rst +++ b/srcDoc/release_notes.rst @@ -9,11 +9,27 @@ Release Notes develop What's New in develop ~~~~~~~~~~~~~~~~~~~~~ -<- Nothing new yet -> +Using `-pubRate` will disable batching by default |newTag| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +In previous releases, using `-pubRate` would not modify the batching behavior +of *Perftest* (enabled by default for a throughput test). This would lead to +confusion and scenarios difficult to understand. + +This behavior has been modified and now using `-pubRate` will disable batching +by default. However if explicitly set via command line, batching will still be enabled. What's Fixed in develop ~~~~~~~~~~~~~~~~~~~~~~~ +<- Nothing new yet -> + +Release Notes 4.1.1 +--------------------- + +What's Fixed in 4.1.1 +~~~~~~~~~~~~~~~~~~~~~~~ + Terminated connection in VxWorks after finishing test for *Traditional* and *Modern* C++ |fixedTag| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java index e50bb1a4..414d0344 100644 --- a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java +++ b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java @@ -115,6 +115,7 @@ public final class RTIDDSImpl implements IMessaging { private long _maxSynchronousSize = PerftestTransport.MESSAGE_SIZE_MAX_NOT_SET; private boolean _isScan = false; private boolean _isPublisher = false; + private boolean _isPubRateSet = false; private boolean _IsAsynchronous = false; private boolean _isDynamicData = false; private String _FlowControllerCustom = "default"; @@ -385,6 +386,10 @@ public boolean data_size_related_calculations() { _batchSize = 0; } } + + if (_isPubRateSet && _isBatchSizeProvided) { + _batchSize = -3; + } } if (_TurboMode) { @@ -1426,6 +1431,10 @@ private boolean parseConfig(int argc, String[] argv) { else if ("-pub".toLowerCase().startsWith(argv[i].toLowerCase())) { _isPublisher = true; } + else if ( "-pubRate".toLowerCase().startsWith(argv[i].toLowerCase())) + { + _isPubRateSet = true; + } else if ("-dynamicData".toLowerCase().startsWith(argv[i].toLowerCase())) { _isDynamicData = true; } diff --git a/srcJava/com/rti/perftest/harness/PerfTest.java b/srcJava/com/rti/perftest/harness/PerfTest.java index dc84c45c..38ab2365 100644 --- a/srcJava/com/rti/perftest/harness/PerfTest.java +++ b/srcJava/com/rti/perftest/harness/PerfTest.java @@ -637,6 +637,8 @@ else if ("-writerStats".toLowerCase().startsWith(argv[i].toLowerCase())) } else if ( "-pubRate".toLowerCase().startsWith(argv[i].toLowerCase())) { + _messagingArgv[_messagingArgc++] = argv[i]; + if (( i == (argc-1)) || argv[++i].startsWith("-") ) { System.err.println("Missing : after -pubRate"); return false; @@ -896,6 +898,10 @@ private void printConfiguration() { sb.append("\t\t BatchSize cannot be used with\n"); sb.append("\t\t Large Data.\n"); } + if (batchSize == -3) { + sb.append("\t\t BatchSize disabled by default.\n"); + sb.append("\t\t when using -pubRate.\n"); + } } // Publication Rate From a600059f9c3a7b147059da312dc0776ce11a3c9e Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Tue, 26 Mar 2024 18:26:07 +0000 Subject: [PATCH 07/49] Revert "Remove zero-copy idl" This reverts commit 7309f9e2dd7104be418020169780f2b4438f64e3. --- .gitignore | 1 + build.bat | 66 +++++++++++++++++++ build.sh | 70 +++++++++++++++++++- srcCpp/connextDDS/RTIDDSImpl.h | 3 + srcCpp11/RTIDDSImpl.h | 4 ++ srcCppCommon/ParameterManager.cxx | 2 +- srcIdl/perftest.idl | 104 ++++-------------------------- srcIdl/perftest_ZeroCopy.idl | 94 +++++++++++++++++++++++++++ 8 files changed, 249 insertions(+), 95 deletions(-) create mode 100644 srcIdl/perftest_ZeroCopy.idl diff --git a/.gitignore b/.gitignore index 62521e59..e97ef500 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /srcCpp*/perftest.* +/srcC*/perftest_ZeroCopy* /srcC*/perftestPlugin.* /srcC*/perftestSupport.* /srcC*/perftest_publisher.* diff --git a/build.bat b/build.bat index b13b5427..142442d1 100755 --- a/build.bat +++ b/build.bat @@ -485,6 +485,11 @@ if !BUILD_CPP! == 1 ( set "additional_header_files=!additional_header_files_custom_type!!additional_header_files!RTIRawTransportImpl.h Parameter.h ParameterManager.h ThreadPriorities.h RTIDDSLoggerDevice.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h Infrastructure_common.h Infrastructure_pro.h PerftestPrinter.h FileDataLoader.h" set "additional_source_files=!additional_source_files_custom_type!!additional_source_files!RTIRawTransportImpl.cxx Parameter.cxx ParameterManager.cxx ThreadPriorities.cxx RTIDDSLoggerDevice.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx Infrastructure_common.cxx Infrastructure_pro.cxx PerftestPrinter.cxx FileDataLoader.cxx" + if !FLATDATA_AVAILABLE! == 1 ( + set "additional_header_files=!additional_header_files! perftest_ZeroCopy.h perftest_ZeroCopyPlugin.h perftest_ZeroCopySupport.h" + set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx perftest_ZeroCopySupport.cxx" + ) + set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -522,6 +527,33 @@ if !BUILD_CPP! == 1 ( exit /b 1 ) + @REM # Generate ZeroCopy types avoiding performance degradation issue + if !FLATDATA_AVAILABLE! == 1 ( + echo[ + echo "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles^ + -platform %architecture%^ + !rtiddsgen_extra_options! !additional_defines_custom_type!^ + -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + + echo[ + echo [INFO]: Generating Zero Copy code + call "%rtiddsgen_executable%" -language %classic_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles^ + -platform %architecture%^ + !rtiddsgen_extra_options! !additional_defines_custom_type!^ + -d "%classic_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + if not !ERRORLEVEL! == 0 ( + echo [ERROR]: Failure generating code for %classic_cpp_lang_string%. + call::clean_copied_files + exit /b 1 + ) + ) + call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_publisher.cxx call copy "%classic_cpp_folder%"\perftest_cpp.cxx "%classic_cpp_folder%"\perftest_subscriber.cxx @@ -641,6 +673,11 @@ if !BUILD_CPP11! == 1 ( set "additional_header_files=ThreadPriorities.h Parameter.h ParameterManager.h MessagingIF.h RTIDDSImpl.h perftest_cpp.h qos_string.h CpuMonitor.h PerftestTransport.h PerftestPrinter.h" set "additional_source_files=ThreadPriorities.cxx Parameter.cxx ParameterManager.cxx RTIDDSImpl.cxx CpuMonitor.cxx PerftestTransport.cxx PerftestPrinter.cxx" + if !FLATDATA_AVAILABLE! == 1 ( + set "additional_header_files=!additional_header_files! perftest_ZeroCopy.hpp perftest_ZeroCopyPlugin.hpp" + set "additional_source_files=!additional_source_files! perftest_ZeroCopy.cxx perftest_ZeroCopyPlugin.cxx" + ) + set additional_rti_libs_str= if "!additional_rti_libs!" NEQ "" ( set additional_rti_libs_str=-additionalRtiLibraries "!additional_rti_libs!" @@ -680,6 +717,32 @@ if !BUILD_CPP11! == 1 ( exit /b 1 ) + if !FLATDATA_AVAILABLE! == 1 ( + echo[ + echo "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles -platform %architecture%^ + !rtiddsgen_extra_options!^ + -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + + + @REM # Generate Zero Copy types avoiding performance degradation issue + echo[ + echo [INFO]: Generating Zero Copy code + call "%rtiddsgen_executable%" -language %modern_cpp_lang_string%^ + !additional_defines_rtiddsgen!^ + !additional_defines_rtiddsgen_flatdata!^ + -replace -create typefiles -platform %architecture%^ + !rtiddsgen_extra_options!^ + -d "%modern_cpp_folder%" "%idl_location%\perftest_ZeroCopy.idl" + if not !ERRORLEVEL! == 0 ( + echo [ERROR]: Failure generating code for %modern_cpp_lang_string%. + call::clean_copied_files + exit /b 1 + ) + ) + call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_publisher.cxx call copy "%modern_cpp_folder%"\perftest_cpp.cxx "%modern_cpp_folder%"\perftest_subscriber.cxx @@ -1258,6 +1321,9 @@ GOTO:EOF del %script_location%srcCpp\perftest.* > nul 2>nul del %script_location%srcCpp\perftestPlugin.* > nul 2>nul del %script_location%srcCpp\perftestSupport.* > nul 2>nul + del %script_location%srcCpp\perftest_ZeroCopy.* > nul 2>nul + del %script_location%srcCpp\perftest_ZeroCopyPlugin.* > nul 2>nul + del %script_location%srcCpp\perftest_ZeroCopySupport.* > nul 2>nul del %script_location%srcCpp\perftest_publisher.cxx > nul 2>nul del %script_location%srcCpp\perftest_subscriber.cxx > nul 2>nul del %script_location%srcCpp\perftestApplication.h > nul 2>nul diff --git a/build.sh b/build.sh index 782d7fa2..3fb9afa3 100755 --- a/build.sh +++ b/build.sh @@ -229,6 +229,7 @@ function clean() rm -f "${script_location}"/srcC*/README_*.txt rm -f "${script_location}"/srcC*/perftest.* + rm -f "${script_location}"/srcC*/perftest_ZeroCopy* rm -f "${script_location}"/srcC*/perftestPlugin.* rm -f "${script_location}"/srcC*/perftestSupport.* rm -f "${script_location}"/srcC*/perftest_publisher.* @@ -711,6 +712,7 @@ function additional_defines_calculation() additional_defines=${additional_defines}" DMAX_DARWIN_SHMEM_SIZE=${darwin_shmem_size}" fi + # Adding RTI_ZEROCOPY_AVAILABLE, RTI_FLATDATA_AVAILABLE and RTI_FLATDATA_MAX_SIZE as defines if [ "${FLATDATA_AVAILABLE}" == "1" ]; then additional_defines=${additional_defines}" DRTI_FLATDATA_AVAILABLE" additional_rtiddsgen_defines_flatdata=" -D RTI_FLATDATA_AVAILABLE" @@ -1004,6 +1006,18 @@ function build_cpp() additional_defines=${additional_defines}" DPERFTEST_FAST_QUEUE" fi + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + additional_header_files="${additional_header_files} \ + perftest_ZeroCopy.h \ + perftest_ZeroCopyPlugin.h \ + perftest_ZeroCopySupport.h" + + additional_source_files="${additional_source_files} \ + perftest_ZeroCopy.cxx \ + perftest_ZeroCopyPlugin.cxx \ + perftest_ZeroCopySupport.cxx" + fi + ############################################################################## # Generate files for srcCpp @@ -1035,6 +1049,29 @@ function build_cpp() fi fi + # Generate ZeroCopy types avoiding performance degradation issue + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + echo -e "${INFO_TAG} Generating Zero Copy code" + rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${classic_cpp_lang_string} \ + ${additional_rtiddsgen_defines} \ + -replace -create typefiles \ + -platform ${platform} \ + ${rtiddsgen_extra_options} ${additional_defines_custom_type} \ + -d \"${classic_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" + + echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" + if [[ "${SKIP_GENERATE}" == "" ]]; then + eval $rtiddsgen_command + if [ "$?" != 0 ]; then + echo -e "${ERROR_TAG} Failure generating code for ${classic_cpp_lang_string}." + clean_copied_files + exit -1 + fi + fi + + rm -rf ${classic_cpp_folder}/makefile_perftest_ZeroCopy_${platform} + fi + cp "${classic_cpp_folder}/perftest_cpp.cxx" \ "${classic_cpp_folder}/perftest_publisher.cxx" cp "${classic_cpp_folder}/perftest_cpp.cxx" \ @@ -1369,6 +1406,17 @@ function build_cpp11() PerftestTransport.cxx \ PerftestPrinter.cxx" + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + additional_header_files="${additional_header_files} \ + perftest_ZeroCopy.hpp \ + perftest_ZeroCopyPlugin.hpp" + + additional_source_files="${additional_source_files} \ + perftest_ZeroCopy.cxx \ + perftest_ZeroCopyPlugin.cxx" + fi + + ############################################################################## # Generate files for srcCpp11 rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ @@ -1401,6 +1449,26 @@ function build_cpp11() exit -1 fi + # Generate Zero Copy types avoiding performance degradation issue + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + echo -e "${INFO_TAG} Generating Zero Copy code" + rtiddsgen_command="\"${rtiddsgen_executable}\" -language ${modern_cpp_lang_string} \ + ${additional_rtiddsgen_defines} \ + -replace -create typefiles -platform ${platform} \ + ${rtiddsgen_extra_options} \ + -d \"${modern_cpp_folder}\" \"${idl_location}/perftest_ZeroCopy.idl\"" + + echo -e "${INFO_TAG} Command (Generating Zero Copy types): $rtiddsgen_command" + eval $rtiddsgen_command + if [ "$?" != 0 ]; then + echo -e "${ERROR_TAG} Failure generating code for ${modern_cpp_lang_string}." + clean_copied_files + exit -1 + fi + + rm -rf ${modern_cpp_folder}/makefile_perftest_ZeroCopy_${platform} + fi + cp "${modern_cpp_folder}/perftest_cpp.cxx" \ "${modern_cpp_folder}/perftest_publisher.cxx" cp "${modern_cpp_folder}/perftest_cpp.cxx" \ @@ -1989,7 +2057,7 @@ elif [ "${BUILD_MICRO}" -eq "1" ]; then else # Build for ConnextDDS Pro rtiddsgen_executable="$NDDSHOME/bin/rtiddsgen" - classic_cpp_lang_string=C++98 + classic_cpp_lang_string=C++ modern_cpp_lang_string=C++11 java_lang_string=java cs_lang_string=C# diff --git a/srcCpp/connextDDS/RTIDDSImpl.h b/srcCpp/connextDDS/RTIDDSImpl.h index 363e3e48..575088c6 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.h +++ b/srcCpp/connextDDS/RTIDDSImpl.h @@ -20,6 +20,9 @@ #include "MessagingIF.h" #include "perftestSupport.h" +#ifdef RTI_ZEROCOPY_AVAILABLE + #include "perftest_ZeroCopySupport.h" +#endif #include "PerftestTransport.h" #include "Infrastructure_common.h" #ifdef PERFTEST_RTI_PRO diff --git a/srcCpp11/RTIDDSImpl.h b/srcCpp11/RTIDDSImpl.h index 9510cf5f..8206f30a 100644 --- a/srcCpp11/RTIDDSImpl.h +++ b/srcCpp11/RTIDDSImpl.h @@ -18,6 +18,10 @@ #include "PerftestTransport.h" #include +#ifdef RTI_ZEROCOPY_AVAILABLE +#include "perftest_ZeroCopy.hpp" +#endif + #ifdef RTI_DARWIN #include #include diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index b00b7ea9..6315a416 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -379,7 +379,7 @@ void ParameterManager::initialize() checkconsistency->set_group(GENERAL); checkconsistency->set_supported_middleware(Middleware::RTIDDSPRO); create("checkconsistency", checkconsistency); - #endif // RTI_ZEROCOPY_AVAILABLE + #endif #endif #if defined(RTI_LANGUAGE_CPP_TRADITIONAL) && defined(PERFTEST_CONNEXT_PRO_610) diff --git a/srcIdl/perftest.idl b/srcIdl/perftest.idl index 5c6fbe4a..d5badccd 100644 --- a/srcIdl/perftest.idl +++ b/srcIdl/perftest.idl @@ -31,6 +31,16 @@ const string LATENCY_TOPIC_NAME_STRING = "Latency"; const string ANNOUNCEMENT_TOPIC_NAME_STRING = "Announcement"; #endif +/* + * This idl uses prefix annotations. In order to compile with previous versions + * of *Connext DDS Professional* modify the following annotations: + * + * - @final -- Remove it and replace at the + * end with "//@Extensibility FINAL_EXTENSIBILITY" + * - @key -- Remove it and replace it at the end of the member with "//@key" + * + */ + /* * FACE Types need to be inside a FACE::DM module */ @@ -192,96 +202,4 @@ struct TestDataKeyedLarge_FlatData_t { #endif }; -#ifdef RTI_ZEROCOPY_AVAILABLE -/* - * ZERO COPY WITH FLATDATA - */ -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestData_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyed_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataLarge_ZeroCopy_w_FlatData_t { - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -@mutable -@language_binding(FLAT_DATA) -@transfer_mode(SHMEM_REF) -struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { - @key - octet key[KEY_SIZE]; - - long entity_id; - unsigned long seq_num; - long timestamp_sec; - unsigned long timestamp_usec; - long latency_ping; - sequence bin_data; - #ifdef RTI_CUSTOM_TYPE_FLATDATA - @key - RTI_CUSTOM_TYPE_FLATDATA custom_type; - long custom_type_size; - #endif -}; - -#endif // RTI_ZEROCOPY_AVAILABLE - -#endif // RTI_FLATDATA_AVAILABLE - -/* - * This idl uses prefix annotations. In order to compile with previous versions - * of *Connext DDS Professional* modify the following annotations: - * - * - @final -- Remove it and replace at the - * end with "//@Extensibility FINAL_EXTENSIBILITY" - * - @key -- Remove it and replace it at the end of the member with "//@key" - * - */ \ No newline at end of file +#endif // RTI_FLATDATA_AVAILABLE \ No newline at end of file diff --git a/srcIdl/perftest_ZeroCopy.idl b/srcIdl/perftest_ZeroCopy.idl new file mode 100644 index 00000000..a8b8991e --- /dev/null +++ b/srcIdl/perftest_ZeroCopy.idl @@ -0,0 +1,94 @@ +/* + * (c) 2005-2019 Copyright, Real-Time Innovations, Inc. All rights reserved. + * Subject to Eclipse Public License v1.0; see LICENSE.md for details. + */ + +/* + * This file contains the types for Zero Copy used by RTI Perftest. The reason + * why these types are separated from the main idl is because in RTI Connext + * DDS 6.0.0 we will generate a less efficient code for the non-zero-copy types + * if we add zero-copy types in the same idl. This behavior is fixed after 6.0.0 + * This information is covered in bug id: CORE-9693. + */ + +/* We need to use the definitions from the perftest.idl */ +#include "perftest.idl" + +/* + * ZERO COPY WITH FLATDATA + */ +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestData_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyed_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataLarge_ZeroCopy_w_FlatData_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; + +@mutable +@language_binding(FLAT_DATA) +@transfer_mode(SHMEM_REF) +struct TestDataKeyedLarge_ZeroCopy_w_FlatData_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + sequence bin_data; + #ifdef RTI_CUSTOM_TYPE_FLATDATA + @key + RTI_CUSTOM_TYPE_FLATDATA custom_type; + long custom_type_size; + #endif +}; From 4db260e45cc2e95305a5f6533a6400209757cf6f Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 31 Mar 2024 11:02:50 +0000 Subject: [PATCH 08/49] Remove -scan for C++11 --- srcCpp11/PerftestTransport.cxx | 8 -- srcCpp11/RTIDDSImpl.cxx | 24 +---- srcCpp11/perftest_cpp.cxx | 181 +++------------------------------ srcCpp11/perftest_cpp.h | 4 - 4 files changed, 14 insertions(+), 203 deletions(-) diff --git a/srcCpp11/PerftestTransport.cxx b/srcCpp11/PerftestTransport.cxx index 66517f86..353019c5 100644 --- a/srcCpp11/PerftestTransport.cxx +++ b/srcCpp11/PerftestTransport.cxx @@ -271,14 +271,6 @@ void configureShmemTransport( { using namespace rti::core::policy; unsigned long long datalen = _PM->get("dataLen"); - /* - * If we specify -scan, then we are interested in the highest size. - * Since the vector for scan is sorted, that number should be the last - * element. - */ - if (_PM->is_set("scan")) { - datalen = _PM->get_vector("scan").back(); - } long parentMsgSizeMax = transport.minimumMessageSizeMax; std::ostringstream ss; diff --git a/srcCpp11/RTIDDSImpl.cxx b/srcCpp11/RTIDDSImpl.cxx index cb3dac38..0f2bb741 100755 --- a/srcCpp11/RTIDDSImpl.cxx +++ b/srcCpp11/RTIDDSImpl.cxx @@ -200,9 +200,8 @@ bool RTIDDSImpl::data_size_related_calculations() } else { _PM->set("batchSize", -2); } - } else if (((unsigned long)_PM->get("batchSize") - < _PM->get("dataLen") * 2) - && !_PM->is_set("scan")) { + } else if ((unsigned long)_PM->get("batchSize") + < _PM->get("dataLen") * 2) { /* * We don't want to use batching if the batch size is not large * enough to contain at least two samples (in this case we avoid the @@ -243,25 +242,6 @@ bool RTIDDSImpl::data_size_related_calculations() } } - // Manage the parameter: -scan - if (_PM->is_set("scan")) { - const std::vector scanList = - _PM->get_vector("scan"); - - // Check if scan is large data or small data - if (scanList[0] <= (unsigned long long) _maxSynchronousSize - && scanList[scanList.size() - 1] > (unsigned long long)_maxSynchronousSize) { - fprintf(stderr, "The sizes of -scan ["); - for (unsigned int i = 0; i < scanList.size(); i++) { - fprintf(stderr, "%llu ", scanList[i]); - } - fprintf(stderr, - "] should be either all smaller or all bigger than %lld.\n", - _maxSynchronousSize); - return false; - } - } - return true; } diff --git a/srcCpp11/perftest_cpp.cxx b/srcCpp11/perftest_cpp.cxx index 1c84a931..8a11c264 100755 --- a/srcCpp11/perftest_cpp.cxx +++ b/srcCpp11/perftest_cpp.cxx @@ -81,7 +81,6 @@ unsigned long long PerftestClock::getTime() bool perftest_cpp::_testCompleted = false; -bool perftest_cpp::_testCompleted_scan = true; // In order to enter into the scan mode const long timeout_wait_for_ack_sec = 0; const unsigned long timeout_wait_for_ack_nsec = 100000000; @@ -104,7 +103,6 @@ int main(int argc, char *argv[]) { perftest_cpp::_testCompleted = false; - perftest_cpp::_testCompleted_scan = true; // In order to enter into the scan mode try { perftest_cpp app; @@ -482,32 +480,7 @@ bool perftest_cpp::validate_input() _threadPriorities.isSet = true; } - // Manage the parameter: -scan - if (_PM.is_set("scan")) { - - const std::vector scanList = - _PM.get_vector("scan"); - // Max size of scan - _PM.set("dataLen", scanList[scanList.size() - 1]); - if (_PM.get("executionTime") == 0){ - _PM.set("executionTime", 60); - } - // Check if scan is large data or small data - if (scanList[0] <= (unsigned long long) MAX_BOUNDED_SEQ_SIZE - && scanList[scanList.size() - 1] - > (unsigned long long) MAX_BOUNDED_SEQ_SIZE) { - std::cerr << "[Error] The sizes of -scan ["; - for (unsigned int i = 0; i < scanList.size(); i++) { - std::cerr << scanList[i] << " "; - } - std::cerr << "] should be either all smaller or all bigger than " - << MAX_BOUNDED_SEQ_SIZE - << std::endl; - throw std::logic_error("[Error] Error parsing commands"); - } - } - - // Check if we need to enable the use of unbounded sequences. This works also for -scan + // Check if we need to enable the use of unbounded sequences. if (_PM.get("dataLen") > MAX_BOUNDED_SEQ_SIZE) { if (_PM.get("unbounded") == 0) { _PM.set("unbounded", MAX_BOUNDED_SEQ_SIZE); @@ -613,27 +586,10 @@ void perftest_cpp::print_configuration() << _PM.get("latencyCount") << " samples\n"; - // Scan/Data Sizes - stringStream << "\tData Size: "; - if (_PM.is_set("scan")) { - const std::vector scanList = - _PM.get_vector("scan"); - - for (unsigned long i = 0; i < scanList.size(); i++) { - stringStream << scanList[i]; - if (i == scanList.size() - 1) { - stringStream << "\n"; - } else { - stringStream << ", "; - } - } - - stringStream << "\n\t(Set the data size on the subscriber" - << " to the maximum data size to achieve maximum performance)" - << std::endl; - } else { - stringStream << _PM.get("dataLen") << "\n"; - } + // Data Sizes + stringStream << "\tData Size: " + << _PM.get("dataLen") + << "\n"; // Batching stringStream << "\tBatching: "; @@ -716,12 +672,6 @@ void perftest_cpp::print_configuration() << std::endl;; } - if (_PM.is_set("scan")) { - std::cerr << "[Warning] '-scan' is deprecated and will not " - << "be supported in future versions." - << std::endl; - } - // We want to expose if we are using or not the unbounded type if (_PM.get("unbounded")) { stringStream << "\n[IMPORTANT]: Using the Unbounded Sequence Type."; @@ -777,7 +727,6 @@ class ThroughputListener: public IMessagingCB { std::vector _finished_publishers; CpuMonitor cpu; bool _useCft; - bool change_size; ThroughputListener( ParameterManager &PM, @@ -801,8 +750,7 @@ class ThroughputListener: public IMessagingCB { _reader(reader), _last_seq_num(numPublishers), _num_publishers(numPublishers), - _useCft(UseCft), - change_size(false) + _useCft(UseCft) { end_test = false; @@ -872,14 +820,6 @@ class ThroughputListener: public IMessagingCB { _writer->flush(); } - // Always check if need to reset internals - if (size == perftest_cpp::LENGTH_CHANGED_SIZE) { - print_summary_throughput(message); - change_size = true; - return; - } - - // case where not running a scan if (size != last_data_length) { packets_received = 0; bytes_received = 0; @@ -978,8 +918,6 @@ class ThroughputListener: public IMessagingCB { packets_received = 0; bytes_received = 0; missing_packets = 0; - // length changed only used in scan mode in which case - // there is only 1 publisher with ID 0 _last_seq_num[0] = 0; begin_time = now; } @@ -1125,14 +1063,6 @@ int perftest_cpp::RunSubscriber() MilliSleep(PERFTEST_DISCOVERY_TIME_MSEC); now = PerftestClock::getTime(); - if (reader_listener->change_size) { // ACK change_size - announcement_msg.entity_id = subID; - announcement_msg.size = LENGTH_CHANGED_SIZE; - announcement_writer->send(announcement_msg); - announcement_writer->flush(); - reader_listener->change_size = false; - } - if (reader_listener->end_test) { // ACK end_test announcement_msg.entity_id = subID; announcement_msg.size = FINISHED_SIZE; @@ -1240,8 +1170,7 @@ class AnnouncementListener : public IMessagingCB /* * The subscriber_list vector contains the list of discovered subscribers. * - * - If the message.size is INITIALIZE or LENGTH_CHANGED and the - * subscriber is not in the list, it will be added. + * - If the message.size is INITIALIZE_SIZE, the subscriber will be added * - If the message.size is FINISHED_SIZE and the * subscriber is in the list, it will be removed. * @@ -1250,8 +1179,7 @@ class AnnouncementListener : public IMessagingCB * being changed. * - If all the subscribers are notified that the test has finished. */ - if ((message.size == perftest_cpp::INITIALIZE_SIZE - || message.size == perftest_cpp::LENGTH_CHANGED_SIZE) + if ((message.size == perftest_cpp::INITIALIZE_SIZE) && std::find( subscriber_list.begin(), subscriber_list.end(), @@ -1378,10 +1306,6 @@ class LatencyListener : public IMessagingCB // Test finished message case perftest_cpp::FINISHED_SIZE: return; - // Data length is changing size - case perftest_cpp::LENGTH_CHANGED_SIZE: - print_summary_latency(); - return; default: break; } @@ -1733,8 +1657,6 @@ int perftest_cpp::RunPublisher() // Allocate data and set size TestMessage message; message.entity_id = _PM.get("pidMultiPubTest"); - //message.size = (std::max)(_PM.get("dataLen"), LENGTH_CHANGED_SIZE); - //message.bin_data.resize((std::max)(_PM.get("dataLen"), LENGTH_CHANGED_SIZE)); if ( showCpu && _PM.get("pidMultiPubTest") == 0) { @@ -1791,7 +1713,6 @@ int perftest_cpp::RunPublisher() MilliSleep(1000); int num_pings = 0; - unsigned int scan_count = 0; int pingID = -1; int current_index_in_batch = 0; int ping_index_in_batch = 0; @@ -1818,8 +1739,7 @@ int perftest_cpp::RunPublisher() / 100); } - if (_PM.get("executionTime") > 0 - && !_PM.is_set("scan")) { + if (_PM.get("executionTime") > 0) { executionTimeoutThread = SetTimeout(schedInfo); if (executionTimeoutThread == NULL) { std::cerr << "[Error] Problem creating timeoutThread for executionTime." @@ -1839,8 +1759,6 @@ int perftest_cpp::RunPublisher() * - pubRateMethodSpin * - pubRate * - writerStats - * - isScan - * - scanList * - isSetPubRate */ const unsigned long long numIter = _PM.get("numIter"); @@ -1855,22 +1773,12 @@ int perftest_cpp::RunPublisher() const unsigned long pubRate = (unsigned long)_PM.get_pair("pubRate").first; const bool writerStats = _PM.get("writerStats"); - const bool isScan = _PM.is_set("scan"); - const std::vector scanList = - _PM.get_vector("scan"); const bool isSetPubRate = _PM.is_set("pubRate"); - struct ScheduleInfo schedInfo_scan = { - (unsigned int)_PM.get("executionTime"), - Timeout_scan - }; - /******************** * Main sending loop */ - for (unsigned long long loop = 0; - ((isScan) || (loop < numIter)) && (!_testCompleted); - ++loop ) { + for (unsigned long long loop = 0; (loop < numIter) && (!_testCompleted); ++loop ) { /* This if has been included to perform the control loop that modifies the publication rate according to -pubRate */ @@ -1915,8 +1823,8 @@ int perftest_cpp::RunPublisher() // only send latency pings if is publisher with ID 0 // In batch mode, latency pings are sent once every LatencyCount batches - if ((pidMultiPubTest == 0) && (((loop / samplesPerBatch) - % latencyCount) == 0) ) { + if ((pidMultiPubTest == 0) + && (((loop / samplesPerBatch) % latencyCount) == 0) ) { /* In batch mode only send a single ping in a batch. * @@ -1930,68 +1838,6 @@ int perftest_cpp::RunPublisher() * always. And the if() is always true. */ if ( current_index_in_batch == ping_index_in_batch && !sentPing) { - // If running in scan mode, dataLen under test is changed - // after _executionTime - if (isScan && _testCompleted_scan) { - _testCompleted_scan = false; - - // flush anything that was previously sent - writer->flush(); - writer->wait_for_ack( - timeout_wait_for_ack_sec, - timeout_wait_for_ack_nsec); - - if (scan_count == scanList.size()) { - break; // End of scan test - } else { - // Delete any previous thread - if (executionTimeoutThread != NULL) { - RTIOsapiThread_delete(executionTimeoutThread); - } - - // Launch new schedule function - executionTimeoutThread = SetTimeout(schedInfo_scan); - if (executionTimeoutThread == NULL) { - std::cerr << "[Error] Problem creating timeoutThread for executionTime." - << std::endl; - return -1; - } - } - - - message.size = LENGTH_CHANGED_SIZE; - //message.data.resize(message.size); - // must set latency_ping so that a subscriber sends us - // back the LENGTH_CHANGED_SIZE message - message.latency_ping = num_pings % numSubscribers; - - /* - * If the Throughput topic is reliable, we can send the packet and do - * a wait for acknowledgements. However, if the Throughput topic is - * Best Effort, wait_for_ack() will return inmediately. - * This would cause that the send() would be exercised too many times, - * in some cases causing the network to be flooded, a lot of packets being - * lost, and potentially CPU starbation for other processes. - * We can prevent this by adding a small sleep() if the test is best - * effort. - */ - announcement_reader_listener->subscriber_list.clear(); - while ((int)announcement_reader_listener->subscriber_list.size() - < numSubscribers) { - writer->send(message, true); - writer->flush(); - writer->wait_for_ack( - timeout_wait_for_ack_sec, - timeout_wait_for_ack_nsec); - } - - message.size = (int)scanList[scan_count++] - OVERHEAD_BYTES; - /* Reset _SamplePerBatch */ - samplesPerBatch = get_samples_per_batch(); - - ping_index_in_batch = 0; - current_index_in_batch = 0; - } // Each time ask a different subscriber to echo back pingID = num_pings % numSubscribers; @@ -2154,6 +2000,3 @@ const ThreadPriorities perftest_cpp::get_thread_priorities() inline void perftest_cpp::Timeout() { _testCompleted = true; } -inline void perftest_cpp::Timeout_scan() { - _testCompleted_scan = true; -} \ No newline at end of file diff --git a/srcCpp11/perftest_cpp.h b/srcCpp11/perftest_cpp.h index 33232a07..1cdadfc8 100755 --- a/srcCpp11/perftest_cpp.h +++ b/srcCpp11/perftest_cpp.h @@ -76,7 +76,6 @@ class perftest_cpp static void ThreadYield(); static unsigned long long GetTimeUsec(); static void Timeout(); - static void Timeout_scan(); private: struct ScheduleInfo { @@ -104,7 +103,6 @@ class perftest_cpp /* The following three members are used in a static callback and so they have to be static */ static bool _testCompleted; - static bool _testCompleted_scan; /* * Number of bytes sent in messages besides user data. This value is @@ -116,8 +114,6 @@ class perftest_cpp static const int INITIALIZE_SIZE = 1234; // Flag used to indicate end of test static const int FINISHED_SIZE = 1235; - // Flag used to data packet length is changing - static const int LENGTH_CHANGED_SIZE = 1236; /* * Value used to compare against to check if the latency_min has From 30839064aaa0e84f311a5445eaf45235d54cc912 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 31 Mar 2024 11:05:12 +0000 Subject: [PATCH 09/49] Add support for Cs --- srcCs/ConnextDDS/RTIDDSImpl.cs | 6 +----- srcCs/Harness/ThroughputListener.cs | 2 -- srcCs/Infrastructure/Parameters.cs | 1 - srcCs/Perftest.cs | 5 +---- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/srcCs/ConnextDDS/RTIDDSImpl.cs b/srcCs/ConnextDDS/RTIDDSImpl.cs index 44f11e29..c6719378 100755 --- a/srcCs/ConnextDDS/RTIDDSImpl.cs +++ b/srcCs/ConnextDDS/RTIDDSImpl.cs @@ -373,10 +373,6 @@ public string PrintConfiguration() public bool ParseConfig() { - if (parameters.Scan) - { - Console.Error.WriteLine("Scan has been deprecated in this version of perftest"); - } if (parameters.Durability > 3) { @@ -535,7 +531,7 @@ public bool ParseConfig() SecureUseSecure = true; } - /* Check if we need to enable Large Data. This works also for -scan */ + /* Check if we need to enable Large Data. */ if (parameters.DataLen > MAX_BOUNDED_SEQ_SIZE.Value) { isLargeData = true; diff --git a/srcCs/Harness/ThroughputListener.cs b/srcCs/Harness/ThroughputListener.cs index 53487727..ff4885e7 100644 --- a/srcCs/Harness/ThroughputListener.cs +++ b/srcCs/Harness/ThroughputListener.cs @@ -265,8 +265,6 @@ public void PrintSummaryThroughput(TestMessage message, bool endTest = false) packetsReceived = 0; bytesReceived = 0; missingPackets = 0; - // length changed only used in scan mode in which case - // there is only 1 publisher with ID 0 lastSeqNum[0] = 0; beginTime = now; } diff --git a/srcCs/Infrastructure/Parameters.cs b/srcCs/Infrastructure/Parameters.cs index 3d27a849..91530068 100644 --- a/srcCs/Infrastructure/Parameters.cs +++ b/srcCs/Infrastructure/Parameters.cs @@ -71,7 +71,6 @@ public uint Instances public uint LatencyCount { get; set; } public uint NumSubscribers { get; set; } public uint NumPublishers { get; set; } - public bool Scan { get; set; } public bool NoPrintIntervals { get; set; } public bool UseReadThread { get; set; } public bool LatencyTest diff --git a/srcCs/Perftest.cs b/srcCs/Perftest.cs index cd03bad2..a3ab0286 100755 --- a/srcCs/Perftest.cs +++ b/srcCs/Perftest.cs @@ -207,9 +207,6 @@ private static Parameters ParseParameters(string[] args) new string[] { "--numPublishers", "-numPublishers" }, getDefaultValue: () => 1, description: "Number of publishers running in test."), - new System.CommandLine.Option( - new string[] { "--scan", "-scan" }, - description: "This option is deprecated in this version of perftest."), new System.CommandLine.Option( new string[] { "--noPrintIntervals", "-noPrintIntervals" }, description: "Don't print statistics at intervals during test."), @@ -788,7 +785,7 @@ private void PrintConfiguration() sb.Append(latencyCount); sb.Append('\n'); - // Scan/Data Sizes + // Data Sizes sb.Append("\tData Size: "); sb.Append(dataSize); sb.Append('\n'); From ed8180e35a677deaf03594e5be0657df23baedfa Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 31 Mar 2024 11:21:20 +0000 Subject: [PATCH 10/49] Add changes for C# --- srcCs/Harness/ThroughputListener.cs | 9 --------- srcCs/Perftest.cs | 16 +--------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/srcCs/Harness/ThroughputListener.cs b/srcCs/Harness/ThroughputListener.cs index ff4885e7..1a60c9d1 100644 --- a/srcCs/Harness/ThroughputListener.cs +++ b/srcCs/Harness/ThroughputListener.cs @@ -21,7 +21,6 @@ public class ThroughputListener : IMessagingCallback public ulong bytesReceived; public ulong missingPackets; public bool endTest; - public bool changeSize; private int currentMessageSize; public int lastDataLength = -1; @@ -134,14 +133,6 @@ public void ProcessMessage(TestMessage message) writer.Flush(); } - // // Always check if need to reset internals - // if (currentMessageSize == Perftest.LENGTH_CHANGED_SIZE) - // { - // PrintSummaryThroughput(message); - // changeSize = true; - // return; - // } - if (currentMessageSize != lastDataLength) { packetsReceived = 0; diff --git a/srcCs/Perftest.cs b/srcCs/Perftest.cs index a3ab0286..f0d59225 100755 --- a/srcCs/Perftest.cs +++ b/srcCs/Perftest.cs @@ -57,8 +57,6 @@ public class Perftest : IDisposable public const int INITIALIZE_SIZE = 1234; // Flag used to indicate end of test public const int FINISHED_SIZE = 1235; - // Flag used to indicate end of test - public const int LENGTH_CHANGED_SIZE = 1236; /* * Value used to compare against to check if the latency_min has @@ -90,7 +88,7 @@ private void Run(string[] argv) return; } - ulong maxPerftestSampleSize = Math.Max(dataSize, LENGTH_CHANGED_SIZE); + ulong maxPerftestSampleSize = Math.Max(dataSize, FINISHED_SIZE); if (parameters.UnboundedSizeSet) { @@ -962,18 +960,6 @@ private void Subscriber() Thread.Sleep(1000); now = GetTimeUsec(); - if (readerListener.changeSize) - { // ACK change_size - TestMessage messageChangeSize = new TestMessage(); - messageChangeSize.entityId = subID; - // messageChangeSize.data = new List(new byte[1]); - // messageChangeSize.size = 1; - messageChangeSize.Size = 1; - announcementWriter.Send(messageChangeSize, false); - announcementWriter.Flush(); - readerListener.changeSize = false; - } - if (readerListener.endTest) { TestMessage messageEndTest = new TestMessage(); From 77c2930b80dad56b2d6910184d6c2dc380d1f84f Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 31 Mar 2024 11:21:55 +0000 Subject: [PATCH 11/49] Add changes for srcJava --- .../perftest/ddsimpl/PerfTestLauncher.java | 36 +--- .../perftest/ddsimpl/PerftestTransport.java | 11 -- .../com/rti/perftest/ddsimpl/RTIDDSImpl.java | 40 +--- .../harness/AnnouncementListener.java | 6 +- .../rti/perftest/harness/LatencyListener.java | 6 +- .../com/rti/perftest/harness/PerfTest.java | 174 +----------------- .../perftest/harness/PerftestTimerTask.java | 16 +- .../perftest/harness/ThroughputListener.java | 11 -- 8 files changed, 18 insertions(+), 282 deletions(-) diff --git a/srcJava/com/rti/perftest/ddsimpl/PerfTestLauncher.java b/srcJava/com/rti/perftest/ddsimpl/PerfTestLauncher.java index 4bdb00fd..787204f5 100644 --- a/srcJava/com/rti/perftest/ddsimpl/PerfTestLauncher.java +++ b/srcJava/com/rti/perftest/ddsimpl/PerfTestLauncher.java @@ -33,7 +33,7 @@ public static void main(String[] argv) { parseConfig(argv); int MAX_PERFTEST_SAMPLE_SIZE = Math.max((int)_dataLen, - PerfTest.LENGTH_CHANGED_SIZE); + PerfTest.FINISHED_SIZE); if(_useUnbounded > 0) { if (_isKeyed) { @@ -174,39 +174,6 @@ private static boolean parseConfig(String[] argv) { MAX_BOUNDED_SEQ_SIZE.VALUE); return false; } - }else if ("-scan".toLowerCase().startsWith(argv[i].toLowerCase())) { - _isScan = true; - - System.err.println("'-scan' is deprecated and will not be supported in future versions"); - - if ((i != (argc - 1)) && !argv[1+i].startsWith("-")) { - ++i; - long _scan_max_size = 0; - long aux_scan; - StringTokenizer st = new StringTokenizer(argv[i], ":", true); - while (st.hasMoreTokens()) { - String s = st.nextToken(); - if (!s.equals(":")) { - aux_scan = Long.parseLong(s); - if (aux_scan >= _scan_max_size) { - _scan_max_size = aux_scan; - } - } - } - // Check if large data or small data - if (_scan_max_size > MAX_BOUNDED_SEQ_SIZE.VALUE) { - if (_useUnbounded == 0) { - _useUnbounded = MAX_BOUNDED_SEQ_SIZE.VALUE; - } - } else if (_scan_max_size <= MAX_BOUNDED_SEQ_SIZE.VALUE) { - if (_useUnbounded != 0) { - System.err.printf("Unbounded will be ignored since -scan is present."); - _useUnbounded = 0; - } - } else { - return false; - } - } } } @@ -214,7 +181,6 @@ private static boolean parseConfig(String[] argv) { } private static boolean _isKeyed = false; - private static boolean _isScan = false; private static boolean _isDynamicData = false; private static long _useUnbounded = 0; private static long _dataLen = 100; diff --git a/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java b/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java index 0d920027..8dee06bb 100644 --- a/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java +++ b/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java @@ -915,17 +915,6 @@ private void configureShmemTransport(DomainParticipantQos qos) { Property_t propertyValue = PropertyQosPolicyHelper.lookup_property(qos.property, "dds.transport.shmem.builtin.parent.message_size_max"); - // /* - // * If we specify -scan, then we are interested in the highest size. - // * Since the vector for scan is sorted, that number should be the last - // * element. - // */ - // if (_PM->is_set("scan")) { - // const std::vector scanList = - // _PM->get_vector("scan"); - // datalen = scanList[scanList.size() - 1]; - // } - long parentMsgSizeMax = minimumMessageSizeMax; boolean messageSizeMaxSet = false; diff --git a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java index e50bb1a4..4cd36f3c 100644 --- a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java +++ b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java @@ -113,7 +113,6 @@ public final class RTIDDSImpl implements IMessaging { private boolean _latencyTest = false; private boolean _isLargeData = false; private long _maxSynchronousSize = PerftestTransport.MESSAGE_SIZE_MAX_NOT_SET; - private boolean _isScan = false; private boolean _isPublisher = false; private boolean _IsAsynchronous = false; private boolean _isDynamicData = false; @@ -369,7 +368,7 @@ public boolean data_size_related_calculations() { } else { _batchSize = -2; } - } else if ((_batchSize < _dataLen * 2) && !_isScan) { + } else if ((_batchSize < _dataLen * 2)) { /* * We don't want to use batching if the batch size is not large * enough to contain at least two samples (in this case we avoid the @@ -1392,38 +1391,10 @@ public String printConfiguration() { } private boolean parseConfig(int argc, String[] argv) { - long minScanSize = MAX_PERFTEST_SAMPLE_SIZE.VALUE; for (int i = 0; i < argc; ++i) { - if ("-scan".toLowerCase().startsWith(argv[i].toLowerCase())) { - _isScan = true; - /* - * Check if we have custom scan values. In such case we are just - * interested in the minimum one. - */ - if ((i != (argc - 1)) && !argv[1+i].startsWith("-")) { - ++i; - long auxScan = 0; - StringTokenizer st = new StringTokenizer(argv[i], ":", true); - while (st.hasMoreTokens()) { - String s = st.nextToken(); - if (!s.equals(":")) { - auxScan = Long.parseLong(s); - if (auxScan < minScanSize) { - minScanSize = auxScan; - } - } - } - /* - * If we do not specify any custom value for the -scan, we would - * set minScanSize to the minimum size in the default set for -scan. - */ - } else { - minScanSize = 32; - } - } - else if ("-pub".toLowerCase().startsWith(argv[i].toLowerCase())) { + if ("-pub".toLowerCase().startsWith(argv[i].toLowerCase())) { _isPublisher = true; } else if ("-dynamicData".toLowerCase().startsWith(argv[i].toLowerCase())) { @@ -1872,12 +1843,7 @@ else if ("-noPositiveAcks".toLowerCase().startsWith(argv[i].toLowerCase())) { } } - /* If we are using scan, we get the minimum and set it in Datalen */ - if (_isScan) { - _dataLen = minScanSize; - } - - /* Check if we need to enable Large Data. This works also for -scan */ + /* Check if we need to enable Large Data. */ if (_dataLen > MAX_BOUNDED_SEQ_SIZE.VALUE) { _isLargeData = true; if (_useUnbounded == 0) { diff --git a/srcJava/com/rti/perftest/harness/AnnouncementListener.java b/srcJava/com/rti/perftest/harness/AnnouncementListener.java index e1f4614b..ccaa94e7 100644 --- a/srcJava/com/rti/perftest/harness/AnnouncementListener.java +++ b/srcJava/com/rti/perftest/harness/AnnouncementListener.java @@ -39,8 +39,7 @@ public void processMessage(TestMessage message) { /* * The subscriber_list vector contains the list of discovered subscribers. * - * - If the message.size is INITIALIZE or LENGTH_CHANGED and the - * subscriber is not in the list, it will be added. + * - If the message.size is INITIALIZE_SIZE, it will be added. * - If the message.size is FINISHED_SIZE and the * subscriber is in the list, it will be removed. * @@ -49,8 +48,7 @@ public void processMessage(TestMessage message) { * being changed. * - If all the subscribers are notified that the test has finished. */ - if ((message.size == PerfTest.INITIALIZE_SIZE - || message.size == PerfTest.LENGTH_CHANGED_SIZE) + if ((message.size == PerfTest.INITIALIZE_SIZE) && !subscriber_list.contains(message.entity_id)) { subscriber_list.add(message.entity_id); } else if (message.size == PerfTest.FINISHED_SIZE) { diff --git a/srcJava/com/rti/perftest/harness/LatencyListener.java b/srcJava/com/rti/perftest/harness/LatencyListener.java index 8de9a83f..027065bb 100644 --- a/srcJava/com/rti/perftest/harness/LatencyListener.java +++ b/srcJava/com/rti/perftest/harness/LatencyListener.java @@ -89,6 +89,7 @@ public void processMessage(TestMessage message) { long now = PerfTest.getTimeUsec(); // may be negative! switch (message.size) { + // Initializing message, don't process case PerfTest.INITIALIZE_SIZE: return; @@ -97,11 +98,6 @@ public void processMessage(TestMessage message) { case PerfTest.FINISHED_SIZE: return; - // Data length is changing size - case PerfTest.LENGTH_CHANGED_SIZE: - print_summary_latency(); - return; - default: break; } diff --git a/srcJava/com/rti/perftest/harness/PerfTest.java b/srcJava/com/rti/perftest/harness/PerfTest.java index dc84c45c..0bc2fcaf 100644 --- a/srcJava/com/rti/perftest/harness/PerfTest.java +++ b/srcJava/com/rti/perftest/harness/PerfTest.java @@ -70,10 +70,7 @@ public final class PerfTest { /*package*/ static final int INITIALIZE_SIZE = 1234; // Flag used to indicate end of test - /*package*/ static final int FINISHED_SIZE = 1235; - - // Flag used to indicate end of test - public static final int LENGTH_CHANGED_SIZE = 1236; + public static final int FINISHED_SIZE = 1235; // Value used to compare against to check if the latency_min has // been reset. @@ -100,8 +97,6 @@ public final class PerfTest { private long _dataLen = 100; private long _numIter = 100000000; private boolean _isPub = false; - private boolean _isScan = false; - private ArrayList _scanDataLenSizes = new ArrayList(); private boolean _useReadThread = false; private long _spinLoopCount = 0; private long _sleepNanosec = 0; @@ -123,24 +118,7 @@ public final class PerfTest { private PerftestTimerTask timertask = new PerftestTimerTask(this); /* Indicates when the test should exit due to timeout */ private boolean testCompleted = false; - private boolean testCompletedScan = true; - - // Set the default values into the array _scanDataLenSizes vector - public void set_default_scan_values(){ - _scanDataLenSizes.add((long)32); - _scanDataLenSizes.add((long)64); - _scanDataLenSizes.add((long)128); - _scanDataLenSizes.add((long)256); - _scanDataLenSizes.add((long)512); - _scanDataLenSizes.add((long)1024); - _scanDataLenSizes.add((long)2048); - _scanDataLenSizes.add((long)4096); - _scanDataLenSizes.add((long)8192); - _scanDataLenSizes.add((long)16384); - _scanDataLenSizes.add((long)32768); - _scanDataLenSizes.add((long)64900); - } // ----------------------------------------------------------------------- // Public Methods // ----------------------------------------------------------------------- @@ -161,10 +139,6 @@ public void finishTest() { testCompleted = true; } - public void finishTestScan() { - testCompletedScan = true; - } - static public int getMaxPerftestSampleSizeJava(){ if (MAX_PERFTEST_SAMPLE_SIZE.VALUE > 2147483642){ return 2147483642; //max value for a buffer in Java @@ -326,13 +300,6 @@ private boolean parseConfig(String[] argv) { "\t default 1\n" + "\t-numPublishers - Number of publishers running in test,\n"+ "\t default 1\n" + - "\t-scan ::...: - (Deprecated). Run test in scan mode, traversing\n" + - "\t a range of sample data sizes from\n" + - "\t [32,63000] or [63001,2147482620] bytes,\n" + - "\t in the case that you are using large data or not.\n" + - "\t The list of sizes is optional.\n" + - "\t Default values are '32:64:128:256:512:1024:2048:4096:8192:16384:32768:64900'\n" + - "\t Default: Not set\n" + "\t-noPrintIntervals - Don't print statistics at intervals during\n" + "\t test\n" + "\t-useReadThread - Use separate thread instead of callback to\n"+ @@ -544,40 +511,6 @@ else if ("-numPublishers".toLowerCase().startsWith(argv[i].toLowerCase())) return false; } } - else if ("-scan".toLowerCase().startsWith(argv[i].toLowerCase())) - { - _isScan = true; - _messagingArgv[_messagingArgc++] = argv[i]; - if ((i != (argc - 1)) && !argv[1+i].startsWith("-")) { - ++i; - _messagingArgv[_messagingArgc++] = argv[i]; - StringTokenizer st = new StringTokenizer(argv[i], ":", true); - while (st.hasMoreTokens()) { - String s = st.nextToken(); - if (!s.equals(":")) { - _scanDataLenSizes.add(Long.parseLong(s)); - } - } - if (_scanDataLenSizes.size() < 2) { - System.err.print("'-scan ::...:' the number of size should be equal or greater then two.\n"); - return false; - } - Collections.sort(_scanDataLenSizes); - if (_scanDataLenSizes.get(0) < OVERHEAD_BYTES) { - System.err.println("-scan sizes must be >= " + - OVERHEAD_BYTES); - return false; - } - if (_scanDataLenSizes.get(_scanDataLenSizes.size() - 1) > - MAX_PERFTEST_SAMPLE_SIZE.VALUE) { - System.err.println("-scan sizes must be <= " + - MAX_PERFTEST_SAMPLE_SIZE.VALUE); - return false; - } - } else { - set_default_scan_values(); - } - } else if ("-noPrintIntervals".toLowerCase().startsWith(argv[i].toLowerCase())) { printIntervals = false; @@ -772,7 +705,7 @@ else if ("-outputFormat".toLowerCase().startsWith(argv[i].toLowerCase())) } //manage the parameter: -pubRate -sleep -spin - if (_isPub && _pubRate >0) { + if (_isPub && _pubRate > 0) { if (_spinLoopCount > 0) { System.err.printf( "'-spin' is not compatible with -pubRate. " + "Spin/Sleep value will be set by -pubRate."); @@ -785,24 +718,6 @@ else if ("-outputFormat".toLowerCase().startsWith(argv[i].toLowerCase())) } } - if (_isScan) { - _dataLen = _scanDataLenSizes.get(_scanDataLenSizes.size() - 1); // Max size - if (_executionTime == 0){ - _executionTime = 60; - } - // Check if large data or small data - if (_scanDataLenSizes.get(0) < MAX_BOUNDED_SEQ_SIZE.VALUE - && _scanDataLenSizes.get(_scanDataLenSizes.size() - 1) > MAX_BOUNDED_SEQ_SIZE.VALUE) { - System.err.printf("The sizes of -scan ["); - for (int i = 0; i < _scanDataLenSizes.size(); i++) { - System.err.printf(_scanDataLenSizes.get(i) + " "); - } - System.err.printf("] should be either all smaller or all bigger than " + - MAX_BOUNDED_SEQ_SIZE.VALUE + "\n"); - return false; - } - } - return true; } @@ -857,21 +772,10 @@ private void printConfiguration() { sb.append(_latencyCount); sb.append("\n"); - // Scan/Data Sizes + // Data Size sb.append("\tData Size: "); - if (_isScan) { - for (int i = 0; i < _scanDataLenSizes.size(); i++ ) { - sb.append(_scanDataLenSizes.get(i)); - if (i == _scanDataLenSizes.size() - 1) { - sb.append("\n"); - } else { - sb.append(", "); - } - } - } else { - sb.append(_dataLen); - sb.append("\n"); - } + sb.append(_dataLen); + sb.append("\n"); // Batching int batchSize = _messagingImpl.getBatchSize(); @@ -1000,7 +904,7 @@ public void run() { TestMessage announcement_msg = new TestMessage(); announcement_msg.entity_id = subID; - announcement_msg.data = new byte[LENGTH_CHANGED_SIZE]; + announcement_msg.data = new byte[FINISHED_SIZE]; announcement_msg.size = INITIALIZE_SIZE; // Send announcement message @@ -1032,13 +936,6 @@ public void run() { sleep(1000); now = getTimeUsec(); - if (reader_listener.change_size) { // ACK change_size - announcement_msg.entity_id = subID; - announcement_msg.size = LENGTH_CHANGED_SIZE; - announcement_writer.send(announcement_msg, false); - announcement_writer.flush(); - reader_listener.change_size = false; - } if (reader_listener.end_test) { announcement_msg.entity_id = subID; announcement_msg.size = FINISHED_SIZE; @@ -1228,7 +1125,7 @@ public void run() { // Allocate data and set size TestMessage message = new TestMessage(); message.entity_id = pubID; - message.data = new byte[Math.max((int)_dataLen,LENGTH_CHANGED_SIZE)]; + message.data = new byte[Math.max((int)_dataLen,FINISHED_SIZE)]; message.size = INITIALIZE_SIZE; @@ -1275,7 +1172,6 @@ public void run() { sleep(1000); int num_pings = 0; - int scan_count = 0; int pingID = -1; int current_index_in_batch = 0; int ping_index_in_batch = 0; @@ -1294,15 +1190,10 @@ public void run() { pubRate_sample_period = _pubRate / 100; } - if (_executionTime > 0 && !_isScan) { - timertask.setTimeout(_executionTime, _isScan); - } - /******************** * Main sending loop */ - for (long loop=0; ((_isScan) || (loop < _numIter)) && - (!testCompleted) ; ++loop ) { + for (long loop=0; (loop < _numIter) && (!testCompleted) ; ++loop ) { /* This if has been included to perform the control loop that modifies the publication rate according to -pubRate */ @@ -1368,55 +1259,6 @@ public void run() { */ if ( current_index_in_batch == ping_index_in_batch && !sentPing ) { - // If running in scan mode, dataLen under test is changed - // after _executionTime - if (_isScan && testCompletedScan) { - testCompletedScan = false; - timertask = new PerftestTimerTask(this); - timertask.setTimeout(_executionTime, _isScan); - - // flush anything that was previously sent - writer.flush(); - writer.waitForAck( - timeout_wait_for_ack_sec, - timeout_wait_for_ack_nsec); - - if (scan_count == _scanDataLenSizes.size()) { - break; // End of scan test - } - - message.size = LENGTH_CHANGED_SIZE; - // must set latency_ping so that a subscriber sends us - // back the LENGTH_CHANGED_SIZE message - message.latency_ping = num_pings % _numSubscribers; - - /* - * If the Throughput topic is reliable, we can send the packet and do - * a wait for acknowledgements. However, if the Throughput topic is - * Best Effort, waitForAck() will return inmediately. - * This would cause that the Send() would be exercised too many times, - * in some cases causing the network to be flooded, a lot of packets being - * lost, and potentially CPU starbation for other processes. - * We can prevent this by adding a small sleep() if the test is best - * effort. - */ - - announcement_reader_listener.subscriber_list.clear(); - while (announcement_reader_listener.subscriber_list.size() - < _numSubscribers) { - writer.send(message, true); - writer.waitForAck( - timeout_wait_for_ack_sec, - timeout_wait_for_ack_nsec); - } - - message.size = (int)(_scanDataLenSizes.get(scan_count++) - OVERHEAD_BYTES); - /* Reset _SamplePerBatch */ - samplesPerBatch = getSamplesPerBatch(); - ping_index_in_batch = 0; - current_index_in_batch = 0; - } - // Each time ask a different subscriber to echo back pingID = num_pings % _numSubscribers; long now = getTimeUsec(); // may be negative! diff --git a/srcJava/com/rti/perftest/harness/PerftestTimerTask.java b/srcJava/com/rti/perftest/harness/PerftestTimerTask.java index 342f1102..9c8c1448 100644 --- a/srcJava/com/rti/perftest/harness/PerftestTimerTask.java +++ b/srcJava/com/rti/perftest/harness/PerftestTimerTask.java @@ -14,32 +14,22 @@ public class PerftestTimerTask extends TimerTask { private PerfTest perftest; private Timer timer; - private boolean _isScan; public PerftestTimerTask(PerfTest _perftest) { // this way we can modify testCompleted in perftest perftest = _perftest; // running timer task as daemon thread (true) timer = new Timer(true); - _isScan = false; } @Override public void run() { - if (!_isScan) { - perftest.finishTest(); - } else { - perftest.finishTestScan(); - } + perftest.finishTest(); } - public void setTimeout(long executionTime, boolean isScan) { + public void setTimeout(long executionTime) { timer.schedule(this, executionTime * 1000); - _isScan = isScan; - if (!_isScan) { - System.err.println("Setting timeout to " - + executionTime + " seconds."); - } + System.err.println("Setting timeout to " + executionTime + " seconds."); } public void cancelTimer() { diff --git a/srcJava/com/rti/perftest/harness/ThroughputListener.java b/srcJava/com/rti/perftest/harness/ThroughputListener.java index 2fa1185b..ed00b99a 100644 --- a/srcJava/com/rti/perftest/harness/ThroughputListener.java +++ b/srcJava/com/rti/perftest/harness/ThroughputListener.java @@ -38,7 +38,6 @@ public long intervalTime = 0; public double missingPacketsPercent = 0.0; public CpuMonitor CpuMonitor = new CpuMonitor(); - public boolean change_size = false; // ----------------------------------------------------------------------- // Private Fields @@ -152,14 +151,6 @@ public void processMessage(TestMessage message) { } } - // reset internals - if (message.size == PerfTest.LENGTH_CHANGED_SIZE) { - print_summary_throughput(message); - change_size = true; - return; - } - - // case where not running a scan if (message.size != lastDataLength) { packetsReceived = 0; bytesReceived = 0; @@ -262,8 +253,6 @@ public void print_summary_throughput(TestMessage message, boolean endTest) { packetsReceived = 0; bytesReceived = 0; missingPackets = 0; - // length changed only used in scan mode in which case - // there is only 1 publisher with ID 0 _last_seq_num[0] = 0; _beginTime = now; } From 9abc5126180101c2820dcd3fdabf7ca8ba7d344f Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 31 Mar 2024 11:26:21 +0000 Subject: [PATCH 12/49] Add documentation changes --- srcDoc/command_line_parameters.rst | 26 +------------------------- srcDoc/execution.rst | 10 ++-------- srcDoc/old_release_notes.rst | 1 - srcDoc/release_notes.rst | 6 +++++- 4 files changed, 8 insertions(+), 35 deletions(-) diff --git a/srcDoc/command_line_parameters.rst b/srcDoc/command_line_parameters.rst index 7f864d33..fefa4da4 100644 --- a/srcDoc/command_line_parameters.rst +++ b/srcDoc/command_line_parameters.rst @@ -73,8 +73,6 @@ Test Parameters for Publishing and Subscribing Applications given by the ``MICRO_UNBOUNDED_SEQUENCE_SIZE`` constant, which can be modified in the ``build.bat`` and ``build.sh`` scripts. - If ``-scan`` is specified, this value is ignored. - - ``-verbosity`` Run with different levels of verbosity for *Connext DDS*. @@ -826,8 +824,7 @@ Test Parameters only for Publishing Applications - ``-numIter `` Number of samples to send. See :ref:`Number of Iterations vs. Latency Count` and - :ref:`Warming Up`. If you set ``scan`` = ``true``, you cannot set this option - (see ``-scan``). + :ref:`Warming Up`. | **Default:** ``100000000`` for throughput tests or ``10000000`` for latency tests (when ``-latencyTest`` is specified); @@ -882,27 +879,6 @@ Test Parameters only for Publishing Applications | **Default method:** ``spin`` | **Values method:** ``spin or sleep`` -- ``-scan ::...:`` - - .. note:: - - This command-line option is deprecated and will not be available in future versions - of *RTI Perftest*. - - Run test in scan mode. The list of sizes is optional and can be either in the - [32,64900] range or in the [64970,2147482620] range (Large Data cannot be tested - in the same scan test as small data sizes). Default values to test with are - '32:64:128:256:512:1024:2048:4096:8192:16384:32768:64900'. - - The ``-executionTime`` parameter is applied for every size of the scan. - If ``-executionTime`` is not set, a timeout of 60 seconds will be applied. - - **Default:** ``false`` (no scan) - - .. note:: - - Not available in the C# API implementation. - - ``-sendQueueSize `` Size of the send queue. diff --git a/srcDoc/execution.rst b/srcDoc/execution.rst index 8d5a3adb..34cf2a51 100644 --- a/srcDoc/execution.rst +++ b/srcDoc/execution.rst @@ -209,7 +209,7 @@ test. .. code-block:: console - > perftest_cpp -pub -noPrint -domain 27 -latencyCount 100000 -scan 32:64:256:1024:8192:32768:63000 -exec 30 -nic lo0 + > perftest_cpp -pub -noPrint -domain 27 -latencyCount 100000 -datalen 32 -exec 30 -nic lo0 RTI Perftest 2.3.2 (RTI Connext DDS 5.3.0) Mode: THROUGHPUT TEST @@ -220,7 +220,7 @@ test. Keyed: No Publisher ID: 0 Latency count: 1 latency sample every 100000 samples - Data Size: 32, 64, 256, 1024, 8192, 32768, 63000 + Data Size: 32 Batching: 8192 Bytes (Use "-batchSize 0" to disable batching) Publication Rate: Unlimited (Not set) Execution time: 30 seconds @@ -239,12 +239,6 @@ test. Sending 50 initialization pings ... Publishing data ... Length: 32 Latency: Ave 100 us Std 202.5 us Min 62 us Max 5543 us 50% 88 us 90% 107 us 99% 180 us 99.99% 5543 us 99.9999% 5543 us - Length: 64 Latency: Ave 70 us Std 53.7 us Min 45 us Max 1076 us 50% 63 us 90% 84 us 99% 142 us 99.99% 1076 us 99.9999% 1076 us - Length: 256 Latency: Ave 45 us Std 12.0 us Min 32 us Max 106 us 50% 41 us 90% 69 us 99% 78 us 99.99% 106 us 99.9999% 106 us - Length: 1024 Latency: Ave 28 us Std 4.5 us Min 25 us Max 68 us 50% 27 us 90% 31 us 99% 52 us 99.99% 68 us 99.9999% 68 us - Length: 8192 Latency: Ave 33 us Std 12.6 us Min 28 us Max 86 us 50% 29 us 90% 34 us 99% 86 us 99.99% 86 us 99.9999% 86 us - Length: 32768 Latency: Ave 46 us Std 32.9 us Min 35 us Max 172 us 50% 36 us 90% 53 us 99% 172 us 99.99% 172 us 99.9999% 172 us - Length: 63000 Latency: Ave 57 us Std 25.2 us Min 45 us Max 136 us 50% 48 us 90% 55 us 99% 136 us 99.99% 136 us 99.9999% 136 us Finishing test... Test ended. diff --git a/srcDoc/old_release_notes.rst b/srcDoc/old_release_notes.rst index 9f46f9e0..cbdd993b 100644 --- a/srcDoc/old_release_notes.rst +++ b/srcDoc/old_release_notes.rst @@ -699,7 +699,6 @@ The Raw Transport feature allows the following configurations: - `Multicast` (only for UDPv4) - `One-to-many communication` (Pub -> Sub) - `Latency Test` / `Throughput Test` -- `Scan` Some of the command-line parameters that exist for DDS are not supported if ``-rawTransport`` is used. diff --git a/srcDoc/release_notes.rst b/srcDoc/release_notes.rst index f297c1b4..6fe7886f 100644 --- a/srcDoc/release_notes.rst +++ b/srcDoc/release_notes.rst @@ -9,7 +9,11 @@ Release Notes develop What's New in develop ~~~~~~~~~~~~~~~~~~~~~ -<- Nothing new yet -> +``-scan`` option is now deprecated +++++++++++++++++++++++++++++++++++ + +The ``-scan`` command-line option was previously available in the *Traditional C++*, +*Modern C++*, and *Java API*, it was deprecated in 4.0 and now it has been removed. What's Fixed in develop ~~~~~~~~~~~~~~~~~~~~~~~ From 97e6427ec13e3fdd52fc9c0569d0cf8856213e31 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Sun, 31 Mar 2024 14:30:11 +0000 Subject: [PATCH 13/49] Remove deprecated -scan option --- srcDoc/release_notes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcDoc/release_notes.rst b/srcDoc/release_notes.rst index 2cd60a2e..fbe34909 100644 --- a/srcDoc/release_notes.rst +++ b/srcDoc/release_notes.rst @@ -19,8 +19,8 @@ confusion and scenarios difficult to understand. This behavior has been modified and now using `-pubRate` will disable batching by default. However if explicitly set via command line, batching will still be enabled. -``-scan`` option is now deprecated -++++++++++++++++++++++++++++++++++ +``-scan`` option is now removed ++++++++++++++++++++++++++++++++ The ``-scan`` command-line option was previously available in the *Traditional C++*, *Modern C++*, and *Java API*, it was deprecated in 4.0 and now it has been removed. From 3899654992331dd0f4b0d380aab0e87569451360 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Mon, 1 Apr 2024 12:14:49 +0000 Subject: [PATCH 14/49] CR feedback --- srcJava/com/rti/perftest/harness/PerfTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/srcJava/com/rti/perftest/harness/PerfTest.java b/srcJava/com/rti/perftest/harness/PerfTest.java index 069b6f94..e9e78e27 100644 --- a/srcJava/com/rti/perftest/harness/PerfTest.java +++ b/srcJava/com/rti/perftest/harness/PerfTest.java @@ -910,6 +910,13 @@ public void run() { TestMessage announcement_msg = new TestMessage(); announcement_msg.entity_id = subID; + // Announcement message that will be used by the announcement_writer + // to send information to the Publisher. This message size will indicate + // different things. + // + // We will use 2 sizes: INITIALIZE_SIZE and FINISHED_SIZE, + // msg.data will be used as the payload of such messages, so we choose the + // greatest size. announcement_msg.data = new byte[FINISHED_SIZE]; announcement_msg.size = INITIALIZE_SIZE; From 85585bd156f8e5067982c312a58632fadc6c173e Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Mon, 1 Apr 2024 12:18:13 +0000 Subject: [PATCH 15/49] CR feedback --- srcCs/Harness/LatencyListener.cs | 8 -------- srcDoc/old_release_notes.rst | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/srcCs/Harness/LatencyListener.cs b/srcCs/Harness/LatencyListener.cs index de003128..8354440b 100644 --- a/srcCs/Harness/LatencyListener.cs +++ b/srcCs/Harness/LatencyListener.cs @@ -72,14 +72,6 @@ public void ProcessMessage(TestMessage message) { return; } - else if (message.Size == Perftest.LENGTH_CHANGED_SIZE) - { - Console.Error.WriteLine( - "[Error]: Received command to change size," - + "this is not supported in C#"); - PrintSummaryLatency(); - return; - } sec = message.timestampSec; usec = message.timestampUsec; diff --git a/srcDoc/old_release_notes.rst b/srcDoc/old_release_notes.rst index cbdd993b..9f46f9e0 100644 --- a/srcDoc/old_release_notes.rst +++ b/srcDoc/old_release_notes.rst @@ -699,6 +699,7 @@ The Raw Transport feature allows the following configurations: - `Multicast` (only for UDPv4) - `One-to-many communication` (Pub -> Sub) - `Latency Test` / `Throughput Test` +- `Scan` Some of the command-line parameters that exist for DDS are not supported if ``-rawTransport`` is used. From 4e58c66ee037b79503ef1c53f217febe89ae2d8b Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Fri, 26 Apr 2024 11:10:57 +0000 Subject: [PATCH 16/49] Add changes to qos profile --- perftest_qos_profiles.xml | 1309 ++++++++++++++----------------------- 1 file changed, 480 insertions(+), 829 deletions(-) diff --git a/perftest_qos_profiles.xml b/perftest_qos_profiles.xml index a002133b..a355a711 100644 --- a/perftest_qos_profiles.xml +++ b/perftest_qos_profiles.xml @@ -1,85 +1,81 @@ - - + xsi:noNamespaceSchemaLocation="https://community.rti.com/schema/7.3.0/rti_dds_profiles.xsd"> - - - - - + - - - - - - - - - - 2048 + + + + + TOPIC_PRESENTATION_QOS + true + + - - 4096 + + + @@ -89,121 +85,87 @@ _KeepDurationUsec variable name corresponds to the command-line option -keepDura --> 512 + - + - + + - - - - dds.participant.property_validation_action - 1 - - - - dds.transport.UDPv4.builtin.parent.message_size_max - 65536 + dds.transport.TCPv4.tcp1.library + nddstransporttcp - dds.transport.UDPv4.builtin.send_socket_buffer_size - 1048576 + dds.transport.TCPv4.tcp1.create_function + NDDS_Transport_TCPv4_create - dds.transport.UDPv4.builtin.recv_socket_buffer_size - 2097152 + dds.transport.TCPv4.tcp1.disable_nagle + 1 + + + + - + + + - dds.transport.shmem.builtin.received_message_count_max - 128 + dds.transport.UDPv4.builtin.send_socket_buffer_size + 1048576 - dds.transport.shmem.builtin.receive_buffer_size + dds.transport.UDPv4.builtin.recv_socket_buffer_size 2097152 - --> - - - dds.transport.TCPv4.tcp1.library - nddstransporttcp + dds.flow_controller.token_bucket.1Gbps.token_bucket.tokens_added_per_period + 20 - dds.transport.TCPv4.tcp1.create_function - NDDS_Transport_TCPv4_create + dds.flow_controller.token_bucket.1Gbps.token_bucket.bytes_per_token + 65536 - dds.transport.TCPv4.tcp1.disable_nagle - 1 + dds.flow_controller.token_bucket.1Gbps.token_bucket.period.sec + 0 - dds.transport.TCPv4.tcp1.parent.message_size_max - 65536 + dds.flow_controller.token_bucket.1Gbps.token_bucket.period.nanosec + 10000000 + + + + - + + + + dds.flow_controller.token_bucket.10Gbps.token_bucket.max_tokens 300 @@ -224,355 +186,95 @@ _KeepDurationUsec variable name corresponds to the command-line option -keepDura dds.flow_controller.token_bucket.10Gbps.token_bucket.period.nanosec 10000000 - - - - dds.flow_controller.token_bucket.1Gbps.token_bucket.max_tokens - 30 - - - dds.flow_controller.token_bucket.1Gbps.token_bucket.tokens_added_per_period - 20 - - - dds.flow_controller.token_bucket.1Gbps.token_bucket.bytes_per_token - 65536 - - - dds.flow_controller.token_bucket.1Gbps.token_bucket.period.sec - 0 - - - dds.flow_controller.token_bucket.1Gbps.token_bucket.period.nanosec - 10000000 - - - - - com.rti.serv.secure.cryptography.encryption_algorithm - aes-128-gcm - - - - - - PerfTest Participant - - + - - - - - Ordered Access: Specifies support for ordered access to the samples - received at the subscription end. - --> - TOPIC_PRESENTATION_QOS - true - - + - The base configuration of the Subscriber object. + - - - - Ordered Access: Specifies support for ordered access to the samples - received at the subscription end. - --> - TOPIC_PRESENTATION_QOS - true - - + - The base configuration of the DataWriter object that produces throughput - data (the -pub side of the application). + - - - - See Section 2.2 "Data Types, Topics, Keys, Instances, and Samples" - in the Connext Core Libraries and Utilities User's Manual - for more information about keys and instances. + + + DURATION_ZERO_SEC + 10000000 + - Important: These settings are configured automatically within the - source code. The default value of _InstanceCount is 1. The default - value of _InstanceHashBuckets is -1. + + + DURATION_ZERO_SEC + 1000000 + - _InstanceCount - _InstanceCount + + + DURATION_ZERO_SEC + 10000000 + - if _InstanceCount is greater than 1 - if _InstanceHashBuckets is greater than 0 - _InstanceHashBuckets - - if _InstanceHashBuckets is equal or lower than 0 - _InstanceCount - - --> - - - - - - - DURATION_ZERO_SEC - 100000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 256 - - - - KEEP_ALL_HISTORY_QOS - - - - RELIABLE_RELIABILITY_QOS - - DURATION_INFINITE_SEC - DURATION_INFINITE_NSEC - - - - - - - - - - - - - - - - - - - - DURATION_ZERO_SEC - 10000000 - - - - - DURATION_ZERO_SEC - 1000000 - - - - - DURATION_ZERO_SEC - 10000000 - - - - LENGTH_UNLIMITED + + LENGTH_UNLIMITED + + DURATION_ZERO_SEC + 100000 + + + + + + + + + + + DURATION_ZERO_SEC + DURATION_ZERO_NSEC + + + DURATION_ZERO_SEC + DURATION_ZERO_NSEC + + + + + + + + PerftestQosLibrary::Perftest.ReliableSettings + + + + + + + + + + + + + 10000 + 128 + + + 10000 + + + + + 10000 + + + 65536 + + + + + false @@ -693,411 +520,235 @@ _KeepDurationUsec variable name corresponds to the command-line option -keepDura --> false + + - - false - + + + PerftestQosLibrary::Perftest.ReliableSettings + + + + + 10 + 100 + 1000 + LENGTH_UNLIMITED + LENGTH_UNLIMITED + + - + + + + + DURATION_ZERO_SEC + DURATION_ZERO_NSEC + + + + - - + - - - KEEP_ALL_HISTORY_QOS - - - - - RELIABLE_RELIABILITY_QOS - + + + LENGTH_UNLIMITED + 100 + LENGTH_UNLIMITED + + + - - - 10000 - 128 - - - 10000 + 100 + 100 + 100 - - 10000 - - - 65536 + 100 + + - - + + + + - - DURATION_ZERO_SEC - DURATION_ZERO_NSEC - - - DURATION_ZERO_SEC - DURATION_ZERO_NSEC - - - - - - + + com.rti.serv.secure.cryptography.encryption_algorithm + aes-128-gcm + + + - - - + + - - - - - - - KEEP_ALL_HISTORY_QOS - - - - - RELIABLE_RELIABILITY_QOS - - DURATION_INFINITE_SEC - DURATION_INFINITE_NSEC - - + - + PerftestQosLibrary::Presentation.TopicPresentation - The Durability QoS policy specifies whether or not Connext will store and - deliver previously published data samples to new DataReaders that join the - network later. + + PerftestQosLibrary::Perftest.Transport.UDPv4.IncreaseSendReceiveBuffers + PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration - Important: durability.kind and durability.direct_communication are configured - automatically within the source code. To modify them, use the input commands - -durability and -noDirectCommunication. + + PerftestQosLibrary::Perftest.IncreaseResourceLimits - The default value of _DirectCommunication is true. - The default value of _Durability is DDS_VOLATILE_DURABILITY_QOS + + PerftestQosLibrary::Perftest.FlowController.1Gbps + PerftestQosLibrary::Perftest.FlowController.10Gbps - if _DirectCommunication is false - if _Durability is DDS_TRANSIENT_DURABILITY_QOS or DDS_PERSISTENT_DURABILITY_QOS - - _Durability - _DirectCommunication - - --> + + PerftestQosLibrary::Perftest.Security + - - - LENGTH_UNLIMITED - 100 - LENGTH_UNLIMITED - + + + Perftest Participant + - - - 10 - 100 - 1000 - - DURATION_ZERO_SEC - 10000000 - - - DURATION_ZERO_SEC - 1000000 - - - DURATION_ZERO_SEC - 10000000 - - LENGTH_UNLIMITED - - DURATION_ZERO_SEC - DURATION_ZERO_NSEC - - - DURATION_ZERO_SEC - DURATION_ZERO_NSEC - - LENGTH_UNLIMITED - LENGTH_UNLIMITED - - + + + + dds.participant.property_validation_action + 1 + + + + + - - false - + + + + PerftestQosLibrary::Reliability.StrictReliable + PerftestQosLibrary::Perftest.Throughput.ReliableSettings + PerftestQosLibrary::Perftest.Throughput.BatchingConfig + PerftestQosLibrary::Perftest.Throughput.ResourceLimits + + + + + 256 + + - + - The base configuration of the DataReader object that consumes latency - data (on the -pub side of the application). + + PerftestQosLibrary::Reliability.StrictReliable + PerftestQosLibrary::Perftest.Latency.ReliableSettings + PerftestQosLibrary::Perftest.Latency.ResourceLimits + - This element corresponds to the DataReaderQos type, which is described - in detail in the API Reference HTML documentation. Each child element - corresponds to a field in that structure with the same name. Any - parameter not listed here will pick up the documented default value. - --> - - - RELIABLE_RELIABILITY_QOS - - - - - - - 100 - 100 - 100 - - - - 100 - - - - - - - DURATION_ZERO_SEC - DURATION_ZERO_NSEC - - - DURATION_ZERO_SEC - DURATION_ZERO_NSEC - - - DURATION_ZERO_SEC - DURATION_ZERO_NSEC - - - + + KEEP_LAST_HISTORY_QOS + - - - - + - + + BuiltinQosSnippetLib::QosPolicy.Durability.TransientLocal + - - - RELIABLE_RELIABILITY_QOS - - DURATION_INFINITE_SEC - DURATION_INFINITE_NSEC - - + - - KEEP_ALL_HISTORY_QOS - - - DDS_TRANSIENT_LOCAL_DURABILITY_QOS - - + + - + + + PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration + + PerftestQosLibrary::Perftest.FlowController.1Gbps + PerftestQosLibrary::Perftest.FlowController.10Gbps + - - - RELIABLE_RELIABILITY_QOS - - DURATION_INFINITE_SEC - DURATION_INFINITE_NSEC - - + + + Perftest Participant + - - KEEP_ALL_HISTORY_QOS - - - DDS_TRANSIENT_LOCAL_DURABILITY_QOS - - + + + + + dds.participant.property_validation_action + 1 + + + + + + + + + PerftestQosLibrary::Perftest.Throughput.BatchingConfig + + + + + + + - + \ No newline at end of file From 55c8347e58bfcd9240d066be8fbff58918dea1a7 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Mon, 29 Apr 2024 10:21:10 +0000 Subject: [PATCH 17/49] Remove OOB settings (since we won't make this public for now) --- perftest_qos_profiles.xml | 46 --------------------------------------- 1 file changed, 46 deletions(-) diff --git a/perftest_qos_profiles.xml b/perftest_qos_profiles.xml index a355a711..ca01661c 100644 --- a/perftest_qos_profiles.xml +++ b/perftest_qos_profiles.xml @@ -704,51 +704,5 @@ and Utilities User's Manual in the chapter titled "Configuring QoS with XML." - - - - - - PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration - - PerftestQosLibrary::Perftest.FlowController.1Gbps - PerftestQosLibrary::Perftest.FlowController.10Gbps - - - - - Perftest Participant - - - - - - - dds.participant.property_validation_action - 1 - - - - - - - - - - PerftestQosLibrary::Perftest.Throughput.BatchingConfig - - - - - - - \ No newline at end of file From 0c368d42f36c882397345e2faeec1b6d3d4d5605 Mon Sep 17 00:00:00 2001 From: Alvaro Fernandez Date: Thu, 16 May 2024 07:45:18 -0700 Subject: [PATCH 18/49] Pull request #101: #fix PERFTEST-366: use DISC getWellKnownUnicastPort macro instead of PRES one Merge in PERF/rti-perftest from feature/PERFTEST-366 to develop Squashed commit of the following: commit 24fa091d087b993141221488b51d3fed62734296 Author: Alvaro Fernandez Date: Thu May 16 16:33:24 2024 +0200 PERFTEST-366: move disc include to header file commit d14d6dd73031487cef4d6d27d73f0e3e77a09439 Author: Alvaro Fernandez Date: Tue May 14 16:14:21 2024 +0200 PERFTEST-366: use DISC getWellKnownUnicastPort macro instead of PRES one --- srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx | 4 ++-- srcCpp/connextDDS/pro/RTIRawTransportImpl.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx b/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx index a2c568c2..f19e9114 100755 --- a/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx +++ b/srcCpp/connextDDS/pro/RTIRawTransportImpl.cxx @@ -773,7 +773,7 @@ unsigned int RTIRawTransportImpl::get_peer_unicast_port( struct DDS_RtpsWellKnownPorts_t wellKnownPorts = DDS_RTPS_WELL_KNOWN_PORTS_DEFAULT; - return PRESRtps_getWellKnownUnicastPort( + return DISCRtps_getWellKnownUnicastPort( _PM->get("domain"), /* domainId */ _PM->get("pub") ? subId + 1 : 0, /* participantId */ wellKnownPorts.port_base, @@ -808,7 +808,7 @@ RTIRawTransportImpl::get_receive_port(const char *topicName) * - The subscriber only use one port for receive data from Throughput * channel. */ - return PRESRtps_getWellKnownUnicastPort( + return DISCRtps_getWellKnownUnicastPort( _PM->get("domain"), /* domainId */ _PM->get("pub") ? 0 : sidValue + 1, /* participantId */ wellKnownPorts.port_base, diff --git a/srcCpp/connextDDS/pro/RTIRawTransportImpl.h b/srcCpp/connextDDS/pro/RTIRawTransportImpl.h index b84ffa94..61d48e28 100644 --- a/srcCpp/connextDDS/pro/RTIRawTransportImpl.h +++ b/srcCpp/connextDDS/pro/RTIRawTransportImpl.h @@ -17,6 +17,7 @@ #include "perftest_cpp.h" #include "transport/transport_socketutil.h" #include "transport/transport_udpv4.h" +#include "disc/disc_rtps.h" #include "perftestPlugin.h" From b63edb1e0234aa3f4f8628f49bc6c8e69c2e97a5 Mon Sep 17 00:00:00 2001 From: Marcos Rivera Date: Tue, 28 May 2024 12:39:17 -0700 Subject: [PATCH 19/49] Pull request #99: PERF-465: Add pipelines to build docs Merge in PERF/rti-perftest from feature/PERF-465 to develop Squashed commit of the following: commit 9b619e80b979f458bf2519fb8a044a7d52324cf4 Author: mrivera Date: Tue May 28 21:37:17 2024 +0200 PERF-465: Fix space commit 54621400ce1737cf3b167a929251d22623cdd025 Author: Marcos Rivera Date: Tue May 28 12:33:15 2024 -0700 Applied suggestion commit 71d75e850bb52ee98594ce609abdb23278f7382c Author: Marcos Rivera Date: Tue May 28 12:31:50 2024 -0700 Applied suggestion commit 959b4c5936c62b00fdfe978ee707cafb832d8ce7 Author: Marcos Rivera Date: Tue May 28 12:31:26 2024 -0700 Applied suggestion commit 2ba60325ee865ecdbf9428ee85d53f6808718c30 Author: Marcos Rivera Date: Tue May 28 12:31:07 2024 -0700 Applied suggestion commit 0d2b2d022328acb7d39ea2fe7070b63f8bbe8653 Author: Marcos Rivera Date: Tue May 28 12:30:48 2024 -0700 Applied suggestion commit 8c18843a48d5e9e975a449bdcdb8d440da83b98a Author: Marcos Rivera Date: Tue May 28 12:30:25 2024 -0700 Applied suggestion commit 17974b3cf3ad6eb94d4316141bcc31287ebe5a4d Author: Marcos Rivera Date: Tue May 28 12:29:56 2024 -0700 Applied suggestion commit 3a2e9864f27b55d6ae135009eae0360f153bef86 Author: Marcos Rivera Date: Tue May 28 12:29:41 2024 -0700 Applied suggestion commit 45675e66d8e4390b56876130a277b855b307e0e3 Author: Marcos Rivera Date: Tue May 28 12:29:10 2024 -0700 Applied suggestion commit cac550d736f327946e027af42f15202f318300b7 Merge: deec565 0c368d4 Author: mrivera Date: Tue May 28 21:27:41 2024 +0200 PERF-465: Fix conflicts commit deec5652330d6682634de307c81c93a75cd245ec Author: mrivera Date: Tue May 28 21:22:03 2024 +0200 PERF-465: Fix typo commit acc6e282f85bbfc133fe80402a5cddb7dafdb10c Author: mrivera Date: Tue May 28 21:11:31 2024 +0200 PERF-465: Remove slack message from CI commit 34b975655333d9ebf794700f8103314bdc3efd85 Author: mrivera Date: Tue May 28 20:33:30 2024 +0200 PERF-465: Restored timeout commit 69c8075c7fb2f984468a2a38800c2405153d4293 Merge: 3c981c4 9b0838a Author: mrivera Date: Tue May 28 20:08:52 2024 +0200 Merge branch 'feature/PERF-465' of https://bitbucket.rti.com/scm/perf/rti-perftest into feature/PERF-465 commit 3c981c412be1f86b6d515cc8bcba90dd570878c2 Author: mrivera Date: Tue May 28 20:08:14 2024 +0200 PERF-465: Reduced timeout commit 9b0838aa66607dcf45317f9b29f4ab70fcd02c2d Author: Marcos Rivera Date: Tue May 28 10:56:46 2024 -0700 Applied suggestion commit 3f5bde3a7d9aeeb55ef1ed4608239a34ba2002ce Author: Marcos Rivera Date: Tue May 28 10:50:32 2024 -0700 Applied suggestion commit 4a79554ee581ebbd69b2176698ebb1c70f0ba3ec Author: mrivera Date: Tue May 28 13:19:32 2024 +0200 PERF-465: Removed report variables commit 014aa8974f66f2ddc4816194614f6a59ea666298 Author: mrivera Date: Tue May 28 13:11:47 2024 +0200 PERF-465: Add notification ... and 35 more commits --- .gitignore | 1 + build.sh | 20 ++- resource/jenkins/ci/BuildDocumentation.groovy | 70 ++++++++++ .../UploadDocumentationToDocServer.groovy | 124 ++++++++++++++++++ srcDoc/requirements.txt | 5 + 5 files changed, 217 insertions(+), 3 deletions(-) create mode 100644 resource/jenkins/ci/BuildDocumentation.groovy create mode 100644 resource/jenkins/manual/UploadDocumentationToDocServer.groovy create mode 100644 srcDoc/requirements.txt diff --git a/.gitignore b/.gitignore index e97ef500..32fd25d1 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,4 @@ srcCs/NuGet.Config srcCs/README* srcCs/ConnextDDS/GeneratedCode/* srcDoc/output +.venv diff --git a/build.sh b/build.sh index 3fb9afa3..3ffc9662 100755 --- a/build.sh +++ b/build.sh @@ -1719,9 +1719,20 @@ function clean_documentation() rm -rf ${generate_doc_folder} } -function build_documentation() +function build_documentation() { + # Create virtual environment + echo "" + echo -e "${INFO_TAG} Creating virtual environment" + python3 -m venv .venv + source .venv/bin/activate + + # Upgrade pip and install requirements + echo -e "${INFO_TAG} Upgrading pip and installing requirements" + pip3 install --upgrade pip + pip3 install -r srcDoc/requirements.txt + # Generate HTML echo "" echo -e "${INFO_TAG} Generating HTML documentation" @@ -1731,8 +1742,8 @@ function build_documentation() if [ "$?" != 0 ]; then echo -e "${ERROR_TAG} Failure generating HTML documentation" echo -e "${ERROR_TAG} You will need to install: - sudo pip install -U sphinx - sudo pip install sphinx_rtd_theme" + srcDoc/requirements.txt" + deactivate exit -1 fi @@ -1748,12 +1759,15 @@ function build_documentation() sphinx-build -b pdf ${doc_folder} ${generate_doc_folder}/pdf if [ "$?" != 0 ]; then echo -e "${ERROR_TAG} Failure generating PDF documentation" + deactivate exit -1 fi echo -e "${INFO_TAG} PDF Generation successful. You will find it under: ${generate_doc_folder}/pdf" + # Deactivate virtual environment + deactivate } ################################################################################ diff --git a/resource/jenkins/ci/BuildDocumentation.groovy b/resource/jenkins/ci/BuildDocumentation.groovy new file mode 100644 index 00000000..d66b6d91 --- /dev/null +++ b/resource/jenkins/ci/BuildDocumentation.groovy @@ -0,0 +1,70 @@ +/* groovylint-disable NestedBlockDepth */ +/* (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +* No duplications, whole or partial, manual or electronic, may be made +* without express written permission. Any such copies, or revisions thereof, +* must display this notice unaltered. +* This code contains trade secrets of Real-Time Innovations, Inc. +*/ + +pipeline { + agent none + options { + disableConcurrentBuilds() + /* + To avoid excessive resource usage in server, we limit the number + of builds to keep in pull requests + */ + buildDiscarder( + logRotator( + artifactDaysToKeepStr: '', + artifactNumToKeepStr: '', + daysToKeepStr: '', + /* + For pull requests only keep the last 20 builds, for regular + branches keep up to 100 builds. + */ + numToKeepStr: env.CHANGE_URL ? '20' : '100' + ) + ) + // Set a timeout for the entire pipeline + timeout(time: 10, unit: 'HOURS') + } + stages { + stage('Build documentation') { + agent { + docker { + label "docker" + image 'repo.rti.com:443/build-docker-prod-hq/docbuilder:latest' + alwaysPull true + } + } + steps { + script { + currentBuild.description="""RTI Perftest Documentation""" + echo "Building documentation..." + echo "Result will be available at ${env.BUILD_URL}/RTI_20Perftest_20Documentation/" + runCommand './build.sh --build-doc' + } + } + post { + success { + /* Publish the documentation preview in Jenkins */ + publishHTML( + [ + allowMissing: false, + alwaysLinkToLastBuild: true, + keepAll: true, + reportDir: 'doc/html/', + reportFiles: 'index.html', + reportName: 'RTI Perftest Documentation', + reportTitles: 'RTI Perftest Documentation' + ] + ) + } + failure { + error('Error building the documentation') + } + } + } + } +} diff --git a/resource/jenkins/manual/UploadDocumentationToDocServer.groovy b/resource/jenkins/manual/UploadDocumentationToDocServer.groovy new file mode 100644 index 00000000..02d7f693 --- /dev/null +++ b/resource/jenkins/manual/UploadDocumentationToDocServer.groovy @@ -0,0 +1,124 @@ +/* groovylint-disable NestedBlockDepth */ +/* (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +* No duplications, whole or partial, manual or electronic, may be made +* without express written permission. Any such copies, or revisions thereof, +* must display this notice unaltered. +* This code contains trade secrets of Real-Time Innovations, Inc. +*/ + +String UPLOAD_PATH = "doozer@sjc01kvm2:~/www-docs/docs/rti-perftest/${params.DOC_SERVER_DESTINATION_PATH}" + +pipeline { + agent none + parameters{ + string( + name: 'DOC_SERVER_DESTINATION_PATH', + defaultValue: "${env.BRANCH_NAME}", + description: 'Target path to upload the documentation.' + ) + booleanParam( + name: 'UPLOAD_DOCUMENTATION_TO_DOC_SERVER', + defaultValue: false, + description: 'Confirm if you want to upload the documentation to the documentation server.' + ) + } + options { + disableConcurrentBuilds() + /* + To avoid excessive resource usage in server, we limit the number + of builds to keep in pull requests + */ + buildDiscarder( + logRotator( + artifactDaysToKeepStr: '', + artifactNumToKeepStr: '', + daysToKeepStr: '', + /* + For pull requests only keep the last 20 builds, for regular + branches keep up to 100 builds. + */ + numToKeepStr: env.CHANGE_URL ? '20' : '100' + ) + ) + // Set a timeout for the entire pipeline + timeout(time: 10, unit: 'HOURS') + } + stages { + stage('Build documentation') { + agent { + docker { + label "docker" + image 'repo.rti.com:443/build-docker-prod-hq/docbuilder:latest' + alwaysPull true + } + } + steps { + script { + currentBuild.description="""RTI Perftest Documentation""" + echo "Building documentation..." + echo "Result will be available at ${env.BUILD_URL}/RTI_20Perftest_20Documentation/ and https://docserver.rti.com/docs/rti-perftest/${params.DOC_SERVER_DESTINATION_PATH}" + runCommand './build.sh --build-doc' + } + } + post { + success { + /* Publish the documentation preview in Jenkins */ + publishHTML( + [ + allowMissing: false, + alwaysLinkToLastBuild: true, + keepAll: true, + reportDir: 'doc/html/', + reportFiles: 'index.html', + reportName: 'RTI Perftest Documentation', + reportTitles: 'RTI Perftest Documentation' + ] + ) + stash includes: 'doc/', name: 'perftest-doc' + } + failure { + error('Error building the documentation') + } + } + } + stage('Upload documentation') { + agent { + docker { + label "docker" + image 'repo.rti.com:443/build-docker-prod-hq/docbuilder:latest' + alwaysPull true + } + } + when { + expression { + params.UPLOAD_DOCUMENTATION_TO_DOC_SERVER == true + } + } + steps { + unstash 'perftest-doc' + sshagent(credentials: ['doozer-microservice-deploy-sshkey']) { + sh("""ssh -o StrictHostKeyChecking=no doozer@sjc01kvm2 'mkdir -p ~/www-docs/docs/rti-perftest/${params.DOC_SERVER_DESTINATION_PATH}'""") + sh("rsync -arv --delete -e 'ssh -o StrictHostKeyChecking=no' doc/html/ ${UPLOAD_PATH}") + sh("rsync -arv --delete -e 'ssh -o StrictHostKeyChecking=no' doc/pdf/ ${UPLOAD_PATH}/pdf") + } + } + post { + success { + slackSend( + message: ":white_check_mark: Perftest documentation is ready! You can check it <${env.BUILD_URL}/RTI_20Perftest_20Documentation/|here> and in the documentation server ", + channel: slackUserIdFromEmail(currentBuild.getBuildCauses()[0].userId+"@rti.com"), + botUser: true + ) + } + failure { + slackSend( + message: ":atlerror: Your build has failed. An error ocurred during the documentation build. Check the details <${env.BUILD_URL}|here>", + channel: slackUserIdFromEmail(currentBuild.getBuildCauses()[0].userId+"@rti.com"), + botUser: true + ) + error("Error ocurred uploading the documentation to ${UPLOAD_PATH}") + } + } + } + } +} diff --git a/srcDoc/requirements.txt b/srcDoc/requirements.txt new file mode 100644 index 00000000..0a73fa2b --- /dev/null +++ b/srcDoc/requirements.txt @@ -0,0 +1,5 @@ +Sphinx==7.1.2 +sphinx-rtd-theme==2.0.0 +svglib==1.5.1 +rst2pdf==0.101 +urllib3==1.26.6 \ No newline at end of file From baca912faddabff82e09c837ba82526c5b94ca64 Mon Sep 17 00:00:00 2001 From: Marcos Rivera Date: Wed, 29 May 2024 09:04:30 -0700 Subject: [PATCH 20/49] Pull request #100: PERF-444: Add ci build pipeline Merge in PERF/rti-perftest from feature/PERF-444 to develop Squashed commit of the following: commit ac5af573e099ce1720004a4c0ae8a5673ed29494 Merge: 1b478d2 b63edb1 Author: mrivera Date: Tue May 28 21:44:31 2024 +0200 Merge branch 'develop' of https://bitbucket.rti.com/scm/perf/rti-perftest into feature/PERF-444 commit 1b478d2e18bc3ff5b3d884bbe79809976f049e44 Author: mrivera Date: Tue May 28 20:54:02 2024 +0200 PERF-444: Optimiced pipeline commit ba342f4f14e293465a5a1225ddc5529bfe9bd517 Author: mrivera Date: Tue May 28 20:48:07 2024 +0200 PERF-444: Fix arm 2 commit c96cd3e09eb546b298415a89e1da6f03f7a42d1c Author: mrivera Date: Tue May 28 20:45:32 2024 +0200 PERF-444: Fix arm commit 4a2e80caa0a236b1f95dca5d937e33425c89159f Author: mrivera Date: Tue May 28 20:27:18 2024 +0200 PERF-444: Add ARM support commit a1c9c57bc9100e922c15b4ea3e830ad26cee0040 Author: Javier Morales-Castro Date: Mon May 13 07:13:18 2024 -0700 Applied suggestion commit ca3054200195d5b5c260267a849cef495011e001 Author: mrivera Date: Sat May 11 15:52:55 2024 +0200 PERF-444: Removed dotnet commit bfbc14d5db014e895fe4e30b10df4ca30787c320 Author: mrivera Date: Sat May 11 15:49:34 2024 +0200 PERF-444: Add support for more languages commit b9d56ee95ea36762cc0224eee671f4ab34551a40 Author: mrivera Date: Sat May 11 15:42:08 2024 +0200 PERF-444: fix quotes commit 801a1410f8b74f621bed3a57f2a34a5c05294f72 Author: mrivera Date: Sat May 11 15:39:53 2024 +0200 PERF-444: fix labels commit 228fe81bbfc03a5f9b39f0df83117751742bd526 Author: mrivera Date: Sat May 11 15:34:33 2024 +0200 PERF-444: moved agent label commit efc956f6ea321ffa7824fc34914d0cf0d034b3d1 Author: mrivera Date: Sat May 11 15:30:46 2024 +0200 PERF-444: Fix typo commit 222d647f75cf75d3603bcfd6314c2840da826e3b Author: mrivera Date: Sat May 11 15:27:57 2024 +0200 PERF-444: Refactor to use matrix commit b50f0f5d26e7a4332bf734a2fd03627312262419 Author: mrivera Date: Sat May 11 15:17:39 2024 +0200 PERF-444: Refactor to use functions commit 6ae9ec4f3ddc622a9ed93d68a383fe459cafa37f Author: mrivera Date: Sat May 11 15:07:21 2024 +0200 PERF-444: Add support for more languages commit 1d91dcdd4ac1d02d1de929c7a036cb1ebae9ab20 Author: mrivera Date: Sat May 11 15:05:29 2024 +0200 PERF-444: Fix not escaping NDDSHOME var commit af1668fee6297607880d256334a9e327deef3517 Author: mrivera Date: Sat May 11 15:01:51 2024 +0200 PERF-444: Add build pipeline --- resource/jenkins/ci/BuildPerftest.groovy | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 resource/jenkins/ci/BuildPerftest.groovy diff --git a/resource/jenkins/ci/BuildPerftest.groovy b/resource/jenkins/ci/BuildPerftest.groovy new file mode 100644 index 00000000..8305120c --- /dev/null +++ b/resource/jenkins/ci/BuildPerftest.groovy @@ -0,0 +1,44 @@ +/* (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +* No duplications, whole or partial, manual or electronic, may be made +* without express written permission. Any such copies, or revisions thereof, +* must display this notice unaltered. +* This code contains trade secrets of Real-Time Innovations, Inc. +*/ + +def buildPerftestAgainstPro(connext_arch, nddshome, flags) { + sh "./build.sh --platform ${connext_arch} --nddshome ${nddshome} ${flags}" +} + +pipeline { + agent none + + stages { + stage('Build Perftest against RTI Connext Pro') { + matrix { + axes { + axis { + name 'CONNEXT_ARCH' + values 'x64Linux4gcc7.3.0', 'armv8Linux4gcc7.3.0' + } + axis { + name 'LANGUAGE_FLAG' + values '--cpp-build', '--cpp11-build', '--java-build' + } + } + agent { + docker { + image "repo.rti.com/connext-containers/connext-sdk:BUILD_7.3.0.0_20240308T000000Z_RTI_REL-20240521" + args CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? '--platform linux/amd64' : '--platform linux/arm64' + } + } + stages { + stage("Build") { + steps { + buildPerftestAgainstPro("${CONNEXT_ARCH}", "\$NDDSHOME", "${LANGUAGE_FLAG} --secure") + } + } + } + } + } + } +} \ No newline at end of file From 16e1d8683eb460cc650624eaf91c8b1d8adf9c6c Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Wed, 19 Jun 2024 14:04:01 +0000 Subject: [PATCH 21/49] perf: Increase send and receive buffer sizes for TCPv4 transport --- perftest_qos_profiles.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/perftest_qos_profiles.xml b/perftest_qos_profiles.xml index ca01661c..c40b8981 100644 --- a/perftest_qos_profiles.xml +++ b/perftest_qos_profiles.xml @@ -111,6 +111,24 @@ and Utilities User's Manual in the chapter titled "Configuring QoS with XML." + + + + + + + dds.transport.TCPv4.tcp1.send_socket_buffer_size + 1048576 + + + dds.transport.TCPv4.tcp1.recv_socket_buffer_size + 2097152 + + + + + + PerftestQosLibrary::Perftest.Transport.UDPv4.IncreaseSendReceiveBuffers PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration + PerftestQosLibrary::Perftest.Transport.TCPv4.IncreaseSendReceiveBuffers PerftestQosLibrary::Perftest.IncreaseResourceLimits From 9505d8087ac00497defb05fa492830ce92f907f4 Mon Sep 17 00:00:00 2001 From: Mark Chanpanichravee Date: Thu, 17 Oct 2024 08:50:31 -0700 Subject: [PATCH 22/49] Pull request #79: Task/MICRO-5720 Merge in PERF/rti-perftest from task/MICRO-5720 to develop Squashed commit of the following: commit 348afe51f891e537182c3668a210e87fb1e3f784 Author: plombardero0 Date: Wed Oct 16 17:26:43 2024 +0200 MICRO-5720: Fixing the return code of DDS_TypedSampleSeq_get_reference() commit 906628fc7a02cc6df5123ae7f476c6548a686acb Author: plombardero0 Date: Tue Oct 15 17:05:14 2024 +0200 MICRO-5720: Relocating comments after the latest changes commit 005a45f9ec7cac975aef3adcd40178e69d3e6392 Author: plombardero0 Date: Tue Oct 15 16:54:57 2024 +0200 MICRO-5720: Moving all helper fucntions to an anonymous namespace commit 35288eee74e77181661e127de82c3aadd3669269 Author: plombardero0 Date: Mon Oct 14 11:48:40 2024 +0200 MICRO-5720: Applying PR feedback commit 9d31d5e2d75291dbe245fafc713d0bb5eca6e9dd Author: plombardero0 Date: Fri Oct 11 12:59:03 2024 +0200 MICRO-5720: Adding check for message.size when in ZC commit e108813e211202be6a61f36b054f2f5ff711dd4e Author: plombardero0 Date: Fri Oct 11 11:37:09 2024 +0200 MICRO-5720: Fixing transport information for ZeroCopy commit 84b2d432f565722e0c6fb71fefde87934272f204 Author: plombardero0 Date: Fri Oct 11 10:46:01 2024 +0200 MICRO-5720: Making sure that the loan is returned at the end of the test commit 60488f80415a2eddea5051f40c4146ed91208e86 Author: plombardero0 Date: Fri Oct 11 10:43:35 2024 +0200 MICRO-5720: Reverting change around return_loan() commit 184806d55b2f653337314e198a578a7fee8d7d14 Author: plombardero0 Date: Fri Oct 11 10:24:04 2024 +0200 MICRO-5720: Replacing use of non-public function DDS_UntypedSampleSeq_get_reference with a template function commit b649977947fa16a99c631169b0b0eac24c876283 Author: plombardero0 Date: Thu Oct 10 16:21:00 2024 +0200 MICRO-5720: Applying PR feedback commit f31db9f3a0ba09157fc25af1f15927afbb7a4ff4 Author: plombardero0 Date: Thu Oct 10 13:03:22 2024 +0200 MICRO-5720: Applying more PR feedback commit e0dd56be4e2423dd170b6333f688f12bd9c61e52 Author: plombardero0 Date: Thu Oct 10 12:40:50 2024 +0200 MICRO-5720: Simplifying the process of specifying the ZC array size at compile time commit d352a87d26a1d65ae7e9df631e0fdf2bfab74792 Author: plombardero0 Date: Thu Oct 10 11:35:42 2024 +0200 MICRO-5720: Applying PR feedback commit 9205ec565b30febad7d44ab28078504da0c3f09c Author: plombardero0 Date: Wed Oct 9 14:21:31 2024 +0200 MICRO-572: Making Perftest compile for Micro 2 Cert (previously it only worked with Micro 2 non-Cert) commit 069736483bb7f6be8593b647cca2297771ef013c Author: plombardero0 Date: Wed Oct 9 11:33:20 2024 +0200 MICRO-5720: Including rtime_psl lib before and after rti_me to fix undefined reference commit 9306b7fd09f41fc71dee8ac079d72027b6009eaa Author: plombardero0 Date: Tue Oct 8 13:02:45 2024 +0200 MICRO-5720: Checking whether the ZC datalen is valid commit 85c9d29f67e1dc29c39d5545a8d541fb39ba4cf0 Author: plombardero0 Date: Tue Oct 8 11:49:56 2024 +0200 MICRO-5720: Fixing ifdef commit ee176d485798b8cdacda4eb5aa66156deadb67b6 Author: plombardero0 Date: Mon Oct 7 18:51:36 2024 +0200 MICRO-5720: Disabling SHMEM for Cert with error message commit 08669cedb64690c850d6dd2919aa11a6c08fb108 Author: plombardero0 Date: Mon Oct 7 18:44:26 2024 +0200 MICRO-5720: Switching from --cert-zc-array-size to --cert-zc-datalen commit f2f5ceb9fbe0629b5cdc99b4bab9c905cbf74901 Author: plombardero0 Date: Mon Oct 7 17:32:34 2024 +0200 MICRO-5720: Applying PR feedback ... and 127 more commits --- .gitignore | 3 + .vscode/c_cpp_properties.json | 26 + build.sh | 256 +- resource/cert/CMakeLists.txt | 196 ++ resource/cert/perftest_micro.tc | 70 + srcCpp/Infrastructure_common.cxx | 4 +- srcCpp/Infrastructure_common.h | 25 +- srcCpp/MessagingIF.h | 4 +- .../connextDDS/cert/Infrastructure_cert.cxx | 172 ++ srcCpp/connextDDS/cert/Infrastructure_cert.h | 245 ++ srcCpp/connextDDS/cert/RTICertImpl.cxx | 2618 +++++++++++++++++ srcCpp/connextDDS/cert/RTICertImpl.h | 204 ++ srcCpp/perftest_cpp.cxx | 49 +- srcCppCommon/Parameter.cxx | 6 +- srcCppCommon/Parameter.h | 7 +- srcCppCommon/ParameterManager.cxx | 96 +- srcCppCommon/ParameterManager.h | 5 +- srcDoc/compilation.rst | 51 +- srcDoc/examples.rst | 43 + srcDoc/index.rst | 8 +- srcDoc/introduction.rst | 4 +- srcDoc/release_notes.rst | 8 + srcIdl/perftest.idl | 4 +- srcIdl/perftest_cert_zc.idl | 46 + 24 files changed, 4077 insertions(+), 73 deletions(-) create mode 100644 resource/cert/CMakeLists.txt create mode 100644 resource/cert/perftest_micro.tc create mode 100644 srcCpp/connextDDS/cert/Infrastructure_cert.cxx create mode 100644 srcCpp/connextDDS/cert/Infrastructure_cert.h create mode 100644 srcCpp/connextDDS/cert/RTICertImpl.cxx create mode 100644 srcCpp/connextDDS/cert/RTICertImpl.h create mode 100644 srcIdl/perftest_cert_zc.idl diff --git a/.gitignore b/.gitignore index 32fd25d1..be17cde4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /srcCpp*/perftest.* +/srcCpp/perftest_cert_zc* /srcC*/perftest_ZeroCopy* /srcC*/perftestPlugin.* /srcC*/perftestSupport.* @@ -47,6 +48,7 @@ srcDoc/_build /srcCpp/perftestApplication.cxx /srcCpp/perftestApplication.h /srcCpp/gen/* +/srcCpp/gen_c/* /srcCpp/perftest_build /srcCpp/CMakeLists.txt /srcCpp/custom.cxx @@ -70,3 +72,4 @@ srcCs/README* srcCs/ConnextDDS/GeneratedCode/* srcDoc/output .venv +/srcCpp/perftest_micro.tc diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index c0a1aa98..3adeb1e3 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -123,6 +123,32 @@ "cppStandard": "c++17", "intelliSenseMode": "clang-x64" }, + { + "name": "Linux Cert (macOS)", + "includePath": [ + "${workspaceFolder}/srcCpp", + "${workspaceFolder}/srcCpp/connextDDS", + "${workspaceFolder}/srcCpp/connextDDS/cert", + "${workspaceFolder}/srcCppCommon", + "${env.RTIMEHOME}/include", + "${env.RTIMEHOME}/include/rti_me", + "${env.RTIMEHOME}/include/rti_me/dds_c" + ], + "defines": [ + "PERFTEST_CERT=1", + "PERFTEST_RTI_MICRO_24x_COMPATIBILITY=1", + "RTI_LANGUAGE_CPP_TRADITIONAL=1", + "RTI_ZEROCOPY_AVAILABLE=1" + ], + "macFrameworkPath": [ + "/System/Library/Frameworks", + "/Library/Frameworks" + ], + "compilerPath": "/usr/bin/clang", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "clang-x64" + }, { "name": "Micro (OSX)", "includePath": [ diff --git a/build.sh b/build.sh index 3ffc9662..325684c2 100755 --- a/build.sh +++ b/build.sh @@ -26,6 +26,16 @@ BUILD_TSS=0 BUILD_TSS_PRO=0 FACE_COMPLIANCE="None" +# By default we will not build Micro Cert +BUILD_CERT=0 +BUILD_CERT_WITH_REGULAR_MICRO=0 + +# Default ZC dataLen +CERT_ZC_DATALEN=1024 + +# Overhead Bytes for the ZC size +CERT_ZC_OVERHEAD=28 + # By default we will build pro, not micro BUILD_MICRO=0 @@ -199,10 +209,18 @@ function usage() echo " --tss Build against Connext TSS (pro and micro) " echo " For the Classic C++ Implementation only. " echo " Default is not enabled. " + echo " --cert Build RTI Perftest for Connext CERT " + echo " For the Classic C++ Implementation only. " + echo " --micro-use-cert-code [Experimental] Build RTI Perftest for Connext " + echo " Micro using the same Perftest code used for " + echo " Connext CERT. " + echo " --cert-zc-datalen Size of the array for the ZeroCopy Type in CERT" + echo " Default is 1024. " echo " --help -h Display this message. " echo " " echo "================================================================================" echo "" + } function clean_custom_type_files() @@ -230,6 +248,7 @@ function clean() rm -f "${script_location}"/srcC*/README_*.txt rm -f "${script_location}"/srcC*/perftest.* rm -f "${script_location}"/srcC*/perftest_ZeroCopy* + rm -f "${script_location}"/srcC*/perftest_cert_zc* rm -f "${script_location}"/srcC*/perftestPlugin.* rm -f "${script_location}"/srcC*/perftestSupport.* rm -f "${script_location}"/srcC*/perftest_publisher.* @@ -271,8 +290,15 @@ function executable_checking() exit -1 fi - # If we are Building MICRO - if [ "${BUILD_TSS}" -eq "1" ]; then + if [ "${BUILD_CERT}" -eq "1" ]; then + + if [ -z "${RTIMEHOME}" ]; then + echo -e "${ERROR_TAG} The RTIMEHOME variable is not set or the path does not exist" + usage + exit -1 + fi + + elif [ "${BUILD_TSS}" -eq "1" ]; then if [ -z "${RTITSSHOME}" ]; then echo -e "${ERROR_TAG} The RTITSSHOME variable is not set or the path does not exist" usage @@ -567,7 +593,9 @@ function library_sufix_calculation() if [ "${library_sufix}" == "" ]; then rtiddsgen_extra_options="-sharedLib" else - rtiddsgen_extra_options="-libSuffix ${library_sufix}" + if [ "${BUILD_CERT}" == "" ]; then + rtiddsgen_extra_options="-libSuffix ${library_sufix}" + fi fi } @@ -878,6 +906,8 @@ function copy_src_cpp_connextDDS() src_specific_folder="pro" if [ ${BUILD_MICRO} != 0 ]; then src_specific_folder="micro" + elif [ ${BUILD_CERT} != 0 ]; then + src_specific_folder="cert" fi for file in ${classic_cpp_folder}/connextDDS/${src_specific_folder}/* @@ -916,6 +946,8 @@ function clean_copied_files() src_specific_folder="pro" if [ ${BUILD_MICRO} != 0 ]; then src_specific_folder="micro" + elif [ ${BUILD_CERT} != 0 ]; then + src_specific_folder="cert" fi for file in ${classic_cpp_folder}/connextDDS/${src_specific_folder}/* @@ -1379,6 +1411,197 @@ function build_tss_cpp() clean_copied_files } +function calculate_cert_zerocopy_defines() +{ + additional_rtiddsgen_defines="-DRTI_CERT" + + # Determine ZeroCopy availability + if [ "${SKIP_ZEROCOPY}" == "1" ]; then + echo -e "${INFO_TAG} Skipping ZeroCopy build for CERT" + ZEROCOPY_AVAILABLE="0" + else + echo -e "${INFO_TAG} ZeroCopy enabled for CERT" + ZEROCOPY_AVAILABLE="1" + fi + # Set defines and additional libraries for ZeroCopy + if [ "${SKIP_ZEROCOPY}" == "1" ]; then + export ZEROCOPY_AVAILABLE="0" + fi + + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + additional_defines=${additional_defines}" -DRTI_ZEROCOPY_AVAILABLE" + fi +} +# Build the Cert Implementation +function build_cert_cpp() +{ + # Copy common files (srcCppCommon) + copy_src_cpp_common + # Copy RTICertImpl files (srcCpp/connextDDS/cert) + for file in ${classic_cpp_folder}/connextDDS/cert/* + do + if [ -f $file ]; then + cp -rf "$file" "${classic_cpp_folder}" + fi + done + + if [[ $platform == *"Darwin"* ]]; then + additional_defines=" -DRTI_DARWIN" + additional_included_libraries="dl\;m\;pthread" + elif [[ $platform == *"Linux"* ]]; then + additional_defines=" -DRTI_LINUX" + additional_included_libraries="dl\;m\;pthread\;nsl\;rt" + elif [[ $platform == *"qcc"* ]]; then + additional_defines=" -DRTI_QNX" + additional_included_libraries="m\;socket" + fi + additional_defines="-DPERFTEST_CERT -DRTI_LANGUAGE_CPP_TRADITIONAL -DO3"${additional_defines} + + # Copy the CMakeLists.txt file and system file to the srcCpp folder. + cp "${resource_folder}/cert/CMakeLists.txt" "${classic_cpp_folder}/CMakeLists.txt" + cp "${resource_folder}/cert/perftest_micro.tc" "${classic_cpp_folder}/perftest_micro.tc" + + calculate_cert_zerocopy_defines + + # generate C typefiles from defualt idl + rtiddsgen_command="\"${rtiddsgen_executable}\" ${additional_rtiddsgen_defines} \ + -micro -language C \ + -replace -create typefiles \ + ${rtiddsgen_extra_options} \ + -d \"${classic_cpp_folder}\" \"${idl_location}/perftest.idl\" " + + echo "" + echo -e "${INFO_TAG} Generating types for C." + echo -e "${INFO_TAG} Command: $rtiddsgen_command" + + # Executing RTIDDSGEN command here. + eval $rtiddsgen_command + if [ "$?" != 0 ]; then + echo -e "${ERROR_TAG} Failure generating code for C." + exit -1 + fi + + # Generate CERT ZeroCopy types + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + if [ "${CERT_ZC_DATALEN}" -lt "$((CERT_ZC_OVERHEAD + 1))" ]; then + echo -e "${ERROR_TAG} The value of --cert-zc-datalen has to be " + echo -e "greater or equal than the overhead of the sample, which " + echo -e "is ${CERT_ZC_OVERHEAD} B + 1 B because the bin_data " + echo -e "array needs to have a length of at least 1" + exit -1 + fi + + echo -e "${INFO_TAG} The data length for the Zero Copy Type is: ${CERT_ZC_DATALEN}" + + echo -e "${INFO_TAG} Generating Cert Zero Copy TypeFiles" + rtiddsgen_command="\"${rtiddsgen_executable}\" -language C \ + ${additional_rtiddsgen_defines} \ + -replace -create typefiles -DCERT_ZC_DATALEN=${CERT_ZC_DATALEN} \ + -DCERT_ZC_OVERHEAD=${CERT_ZC_OVERHEAD} -d \"${classic_cpp_folder}\" \ + \"${idl_location}/perftest_cert_zc.idl\"" + + echo -e "${INFO_TAG} Command (Generating Cert Zero Copy TypeFiles): $rtiddsgen_command" + eval $rtiddsgen_command + if [ "$?" != 0 ]; then + echo -e "${ERROR_TAG} Failure generating code for Cert Zero Copy TypeFiles." + clean_copied_files + exit -1 + fi + fi + + ############################################################################## + # Compile srcCpp code + + perfest_executable_name="perftest_cpp_cert" + + if [ "${BUILD_CERT_WITH_REGULAR_MICRO}" == "1" ]; then + additional_defines="-DBUILD_CERT_WITH_REGULAR_MICRO ${additional_defines}" + perfest_executable_name="perftest_cpp_micro" + fi + + if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then + perfest_executable_name="${perfest_executable_name}_${CERT_ZC_DATALEN}" + fi + + # rtime-make has some limitations when it comes to passing string defines + # with spaces in it to cmake. Because of this reason, additional_defines + # will not be directly passed to rtime-make, but instead written to a file, + # which is later on directly read from our CMakelists.txt for Cert + + touch ${classic_cpp_folder}/additional_defines.txt + echo "${additional_defines}" > ${classic_cpp_folder}/additional_defines.txt + + echo "" + echo -e "${INFO_TAG} Compiling ${perfest_executable_name}" + cd "${classic_cpp_folder}" + + resource_folder="${RTIMEHOME}/../resource.1.0" + if [[ ! -d ${resource_folder} ]]; then + resource_folder="${RTIMEHOME}/resource" + if [[ ! -d ${resource_folder} ]]; then + echo "${ERROR_TAG} Failed to find a valid Micro resource folder" + exit -1 + fi + fi + + cert_flag="-DRTI_CERT=1" + if [ "${BUILD_CERT_WITH_REGULAR_MICRO}" == "1" ]; then + cert_flag="" + fi + + path_to_rtimemake="${resource_folder}/scripts/rtime-make" + if [[ ! -f ${path_to_rtimemake} ]]; then + echo "${ERROR_TAG} Failed to find rtime-make script inside the resource folder" + exit -1 + fi + + rtimemake_command="${path_to_rtimemake} \ + -DRTIME_RESOURCE_ROOT=${resource_folder} \ + --tcfile ${classic_cpp_folder}/perftest_micro.tc \ + --config ${RELEASE_DEBUG} ${cert_flag} \ + ${cmake_c_compiler_string} \ + -G \"Unix Makefiles\" --name ${platform} \ + --source-dir ${classic_cpp_folder} \ + --build -DRTIME_ZEROCOPY_AVAILABLE=${ZEROCOPY_AVAILABLE} \ + -DPLATFORM_LIBS=${additional_included_libraries} \ + -DPERFTEST_EXECUTABLE_NAME=${perfest_executable_name} \ + ${ADDITIONAL_CMAKE_ARGS} --delete" + + echo -e "${INFO_TAG} rtime-make Command: $rtimemake_command" + eval $rtimemake_command + rtimemake_retcode=$? + rm ${classic_cpp_folder}/additional_defines.txt + if [ "$rtimemake_retcode" != 0 ]; then + echo -e "${ERROR_TAG} Failure building using rtime-make." + cd .. + exit -1 + fi + + echo -e "${INFO_TAG} Compilation successful" + cd .. + + # Copy executables to bin + echo "" + echo -e "${INFO_TAG} Copying executable into: \"bin/${platform}/${RELEASE_DEBUG}\" folder" + + # Create bin folder if not exists and copy executables + destination_folder="${bin_folder}/${platform}/${RELEASE_DEBUG}" + mkdir -p "${bin_folder}/${platform}/${RELEASE_DEBUG}" + cp -f "${classic_cpp_folder}/objs/${platform}/${perfest_executable_name}" "${destination_folder}" + + # This will remove the srcCppCommon copied files. + if [ "$?" != 0 ]; then + echo -e "${ERROR_TAG} Failure copying code for CERT C." + clean_copied_files + exit -1 + else + echo -e "${INFO_TAG} Copy successful for CERT C." + clean_copied_files + rm ${classic_cpp_folder}/CMakeLists.txt + rm ${classic_cpp_folder}/perftest_micro.tc + fi +} + function build_cpp11() { copy_src_cpp_common @@ -1804,6 +2027,11 @@ while [ "$1" != "" ]; do BUILD_MICRO=1 BUILD_MICRO_24x_COMPATIBILITY=1 ;; + --cert) + BUILD_CERT=1 + # Force use cpp 11 infrastructure + RTI_USE_CPP_11_INFRASTRUCTURE=0 + ;; --skip-java-build) BUILD_JAVA=0 ;; @@ -2025,7 +2253,18 @@ while [ "$1" != "" ]; do FAST_QUEUE=1 ;; --no-zeroCopy) - SKIP_ZEROCOPY="1" + SKIP_ZEROCOPY=1 + ;; + --cert-zc-datalen) + CERT_ZC_DATALEN=$2 + shift + ;; + --micro-use-cert-code) + BUILD_CERT_WITH_REGULAR_MICRO=1 + BUILD_CERT=1 + # Do not use C++11 infrastructure + RTI_USE_CPP_11_INFRASTRUCTURE=0 + shift ;; # These options are not exposed to the user (yet) --just-generate) @@ -2058,6 +2297,15 @@ if [ "${BUILD_TSS}" -eq "1" ]; then build_tss_cpp fi +elif [ "${BUILD_CERT}" -eq "1" ]; then + rtiddsgen_executable="$RTIMEHOME/rtiddsgen/scripts/rtiddsgen" + + classic_cpp_lang_string=C++ + if [ "${BUILD_CPP}" -eq "1" ]; then + library_sufix_calculation + build_cert_cpp + fi + elif [ "${BUILD_MICRO}" -eq "1" ]; then rtiddsgen_executable="$RTIMEHOME/rtiddsgen/scripts/rtiddsgen" diff --git a/resource/cert/CMakeLists.txt b/resource/cert/CMakeLists.txt new file mode 100644 index 00000000..c0d81572 --- /dev/null +++ b/resource/cert/CMakeLists.txt @@ -0,0 +1,196 @@ +############################################################################### +# (c) Copyright, Real-Time Innovations 2018-2024 +# +# All rights reserved. +# No duplications, whole or partial, manual or electronic, may be made +# without express written permission. Any such copies, or +# revisions thereof, must display this notice unaltered. +# This code contains trade secrets of Real-Time Innovations, Inc. +# +# Description: +# ------------ +# CMakeLists.txt for building Perftest with Connext Cert +# +################################################################################ + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4) + +# This funtion returns the directory name where the Core library can be found +# based on the provided . +# The function produces output containing the Core's +# directory name +function(get_core_lib_dir_name full_arch_name) + string(REPLACE "-" ";" split_arch_name ${full_arch_name}) + list(GET split_arch_name 0 core_lib_dir_name) + list(LENGTH split_arch_name split_arch_name_length) + # Set function outputs + set(core_lib_dir_name ${core_lib_dir_name} PARENT_SCOPE) + # If there's text following the "-" in the arch name, we are working with a + # Platform Independent architecture, hence a Platform Independent Cert + if(split_arch_name_length GREATER 1) + set(cert_is_pi ON PARENT_SCOPE) + else() + set(cert_is_pi OFF PARENT_SCOPE) + endif() +endfunction() + +function(remove_unwanted_flags) + function(remove_warning_flags_from var_name) + set(current_flags "${${var_name}}") + + string(REGEX MATCHALL "[^ ]+" flags_list "${current_flags}") + + set(new_flags "") + foreach(flag ${flags_list}) + if(NOT flag MATCHES "^-W.*") + list(APPEND new_flags "${flag}") + endif() + endforeach() + + string(REPLACE ";" " " new_flags_str "${new_flags}") + set(${var_name} "${new_flags_str}" PARENT_SCOPE) + endfunction() + + # TODO: Remove these calls and the function once PERFTEST-388 is addressed + remove_warning_flags_from(CMAKE_CXX_FLAGS) + remove_warning_flags_from(CMAKE_C_FLAGS) + + string(REPLACE "-O0" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + string(REPLACE "-O0" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE) +endfunction() + +LINK_DIRECTORIES() + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + +PROJECT(Perftest_Cert CXX C) +SET(SOURCE_EXTENSION cxx) + +remove_unwanted_flags() + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") + +SET(RTIDDSGEN $ENV{RTIMEHOME}/rtiddsgen/scripts/rtiddsgen) +SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) + +SET(IDL_SOURCE_C perftest.idl) +IF (RTIME_ZEROCOPY_AVAILABLE) + SET(IDL_SOURCE_C ${IDL_SOURCE_C} perftest_cert_zc.idl) + add_compile_definitions(RTI_ZEROCOPY_AVAILABLE) +ENDIF() + +SET(IDL_GEN_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/gen) + +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME}) +SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME}) + +IF (NOT EXISTS gen) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory gen) +ENDIF() + +SET(RTI_LIB_PREFIX rti_me) +SET(RTI_LIB_SUFFIX) + +IF (NOT (DEFINED RTI_SHARED_LIB)) + IF (${CMAKE_BUILD_TYPE} MATCHES "[Rr]elease") + SET(RTI_LIB_SUFFIX "z") + SET(RTI_DEBUG_BUILD FALSE) + ADD_DEFINITIONS(-DNDEBUG) + ELSE() + SET(RTI_LIB_SUFFIX "zd") + SET(RTI_DEBUG_BUILD TRUE) + ENDIF() +ELSE() + IF (${CMAKE_BUILD_TYPE} MATCHES "[Rr]elease") + SET(RTI_LIB_SUFFIX "") + SET(RTI_DEBUG_BUILD FALSE) + ADD_DEFINITIONS(-DNDEBUG) + ELSE() + SET(RTI_LIB_SUFFIX "d") + SET(RTI_DEBUG_BUILD TRUE) + ENDIF() +ENDIF() + +get_core_lib_dir_name(${RTIME_TARGET_NAME}) + +# If the architecture has CERT in it, enable Cert +string(REGEX MATCH "CERT" cert_match ${RTIME_TARGET_NAME}) +IF (cert_match) + ADD_DEFINITIONS(-DRTI_CERT) +ENDIF() + +# Recovering ADDITIONAL_DEFINES from a file that should have been previously +# created and populated by build.sh +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/additional_defines.txt ADDITIONAL_DEFINES) + +IF (DEFINED RTI_CERT OR cert_match) + IF (RTIME_ZEROCOPY_AVAILABLE) + list(APPEND MICRO_C_LIBS rti_me_netiozcopy${RTI_LIB_SUFFIX}) + ENDIF() + IF(cert_is_pi) + list(APPEND MICRO_C_LIBS rti_me_psl${RTI_LIB_SUFFIX}) + ENDIF() + list(APPEND MICRO_C_LIBS rti_me${RTI_LIB_SUFFIX}) + IF(cert_is_pi) + list(APPEND MICRO_C_LIBS rti_me_psl${RTI_LIB_SUFFIX}) + ENDIF() + add_definitions(${ADDITIONAL_DEFINES} -DRTI_CERT -DPERFTEST_CERT) +ELSE() + SET(MICRO_C_LIBS rti_me_rhsm${RTI_LIB_SUFFIX} + rti_me_whsm${RTI_LIB_SUFFIX} + rti_me_discdpse${RTI_LIB_SUFFIX} + rti_me_discdpde${RTI_LIB_SUFFIX} + rti_me${RTI_LIB_SUFFIX} + ) + add_definitions(${ADDITIONAL_DEFINES} -DPERFTEST_CERT) +ENDIF() + +INCLUDE_DIRECTORIES(gen/ $ENV{RTIMEHOME}/include $ENV{RTIMEHOME}/include/rti_me) + +IF (${cert_is_pi}) + INCLUDE_DIRECTORIES($ENV{RTIMEHOME}/../rti_me_psl.1.0/include + $ENV{RTIMEHOME}/../rti_me_psl.1.0/include/rti_me_psl) +ENDIF() + +LINK_DIRECTORIES($ENV{RTIMEHOME}/lib/${RTIME_TARGET_NAME}) +# If ${core_lib_dir_name} is not empty, we are working with a +# Platform Independent Cert +IF (${cert_is_pi}) + LINK_DIRECTORIES($ENV{RTIMEHOME}/lib/${core_lib_dir_name}) +ENDIF() + +FOREACH(idl ${IDL_SOURCE_C}) + GET_FILENAME_COMPONENT(filename ${idl} NAME) + STRING(REGEX REPLACE "\\.idl" "" basename ${filename}) + LIST(APPEND IDL_GEN_C ${basename}.c + ${basename}Plugin.c + ${basename}Support.c) + + LIST(APPEND IDL_GEN_H ${basename}.h + ${basename}Plugin.h + ${basename}Support.h) + +ENDFOREACH() + +FILE(GLOB MyCSources ${CMAKE_CURRENT_SOURCE_DIR}/*) +LIST(REMOVE_ITEM MyCSources + ${CMAKE_CURRENT_SOURCE_DIR}/perftest_subscriber.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/perftest_publisher.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/perftest_cpp.cxx) + +if(${cert_is_pi}) + add_compile_definitions(RTI_CERT_IS_PI) +ENDIF() + +ADD_EXECUTABLE(perftest_cpp_cert + ${CMAKE_CURRENT_SOURCE_DIR}/perftest_cpp.${SOURCE_EXTENSION} + ${MyCSources} ${IDL_GEN_C} ${IDL_GEN_H}) + +set_target_properties(perftest_cpp_cert PROPERTIES OUTPUT_NAME ${PERFTEST_EXECUTABLE_NAME}) + +TARGET_LINK_LIBRARIES(perftest_cpp_cert ${MICRO_C_LIBS} ${PLATFORM_LIBS}) \ No newline at end of file diff --git a/resource/cert/perftest_micro.tc b/resource/cert/perftest_micro.tc new file mode 100644 index 00000000..b29c8b6d --- /dev/null +++ b/resource/cert/perftest_micro.tc @@ -0,0 +1,70 @@ +############################################################################### +# (c) Copyright, Real-Time Innovations 2024 +# +# All rights reserved. +# No duplications, whole or partial, manual or electronic, may be made +# without express written permission. Any such copies, or +# revisions thereof, must display this notice unaltered. +# This code contains trade secrets of Real-Time Innovations, Inc. +################################################################################ + +# This file includes basic platform dependencies for self-hosted builds +IF (DEFINED RTIME_TARGET_NAME) + STRING(REGEX MATCH "(.*)-(.*)" pil_match ${RTIME_TARGET_NAME}) + IF (pil_match) + SET(RTIME_PSL TRUE) + ADD_DEFINITIONS(-DRTI_PSL=1) + IF (${RTIME_TARGET_NAME} MATCHES ".*gcc.*") + ADD_DEFINITIONS(-DOSAPI_CC_DEF_H=osapi/osapi_cc_gcc.h) + SET(RTIME_OSAPI_COMPILER osapi/osapi_cc_gcc.h) + ELSEIF (${RTIME_TARGET_NAME} MATCHES ".*clang.*") + ADD_DEFINITIONS(-DOSAPI_CC_DEF_H=osapi/osapi_cc_clang.h) + SET(RTIME_OSAPI_COMPILER osapi/osapi_cc_clang.h) + ELSEIF (${RTIME_TARGET_NAME} MATCHES ".*qcc.*") + ADD_DEFINITIONS(-DOSAPI_CC_DEF_H=osapi/osapi_cc_qcc.h) + SET(RTIME_OSAPI_COMPILER osapi/osapi_cc_qcc.h) + ELSEIF (${RTIME_TARGET_NAME} MATCHES ".*PEvs.*") + ADD_DEFINITIONS(-DOSAPI_CC_DEF_H=osapi/osapi_cc_msvsc.h) + SET(RTIME_OSAPI_COMPILER osapi/osapi_cc_msvsc.h) + ELSE() + MESSAGE(FATAL_ERROR "Unknown PSL architecture #{RTIME_TARGET_NAME}") + ENDIF() + SET(OSAPI_CC_DEF_H_SET TRUE) + ENDIF() + IF (${RTIME_TARGET_NAME} MATCHES ".*qcc.*") + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/Platform/qnx.tc) + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/Compiler/qcc.tc) + IF (pil_match) + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/Compiler/qcc_pi.tc) + ENDIF() + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/${RTIME_TARGET_NAME}.tc) + ELSE() + IF(NOT DEFINED RTIME_SYSTEM_FILE AND DEFINED RTIME_RESOURCE_ROOT) + # Check for knowns defaults + IF (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/Platform/linux.tc) + ELSEIF(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/Platform/windows.tc) + ELSEIF(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin") + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/Platform/darwin.tc) + ELSEIF(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "VOS") + INCLUDE(${RTIME_RESOURCE_ROOT}/cmake/architectures/Platform/vos.tc) + ELSE() + MESSAGE(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} is an unknown host system, aborting.") + ENDIF() + ELSEIF(NOT ${RTIME_SYSTEM_FILE} STREQUAL "") + # A non-emty value has been defined, check if the file exists + IF (NOT EXISTS ${RTIME_SYSTEM_FILE}) + MESSAGE(FATAL_ERROR "Could not locate file ${RTIME_SYSTEM_FILE} as the system file, aborting.") + ELSEIF(IS_DIRECTORY ${RTIME_SYSTEM_FILE}) + MESSAGE(FATAL_ERROR "${RTIME_SYSTEM_FILE} is a directory, not a valid system definition file.") + ENDIF() + + MESSAGE(STATUS "Using ${RTIME_SYSTEM_FILE} as the system file for ${CMAKE_HOST_SYSTEM_NAME}.") + INCLUDE(${RTIME_SYSTEM_FILE}) + ELSE() + # RTIME_SYSTEM_FILE="", ignore any defaults + MESSAGE(WARNING "${RTIME_SYSTEM_FILE} defined as \"\", using cmake system defaults for ${CMAKE_HOST_SYSTEM_NAME}.") + ENDIF() + ENDIF() +ENDIF() diff --git a/srcCpp/Infrastructure_common.cxx b/srcCpp/Infrastructure_common.cxx index bb112a5d..5f61696b 100644 --- a/srcCpp/Infrastructure_common.cxx +++ b/srcCpp/Infrastructure_common.cxx @@ -1,5 +1,5 @@ /* - * (c) 2005-2020 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ @@ -17,7 +17,7 @@ * which will make us compatible with less OSs. In other cases we do need a * implementation for these classes. */ -#if defined(RTI_USE_CPP_11_INFRASTRUCTURE) || (!defined(PERFTEST_RTI_MICRO) && !defined(PERFTEST_RTI_PRO)) +#if defined(RTI_USE_CPP_11_INFRASTRUCTURE) || defined(PERFTEST_NO_INFRASTRUCTURE_AVAILABLE) /********************************************************************/ /* Perftest Semaphore class */ diff --git a/srcCpp/Infrastructure_common.h b/srcCpp/Infrastructure_common.h index a0ec8e69..e06192b0 100644 --- a/srcCpp/Infrastructure_common.h +++ b/srcCpp/Infrastructure_common.h @@ -1,12 +1,12 @@ /* - * (c) 2005-2020 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ #ifndef INFRASTRUCTURE_COMMON_H_ #define INFRASTRUCTURE_COMMON_H_ -#if defined(PERFTEST_RTI_PRO) || defined(PERFTEST_RTI_MICRO) +#if defined(PERFTEST_RTI_PRO) || defined(PERFTEST_RTI_MICRO) || defined(RTI_CERT) || defined(BUILD_CERT_WITH_REGULAR_MICRO) #include "perftest.h" #elif defined(RTI_PERF_TSS) #include "gen/perftest.h" @@ -58,9 +58,13 @@ #include "Infrastructure_pro.h" #elif defined(PERFTEST_RTI_MICRO) || defined(RTI_PERF_TSS_MICRO) #include "Infrastructure_micro.h" +#elif defined(PERFTEST_CERT) + #include "Infrastructure_cert.h" +#else + #define PERFTEST_NO_INFRASTRUCTURE_AVAILABLE=1 #endif -#if defined(RTI_USE_CPP_11_INFRASTRUCTURE) || (!defined(PERFTEST_RTI_MICRO) && !defined(PERFTEST_RTI_PRO)) +#if defined(RTI_USE_CPP_11_INFRASTRUCTURE) || defined(PERFTEST_NO_INFRASTRUCTURE_AVAILABLE) #include #include @@ -73,7 +77,7 @@ * generated variable for a string is different. We need to move it to a generic * place and remove it from here in the future. */ -#if !defined(PERFTEST_RTI_PRO) && !defined(PERFTEST_RTI_MICRO) && !defined(RTI_PERF_TSS) +#if !defined(PERFTEST_RTI_PRO) && !defined(PERFTEST_RTI_MICRO) && !defined(RTI_PERF_TSS) && !defined(PERFTEST_CERT) static const char *const THROUGHPUT_TOPIC_NAME = "Throughput"; static const char *const LATENCY_TOPIC_NAME = "Latency"; static const char *const ANNOUNCEMENT_TOPIC_NAME = "Announcement"; @@ -107,7 +111,7 @@ class PerftestSemaphore { try { std::unique_lock lock(mutex); condition.wait(lock, [&]() -> bool { return count > 0; }); - --count; + count = count == 0 ? 0 : count - 1; return true; } catch (std::exception& e) { std::cerr << "[Exception]: "<< e.what() << std::endl; @@ -117,11 +121,16 @@ class PerftestSemaphore { bool take(int timeout_millisec) { + if (timeout_millisec == PERFTEST_SEMAPHORE_TIMEOUT_INFINITE) + { + return take(); + } + try { std::chrono::milliseconds timeout(timeout_millisec); std::unique_lock lock(mutex); condition.wait_for(lock, timeout, [&]() -> bool { return count > 0; }); - --count; + count = count == 0 ? 0 : count - 1; return true; } catch (std::exception& e) { std::cerr << "[Exception]: "<< e.what() << std::endl; @@ -194,14 +203,14 @@ PerftestThread *PerftestThread_new( void PerftestThread_delete(PerftestThread *thread); -#if !defined(PERFTEST_RTI_PRO) && !defined(PERFTEST_RTI_MICRO) && !defined(RTI_PERF_TSS) +#ifdef PERFTEST_NO_INFRASTRUCTURE_AVAILABLE struct DDS_Duration_t { int sec; unsigned int nanosec; }; #endif -#if !defined(PERFTEST_RTI_PRO) && !defined(PERFTEST_RTI_MICRO) && !defined(RTI_PERF_TSS_PRO) +#ifdef PERFTEST_NO_INFRASTRUCTURE_AVAILABLE class NDDSUtility { public: /*e \dref_Utility_sleep */ diff --git a/srcCpp/MessagingIF.h b/srcCpp/MessagingIF.h index 2dc67f0e..f4e8ece9 100644 --- a/srcCpp/MessagingIF.h +++ b/srcCpp/MessagingIF.h @@ -2,7 +2,7 @@ #define __MESSAGINGIF_H__ /* - * (c) 2005-2017 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ @@ -55,7 +55,9 @@ class IMessagingCB virtual ~IMessagingCB() { if (sync_semaphore != NULL) { +#ifndef PERFTEST_CERT PerftestSemaphore_delete(sync_semaphore); +#endif sync_semaphore = NULL; } } diff --git a/srcCpp/connextDDS/cert/Infrastructure_cert.cxx b/srcCpp/connextDDS/cert/Infrastructure_cert.cxx new file mode 100644 index 00000000..9b9a74bf --- /dev/null +++ b/srcCpp/connextDDS/cert/Infrastructure_cert.cxx @@ -0,0 +1,172 @@ +/* + * (c) 2023-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. + * Subject to Eclipse Public License v1.0; see LICENSE.md for details. + */ + +#ifdef PERFTEST_CERT + +#include "Infrastructure_common.h" + +#ifdef RTI_QNX +#include +#include +#endif + +#ifndef RTI_USE_CPP_11_INFRASTRUCTURE + +/********************************************************************/ +/* Perftest Clock class */ + +PerftestClock::PerftestClock() +{ + #ifndef RTI_PERFTEST_NANO_CLOCK + #ifndef RTI_WIN32 + + OSAPI_NtpTime_from_millisec(&clockTimeAux, 0, 0); + clockSec = 0; + clockUsec = 0; + + #else + _frequency = 0.0; + LARGE_INTEGER ticks; + if(!QueryPerformanceFrequency(&ticks)){ + printf("QueryPerformanceFrequency failed!\n"); + } + + _frequency = double(ticks.QuadPart); + + #endif + #endif +} + +PerftestClock::~PerftestClock() +{ +} + +PerftestClock &PerftestClock::getInstance() +{ + static PerftestClock instance; + return instance; +} + +unsigned long long PerftestClock::getTime() +{ + #ifndef RTI_PERFTEST_NANO_CLOCK + #ifndef RTI_WIN32 + + #if defined(RTI_QNX) + + // Get cycles per second for this machine + uint64_t cps = SYSPAGE_ENTRY(qtime)->cycles_per_sec; + + // Get current timestamp in CPU cycles instead of time + uint64_t now = ClockCycles(); + + clockSec = now / cps; + clockUsec = (now % cps) * 1000000 / cps; + + return clockUsec + clockSec * 1000000; + + #else + + if (!OSAPI_System_get_time((OSAPI_NtpTime*)&clockTimeAux)) { + return 0; + } + + /* OSAPI_NtpTime_to_microsec is not available in CERT library */ + OSAPI_NtpTime_to_nanosec( + &clockSec, + &clockUsec, + (struct OSAPI_NtpTime*)&clockTimeAux); + clockUsec = clockUsec / 1000; + return clockUsec + (unsigned long long) 1000000 * clockSec; + #endif + + #else + /* + * RTI Connext DDS Micro takes the timestamp by GetSystemTimeAsFileTime, + * this function should have a resolution of 100 nanoseconds but + * GetSystemTimeAsFileTime is a non-realtime time & busy loop (very fast) + * in implementation. The system time is obtained from SharedUserData, which + * is fill by system on every hardware clock interruption. MICRO-2099 + * + * More info here: + * https://docs.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps + * + * In order to obtain enough precission for a latencyTest we are going to + * use the native API QueryPerformanceCounter function measured in + * microseconds as RTI Connext DDS Pro does. + */ + LARGE_INTEGER ticks; + QueryPerformanceCounter(&ticks); + return ticks.QuadPart / (unsigned long long) (_frequency /1000000.0); + + #endif /* RTI_WIN32 */ + #else + clock_gettime(CLOCK_MONOTONIC, &timeStruct); + return (timeStruct.tv_sec * ONE_BILLION) + timeStruct.tv_nsec; + #endif /* RTI_PERFTEST_NANO_CLOCK */ +} + +void PerftestClock::milliSleep(unsigned int millisec) +{ + std::this_thread::sleep_for(std::chrono::milliseconds(millisec)); +} + +void PerftestClock::sleep(const struct DDS_Duration_t& sleep_period) +{ + NDDSUtility::sleep(sleep_period); +} + +/********************************************************************/ +/* Micro OnSpawed Method */ + +struct PerftestMicroThreadOnSpawnedMethod +{ + MicroThreadOnSpawnedMethod method; + void *thread_param; + +}; + +static RTI_BOOL perftestMicroThreadRoutine(struct OSAPI_ThreadInfo *thread_info) +{ + PerftestMicroThreadOnSpawnedMethod *data = (PerftestMicroThreadOnSpawnedMethod *)thread_info->user_data; + + data->method(data->thread_param); + delete(data); + + thread_info->stop_thread = RTI_TRUE; + return RTI_TRUE; +} + +/********************************************************************/ +/* Thread Related functions */ + +struct PerftestThread* PerftestThread_new( + const char *name, + int threadPriority, + int threadOptions, + MicroThreadOnSpawnedMethod method, + void *threadParam) +{ + struct OSAPI_ThreadProperty prio = OSAPI_ThreadProperty_INITIALIZER; + PerftestMicroThreadOnSpawnedMethod *data = new PerftestMicroThreadOnSpawnedMethod(); + data->method = method; + data->thread_param = threadParam; + + struct OSAPI_Thread *thread = NULL; + thread = OSAPI_Thread_create( + name, + &prio, + perftestMicroThreadRoutine, + data, + NULL); + if (!OSAPI_Thread_start(thread)) { + return NULL; + } + return thread; +} + +#endif //#ifndef RTI_USE_CPP_11_INFRASTRUCTURE + +#endif // PERFTEST_CERT diff --git a/srcCpp/connextDDS/cert/Infrastructure_cert.h b/srcCpp/connextDDS/cert/Infrastructure_cert.h new file mode 100644 index 00000000..6ae7db72 --- /dev/null +++ b/srcCpp/connextDDS/cert/Infrastructure_cert.h @@ -0,0 +1,245 @@ +/* + * (c) 2023-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. + * Subject to Eclipse Public License v1.0; see LICENSE.md for details. + */ + +#ifndef INFRASTRUCTURE_CERT_H_ +#define INFRASTRUCTURE_CERT_H_ + +#ifdef PERFTEST_CERT + +#include "osapi/osapi_semaphore.h" +#include "osapi/osapi_thread.h" +#include "osapi/osapi_time.h" +#include "rti_me_c.h" +#include +#include + +#include "PerftestTransport.h" + +#include "Infrastructure_common.h" + +#ifdef RTI_WIN32 + #include "windows.h" +#endif + +#include + + +#ifndef RTI_USE_CPP_11_INFRASTRUCTURE + +/********************************************************************/ +/* + * In order to unify the implementations for Micro and Pro, we wrap the + * semaphores to a common PerftestSemaphore implementation. + */ + +#define PerftestSemaphore OSAPI_Semaphore_T +#define PerftestSemaphore_new OSAPI_Semaphore_new +#define PerftestSemaphore_give OSAPI_Semaphore_give +#define PERFTEST_SEMAPHORE_TIMEOUT_INFINITE OSAPI_SEMAPHORE_TIMEOUT_INFINITE + +inline RTI_BOOL PerftestSemaphore_take(PerftestSemaphore *sem, int timeout) +{ + return OSAPI_Semaphore_take(sem, timeout, NULL); +} + +#define PERFTEST_DISCOVERY_TIME_MSEC 1000 // 1 second +#define ONE_BILLION 1000000000L // 1 billion (US) == 1 second in ns + +#define PerftestMutex OSAPI_Mutex_T +#define PerftestMutex_new OSAPI_Mutex_new +#define PerftestMutex_give OSAPI_Mutex_give +#define PerftestMutex_take OSAPI_Mutex_take + +/* Perftest Clock Class */ +class PerftestClock { + + private: + #ifndef RTI_PERFTEST_NANO_CLOCK + #ifndef RTI_WIN32 + OSAPI_NtpTime clockTimeAux; + #ifdef RTI_QNX + uint64_t clockSec; + uint64_t clockUsec; + #else + RTI_INT32 clockSec; + RTI_UINT32 clockUsec; + #endif + #else + double _frequency; + #endif + #else + struct timespec timeStruct; + #endif + + public: + PerftestClock(); + ~PerftestClock(); + + static PerftestClock &getInstance(); + unsigned long long getTime(); + static void milliSleep(unsigned int millisec); + static void sleep(const struct DDS_Duration_t& sleep_period); + +}; + +/********************************************************************/ +/* THREADS */ + +#define PerftestThread OSAPI_Thread + +#define Perftest_THREAD_PRIORITY_DEFAULT 0 +#define Perftest_THREAD_SETTINGS_REALTIME_PRIORITY 0 +#define Perftest_THREAD_SETTINGS_PRIORITY_ENFORCE 0 +#define Perftest_THREAD_OPTION_DEFAULT 0 + +typedef void *(*MicroThreadOnSpawnedMethod)(void*); + +struct PerftestThread* PerftestThread_new( + const char *name, + int threadPriority, + int threadOptions, + MicroThreadOnSpawnedMethod method, + void *threadParam); + +#endif // #ifndef RTI_USE_CPP_11_INFRASTRUCTURE + +/********************************************************************/ +/* The following structures/classes are copied from RTI Connext DDS */ + +typedef struct RTINtpTime +{ + /*e Seconds.**/ + RTI_INT32 sec; + /*e fraction of a second in 1/2^32 form.*/ + RTI_UINT32 frac; +} RTINtpTime; + +#define RTI_NTP_TIME_ZERO {0,0} + +#define RTINtpTime_unpackToMicrosec(s, usec, time) \ +{ \ + register RTI_UINT32 RTINtpTime_temp = (time).frac; \ + s = (time).sec; \ + usec = ((time).frac- \ + (RTINtpTime_temp>>5)- \ + (RTINtpTime_temp>>7)- \ + (RTINtpTime_temp>>8)- \ + (RTINtpTime_temp>>9)- \ + (RTINtpTime_temp>>10)- \ + (RTINtpTime_temp>>12)- \ + (RTINtpTime_temp>>13)- \ + (RTINtpTime_temp>>14) + (1<<11)) >> 12; \ + if( ((usec) >= 1000000) && ((s)!=0x7FFFFFFF) ) { \ + (usec) -= 1000000; \ + (s)++; \ + } \ +} + +#define NDDS_Utility_spin(spinCount) \ +{ \ + RTI_UINT64 spin; \ + RTI_UINT64 ad, bd, cd; \ + volatile RTI_UINT64 * a, * b, * c; \ + a = &ad; \ + b = &bd; \ + c = &cd; \ + for (spin = 0; spin < (spinCount); ++spin) { \ + *a = 3; \ + *b = 1; \ + *c = (*a/(*b))*spin; \ + } \ +} + +class NDDSUtility +{ + public: + /*e \dref_Utility_sleep */ + static void sleep(const struct DDS_Duration_t& durationIn){ + /* following is a copy of OSAPI_Thread_sleep() in POSIX. + * for other platforms we need to find out how to sleep + * with a nanosecond precession + */ + #if defined(RTI_LINUX) || defined(RTI_DARWIN) || defined(RTI_QNX) + RTI_INT32 is; + struct timespec remain,next; + int rval; + + next.tv_sec = durationIn.sec; + next.tv_nsec = durationIn.nanosec; + + #if !defined(__APPLE__) && !defined(USE_TIMER_THREAD_SLEEP) && !defined(RTI_UCLINUX) + do + { + rval = clock_nanosleep(CLOCK_REALTIME,0,&next,&remain); + if (rval == EINTR) + { + next = remain; + } + } while (rval == EINTR); + #else + do + { + rval = nanosleep(&next,&remain); + if ((rval == -1) && (errno == EINTR)) + { + next = remain; + } + } while ((rval == -1) && (errno == EINTR)); + #endif + #else + /* for other platforms sleep only if time to sleep is greater than 0 ms */ + RTI_UINT32 ms = durationIn.sec * 1000 + durationIn.nanosec / 1000000; + if (ms > 0) + OSAPI_Thread_sleep(ms); + #endif + }; + + /*e \dref_Utility_spin */ + static void spin(DDS_UnsignedLongLong spinCount){ + NDDS_Utility_spin(spinCount); + }; + + + static DDS_UnsignedLongLong + get_spin_per_microsecond(unsigned int precision = 100) + { + /* Same default values used by DDS */ + unsigned int spinCount = 200000; + unsigned long long clockCalculationLoopCountMax = 100; + + unsigned long long usec = 0; + unsigned long long iterations = 0; + + PerftestClock clock = PerftestClock::getInstance(); + + do{ + usec = clock.getTime(); // Initial time + NDDS_Utility_spin(spinCount * iterations); + usec = clock.getTime() - usec; // Final time + iterations++; + /* + * If the the clock have a low precision, increase spinCount + * until we measure some us or reach a maximum count loop + */ + } while (usec < precision && iterations < clockCalculationLoopCountMax); + + /* + * The measure time can be zero due to lack of resolution or non + * monotonic clocks and a really fast machine. + * We may end on a exception condition, unable to calculate the + * spins per micro-seconds. + */ + if (usec == 0) { + fprintf(stderr, + "Unable to calculate the number of spins per" + "micro-seconds\n"); + return 0; + } + return (unsigned long long) (iterations * spinCount) / usec; + } +}; + +#endif /* PERFTEST_CERT */ +#endif /* INFRASTRUCTURE_CERT_H_ */ diff --git a/srcCpp/connextDDS/cert/RTICertImpl.cxx b/srcCpp/connextDDS/cert/RTICertImpl.cxx new file mode 100644 index 00000000..382cac3d --- /dev/null +++ b/srcCpp/connextDDS/cert/RTICertImpl.cxx @@ -0,0 +1,2618 @@ +/* + * (c) 2023-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. + * Subject to Eclipse Public License v1.0; see LICENSE.md for details. + */ +#include "MessagingIF.h" +#include "perftest_cpp.h" +#include "RTICertImpl.h" + +#include +#include + +/********************************** + * Free standing helper functions * + **********************************/ + +#define CHECK_PTR(ptr, msg) \ + if (ptr == NULL) { \ + fprintf(stderr, "%s:%d: Error %s.\n", \ + __FUNCTION__, __LINE__, msg); \ + fflush(stderr); \ + goto done; \ + } + + +#define CHECK_BOOL(b, msg) \ + if (b == RTI_FALSE) { \ + fprintf(stderr, "%s:%d: Error %s.\n", \ + __FUNCTION__, __LINE__, msg); \ + fflush(stderr); \ + goto done; \ + } + +#define CHECK_RETCODE(rc, msg) \ + if (rc != DDS_RETCODE_OK) { \ + fprintf(stderr, "%s:%d: Error %s (%d).\n", \ + __FUNCTION__, __LINE__, msg, rc); \ + fflush(stderr); \ + goto done; \ + } + +// THis definition is only needed for Platform Independent Cert +#if !defined(BUILD_CERT_WITH_REGULAR_MICRO) && defined(RTI_CERT_IS_PI) +const char* const NETIO_DEFAULT_UDP_NAME = "_udp"; +#endif + +// Using an anonymous namespace to make sure that these functions are not +// used outside of this file +namespace { +#ifdef RTI_CERT + DDS_Octet* DDS_OctetSeq_get_contiguous_buffer(const struct DDS_OctetSeq *self); + + RTI_BOOL DDS_OctetSeq_loan_contiguous(struct DDS_OctetSeq *self, void *buffer, + RTI_INT32 new_length, RTI_INT32 new_max); + + RTI_BOOL DDS_OctetSeq_unloan(struct DDS_OctetSeq *self); +#endif + +template +T* DDS_TypedSampleSeq_get_reference(TSeq* self, RTI_INT32 i); + +RTI_UINT32 get_interface_address(const char *interface_name); + +bool configureUDPv4Transport( + RT_Registry_T *registry, + PerftestTransport &transport, + ParameterManager *_PM); + +void configureDPResourceLimits( + DDS_DomainParticipantQos& dp_qos); +} + +const std::string GetMiddlewareVersionString() +{ + return "RTI Connext DDS CERT " + + perftest::to_string((int) RTIME_DDS_VERSION_MAJOR) + "." + + perftest::to_string((int) RTIME_DDS_VERSION_MINOR) + "." + + perftest::to_string((int) RTIME_DDS_VERSION_REVISION) + "." + + perftest::to_string((int) RTIME_DDS_VERSION_RELEASE); +} + +/***************************************** + * End of free standing helper functions * + *****************************************/ + +/**************************** + * Listeners for DataReader * + ****************************/ +/****************** + * ReaderListener * + ******************/ +template +static void on_data_available(void *listener_data, DDS_DataReader *reader) +{ + if (listener_data == NULL) { + fprintf(stderr,"Error: listener_data is NULL\n"); + return; + } + + TSeq samples = DDS_SEQUENCE_INITIALIZER; + struct DDS_SampleInfoSeq sampleInfo = DDS_SEQUENCE_INITIALIZER; + TestMessage message; + IMessagingCB *callback = (IMessagingCB *) listener_data; + + DDS_ReturnCode_t retcode = DDS_DataReader_take( + reader, + (struct DDS_UntypedSampleSeq *) &samples, + &sampleInfo, + DDS_LENGTH_UNLIMITED, + DDS_ANY_SAMPLE_STATE, + DDS_ANY_VIEW_STATE, + DDS_ANY_INSTANCE_STATE); + if (retcode == DDS_RETCODE_NO_DATA) + { + return; + } + else if (retcode != DDS_RETCODE_OK) + { + fprintf(stderr,"Error during taking data in listener %d\n", retcode); + return; + } + + int seq_length = DDS_SampleInfoSeq_get_length(&sampleInfo); + for (int i = 0; i < seq_length; ++i) + { + if (DDS_SampleInfoSeq_get_reference(&sampleInfo, i)->valid_data == DDS_BOOLEAN_TRUE) + { + T *sample = DDS_TypedSampleSeq_get_reference(&samples,i); + + message.entity_id = sample->entity_id; + message.seq_num = sample->seq_num; + message.timestamp_sec = sample->timestamp_sec; + message.timestamp_usec = sample->timestamp_usec; + message.latency_ping = sample->latency_ping; + + message.size = DDS_OctetSeq_get_length(&sample->bin_data); + message.data = (char *) DDS_OctetSeq_get_contiguous_buffer(&sample->bin_data); + + callback->process_message(message); + } + } + retcode = DDS_DataReader_return_loan( + reader, + (struct DDS_UntypedSampleSeq *) &samples, + &sampleInfo); + if (retcode != DDS_RETCODE_OK) + { + fprintf(stderr,"Error during return loan in listener %d.\n", retcode); + fflush(stderr); + } +} + +template +class ReaderListenerBase { +public: + DDS_DataReaderListener *get_listener() + { + return &this->dr_listener; + } + +protected: + struct DDS_DataReaderListener dr_listener; +}; + +template +class ReaderListener : public ReaderListenerBase { +public: + ReaderListener(IMessagingCB *callback) + { + this->dr_listener = DDS_DataReaderListener_INITIALIZER; + this->dr_listener.as_listener.listener_data = (void *) callback; + this->dr_listener.on_data_available = &on_data_available; + } +}; +/************************* + * End of ReaderListener * + *************************/ + +/*********************** + * ZCopyReaderListener * + ***********************/ +#ifdef RTI_ZEROCOPY_AVAILABLE +template +static void on_data_available_zcopy(void *listener_data, DDS_DataReader *reader) +{ + if (listener_data == NULL) { + fprintf(stderr,"Error: listener_data is NULL\n"); + return; + } + + TSeq samples = DDS_SEQUENCE_INITIALIZER; + struct DDS_SampleInfoSeq sampleInfo = DDS_SEQUENCE_INITIALIZER; + TestMessage message; + IMessagingCB *callback = (IMessagingCB *) listener_data; + + DDS_ReturnCode_t retcode = DDS_DataReader_take( + reader, + (struct DDS_UntypedSampleSeq *) &samples, + &sampleInfo, + DDS_LENGTH_UNLIMITED, + DDS_ANY_SAMPLE_STATE, + DDS_ANY_VIEW_STATE, + DDS_ANY_INSTANCE_STATE); + if (retcode == DDS_RETCODE_NO_DATA) + { + return; + } + else if (retcode != DDS_RETCODE_OK) + { + fprintf(stderr,"Error during taking data in listener %d\n", retcode); + return; + } + + int seq_length = DDS_SampleInfoSeq_get_length(&sampleInfo); + for (int i = 0; i < seq_length; ++i) + { + if (DDS_SampleInfoSeq_get_reference(&sampleInfo, i)->valid_data == DDS_BOOLEAN_TRUE) + { + T *sample = DDS_TypedSampleSeq_get_reference(&samples, i); + + message.entity_id = sample->entity_id; + message.seq_num = sample->seq_num; + message.timestamp_sec = sample->timestamp_sec; + message.timestamp_usec = sample->timestamp_usec; + message.latency_ping = sample->latency_ping; + /* DDS_Octet[] is fixed-size, and the content is ignored + * So only the size of message matters */ + message.size = sample->size; + + if (message.size != CERT_ZC_ARRAY_SIZE + && message.size != perftest_cpp::INITIALIZE_SIZE + && message.size != perftest_cpp::FINISHED_SIZE) + { + fprintf(stderr, "Unexpected size of received sample (%d).\n", + message.size); + continue; + } + + callback->process_message(message); + } + } + retcode = DDS_DataReader_return_loan( + reader, + (struct DDS_UntypedSampleSeq *) &samples, + &sampleInfo); + if (retcode != DDS_RETCODE_OK) + { + fprintf(stderr,"Error during return loan in listener %d.\n", retcode); + fflush(stderr); + } +} + +template +class ZCopyReaderListener : public ReaderListenerBase { +public: + ZCopyReaderListener(IMessagingCB *callback) + { + this->dr_listener = DDS_DataReaderListener_INITIALIZER; + this->dr_listener.as_listener.listener_data = (void *) callback; + this->dr_listener.on_data_available = &on_data_available_zcopy; + } +}; +#endif +/****************************** + * End of ZCopyReaderListener * + ******************************/ + +/******************* + * End of Listener * + *******************/ + +/********************************************************************** + *********************** RTICertImpl methods ************************** + **********************************************************************/ + +/******************************* + * Constructor for RTICertImpl + */ +template +RTICertImplBase::RTICertImplBase( + const char *type_name, + NDDS_Type_Plugin *plugin) + : _parent(nullptr), + _PM(nullptr), + _transport(), + _pongSemaphore(nullptr) +{ + _instanceMaxCountReader = 1; + _factory = NULL; + _participant = NULL; + _subscriber = NULL; + _publisher = NULL; + _reader = NULL; + _typename = type_name; + _plugin = plugin; + _useZeroCopy = false; + + _qoSProfileNameMap[LATENCY_TOPIC_NAME] = std::string("LatencyQos"); + _qoSProfileNameMap[ANNOUNCEMENT_TOPIC_NAME] = std::string("AnnouncementQos"); + _qoSProfileNameMap[THROUGHPUT_TOPIC_NAME] = std::string("ThroughputQos"); +} + +/********************************************************* + * shutdown + */ +template +void RTICertImplBase::shutdown() +{ + if(_pongSemaphore != NULL) { + _pongSemaphore = NULL; + } + DDS_DomainParticipantFactory *factory = NULL; + RT_Registry_T *registry = NULL; + factory = DDS_DomainParticipantFactory_get_instance(); + CHECK_PTR(factory, "DDS_DomainParticipantFactory_get_instance"); + registry = DDS_DomainParticipantFactory_get_registry(factory); + CHECK_PTR(registry, "DDS_DomainParticipantFactory_get_registry"); + RT_Registry_unregister(registry, DISC_FACTORY_DEFAULT_NAME, NULL, NULL); + RT_Registry_unregister(registry, NETIO_DEFAULT_UDP_NAME, NULL, NULL); + RT_Registry_unregister(registry, DDSHST_READER_DEFAULT_HISTORY_NAME, NULL, NULL); + RT_Registry_unregister(registry, DDSHST_WRITER_DEFAULT_HISTORY_NAME, NULL, NULL); +done: + return; +} + +#ifdef RTI_ZEROCOPY_AVAILABLE +template +void RTICertImpl_ZCopy::shutdown() +{ + RTICertImplBase::shutdown(); + DDS_DomainParticipantFactory *factory = NULL; + RT_Registry_T *registry = NULL; + factory = DDS_DomainParticipantFactory_get_instance(); + CHECK_PTR(factory, "DDS_DomainParticipantFactory_get_instance"); + registry = DDS_DomainParticipantFactory_get_registry(factory); + CHECK_PTR(registry, "DDS_DomainParticipantFactory_get_registry"); + RT_Registry_unregister(registry, NETIO_DEFAULT_NOTIF_NAME, NULL, NULL); +done: + return; +} +#endif + +/******************************** + * get_middleware_version_string + */ +template +const std::string RTICertImplBase::get_middleware_version_string() +{ + return "RTI Connext DDS Micro " + + perftest::to_string((int) RTIME_DDS_VERSION_MAJOR) + "." + + perftest::to_string((int) RTIME_DDS_VERSION_MINOR) + "." + + perftest::to_string((int) RTIME_DDS_VERSION_REVISION) + "." + + perftest::to_string((int) RTIME_DDS_VERSION_RELEASE); +} + +/************************************* + * Validate and manage the parameters + */ +template +bool RTICertImplBase::validate_input() +{ + /* Manage parameter -instance */ + if (_PM->is_set("instances")) { + _instanceMaxCountReader = _PM->get("instances"); + } + +#ifdef RTI_ZEROCOPY_AVAILABLE + /* Manage parameter -dataLen */ + if (_PM->is_set("zerocopy")) { + long dataLen = CERT_ZC_ARRAY_SIZE + perftest_cpp::OVERHEAD_BYTES; + if (_PM->is_set("dataLen")) { + fprintf(stderr, + "Specified '-dataLen' (%ld) invalid and ignored:\n" + "When using ZeroCopy transport, the Data length\n" + "is configured at building stage with the\n" + "build parameter --cert-zc-datalen <>.\n" + "The current ZC data length is (%ld).\n", + _PM->get("dataLen"), + dataLen); + } + _PM->set("dataLen", dataLen); + } +#endif + + /* Manage parameter -writeInstance */ + if (_PM->is_set("writeInstance")) { + if (_PM->get("instances") < _PM->get("writeInstance")) { + fprintf(stderr, + "Specified '-WriteInstance' (%ld) invalid: " + "Bigger than the number of instances (%ld).\n", + _PM->get("writeInstance"), + _PM->get("instances")); + return false; + } + } + + /* Manage parameter -peer */ + if (_PM->get_vector("peer").size() >= RTIPERFTEST_MAX_PEERS) { + fprintf(stderr, + "The maximum of 'initial_peers' is %d\n", + RTIPERFTEST_MAX_PEERS); + return false; + } + + /* Manage transport parameter */ + if (!_transport.validate_input()) { + fprintf(stderr, "Failure validating the transport options.\n"); + return false; + }; + +#ifdef RTI_CERT + if (_PM->get("transport") == "SHMEM") + { + fprintf(stderr, "SHMEM is not supported for Connext Cert.\n"); + return false; + } +#endif + + return true; +} + +/********************************************************* + * PrintConfiguration + */ +template +std::string RTICertImplBase::print_configuration() +{ + + std::ostringstream stringStream; + + stringStream << "\tDomain: " << _PM->get("domain") << "\n"; + + stringStream << "\n" << _transport.printTransportConfigurationSummary(); + + const std::vector peerList = + _PM->get_vector("peer"); + if (!peerList.empty()) { + stringStream << "\tInitial peers: "; + for (unsigned int i = 0; i < peerList.size(); ++i) { + stringStream << peerList[i]; + if (i == peerList.size() - 1) { + stringStream << "\n"; + } else { + stringStream << ", "; + } + } + } + + return stringStream.str(); +} + +/********************************* + ******* Publisher classes ******* + *********************************/ + +/********************************* + * CertPublisher class + */ +template +class CertPublisherBase : public IMessagingWriter +{ +protected: + ParameterManager *_PM; + DDS_DataWriter *_writer; + PerftestSemaphore *_pongSemaphore; + long _numInstances; + long _instanceCounter; + long _instancesToBeWritten; + DDS_InstanceHandle_t *_instanceHandles; + bool _isReliable; + DDS_ReturnCode_t retCode; + + long &getCftInstanceIndex() { + return _numInstances; + } + +public: + CertPublisherBase( + DDS_DataWriter *writer, + long num_instances, + PerftestSemaphore *pongSemaphore, + long instancesToBeWritten, + ParameterManager *PM) + : _PM(PM), + _writer(writer), + _pongSemaphore(pongSemaphore), + _numInstances(num_instances), + _instanceCounter(0), + _instancesToBeWritten(instancesToBeWritten), + _isReliable(!_PM->is_set("bestEffort")) + { + /* Adding one extra instance for MAX_CFT_VALUE */ + _instanceHandles = (DDS_InstanceHandle_t *) malloc( + sizeof(DDS_InstanceHandle_t)*static_cast( + _numInstances + 1)); + if (_instanceHandles == NULL) { + shutdown(); + fprintf(stderr, "_instanceHandles malloc failed\n"); + throw std::bad_alloc(); + } + } + + ~CertPublisherBase() + { + try { + shutdown(); + } catch (const std::exception &ex) { + fprintf(stderr, "Exception in CertPublisherBase::~CertPublisherBase(): %s.\n", ex.what()); + } + } + + void shutdown() + { + if (_instanceHandles != NULL) { + free(_instanceHandles); + _instanceHandles = NULL; + } + } + + virtual void flush() override + { + } + + virtual bool wait_for_ping_response() override + { + if(_pongSemaphore != nullptr) { + if (!PerftestSemaphore_take( + _pongSemaphore, + PERFTEST_SEMAPHORE_TIMEOUT_INFINITE)) { + fprintf(stderr,"Unexpected error taking semaphore\n"); + return false; + } + } + return true; + } + /* time out in milliseconds */ + virtual bool wait_for_ping_response(int timeout) override + { + if(_pongSemaphore != nullptr) { + if (!PerftestSemaphore_take( + _pongSemaphore, + timeout)) { + fprintf(stderr,"Unexpected error taking semaphore\n"); + return false; + } + } + return true; + } + + virtual bool notify_ping_response() override + { + if(_pongSemaphore != nullptr) { + if (!PerftestSemaphore_give(_pongSemaphore)) { + fprintf(stderr,"Unexpected error giving semaphore\n"); + return false; + } + } + return true; + } + + virtual unsigned int get_pulled_sample_count() override + { + /* Not supported in Cert */ + return 0; + } + + virtual unsigned int get_sample_count() override + { + /* Not supported in Cert */ + return 0; + } + + virtual unsigned int get_sample_count_peak() override + { + /* Not supported in Cert */ + return 0; + } + + virtual void wait_for_ack(int sec, unsigned int nsec) override + { + UNUSED_ARG(sec); + UNUSED_ARG(nsec); + + /* Since wait_for_ack is not supported in Cert, it is replaced by a + sleep of 20 milliseconds */ + PerftestClock::milliSleep(20); + + return; + } + +}; + +template +class CertPublisher : public CertPublisherBase +{ +protected: + /* pointer to loned data in SharedQ */ + T *_data; +public: + CertPublisher( + DDS_DataWriter *writer, + long num_instances, + PerftestSemaphore *pongSemaphore, + long instancesToBeWritten, + ParameterManager *PM) + : CertPublisherBase( + writer, + num_instances, + pongSemaphore, + instancesToBeWritten, + PM) + { + _data = (T *) malloc(sizeof(T)); + memset(_data, 0, sizeof(*_data)); + } + + ~CertPublisher() + { + try { + this->shutdown(); + } catch (const std::exception &ex) { + fprintf(stderr, "Exception in CertPublisher::~CertPublisher(): %s.\n", ex.what()); + } + } + + void shutdown() + { + if (this->_instanceHandles != NULL) { + free(this->_instanceHandles); + this->_instanceHandles = NULL; + } + + if (this->_data != NULL) { + free(this->_data); + this->_data = NULL; + } + } + + void wait_for_readers(int numSubscribers) + { + /* This is a workaround for registering before enabling Datawriter + * The datawriter is enabled at this point + * Possible Improvement: Create a function for this instead + * Modify the perftest_cpp to call the function before calling wait_for_reader + */ + for (long i = 0; i < this->_numInstances; ++i) { + for (int c = 0; c < KEY_SIZE; c++) { + _data->key[c] = (unsigned char) (i >> (c * 8)); + } + this->_instanceHandles[i] = DDS_DataWriter_register_instance(this->_writer, this->_data); + } + + /* Register the key of MAX_CFT_VALUE */ + for (int c = 0; c < KEY_SIZE; c++) { + _data->key[c] = (unsigned char)(MAX_CFT_VALUE >> (c * 8)); + } + this->_instanceHandles[this->_numInstances] = DDS_DataWriter_register_instance(this->_writer, this->_data); + + DDS_PublicationMatchedStatus status; + + while (true) { + DDS_ReturnCode_t retcode = DDS_DataWriter_get_publication_matched_status( + this->_writer, + &status); + if (retcode != DDS_RETCODE_OK) { + fprintf(stderr, + "wait_for_readers DDS_DataWriter_get_publication_matched_status " + "failed: %d.\n", + retcode); + } + if (status.current_count >= numSubscribers) { + break; + } + PerftestClock::milliSleep(PERFTEST_DISCOVERY_TIME_MSEC); + } + } + + bool send(const TestMessage &message, bool isCftWildCardKey) + { + DDS_ReturnCode_t retcode; + RTI_BOOL brc; + long key = 0; + long instanceHandlesIndex = 0; + + /* Calculate key and add it if using more than one instance */ + if (!isCftWildCardKey) { + if (this->_numInstances > 1) { + if (this->_instancesToBeWritten == -1) { + key = this->_instanceCounter++ % this->_numInstances; + } else { + /* send sample to a specific subscriber */ + key = this->_instancesToBeWritten; + } + } + } else { + key = MAX_CFT_VALUE; + } + + for (int c = 0; c < KEY_SIZE; c++) { + _data->key[c] = (unsigned char)(key >> (c * 8)); + } + + /* Populate sample */ + _data->entity_id = message.entity_id; + _data->seq_num = message.seq_num; + _data->timestamp_sec =message.timestamp_sec; + _data->timestamp_usec = message.timestamp_usec; + _data->latency_ping = message.latency_ping; + brc = DDS_OctetSeq_loan_contiguous(&_data->bin_data, + (DDS_Octet*)message.data, + message.size, + message.size); + CHECK_BOOL(brc, "DDS_OctetSeq_loan_contiguous"); + +#ifdef DEBUG_PING_PONG + std::cerr << " -- -- before sending it in the write\n"; +#endif + instanceHandlesIndex = this->getCftInstanceIndex(); + if (!isCftWildCardKey) { + instanceHandlesIndex = key; + } + retcode = DDS_DataWriter_write( + this->_writer, + this->_data, + &this->_instanceHandles[instanceHandlesIndex]); + if (retcode != DDS_RETCODE_OK) { + fprintf(stderr,"Write error %d.\n", retcode); + return false; + } +#ifdef DEBUG_PING_PONG + else std::cerr << ">> wrote sample " << this->_data->seq_num << std::endl; +#endif + + brc = DDS_OctetSeq_unloan(&_data->bin_data); + CHECK_BOOL(brc, "DDS_OctetSeq_unloan"); + + return true; + done: + return false; + } +}; +/********************************** + * End of CertPublisher class + */ + + +#ifdef RTI_ZEROCOPY_AVAILABLE +/********************************* + * ZCopyCertPublisher class + */ +template +class ZCopyCertPublisher : public CertPublisherBase +{ +public: + ZCopyCertPublisher( + DDS_DataWriter *writer, + long num_instances, + PerftestSemaphore *pongSemaphore, + long instancesToBeWritten, + ParameterManager *PM) + : CertPublisherBase( + writer, + num_instances, + pongSemaphore, + instancesToBeWritten, + PM) + { } + + ~ZCopyCertPublisher() + { + try { + this->shutdown(); + } catch (const std::exception &ex) { + fprintf(stderr, "Exception in ZCopyCertPublisher::~ZCopyCertPublisher(): %s.\n", ex.what()); + } + } + + void shutdown() + { + if (this->_instanceHandles != NULL) { + free(this->_instanceHandles); + this->_instanceHandles = NULL; + } + } + + void wait_for_readers(int numSubscribers) + { + DDS_PublicationMatchedStatus status; + + while (true) { + DDS_ReturnCode_t retcode = DDS_DataWriter_get_publication_matched_status( + this->_writer, + &status); + if (retcode != DDS_RETCODE_OK) { + fprintf(stderr, + "wait_for_readers DDS_DataWriter_get_publication_matched_status " + "failed: %d.\n", + retcode); + } + if (status.current_count >= numSubscribers) { + break; + } + PerftestClock::milliSleep(PERFTEST_DISCOVERY_TIME_MSEC); + } + } + + bool send(const TestMessage &message, bool isCftWildCardKey) + { + DDS_ReturnCode_t retcode; + long key = 0; + long instanceHandlesIndex = 0; + + /* Must loan a new sample for every write + * Cannot reuse writen-sample + */ + T* data; + retcode = DDS_DataWriter_get_loan(this->_writer, (void **) &data); + if (retcode == DDS_RETCODE_OUT_OF_RESOURCES) { + goto done; + } + CHECK_RETCODE(retcode, "DDS_DataWriter_get_loan"); + + /* This is a workaround for registering before enabling Datawriter + * The datawriter is enabled at this point + * Possible Improvement: Create a function for this instead + * Modify the perftest_cpp to call the function before calling wait_for_reader + */ + for (long i = 0; i < this->_numInstances; ++i) { + for (int c = 0; c < KEY_SIZE; c++) { + data->key[c] = (unsigned char) (i >> (c * 8)); + } + this->_instanceHandles[i] = DDS_DataWriter_register_instance(this->_writer, data); + } + + /* Register the key of MAX_CFT_VALUE */ + for (int c = 0; c < KEY_SIZE; c++) { + data->key[c] = (unsigned char)(MAX_CFT_VALUE >> (c * 8)); + } + this->_instanceHandles[this->_numInstances] = DDS_DataWriter_register_instance(this->_writer, data); + + /* Calculate key and add it if using more than one instance */ + if (!isCftWildCardKey) { + if (this->_numInstances > 1) { + if (this->_instancesToBeWritten == -1) { + key = this->_instanceCounter++ % this->_numInstances; + } else { /* send sample to a specific subscriber */ + key = this->_instancesToBeWritten; + } + } + } else { + key = MAX_CFT_VALUE; + } + + for (int c = 0; c < KEY_SIZE; c++) { + data->key[c] = (unsigned char)(key >> (c * 8)); + } + + /* Populate sample */ + data->entity_id = message.entity_id; + data->seq_num = message.seq_num; + data->timestamp_sec = message.timestamp_sec; + data->timestamp_usec = message.timestamp_usec; + data->latency_ping = message.latency_ping; + /* DDS_Octet[] is fixed size and content does not matter + * Only the size of the message matters. + */ + data->size = message.size; + +#ifdef DEBUG_PING_PONG + std::cerr << " -- -- before sending it in the write\n"; +#endif + instanceHandlesIndex = this->getCftInstanceIndex(); + if (!isCftWildCardKey) { + instanceHandlesIndex = key; + } + retcode = DDS_DataWriter_write( + this->_writer, + data, + &this->_instanceHandles[instanceHandlesIndex]); + if (retcode != DDS_RETCODE_OK) { + fprintf(stderr,"Write error %d.\n", retcode); + return false; + } +#ifdef DEBUG_PING_PONG + else std::cerr << ">> wrote sample " << data->seq_num << std::endl; +#endif + + return true; + done: + return false; + } +}; +/*************************************** + * End of ZCopyCertPublisher class + */ +#endif /* RTI_ZEROCOPY_AVAILABLE */ +/********************************* + *** End of Publisher classes ** + *********************************/ + +/********************************* + ****** Subscriber classes ****** + *********************************/ + +/********************** + * CertSubscriber class + */ +template +class CertSubscriberBase : public IMessagingReader +{ +public: + ParameterManager *_PM; + TestMessage _message; + int _data_idx; + bool _no_data; + bool _endTest; + bool _useReceiveThread; + DDS_WaitSet *_waitset; + DDS_ConditionSeq _active_conditions; + DDS_GuardCondition *_endTestCondition; + DDS_DataReader *_reader; + TSeq _data_seq; + DDS_SampleInfoSeq _info_seq; + + CertSubscriberBase(DDS_DataReader *reader, bool useReceiveThread, ParameterManager *PM) + : _PM(PM), + _message(), + _data_idx(0), + _no_data(true), + _endTest(false), + _useReceiveThread(useReceiveThread), + _waitset(NULL), + _reader(reader) + { + RTI_BOOL brc; + DDS_ReturnCode_t retcode; + + _data_seq = DDS_SEQUENCE_INITIALIZER; + _info_seq = DDS_SEQUENCE_INITIALIZER; + + if (_useReceiveThread) { + _active_conditions = (struct DDS_ConditionSeq)DDS_SEQUENCE_INITIALIZER; + brc = DDS_ConditionSeq_set_maximum(&this->_active_conditions, 1); + CHECK_BOOL(brc, "DDS_ConditionSeq_set_maximum"); + _waitset = DDS_WaitSet_new(); + CHECK_PTR(_waitset, "DDS_WaitSet_new"); + + DDS_StatusCondition *reader_status; + DDS_Condition *condition; + DDS_Entity *entity = DDS_DataReader_as_entity(reader); + CHECK_PTR(entity, "DDS_DataReader_as_entity"); + reader_status = DDS_Entity_get_statuscondition(entity); + CHECK_PTR(reader_status, "DDS_Entity_get_statuscondition"); + + retcode = DDS_StatusCondition_set_enabled_statuses(reader_status, DDS_DATA_AVAILABLE_STATUS); + CHECK_RETCODE(retcode, "DDS_StatusCondition_set_enabled_statuses"); + condition = DDS_StatusCondition_as_condition(reader_status); + CHECK_PTR(condition, "DDS_StatusCondition_as_condition"); + retcode = DDS_WaitSet_attach_condition(_waitset, condition); + CHECK_RETCODE(retcode, "DDS_WaitSet_attach_condition"); + + _endTestCondition = DDS_GuardCondition_new(); + CHECK_PTR(_endTestCondition, "DDS_GuardCondition_new"); + retcode = DDS_WaitSet_attach_condition(_waitset, DDS_GuardCondition_as_condition(_endTestCondition)); + CHECK_RETCODE(retcode, "DDS_WaitSet_attach_condition"); + } + done: + return; + } + + ~CertSubscriberBase() + { + try + { + shutdown(); + } + catch(const std::exception& e) + { + fprintf(stderr, "Exception in CertSubscriberBase::~CertSubscriberBase(): %s.\n", e.what()); + } + } + + virtual void shutdown() override + { + /* loan may be outstanding during shutdown */ + DDS_DataReader_return_loan( + _reader, + (struct DDS_UntypedSampleSeq *) &_data_seq, + &_info_seq); + } + + virtual void wait_for_writers(int numPublishers) override + { + DDS_SubscriptionMatchedStatus status; + + while (true) { + DDS_DataReader_get_subscription_matched_status(_reader, &status); + if (status.current_count >= numPublishers) { + break; + } + PerftestClock::milliSleep(PERFTEST_DISCOVERY_TIME_MSEC); + } + } + + virtual bool unblock() override + { + _endTest = true; + DDS_ReturnCode_t retCode = DDS_GuardCondition_set_trigger_value(_endTestCondition, DDS_BOOLEAN_TRUE); + if (retCode != DDS_RETCODE_OK) { + fprintf(stderr,"Error setting a GuardCondition on unblock %d.\n", retCode); + fflush(stderr); + return false; + } + return true; + } + + virtual unsigned int get_sample_count() override + { + /* Not supported in Micro */ + return 0; + } + + virtual unsigned int get_sample_count_peak() override + { + /* Not supported in Micro */ + return 0; + } + +}; + +template +class CertSubscriber : public CertSubscriberBase +{ +public: + CertSubscriber(DDS_DataReader *reader, bool useReceiveThread, ParameterManager *PM) + : CertSubscriberBase(reader, useReceiveThread, PM) + { } + + TestMessage *receive_message() + { + DDS_ReturnCode_t retCode; + int seq_length; + + while (!this->_endTest) { + /* no outstanding reads */ + if (this->_no_data) { + retCode = DDS_WaitSet_wait( + this->_waitset, + &this->_active_conditions, + &DDS_DURATION_INFINITE); + if (retCode != DDS_RETCODE_OK) { + printf("dds_waitset_wait RetCode: %d\n", + retCode); + continue; + } + + if (DDS_ConditionSeq_get_length(&this->_active_conditions) == 0) + { + continue; + } + + if (this->_endTest) + { + if (this->_data_idx != seq_length) + { + retCode = DDS_DataReader_return_loan( + this->_reader, + (struct DDS_UntypedSampleSeq *) &this->_data_seq, + &this->_info_seq); + if (retCode != DDS_RETCODE_OK) { + fprintf(stderr,"Error during return loan %d.\n", retCode); + fflush(stderr); + } + } + return NULL; + } + + retCode = DDS_DataReader_take( + this->_reader, + (struct DDS_UntypedSampleSeq *) &this->_data_seq, + &this->_info_seq, + DDS_LENGTH_UNLIMITED, + DDS_ANY_SAMPLE_STATE, + DDS_ANY_VIEW_STATE, + DDS_ANY_INSTANCE_STATE); + if (retCode == DDS_RETCODE_NO_DATA) + { + continue; + } + else if (retCode != DDS_RETCODE_OK) + { + fprintf(stderr,"Error during taking data %d.\n", retCode); + return NULL; + } + + this->_data_idx = 0; + this->_no_data = false; + } + + seq_length = DDS_SampleInfoSeq_get_length(&this->_info_seq); + /* check to see if hit end condition */ + if (this->_data_idx == seq_length) + { + retCode = DDS_DataReader_return_loan( + this->_reader, + (struct DDS_UntypedSampleSeq *) &this->_data_seq, + &this->_info_seq); + if (retCode != DDS_RETCODE_OK) { + fprintf(stderr,"Error during return loan %d.\n", retCode); + fflush(stderr); + } + this->_no_data = true; + continue; + } + + /*skip non-valid data */ + DDS_SampleInfo *sample_info = DDS_SampleInfoSeq_get_reference( + &this->_info_seq, this->_data_idx); + while ((sample_info->valid_data == false) + && (this->_data_idx < seq_length)) + { + this->_data_idx++; + sample_info = DDS_SampleInfoSeq_get_reference(&this->_info_seq, + this->_data_idx); + } + + T *valid_sample = DDS_TypedSampleSeq_get_reference( + &this->_data_seq, this->_data_idx); + + this->_message.entity_id = valid_sample->entity_id; + this->_message.seq_num = valid_sample->seq_num; + this->_message.timestamp_sec = valid_sample->timestamp_sec; + this->_message.timestamp_usec = valid_sample->timestamp_usec; + this->_message.latency_ping = valid_sample->latency_ping; + this->_message.size = DDS_OctetSeq_get_length(&valid_sample->bin_data); + this->_message.data = (char *) DDS_OctetSeq_get_contiguous_buffer(&valid_sample->bin_data); + + ++this->_data_idx; + + return &this->_message; + } /* end while */ + return NULL; + } +}; +/********************************** + * End of CertSubscriber class + */ + +#ifdef RTI_ZEROCOPY_AVAILABLE +/********************************* + * ZCopyCertSubscriber class + */ +template +class ZCopyCertSubscriber : public CertSubscriberBase +{ +public: + ZCopyCertSubscriber(DDS_DataReader *reader, bool useReceiveThread, ParameterManager *PM) + : CertSubscriberBase(reader, useReceiveThread, PM) + { } + + TestMessage *receive_message() + { + DDS_ReturnCode_t retCode; + int seq_length; + + while (!this->_endTest) { + /* no outstanding reads */ + if (this->_no_data) { + retCode = DDS_WaitSet_wait( + this->_waitset, + &this->_active_conditions, + &DDS_DURATION_INFINITE); + if (retCode != DDS_RETCODE_OK) { + printf("dds_waitset_wait RetCode: %d\n", + retCode); + continue; + } + + if ((int) DDS_ConditionSeq_get_length(&this->_active_conditions) == 0) + { + continue; + } + + if (this->_endTest) + { + if (this->_data_idx != seq_length) + { + retCode = DDS_DataReader_return_loan( + this->_reader, + (struct DDS_UntypedSampleSeq *) &this->_data_seq, + &this->_info_seq); + if (retCode != DDS_RETCODE_OK) { + fprintf(stderr,"Error during return loan %d.\n", retCode); + fflush(stderr); + } + } + return NULL; + } + + retCode = DDS_DataReader_take( + this->_reader, + (struct DDS_UntypedSampleSeq *) &this->_data_seq, + &this->_info_seq, + DDS_LENGTH_UNLIMITED, + DDS_ANY_SAMPLE_STATE, + DDS_ANY_VIEW_STATE, + DDS_ANY_INSTANCE_STATE); + if (retCode == DDS_RETCODE_NO_DATA) + { + continue; + } + else if (retCode != DDS_RETCODE_OK) + { + fprintf(stderr,"Error during taking data %d.\n", retCode); + return NULL; + } + + this->_data_idx = 0; + this->_no_data = false; + } + + seq_length = DDS_SampleInfoSeq_get_length(&this->_info_seq); + /* check to see if hit end condition */ + if (this->_data_idx == seq_length) + { + retCode = DDS_DataReader_return_loan( + this->_reader, + (struct DDS_UntypedSampleSeq *) &this->_data_seq, + &this->_info_seq); + if (retCode != DDS_RETCODE_OK) { + fprintf(stderr,"Error during return loan %d.\n", retCode); + fflush(stderr); + } + this->_no_data = true; + continue; + } + + /* skip non-valid data */ + DDS_SampleInfo *sample_info = DDS_SampleInfoSeq_get_reference( + &this->_info_seq, this->_data_idx); + while ((sample_info->valid_data == false) + && (this->_data_idx < seq_length)) + { + this->_data_idx++; + sample_info = DDS_SampleInfoSeq_get_reference(&this->_info_seq, + this->_data_idx); + } + + T *valid_sample = DDS_TypedSampleSeq_get_reference( + &this->_data_seq, this->_data_idx); + + this->_message.entity_id = valid_sample->entity_id; + this->_message.seq_num = valid_sample->seq_num; + this->_message.timestamp_sec = valid_sample->timestamp_sec; + this->_message.timestamp_usec = valid_sample->timestamp_usec; + this->_message.latency_ping = valid_sample->latency_ping; + /* DDS_Octet[] is fixed-size, and the content is ignored + * So only the size of message matters */ + this->_message.size = valid_sample->size; + + if (this->_message.size != CERT_ZC_ARRAY_SIZE + && this->_message.size != perftest_cpp::INITIALIZE_SIZE + && this->_message.size != perftest_cpp::FINISHED_SIZE) + { + fprintf(stderr, "Unexpected size of received sample (%d).\n", + this->_message.size); + continue; + } + + ++this->_data_idx; + + return &this->_message; + } /* end while */ + return NULL; + } +}; +/*************************************** + * End of ZCopyCertSubscriber class + */ +#endif /* RTI_ZEROCOPY_AVAILABLE */ +/********************************* + *** End of Subscriber classes *** + *********************************/ + +/****************************************************************** + ****************** RTICertImpl Configuration ********************* + ******************************************************************/ + +/********************************* + * configure participant qos + */ +template bool +RTICertImplBase::configure_participant_qos(DDS_DomainParticipantQos &dpQos) +{ + // To be implemented by derived classes + // Unused parameter + UNUSED_ARG(dpQos); + return false; +} + +template bool +RTICertImpl::configure_participant_qos(DDS_DomainParticipantQos &dpQos) +{ + DDS_DomainParticipantFactory *factory; + struct DDS_DomainParticipantFactoryQos dpfQos = + DDS_DomainParticipantFactoryQos_INITIALIZER; + dpQos = DDS_DomainParticipantQos_INITIALIZER; + const std::vector peerList = + this->_PM->template get_vector("peer"); + RT_Registry_T *registry; + struct DPSE_DiscoveryPluginProperty discProp = DPSE_DiscoveryPluginProperty_INITIALIZER; + RTI_BOOL brc; + DDS_ReturnCode_t retCode; + char **strRef; + + factory = DDS_DomainParticipantFactory_get_instance(); + CHECK_PTR(factory, "Domain ParticipantFactory get instance"); + + registry = DDS_DomainParticipantFactory_get_registry(factory); + CHECK_PTR(registry, "DDS DomainParticipantFactory get registry"); + + /* Register default Data Writer and Reader history */ + brc = RT_Registry_register(registry, DDSHST_WRITER_DEFAULT_HISTORY_NAME, + WHSM_HistoryFactory_get_interface(), NULL, NULL); + CHECK_BOOL(brc, "RT_Registry_register wh"); + + brc = RT_Registry_register(registry, DDSHST_READER_DEFAULT_HISTORY_NAME, + RHSM_HistoryFactory_get_interface(), NULL, NULL); + CHECK_BOOL(brc, "RT_Registry_register rh"); + + /* Disable autoenable created entities */ + retCode = DDS_DomainParticipantFactory_get_qos(factory, &dpfQos); + CHECK_RETCODE(retCode, "DDS_DomainParticipantFactory_get_qos"); + dpfQos.entity_factory.autoenable_created_entities = DDS_BOOLEAN_FALSE; + retCode = DDS_DomainParticipantFactory_set_qos(factory, &dpfQos); + CHECK_RETCODE(retCode, "DDS_DomainParticipantFactory_set_qos"); + + /* Discovery register */ + brc = RT_Registry_register(registry, DISC_FACTORY_DEFAULT_NAME, + DPSE_DiscoveryFactory_get_interface(), + &discProp._parent, NULL); + CHECK_BOOL(brc, "RT_Registry_register DISC"); + + brc = RT_ComponentFactoryId_set_name(&dpQos.discovery.discovery.name, + DISC_FACTORY_DEFAULT_NAME); + CHECK_BOOL(brc, "RT_ComponentFactoryId_set_name DISC"); + + /* Configure UDP */ + if (!configureUDPv4Transport(registry, this->_transport, this->_PM)) + { + return false; + } + + /* Enabled transport(s) for transport and user_traffic */ + brc = DDS_StringSeq_set_maximum(&dpQos.transports.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.transports.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference(&dpQos.transports.enabled_transports, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(UDP_TRANSPORT_NAME); + CHECK_PTR(*strRef, "DDS_String_dup"); + + if (this->_PM->template get("multicast")) { + brc = DDS_StringSeq_set_maximum(&dpQos.user_traffic.enabled_transports, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.user_traffic.enabled_transports, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference( + &dpQos.user_traffic.enabled_transports, 1); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup("_udp://239.255.0.1"); + } + else + { + brc = DDS_StringSeq_set_maximum(&dpQos.user_traffic.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.user_traffic.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + } + strRef = DDS_StringSeq_get_reference(&dpQos.user_traffic.enabled_transports, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(UDP_TRANSPORT_LOCATOR); + CHECK_PTR(*strRef, "DDS_String_dup"); + + this->_transport.transportConfig.kind = TRANSPORT_UDPv4; + this->_transport.transportConfig.nameString = "UDPv4"; + + /* Enable transport for Discovery */ + brc = DDS_StringSeq_set_maximum(&dpQos.discovery.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.discovery.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference(&dpQos.discovery.enabled_transports, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(UDP_TRANSPORT_LOCATOR); + CHECK_PTR(*strRef, "DDS_String_dup"); + + /* If the user provides the list of addresses */ + if (!peerList.empty()) { + brc = DDS_StringSeq_set_maximum( + &dpQos.discovery.initial_peers, (int) peerList.size()); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length( + &dpQos.discovery.initial_peers, (int) peerList.size()); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + for(unsigned int i = 0; i < peerList.size(); ++i) { + strRef = DDS_StringSeq_get_reference( + &dpQos.discovery.initial_peers, static_cast(i)); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(peerList[i].c_str()); + CHECK_PTR(*strRef, "DDS_String_dup"); + } + } + else + { + /* Default discovery peers (unicast and multicast) */ + brc = DDS_StringSeq_set_maximum(&dpQos.discovery.initial_peers, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.discovery.initial_peers, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference(&dpQos.discovery.initial_peers, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup("239.255.0.1"); + CHECK_PTR(*strRef, "DDS_String_dup"); + strRef = DDS_StringSeq_get_reference(&dpQos.discovery.initial_peers, 1); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup("127.0.0.1"); + CHECK_PTR(*strRef, "DDS_String_dup"); + } + dpQos.discovery.accept_unknown_peers = DDS_BOOLEAN_TRUE; + + configureDPResourceLimits(dpQos); + + return true; +done: + return false; +} + +#ifdef RTI_ZEROCOPY_AVAILABLE +template +bool RTICertImpl_ZCopy::configure_participant_qos( + DDS_DomainParticipantQos &dpQos) +{ + DDS_DomainParticipantFactory *factory; + struct DDS_DomainParticipantFactoryQos dpfQos = DDS_DomainParticipantFactoryQos_INITIALIZER; + dpQos = DDS_DomainParticipantQos_INITIALIZER; + RT_Registry_T *registry; + struct DPSE_DiscoveryPluginProperty discProp = DPSE_DiscoveryPluginProperty_INITIALIZER; + DDS_DomainParticipantListener participantlistener = DDS_DomainParticipantListener_INITIALIZER; + struct ZCOPY_NotifInterfaceFactoryProperty *notifProp = NULL; + struct ZCOPY_NotifMechanismProperty *notifMechProp = NULL; + RTI_BOOL brc; + DDS_ReturnCode_t retCode; + char **strRef; + + factory = DDS_DomainParticipantFactory_get_instance(); + CHECK_PTR(factory, "Domain ParticipantFactory get instance"); + + registry = DDS_DomainParticipantFactory_get_registry(factory); + CHECK_PTR(registry, "DDS DomainParticipantFactory get registry"); + + /* Register default Data Writer and Reader history */ + brc = RT_Registry_register(registry, DDSHST_WRITER_DEFAULT_HISTORY_NAME, + WHSM_HistoryFactory_get_interface(), NULL, NULL); + CHECK_BOOL(brc, "RT_Registry_register wh"); + + brc = RT_Registry_register(registry, DDSHST_READER_DEFAULT_HISTORY_NAME, + RHSM_HistoryFactory_get_interface(), NULL, NULL); + CHECK_BOOL(brc, "RT_Registry_register rh"); + + /* Disable autoenable created entities */ + retCode = DDS_DomainParticipantFactory_get_qos(factory, &dpfQos); + CHECK_RETCODE(retCode, "DDS_DomainParticipantFactory_get_qos"); + dpfQos.entity_factory.autoenable_created_entities = DDS_BOOLEAN_FALSE; + retCode = DDS_DomainParticipantFactory_set_qos(factory, &dpfQos); + CHECK_RETCODE(retCode, "DDS_DomainParticipantFactory_set_qos"); + + /* Discovery register */ + brc = RT_Registry_register(registry, DISC_FACTORY_DEFAULT_NAME, + DPSE_DiscoveryFactory_get_interface(), + &discProp._parent, NULL); + CHECK_BOOL(brc, "RT_Registry_register DISC"); + + brc = RT_ComponentFactoryId_set_name(&dpQos.discovery.discovery.name, + DISC_FACTORY_DEFAULT_NAME); + CHECK_BOOL(brc, "RT_ComponentFactoryId_set_name DISC"); + + /* Configure UDP */ + if (!configureUDPv4Transport(registry, this->_transport, this->_PM)) { + return false; + } + + /* Initialize Zero Copy */ + brc = NDDS_Transport_ZeroCopy_initialize(registry, NULL, NULL); + CHECK_BOOL(brc, "NDDS_Transport_ZeroCopy_initialize"); + + /* Register Notification transport mechanism */ + notifMechProp = (struct ZCOPY_NotifMechanismProperty *) + malloc(sizeof(struct ZCOPY_NotifMechanismProperty)); + CHECK_PTR(notifMechProp, "malloc"); + + *notifMechProp = ZCOPY_NotifMechanismProperty_INITIALIZER; + notifProp = (struct ZCOPY_NotifInterfaceFactoryProperty *) + malloc(sizeof(struct ZCOPY_NotifInterfaceFactoryProperty)); + CHECK_PTR(notifProp, "malloc"); + *notifProp = ZCOPY_NotifInterfaceFactoryProperty_INITIALIZER; + + notifMechProp->intf_addr = 0; + notifProp->user_property = notifMechProp; + if (this->_PM->template get("latencyTest")) { + notifProp->max_samples_per_notif = 1; + } else { + /* Since DW is writing as fast as possible + * DR should read more samples per notification + * to keep up with DW. + */ + notifProp->max_samples_per_notif = 500; + } + brc = ZCOPY_NotifMechanism_register(registry, NETIO_DEFAULT_NOTIF_NAME, notifProp); + CHECK_BOOL(brc, "ZCOPY_NotifMechanism_register"); + + /* Enabled transport(s) for transport and user_traffic */ + brc = DDS_StringSeq_set_maximum(&dpQos.transports.enabled_transports, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.transports.enabled_transports, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference(&dpQos.transports.enabled_transports, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(NOTIF_TRANSPORT_NAME); + CHECK_PTR(*strRef, "DDS_String_dup"); + strRef = DDS_StringSeq_get_reference(&dpQos.transports.enabled_transports, 1); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(UDP_TRANSPORT_NAME); + CHECK_PTR(*strRef, "DDS_String_dup"); + + brc = DDS_StringSeq_set_maximum(&dpQos.user_traffic.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.user_traffic.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference(&dpQos.user_traffic.enabled_transports, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(NOTIF_TRANSPORT_LOCATOR); + CHECK_PTR(*strRef, "DDS_String_dup"); + + this->_transport.transportConfig.kind = TRANSPORT_SHMEM; + this->_transport.transportConfig.nameString = "ZeroCopy"; + + /* Enable transport for Discovery */ + brc = DDS_StringSeq_set_maximum(&dpQos.discovery.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.discovery.enabled_transports, 1); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference(&dpQos.discovery.enabled_transports, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup(UDP_TRANSPORT_LOCATOR); + CHECK_PTR(*strRef, "DDS_String_dup"); + + /* Default discovery peers (unicast and multicast) + * Custom peer list is not supported yet + */ + brc = DDS_StringSeq_set_maximum(&dpQos.discovery.initial_peers, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&dpQos.discovery.initial_peers, 2); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + strRef = DDS_StringSeq_get_reference(&dpQos.discovery.initial_peers, 0); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup("239.255.0.1"); + CHECK_PTR(*strRef, "DDS_String_dup"); + strRef = DDS_StringSeq_get_reference(&dpQos.discovery.initial_peers, 1); + CHECK_PTR(strRef, "DDS_StringSeq_get_reference"); + *strRef = DDS_String_dup("127.0.0.1"); + CHECK_PTR(*strRef, "DDS_String_dup"); + + dpQos.discovery.accept_unknown_peers = DDS_BOOLEAN_TRUE; + + configureDPResourceLimits(dpQos); + + return true; +done: + return false; +} +#endif /* RTI_ZEROCOPY_AVAILABLE */ +/************************************* + * End of configuring participant qos + */ + + +/*************************** + * configure writer qos + */ +template +bool RTICertImplBase::configure_writer_qos( + DDS_DataWriterQos &dw_qos, + std::string qos_profile, + std::string topic_name) +{ + /* Only force reliability on throughput/latency topics */ + if (strcmp(topic_name.c_str(), ANNOUNCEMENT_TOPIC_NAME) != 0) { + if (!_PM->get("bestEffort")) { + /* default: use the setting specified in the qos profile */ + dw_qos.reliability.kind = DDS_RELIABLE_RELIABILITY_QOS; + } + else { + /* override to best-effort */ + dw_qos.reliability.kind = DDS_BEST_EFFORT_RELIABILITY_QOS; + } + } else { + dw_qos.reliability.kind = DDS_RELIABLE_RELIABILITY_QOS; + dw_qos.durability.kind = DDS_TRANSIENT_LOCAL_DURABILITY_QOS; + } + + if (_PM->get("keyed")) + { + /* Adding one extra instance for MAX_CFT_VALUE */ + dw_qos.resource_limits.max_instances = + static_cast(_PM->get("instances") + 1); + dw_qos.resource_limits.max_samples = + dw_qos.resource_limits.max_instances * dw_qos.resource_limits.max_samples_per_instance; + } + + /* These QOS's are only set for the Throughput datawriter */ + if (qos_profile == "ThroughputQos") { + dw_qos.resource_limits.max_samples = _PM->get("sendQueueSize"); + this->_sendQueueSize = dw_qos.resource_limits.max_samples; + + if (_PM->get("keyed")) { + dw_qos.resource_limits.max_samples_per_instance = + dw_qos.resource_limits.max_samples / dw_qos.resource_limits.max_instances; + } else { + dw_qos.resource_limits.max_samples_per_instance = + dw_qos.resource_limits.max_samples; + } + + dw_qos.durability.kind = + (DDS_DurabilityQosPolicyKind)_PM->get("durability"); + + if (_PM->get("dataLen") > DEFAULT_MESSAGE_SIZE_MAX) { + dw_qos.protocol.rtps_reliable_writer.heartbeats_per_max_samples = + _PM->get("sendQueueSize"); + } else { + dw_qos.protocol.rtps_reliable_writer.heartbeats_per_max_samples = + _PM->get("sendQueueSize") / 10; + } + dw_qos.history.kind = DDS_KEEP_LAST_HISTORY_QOS; + dw_qos.history.depth = dw_qos.resource_limits.max_samples_per_instance; + /* Same values we use for Pro (See perftest_qos_profiles.xml). */ + dw_qos.protocol.rtps_reliable_writer.heartbeat_period.sec = 0; + dw_qos.protocol.rtps_reliable_writer.heartbeat_period.nanosec = 10000000; + /* DPSE object ID for discovery */ + dw_qos.protocol.rtps_object_id = 101; + } + else if (qos_profile == "LatencyQos") { + /* DPSE object ID for discovery */ + dw_qos.protocol.rtps_object_id = 202; + } + else /* qos_profile == "AnnouncementQos" */ + { + /* DPSE object ID for discovery */ + dw_qos.protocol.rtps_object_id = 203; + } + + /* SUMMARY FOR THE RESOURCE LIMITS */ + if (_PM->get("showResourceLimits")) { + std::ostringstream stringStream; + + stringStream << "Resource Limits DW (" + << topic_name + << " topic):\n" + << "\tSamples (Max): " + << dw_qos.resource_limits.max_samples + << "\n"; + + if (_PM->get("keyed")) { + stringStream << "\tInstances (Max): " + << dw_qos.resource_limits.max_instances + << "\n"; + stringStream << "\tMax Samples per Instance: " + << dw_qos.resource_limits.max_samples_per_instance + << "\n"; + + } + stringStream << "\tDurability is: " + << dw_qos.durability.kind + << "\n"; + stringStream << "\tHistory is: " + << dw_qos.history.kind + << "\n"; + stringStream << "\tReliability is: " + << dw_qos.reliability.kind + << "\n"; + + /* Heartbeats per max samples */ + stringStream << "\tHeartbeat period (s/ns): " + << dw_qos.protocol.rtps_reliable_writer.heartbeat_period.sec + << ", " + << dw_qos.protocol.rtps_reliable_writer.heartbeat_period.nanosec + << "\n"; + fprintf(stderr, "%s\n", stringStream.str().c_str()); + } + return true; +} + +/*************************** + * configure reader qos + */ +template +bool RTICertImplBase::configure_reader_qos( + DDS_DataReaderQos &dr_qos, + std::string qos_profile, + std::string topic_name) +{ + /* Only force reliability on throughput/latency topics */ + if (strcmp(topic_name.c_str(), ANNOUNCEMENT_TOPIC_NAME) != 0) { + if (!_PM->get("bestEffort")) { + dr_qos.reliability.kind = DDS_RELIABLE_RELIABILITY_QOS; + } else { + dr_qos.reliability.kind = DDS_BEST_EFFORT_RELIABILITY_QOS; + } + } + + /* only apply durability on Throughput datareader */ + if ((qos_profile == "ThroughputQos" || qos_profile == "LatencyQos") + && _PM->get("durability") != DDS_PERSISTENT_DURABILITY_QOS) { + dr_qos.durability.kind = + (DDS_DurabilityQosPolicyKind) _PM->get("durability"); + } + + /* + * In micro we cannot have UNLIMITED instances, this means that we need to + * increase the InstanceMaxCountReader (max instances for the dr) in all + * cases + */ + _instanceMaxCountReader++; + dr_qos.resource_limits.max_instances = static_cast( + _instanceMaxCountReader); + + if (qos_profile == "ThroughputQos") { + /* + * For Connext DDS Pro settings are set so initial samples are set to + * a lower value than max_samples, so we can grow if needed. For micro + * however we do not have the initial_samples parameter, therefore we + * must choose a value for max_samples since the beginning. We chose to + * use 5000. This value should be large enough to handle most of the + * communications. + * + * We could potentially modify this with a new command line parameter + */ + if (_PM->get("dataLen") > MAX_BOUNDED_SEQ_SIZE) { + dr_qos.resource_limits.max_samples = 50; + dr_qos.resource_limits.max_samples_per_instance = + 50 / dr_qos.resource_limits.max_instances; + dr_qos.history.depth = 50 / dr_qos.resource_limits.max_instances; + } + else { + dr_qos.resource_limits.max_samples = 5000; + dr_qos.resource_limits.max_samples_per_instance = + 5000 / dr_qos.resource_limits.max_instances; + dr_qos.history.depth = 5000 / dr_qos.resource_limits.max_instances; + } + /* + * In micro 2.4.x we don't have keep all, this means we need to set the + * history to keep last and chose a history depth. For the depth value + * we can we same value as max_samples + */ + + /* Keep all not supported in Micro 2.4.x */ + dr_qos.history.kind = DDS_KEEP_LAST_HISTORY_QOS; + + /* DPSE object ID for discovery */ + dr_qos.protocol.rtps_object_id = 211; + + } else { /* "LatencyQos" or "AnnouncementQos" */ + + /* + * By default Micro will use a max_samples = 1. This is too low for the + * initial burst of data. In pro we set this value via QoS to + * LENGTH_UNLIMITED. In Micro we will use a lower number due to + * memory restrictions. + */ + if (_PM->get("dataLen") > MAX_BOUNDED_SEQ_SIZE) { + dr_qos.resource_limits.max_samples = 50; + } + else { + dr_qos.resource_limits.max_samples = 1000; + } + + if (qos_profile == "LatencyQos") + { + /* DPSE object ID for discovery */ + dr_qos.protocol.rtps_object_id = 112; + } + else /* qos_profile == "AnnouncementQos" */ + { + /* DPSE object ID for discovery */ + dr_qos.protocol.rtps_object_id = 113; + } + } + + /* + * We could potentially use here the number of subscriber, right now this + * class does not have access to the number of subscriber though. + */ + dr_qos.reader_resource_limits.max_remote_writers = 50; + dr_qos.reader_resource_limits.max_remote_writers_per_instance = 50; + + /* + * In micro we cannot have UNLIMITED instances, this means that we need to + * increase the InstanceMaxCountReader (max instances for the dr) in all + * cases + */ + dr_qos.resource_limits.max_instances = _instanceMaxCountReader; + + _instanceMaxCountReader++; + + if (_PM->get("multicast")) { + + if (_transport.getMulticastAddr(topic_name.c_str()).empty()) { + fprintf(stderr, + "topic name must either be %s or %s or %s.\n", + THROUGHPUT_TOPIC_NAME, + LATENCY_TOPIC_NAME, + ANNOUNCEMENT_TOPIC_NAME); + return false; + } + + std::string receive_address = "_udp://" + _transport.getMulticastAddr(topic_name.c_str()); + DDS_StringSeq_set_maximum(&dr_qos.transport.enabled_transports, 1); + DDS_StringSeq_set_length(&dr_qos.transport.enabled_transports, 1); + *DDS_StringSeq_get_reference(&dr_qos.transport.enabled_transports, 0) = + DDS_String_dup(receive_address.c_str()); + + } + + if (_PM->get("showResourceLimits") + && topic_name.c_str() != ANNOUNCEMENT_TOPIC_NAME) { + std::ostringstream stringStream; + + stringStream << "Resource Limits DR (" + << topic_name + << " topic):\n" + << "\tSamples (Max): " + << dr_qos.resource_limits.max_samples + << "\n"; + + if (_PM->get("keyed")){ + stringStream << "\tInstances (Max): " + << dr_qos.resource_limits.max_instances + << "\n"; + + /* Samples per Instance */ + stringStream << "\tMax Samples per Instance: " + << dr_qos.resource_limits.max_samples_per_instance + << "\n"; + } + fprintf(stderr, "%s\n", stringStream.str().c_str()); + } + + return true; +} + +/********************************************************* + * Initialize + */ +template +bool RTICertImplBase::initialize( + ParameterManager &PM, + perftest_cpp *parent) +{ + /* Assign ParameterManager */ + _PM = &PM; + _transport.initialize(_PM); + _useZeroCopy = _PM->get("zerocopy"); + + DDS_DomainParticipantQos dpQos = DDS_DomainParticipantQos_INITIALIZER; + DDS_ReturnCode_t retCode; + + if (parent == NULL) { + return false; + } + _parent = parent; + + _factory = DDS_DomainParticipantFactory_get_instance(); + + if (!validate_input()) { + return false; + } + + /* + * Only if we run the latency test we need to wait + * for pongs after sending pings + */ + _pongSemaphore = _PM->get("latencyTest") + ? PerftestSemaphore_new() + : NULL; + + + if (!configure_participant_qos(dpQos)) { + return false; + } + + if (!create_domain_participant(&dpQos)) + { + return false; + } + + if (!_PM->get("dynamicData")) { + retCode = DDS_DomainParticipant_register_type(_participant, _typename, _plugin); + CHECK_RETCODE(retCode, "DDS_DomainParticipant_register_type"); + } else { + fprintf(stderr, "Dynamic data not supported in CERT.\n"); + return false; + } + + /* Enabling DPSE discovery of an remote participant */ + if (_PM->get("pub")) { + retCode = DPSE_RemoteParticipant_assert(_participant, PARTICIPANT_NAME_SX); + } else { + retCode = DPSE_RemoteParticipant_assert(_participant, PARTICIPANT_NAME_PX); + } + CHECK_RETCODE(retCode, "DPSE_RemoteParticipant_assert"); + + _publisher = DDS_DomainParticipant_create_publisher( + _participant, + &DDS_PUBLISHER_QOS_DEFAULT, + NULL, + DDS_STATUS_MASK_NONE); + CHECK_PTR(_publisher, "DDS_DomainParticipant_create_publisher"); + + _subscriber = DDS_DomainParticipant_create_subscriber( + _participant, + &DDS_SUBSCRIBER_QOS_DEFAULT, + NULL, + DDS_STATUS_MASK_NONE); + CHECK_PTR(_subscriber, "DDS_DomainParticipant_create_subscriber"); + + return true; +done: + return false; +} + +template +bool RTICertImplBase::create_domain_participant( + DDS_DomainParticipantQos *dpQos) +{ + + DDS_DomainParticipantListener participantlistener = DDS_DomainParticipantListener_INITIALIZER; + + /* Configure the participant name for DPSE */ + if (this->_PM->template get("pub")) { + DDS_EntityNameQosPolicy_set_name(&dpQos->participant_name, PARTICIPANT_NAME_PX); + dpQos->protocol.participant_id = PARTICIPANT_ID_PX; + } else { + DDS_EntityNameQosPolicy_set_name(&dpQos->participant_name, PARTICIPANT_NAME_SX); + dpQos->protocol.participant_id = PARTICIPANT_ID_SX; + } + + _participant = DDS_DomainParticipantFactory_create_participant( + _factory, + _PM->get("domain"), + dpQos, + &participantlistener, + DDS_STATUS_MASK_NONE); + + CHECK_PTR(_participant, "DDS_DomainParticipantFactory_create_participant"); + + return true; + +done: + + return false; +} + +#ifdef RTI_ZEROCOPY_AVAILABLE +template +bool RTICertImpl_ZCopy::create_domain_participant( + DDS_DomainParticipantQos *dpQos) +{ + DDS_DomainParticipantListener participantlistener = DDS_DomainParticipantListener_INITIALIZER; + + /* Configure the participant name for DPSE */ + if (this->_PM->template get("pub")) { + DDS_EntityNameQosPolicy_set_name(&dpQos->participant_name, PARTICIPANT_NAME_PX); + dpQos->protocol.participant_id = PARTICIPANT_ID_PX; + } else { + DDS_EntityNameQosPolicy_set_name(&dpQos->participant_name, PARTICIPANT_NAME_SX); + dpQos->protocol.participant_id = PARTICIPANT_ID_SX; + } + + this->_participant = DDS_DomainParticipantFactory_create_participant( + this->_factory, + this->_PM->template get("domain"), + dpQos, + &participantlistener, + DDS_STATUS_MASK_NONE); + CHECK_PTR(this->_participant, + "DDS_DomainParticipantFactory_create_participant"); + + return true; + +done: + + return false; +} +#endif + +/********************************************************* + * GetInitializationSampleCount + */ +template +unsigned long RTICertImplBase::get_initial_burst_size() +{ + unsigned long initial_burst_size = 50; + if(_PM->is_set("initialBurstSize")) + { + initial_burst_size = _PM->get("initialBurstSize"); + } + return initial_burst_size; +} + +/********************************************************* + * CreateWriter + */ +template +IMessagingWriter *RTICertImplBase::create_writer(const char *topic_name) +{ + if (_participant == NULL) + { + fprintf(stderr,"Participant not initialized.\n"); + return NULL; + } + struct DDS_SubscriptionBuiltinTopicData rem_subscription_data = + DDS_SubscriptionBuiltinTopicData_INITIALIZER; + std::string rem_participant_name = ""; + struct DDS_DataWriterQos dw_qos = DDS_DataWriterQos_INITIALIZER; + DDS_DataWriter *writer = NULL; + std::string qos_profile = ""; + DDS_Topic *topic = DDS_DomainParticipant_create_topic( + _participant, + topic_name, + _typename, + &DDS_TOPIC_QOS_DEFAULT, + NULL, + DDS_STATUS_MASK_NONE); + if (topic == NULL) { + fprintf(stderr,"Problem creating topic %s.\n", topic_name); + return NULL; + } + + qos_profile = get_qos_profile_name(topic_name); + if (qos_profile.empty()) { + fprintf(stderr, "Problem getting qos profile.\n"); + return NULL; + } + + if (!configure_writer_qos(dw_qos, qos_profile, topic_name)) { + fprintf(stderr, "Problem creating additional QoS settings with %s profile.\n", qos_profile.c_str()); + return NULL; + } + + writer = DDS_Publisher_create_datawriter(_publisher, topic, &dw_qos, NULL, DDS_STATUS_MASK_NONE); + CHECK_PTR(writer, "Problem creating writer"); + + /* DPSE assert remote subscription + * The schematic used is the following: + * Participant Publisher is 1 / Subscriber is 2 + * DatarWriter is 0 / DataReader is 1 + * topic name is Throughput is 1 / Latency is 2 / Announcement is 3 + + * Publisher: Throughput DW is 101 + * Publisher: Latency DR is 112 + * Publisher: Announcement DR is 113 + + * Subscriber: Throughput DR is 211 + * Subscriber: Latency DW is 202 + * Subscriber: Announcement DW is 203 + */ + + /* Assert Remote Subscriptions to discover them */ + rem_subscription_data.topic_name = DDS_String_dup(topic_name); + rem_subscription_data.type_name = DDS_String_dup(_typename); + rem_subscription_data.reliability.kind = dw_qos.reliability.kind; + rem_subscription_data.durability.kind = dw_qos.durability.kind; + if (qos_profile == "ThroughputQos") { + rem_subscription_data.key.value[DDS_BUILTIN_TOPIC_KEY_OBJECT_ID] = 211; + rem_participant_name = PARTICIPANT_NAME_SX; + } else if (qos_profile == "LatencyQos") { + rem_subscription_data.key.value[DDS_BUILTIN_TOPIC_KEY_OBJECT_ID] = 112; + rem_participant_name = PARTICIPANT_NAME_PX; + } else { + rem_subscription_data.key.value[DDS_BUILTIN_TOPIC_KEY_OBJECT_ID] = 113; + rem_participant_name = PARTICIPANT_NAME_PX; + } + + if (DDS_RETCODE_OK != + DPSE_RemoteSubscription_assert( + this->_participant, + rem_participant_name.c_str(), + &rem_subscription_data, + this->_plugin->get_key_kind(this->_plugin, NULL))) + { + printf("failed to assert remote subscription: %s\n", rem_participant_name.c_str()); + goto done; + } + + /* Enable DDS entities since this is the last writer created (Announcement) + * for Perftest_cert_subscriber */ + if (qos_profile == "AnnouncementQos") + { + DDS_Entity *entity; + DDS_ReturnCode_t retcode; + + entity = DDS_DomainParticipant_as_entity(this->_participant); + + retcode = DDS_Entity_enable(entity); + if (retcode != DDS_RETCODE_OK) + { + printf("failed to enable entity\n"); + goto done; + } + } + + if (!_PM->get("dynamicData")) { + try { + return create_CertPublisher(writer); + } catch (const std::exception &ex) { + fprintf(stderr, + "Exception in RTICertImpl::create_writer(): %s.\n", + ex.what()); + return NULL; + } + } else { + fprintf(stderr,"Dynamic data not supported on CERT.\n"); + return NULL; + } +done: + return NULL; +} + +template +IMessagingWriter *RTICertImplBase::create_CertPublisher( + DDS_DataWriter *writer) +{ + // To be implemented by derived classes + UNUSED_ARG(writer); + + return nullptr; +} + +template +IMessagingWriter *RTICertImpl::create_CertPublisher( + DDS_DataWriter *writer) +{ + return new CertPublisher( + writer, + this->_PM->template get("instances"), + this->_pongSemaphore, + this->_PM->template get("writeInstance"), + this->_PM); +} + +#ifdef RTI_ZEROCOPY_AVAILABLE +template +IMessagingWriter *RTICertImpl_ZCopy::create_CertPublisher( + DDS_DataWriter *writer) +{ + return new ZCopyCertPublisher( + writer, + this->_PM->template get("instances"), + this->_pongSemaphore, + this->_PM->template get("writeInstance"), + this->_PM); +} +#endif + +/********************************************************* + * CreateReader + */ +template +IMessagingReader *RTICertImplBase::create_reader( + const char *topic_name, + IMessagingCB *callback) +{ + std::string err_str = ""; + DDS_DataReader *reader = NULL; + struct DDS_DataReaderQos dr_qos = DDS_DataReaderQos_INITIALIZER; + std::string qos_profile = ""; + std::string rem_participant_name = ""; + /* Used to create the DDS DataReader */ + DDS_TopicDescription* topic_desc = NULL; + struct DDS_PublicationBuiltinTopicData rem_publication_data = + DDS_PublicationBuiltinTopicData_INITIALIZER; + DDS_Topic *topic = DDS_DomainParticipant_create_topic( + _participant, + topic_name, + _typename, + &DDS_TOPIC_QOS_DEFAULT, + NULL, + DDS_STATUS_MASK_NONE); + CHECK_PTR(topic, "Problem creating topic"); + topic_desc = DDS_Topic_as_topicdescription(topic); + + qos_profile = get_qos_profile_name(topic_name); + if (qos_profile.empty()) { + fprintf(stderr, "Problem getting qos profile.\n"); + return NULL; + } + + if (!configure_reader_qos(dr_qos, qos_profile, topic_name)) { + fprintf(stderr, "Problem creating additional QoS settings with %s profile.\n", qos_profile.c_str()); + return NULL; + } + + if (callback != NULL) + { + if (!_PM->get("dynamicData")) + { + ReaderListenerBase *listener + = (ReaderListenerBase *)create_CertReaderListener(callback); + reader = DDS_Subscriber_create_datareader( + _subscriber, + topic_desc, + &dr_qos, + listener->get_listener(), + DDS_DATA_AVAILABLE_STATUS); + } + else + { + fprintf(stderr,"Dynamic data not supported on CERT.\n"); + return NULL; + } + } + else + { + reader = DDS_Subscriber_create_datareader( + _subscriber, + topic_desc, + &dr_qos, + NULL, + DDS_STATUS_MASK_NONE); + } + CHECK_PTR(reader, "Problem creating reader"); + + /* Assert Remote Publisher */ + rem_publication_data.topic_name = DDS_String_dup(topic_name); + rem_publication_data.type_name = DDS_String_dup(_typename); + rem_publication_data.reliability.kind = dr_qos.reliability.kind; + rem_publication_data.durability.kind = dr_qos.durability.kind; + if (qos_profile == "ThroughputQos") { + rem_publication_data.key.value[DDS_BUILTIN_TOPIC_KEY_OBJECT_ID] = 101; + rem_participant_name = PARTICIPANT_NAME_PX; + } else if (qos_profile == "LatencyQos") { + rem_publication_data.key.value[DDS_BUILTIN_TOPIC_KEY_OBJECT_ID] = 202; + rem_participant_name = PARTICIPANT_NAME_SX; + } else { + rem_publication_data.key.value[DDS_BUILTIN_TOPIC_KEY_OBJECT_ID] = 203; + rem_participant_name = PARTICIPANT_NAME_SX; + } + + if (DDS_RETCODE_OK != + DPSE_RemotePublication_assert( + this->_participant, + rem_participant_name.c_str(), + &rem_publication_data, + this->_plugin->get_key_kind(this->_plugin, NULL))) + { + printf("failed to assert remote publisher: %s\n", rem_participant_name.c_str()); + goto done; + } + + /* Enable DDS entities since this is the last writer created (Announcement) + * for Perftest Cert Publisher */ + if (qos_profile == "AnnouncementQos") + { + DDS_Entity *entity; + DDS_ReturnCode_t retcode; + + entity = DDS_DomainParticipant_as_entity(this->_participant); + + retcode = DDS_Entity_enable(entity); + if (retcode != DDS_RETCODE_OK) + { + printf("failed to enable entity\n"); + goto done; + } + } + return create_CertSubscriber(reader, callback == NULL); +done: + return NULL; +} + +template +IMessagingReader *RTICertImplBase::create_CertSubscriber( + DDS_DataReader *reader, bool isCallbackNull) +{ + // To be implemented by derived classes + UNUSED_ARG(reader); + UNUSED_ARG(isCallbackNull); + + return nullptr; +} + +template +void *RTICertImplBase::create_CertReaderListener( + IMessagingCB *callback) +{ + // To be implemented by derived classes + UNUSED_ARG(callback); + return nullptr; +} + +template +IMessagingReader *RTICertImpl::create_CertSubscriber( + DDS_DataReader *reader, bool isCallbackNull) +{ + return new CertSubscriber(reader, isCallbackNull, this->_PM); +} + +template +void *RTICertImpl::create_CertReaderListener( + IMessagingCB *callback) +{ + return new ReaderListener(callback); +} + +#ifdef RTI_ZEROCOPY_AVAILABLE +template +IMessagingReader *RTICertImpl_ZCopy::create_CertSubscriber( + DDS_DataReader *reader, bool isCallbackNull) +{ + return new ZCopyCertSubscriber(reader, isCallbackNull, this->_PM); +} + +template +void *RTICertImpl_ZCopy::create_CertReaderListener( + IMessagingCB *callback) +{ + return new ZCopyReaderListener(callback); +} +#endif + +template +const std::string RTICertImplBase::get_qos_profile_name(const char *topicName) +{ + if (_qoSProfileNameMap[std::string(topicName)].empty()) { + fprintf(stderr, + "topic name must either be %s or %s or %s.\n", + THROUGHPUT_TOPIC_NAME, + LATENCY_TOPIC_NAME, + ANNOUNCEMENT_TOPIC_NAME); + } + + /* If the topic name dont match any key return a empty string */ + return _qoSProfileNameMap[std::string(topicName)]; +} +/********************************************************* + *************** End of RTICertImpl methods ************** + *********************************************************/ +namespace { +#ifdef RTI_CERT + /** + * WARNING: The REDA functions used here cannot be used in safety + * applications. + */ + DDS_Octet* DDS_OctetSeq_get_contiguous_buffer(const struct DDS_OctetSeq *self) + { + return (DDS_Octet*)REDA_Sequence_get_buffer((const struct REDA_Sequence *)self); + } + + RTI_BOOL DDS_OctetSeq_loan_contiguous(struct DDS_OctetSeq *self, void *buffer, + RTI_INT32 new_length, RTI_INT32 new_max) + { + self->_element_size = sizeof(DDS_Octet); + + return REDA_Sequence_loan_contiguous( + (struct REDA_Sequence *)self, buffer, new_length, new_max); + } + + RTI_BOOL DDS_OctetSeq_unloan(struct DDS_OctetSeq *self) + { + return REDA_Sequence_unloan((struct REDA_Sequence *)self); + } +#endif + + /** + * Explicitly instatiating the DDS_ template function for each possible type, + * as we need to use C functions in their implementations + */ + template<> + TestData_t* DDS_TypedSampleSeq_get_reference( + TestData_tSeq* self, RTI_INT32 i) + { + return TestData_tSeq_get_reference(self, i); + } + + template<> + TestDataKeyed_t* DDS_TypedSampleSeq_get_reference( + TestDataKeyed_tSeq* self, RTI_INT32 i) + { + return TestDataKeyed_tSeq_get_reference(self, i); + } + +#ifdef RTI_ZEROCOPY_AVAILABLE + template<> + TestData_Cert_ZCopy_t* DDS_TypedSampleSeq_get_reference( + TestData_Cert_ZCopy_tSeq* self, RTI_INT32 i) + { + return TestData_Cert_ZCopy_tSeq_get_reference(self, i); + } + + template<> + TestDataKeyed_Cert_ZCopy_t* DDS_TypedSampleSeq_get_reference( + TestDataKeyed_Cert_ZCopy_tSeq* self, RTI_INT32 i) + { + return TestDataKeyed_Cert_ZCopy_tSeq_get_reference(self, i); + } +#endif + + RTI_UINT32 get_interface_address(const char *interface_name) + { + struct ifaddrs * ifAddrStruct = NULL; + struct ifaddrs * ifa = NULL; + void * tmpAddrPtr = NULL; + RTI_UINT32 address_hex = 0; + + getifaddrs(&ifAddrStruct); + + for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next) { + if (!ifa->ifa_addr) { + continue; + } + if (strcmp(ifa->ifa_name, interface_name) != 0) { + continue; + } +#ifndef RTI_QNX + if (ifa->ifa_addr->sa_family == AF_INET) { // check it is IP4 +#endif + // is a valid IP4 Address + tmpAddrPtr = &((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; + address_hex = ntohl(((struct in_addr *)tmpAddrPtr)->s_addr); +#ifndef RTI_QNX + } +#endif + } + if (ifAddrStruct!=NULL) freeifaddrs(ifAddrStruct); + return address_hex; + } + +#ifndef RTI_CERT_IS_PI + bool configureUDPv4Transport( + RT_Registry_T *registry, + PerftestTransport &transport, + ParameterManager *_PM) + { + RTI_BOOL brc; + struct UDP_InterfaceFactoryProperty* udp_property = (struct UDP_InterfaceFactoryProperty *) + malloc(sizeof(struct UDP_InterfaceFactoryProperty)); + CHECK_PTR(udp_property, "malloc"); + *udp_property = UDP_INTERFACE_FACTORY_PROPERTY_DEFAULT; + + udp_property->max_message_size = 65536; + udp_property->max_receive_buffer_size = _PM->get("receiveBufferSize"); + udp_property->max_send_buffer_size = _PM->get("sendBufferSize"); + + brc = RT_Registry_unregister(registry, NETIO_DEFAULT_UDP_NAME, NULL, NULL); + CHECK_BOOL(brc, "RT_Registry_unregister"); + + /* Set interface to use if provided */ + if (!_PM->get("allowInterfaces").empty()) { + + if (is_ip_address(_PM->get("allowInterfaces"))) { + fprintf(stderr, + "[Error]: Micro does not support providing the allowed interfaces\n" + "(-nic/-allowInterfaces) as an ip, provide the nic name instead\n" + "(value provided: %s)\n", + _PM->get("allowInterfaces").c_str()); + return false; + } + + brc = DDS_StringSeq_set_maximum(&udp_property->allow_interface,1); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&udp_property->allow_interface,1); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + *DDS_StringSeq_get_reference(&udp_property->allow_interface,0) = + DDS_String_dup(_PM->get("allowInterfaces").c_str()); + + RTI_UINT32 address_hex = get_interface_address( + _PM->get("allowInterfaces").c_str()); + + if (!UDP_InterfaceTable_add_entry( + &udp_property->if_table, + address_hex, + 0xff000000, + _PM->get("allowInterfaces").c_str(), + UDP_INTERFACE_INTERFACE_UP_FLAG | UDP_INTERFACE_INTERFACE_MULTICAST_FLAG)) + { + printf("failed to add interface\n"); + } + } + else + { + brc = DDS_StringSeq_set_maximum(&udp_property->allow_interface,2); + CHECK_BOOL(brc, "DDS_StringSeq_set_maximum"); + brc = DDS_StringSeq_set_length(&udp_property->allow_interface,2); + CHECK_BOOL(brc, "DDS_StringSeq_set_length"); + *DDS_StringSeq_get_reference(&udp_property->allow_interface,0) = + DDS_String_dup("lo"); + *DDS_StringSeq_get_reference(&udp_property->allow_interface,1) = + DDS_String_dup("eth0"); + + if (!UDP_InterfaceTable_add_entry( + &udp_property->if_table, + 0x7f000001, + 0xff000000, + "lo", + UDP_INTERFACE_INTERFACE_UP_FLAG | UDP_INTERFACE_INTERFACE_MULTICAST_FLAG)) + { + printf("failed to add interface\n"); + } + } + + /* Re-register UDP under its default name */ + brc = RT_Registry_register(registry, NETIO_DEFAULT_UDP_NAME, + UDP_InterfaceFactory_get_interface(), + (struct RT_ComponentFactoryProperty*)udp_property, NULL); + + CHECK_BOOL(brc, "RT_Registry_register"); + + transport.minimumMessageSizeMax = udp_property->max_message_size; + + return true; + + done: + return false; + } +#else + bool configureUDPv4Transport( + RT_Registry_T *registry, + PerftestTransport &transport, + ParameterManager *_PM) + { + RTI_BOOL brc; + Udpv4_TransportProperties_T *udp_property = UDPv4_TransportProperties_new(); + CHECK_PTR(udp_property, "Udpv4_TransportProperties_new"); + + /* Set interface to use if provided */ + if (!_PM->get("allowInterfaces").empty()) { + + if (is_ip_address(_PM->get("allowInterfaces"))) { + fprintf(stderr, + "[Error]: Micro does not support providing the allowed interfaces\n" + "(-nic/-allowInterfaces) as an ip, provide the nic name instead\n" + "(value provided: %s)\n", + _PM->get("allowInterfaces").c_str()); + return false; + } + + RTI_UINT32 address_hex = get_interface_address( + _PM->get("allowInterfaces").c_str()); + + if (!UDPv4_InterfaceTable_add_entry( + udp_property, + address_hex, + 0xff000000, + _PM->get("allowInterfaces").c_str(), + UDP_INTERFACE_INTERFACE_UP_FLAG | UDP_INTERFACE_INTERFACE_MULTICAST_FLAG)) + { + printf("failed to add interface\n"); + } + } + else + { + if (!UDPv4_InterfaceTable_add_entry( + udp_property, + 0x7f000001, + 0xff000000, + "lo", + UDP_INTERFACE_INTERFACE_UP_FLAG | UDP_INTERFACE_INTERFACE_MULTICAST_FLAG)) + { + printf("failed to add interface\n"); + } + } + + /* Re-register UDP under its default name */ + brc = Udpv4_Interface_register(registry, NETIO_DEFAULT_UDP_NAME, + udp_property); + + CHECK_BOOL(brc, "RT_Registry_register"); + + return true; + + done: + return false; + } +#endif + + void configureDPResourceLimits( + DDS_DomainParticipantQos& dp_qos) + { + dp_qos.resource_limits.max_destination_ports = 32; + dp_qos.resource_limits.max_receive_ports = 32; + dp_qos.resource_limits.local_topic_allocation = 3; + dp_qos.resource_limits.local_type_allocation = 1; + dp_qos.resource_limits.local_reader_allocation = 2; + dp_qos.resource_limits.local_writer_allocation = 2; + dp_qos.resource_limits.remote_participant_allocation = 8; + dp_qos.resource_limits.remote_reader_allocation = 8; + dp_qos.resource_limits.remote_writer_allocation = 8; + dp_qos.resource_limits.local_publisher_allocation = 3; + dp_qos.resource_limits.local_subscriber_allocation = 3; + } +} + +template class RTICertImpl; +template class RTICertImpl; +#ifdef RTI_ZEROCOPY_AVAILABLE +template class RTICertImpl_ZCopy; +template class RTICertImpl_ZCopy; +#endif \ No newline at end of file diff --git a/srcCpp/connextDDS/cert/RTICertImpl.h b/srcCpp/connextDDS/cert/RTICertImpl.h new file mode 100644 index 00000000..cb7b6996 --- /dev/null +++ b/srcCpp/connextDDS/cert/RTICertImpl.h @@ -0,0 +1,204 @@ +/* + * (c) 2023-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. + * Subject to Eclipse Public License v1.0; see LICENSE.md for details. + */ + +#ifndef __RTICERTIMPL_H__ +#define __RTICERTIMPL_H__ + +#ifdef PERFTEST_CERT + +#include "Infrastructure_common.h" +#include "MessagingIF.h" +#include "PerftestTransport.h" +#include +#include +#include // This header is part of the error handling library. +#include + +#include "disc_dpse/disc_dpse_dpsediscovery.h" +#include "wh_sm/wh_sm_history.h" +#include "rh_sm/rh_sm_history.h" +#include "rti_me_c.h" + +#ifdef RTI_CERT_IS_PI +#include "rti_me_psl/netio/netio_psl_udp.h" +#else +#include "netio/netio_udp.h" +#endif + +#include "dds_c/dds_c_sequence.h" + +// Import here the generated code and anything you need to use for Cert. +#include "perftest.h" +#include "perftestPlugin.h" +#include "perftestSupport.h" +#ifdef RTI_ZEROCOPY_AVAILABLE +#include "perftest_cert_zc.h" +#include "perftest_cert_zcPlugin.h" +#include "perftest_cert_zcSupport.h" +#include "netio_zcopy/netio_zcopy.h" +#ifdef RTI_CERT_IS_PI +#include "rti_me_psl/netio/netio_mynotif.h" +#else +#include "netio_zcopy/posixNotifMechanism.h" +#endif +#include "netio_zcopy/netio_zcopy_publication.h" +#endif + +/* Maximum number of peer possible. -peer is used to provide peer addresses */ +#define RTIPERFTEST_MAX_PEERS 1024 +/* Maximum number of samples to optimize the performance result */ +#define PERF_CERT_MAX_SAMPLES 5000 +#define PARTICIPANT_NAME_PX "Perftest_cert_publisher" +#define PARTICIPANT_NAME_SX "Perftest_cert_subscriber" +#define PARTICIPANT_ID_PX (1) +#define PARTICIPANT_ID_SX (2) + +#define DISC_FACTORY_DEFAULT_NAME "dpse" +#define UDP_TRANSPORT_NAME "_udp" +#define UDP_TRANSPORT_LOCATOR "_udp://" + +#ifdef RTI_ZEROCOPY_AVAILABLE + #define NOTIF_TRANSPORT_NAME "notif" + #define NOTIF_TRANSPORT_LOCATOR "notif://" +#endif + +/* Forward declaration of perftest_cpp to avoid circular dependencies */ +class perftest_cpp; + +const std::string GetMiddlewareVersionString(); + +template +class RTICertImplBase : public IMessaging +{ + +public: + + RTICertImplBase(const char *type_name, NDDS_Type_Plugin *plugin); + + ~RTICertImplBase() + { + shutdown(); + } + + const std::string get_middleware_version_string(); + + bool validate_input(); + + std::string print_configuration(); + + bool initialize(ParameterManager &PM, perftest_cpp *parent); + + virtual void shutdown(); + + unsigned long get_initial_burst_size(); + + IMessagingWriter *create_writer(const char *topic_name); + + /* + * Pass null for callback if using IMessagingSubscriber.receive_message() + * to get data + */ + IMessagingReader *create_reader(const char *topic_name, IMessagingCB *callback); + + bool supports_listeners() + { + return true; + }; + + virtual bool configure_participant_qos(DDS_DomainParticipantQos &qos); + bool configure_writer_qos(DDS_DataWriterQos &dw_qos, std::string qos_profile, std::string topic_name); + bool configure_reader_qos(DDS_DataReaderQos &dr_qos, std::string qos_profile, std::string topic_name); + + const std::string get_qos_profile_name(const char *topicName); + +protected: + virtual IMessagingWriter *create_CertPublisher(DDS_DataWriter *writer); + virtual IMessagingReader *create_CertSubscriber(DDS_DataReader *reader, + bool isCallbackNull); + virtual void *create_CertReaderListener( + IMessagingCB *callback); + + virtual bool create_domain_participant( + DDS_DomainParticipantQos *dpQos); + + // Perftest related entities + perftest_cpp *_parent; + ParameterManager *_PM; + std::map _qoSProfileNameMap; + + PerftestTransport _transport; + PerftestSemaphore *_pongSemaphore; + + long _instanceMaxCountReader; + int _sendQueueSize; + bool _useZeroCopy; + + // DDS Entities + DDS_DomainParticipantFactory *_factory; + DDS_DomainParticipant *_participant; + DDS_Subscriber *_subscriber; + DDS_Publisher *_publisher; + DDS_DataReader *_reader; + const char *_typename; + NDDS_Type_Plugin *_plugin; + +}; + +template +class RTICertImpl : public RTICertImplBase +{ + +public: + + RTICertImpl(const char *type_name, NDDS_Type_Plugin *plugin) + : RTICertImplBase(type_name, plugin) + { } + + virtual bool configure_participant_qos( + DDS_DomainParticipantQos &qos) override; + +protected: + virtual IMessagingWriter *create_CertPublisher( + DDS_DataWriter *writer) override; + virtual IMessagingReader *create_CertSubscriber( + DDS_DataReader *reader, bool isCallbackNull) override; + virtual void *create_CertReaderListener( + IMessagingCB *callback) override; +}; + +#ifdef RTI_ZEROCOPY_AVAILABLE +template +class RTICertImpl_ZCopy : public RTICertImplBase +{ + +public: + /** + * Constructor for CertImpl_ZCopy + */ + RTICertImpl_ZCopy(const char *type_name, NDDS_Type_Plugin *plugin) + : RTICertImplBase(type_name, plugin) + { } + + virtual bool configure_participant_qos( + DDS_DomainParticipantQos &qos) override; + + virtual void shutdown() override; + +protected: + virtual IMessagingWriter *create_CertPublisher( + DDS_DataWriter *writer) override; + virtual IMessagingReader *create_CertSubscriber( + DDS_DataReader *reader, bool isCallbackNull) override; + virtual void *create_CertReaderListener( + IMessagingCB *callback) override; + + virtual bool create_domain_participant( + DDS_DomainParticipantQos *dpQos) override; +}; +#endif + + +#endif // PERFTEST_CERT +#endif // __RTICERTIMPL_H__ diff --git a/srcCpp/perftest_cpp.cxx b/srcCpp/perftest_cpp.cxx index f4630a86..4f606caf 100644 --- a/srcCpp/perftest_cpp.cxx +++ b/srcCpp/perftest_cpp.cxx @@ -1,5 +1,5 @@ /* - * (c) 2005-2017 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ @@ -14,6 +14,8 @@ #include "RTIDDSImpl.h" #elif defined(PERFTEST_RTI_MICRO) #include "RTIDDSImpl.h" +#elif defined(PERFTEST_CERT) + #include "RTICertImpl.h" #endif #include "CpuMonitor.h" #include "Infrastructure_common.h" @@ -265,6 +267,45 @@ int perftest_cpp::Run(int argc, char *argv[]) } #endif /* RTI_PERF_TSS */ } + #elif defined(PERFTEST_CERT) + + mask = _PM.get("keyed") << 0; + #ifdef RTI_ZEROCOPY_AVAILABLE + mask += _PM.get("zerocopy") << 1; + #endif + + switch (mask) + { + case 0: // = 0000 (Not keyed) + _MessagingImpl = new RTICertImpl( + TestData_tTypeSupport_get_type_name(), + TestData_tTypePlugin_get()); + break; + + case 1: // Keyed = 0001 + _MessagingImpl = new RTICertImpl( + TestDataKeyed_tTypeSupport_get_type_name(), + TestDataKeyed_tTypePlugin_get()); + break; + + #ifdef RTI_ZEROCOPY_AVAILABLE + + case 2: // = 0010 (zerocopy + Not keyed) + _MessagingImpl = new RTICertImpl_ZCopy( + TestData_Cert_ZCopy_tTypeSupport_get_type_name(), + TestData_Cert_ZCopy_tTypePlugin_get()); + break; + + case 3: // zerocopy + Keyed = 0011 + _MessagingImpl = new RTICertImpl_ZCopy( + TestDataKeyed_Cert_ZCopy_tTypeSupport_get_type_name(), + TestDataKeyed_Cert_ZCopy_tTypePlugin_get()); + break; + + #endif + default: + break; + } #else // No middleware is passed as -DPERFTEST_... fprintf(stderr, @@ -373,6 +414,8 @@ perftest_cpp::perftest_cpp() : _PM(Middleware::RTITSSPRO) #elif defined(RTI_PERF_TSS_MICRO) : _PM(Middleware::RTITSSMICRO) +#elif defined(PERFTEST_CERT) + : _PM(Middleware::RTICERT) #else : _PM() #endif @@ -2355,9 +2398,11 @@ int perftest_cpp::Publisher() _printer->print_final_output(); if (_testCompleted) { // Delete timeout thread +#if !defined(PERFTEST_CERT) if (executionTimeoutThread != NULL) { PerftestThread_delete(executionTimeoutThread); } +#endif fprintf(stderr,"Finishing test due to timer...\n"); } else { @@ -2392,7 +2437,9 @@ bool perftest_cpp::finalize_read_thread( return false; } } +#if !defined(PERFTEST_CERT) PerftestThread_delete(thread); +#endif } return true; } diff --git a/srcCppCommon/Parameter.cxx b/srcCppCommon/Parameter.cxx index 640e0b20..692b3bd9 100644 --- a/srcCppCommon/Parameter.cxx +++ b/srcCppCommon/Parameter.cxx @@ -1,7 +1,7 @@ /* - * (c) 2005-2018 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ @@ -16,7 +16,8 @@ const MiddlewareMask Middleware::RTIDDSPRO = 1 << 0; const MiddlewareMask Middleware::RTIDDSMICRO = 1 << 1; const MiddlewareMask Middleware::RTITSSPRO = 1 << 2; const MiddlewareMask Middleware::RTITSSMICRO = 1 << 3; -const MiddlewareMask Middleware::RAWTRANSPORT = 1 << 4; +const MiddlewareMask Middleware::RTICERT = 1 << 4; +const MiddlewareMask Middleware::RAWTRANSPORT = 1 << 5; const MiddlewareMask Middleware::RTITSS = Middleware::RTITSSPRO @@ -25,6 +26,7 @@ const MiddlewareMask Middleware::RTITSS = const MiddlewareMask Middleware::RTIDDS = Middleware::RTIDDSPRO | Middleware::RTIDDSMICRO + | Middleware::RTICERT | Middleware::RTITSS; const MiddlewareMask Middleware::ALLDDS = diff --git a/srcCppCommon/Parameter.h b/srcCppCommon/Parameter.h index 64936490..61a98885 100644 --- a/srcCppCommon/Parameter.h +++ b/srcCppCommon/Parameter.h @@ -1,7 +1,7 @@ /* - * (c) 2005-2018 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ @@ -57,11 +57,13 @@ enum Group { SUB, TRANSPORT, SECURE, - RAWTRANSPORT + RAWTRANSPORT, + CERT }; // This struct specifies witch parameters are supported by each middleware + struct Middleware { static const MiddlewareMask RTIDDSPRO; static const MiddlewareMask RTIDDSMICRO; @@ -69,6 +71,7 @@ struct Middleware { static const MiddlewareMask RTITSSPRO; static const MiddlewareMask RTITSSMICRO; static const MiddlewareMask RTITSS; + static const MiddlewareMask RTICERT; static const MiddlewareMask RAWTRANSPORT; static const MiddlewareMask ALLDDS; static const MiddlewareMask ALL; diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index 25d70fbd..2c99fbf2 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -1,7 +1,7 @@ /* - * (c) 2005-2018 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ @@ -52,7 +52,12 @@ void ParameterManager::initialize() verbosity->set_extra_argument(YES); verbosity->set_range(0, 3); verbosity->set_group(GENERAL); - verbosity->set_supported_middleware(Middleware::ALL); + // Everything but CERT + verbosity->set_supported_middleware( + Middleware::RTIDDSPRO + | Middleware::RTIDDSMICRO + | Middleware::RTITSS + | Middleware::RAWTRANSPORT); create("verbosity", verbosity); Parameter *dynamicData = new Parameter(false); @@ -314,7 +319,9 @@ void ParameterManager::initialize() threadPriorities->set_extra_argument(YES); threadPriorities->set_group(GENERAL); threadPriorities->set_supported_middleware( - Middleware::RTIDDS + Middleware::RTIDDSPRO + | Middleware::RTIDDSMICRO + | Middleware::RTITSS | Middleware::RAWTRANSPORT); create("threadPriorities", threadPriorities); @@ -358,18 +365,25 @@ void ParameterManager::initialize() flatData->set_group(GENERAL); flatData->set_supported_middleware(Middleware::RTIDDSPRO); create("flatdata", flatData); + #endif - #if RTI_ZEROCOPY_AVAILABLE + #if RTI_ZEROCOPY_AVAILABLE + #if(defined(RTI_CERT) || defined(RTI_FLATDATA_AVAILABLE)) Parameter *zerocopy = new Parameter(false); zerocopy->set_command_line_argument("-zeroCopy", ""); zerocopy->set_description( - "Use Zero Copy transfer mode. FlatData must be used too\nDefault: Not set"); + "Use Zero Copy transfer mode. If not Connext CERT,\n" + "FlatData must be used too\nDefault: Not set"); zerocopy->set_type(T_BOOL); zerocopy->set_extra_argument(NO); zerocopy->set_group(GENERAL); - zerocopy->set_supported_middleware(Middleware::RTIDDSPRO); + zerocopy->set_supported_middleware( + Middleware::RTIDDSPRO + | Middleware::RTICERT); create("zerocopy", zerocopy); + #endif + #ifdef RTI_FLATDATA_AVAILABLE Parameter *checkconsistency = new Parameter(false); checkconsistency->set_command_line_argument("-checkConsistency", ""); checkconsistency->set_description( @@ -479,10 +493,39 @@ void ParameterManager::initialize() receiveQueueSize->set_type(T_NUMERIC_D); receiveQueueSize->set_extra_argument(YES); receiveQueueSize->set_group(GENERAL); - receiveQueueSize->set_supported_middleware(Middleware::ALL); + receiveQueueSize->set_supported_middleware( + Middleware::RTIDDSPRO + | Middleware::RTIDDSMICRO + | Middleware::RTITSS + | Middleware::RAWTRANSPORT); receiveQueueSize->set_range(1, INT_MAX); create("receiveQueueSize", receiveQueueSize); + Parameter *receiveBufferSize = new Parameter(2097152); + receiveBufferSize->set_command_line_argument("-receiveBufferSize", ""); + receiveBufferSize->set_description( + "Sets size of the receive buffer in B\n"); + receiveBufferSize->set_type(T_NUMERIC_D); + receiveBufferSize->set_extra_argument(YES); + receiveBufferSize->set_group(GENERAL); + receiveBufferSize->set_supported_middleware( + Middleware::RTIDDSMICRO + | Middleware::RTICERT); + receiveBufferSize->set_range(1, INT_MAX); + create("receiveBufferSize", receiveBufferSize); + + Parameter *sendBufferSize = new Parameter(524288); + sendBufferSize->set_command_line_argument("-sendBufferSize", ""); + sendBufferSize->set_description("Sets size of the send buffer in B\n"); + sendBufferSize->set_type(T_NUMERIC_D); + sendBufferSize->set_extra_argument(YES); + sendBufferSize->set_group(GENERAL); + sendBufferSize->set_supported_middleware( + Middleware::RTIDDSMICRO + | Middleware::RTICERT); + sendBufferSize->set_range(1, INT_MAX); + create("sendBufferSize", sendBufferSize); + Parameter *showResourceLimits = new Parameter(false); showResourceLimits->set_command_line_argument("-showResourceLimits", ""); showResourceLimits->set_description( @@ -659,11 +702,7 @@ void ParameterManager::initialize() pub->set_type(T_BOOL); pub->set_extra_argument(NO); pub->set_group(PUB); - pub->set_supported_middleware( - Middleware::RTIDDSPRO - | Middleware::RAWTRANSPORT - | Middleware::RTIDDSMICRO - | Middleware::RTITSS); + pub->set_supported_middleware(Middleware::ALL); create("pub", pub); Parameter *latencyCount = @@ -882,11 +921,7 @@ void ParameterManager::initialize() writeInstance->set_extra_argument(YES); writeInstance->set_range(0, LONG_MAX); writeInstance->set_group(PUB); - writeInstance->set_supported_middleware( - Middleware::RTIDDSPRO - | Middleware::RAWTRANSPORT - | Middleware::RTIDDSMICRO - | Middleware::RTITSS); + writeInstance->set_supported_middleware(Middleware::ALL); create("writeInstance", writeInstance); #ifdef RTI_LANGUAGE_CPP_TRADITIONAL @@ -1054,11 +1089,7 @@ void ParameterManager::initialize() peer->set_type(T_VECTOR_STR); peer->set_extra_argument(YES); peer->set_group(TRANSPORT); - peer->set_supported_middleware( - Middleware::RTIDDSPRO - | Middleware::RAWTRANSPORT - | Middleware::RTIDDSMICRO - | Middleware::RTITSS); + peer->set_supported_middleware(Middleware::ALL); create("peer", peer); Parameter *transport = new Parameter("Use XML"); @@ -1083,16 +1114,21 @@ void ParameterManager::initialize() #elif defined(PERFTEST_RTI_MICRO) "\nValues:\n\tUDPv4\n\tSHMEM\n" "Default: UDPv4" + #elif defined(RTI_CERT) + "\nValues:\n" + #ifdef RTI_ZEROCOPY_AVAILABLE + "\tUDPv4 & SHMEM\n" + "Default: UDPv4 & SHMEM" + #else + "\tUDPv4\n" + "Default: UDPv4" + #endif #endif ); transport->set_type(T_STR); transport->set_extra_argument(YES); transport->set_group(TRANSPORT); - transport->set_supported_middleware( - Middleware::RTIDDSPRO - | Middleware::RAWTRANSPORT - | Middleware::RTIDDSMICRO - | Middleware::RTITSS); + transport->set_supported_middleware(Middleware::ALL); transport->add_valid_str_value("UDPv4"); transport->add_valid_str_value("SHMEM"); #if defined(PERFTEST_RTI_PRO) @@ -1122,11 +1158,7 @@ void ParameterManager::initialize() multicast->set_type(T_BOOL); multicast->set_extra_argument(NO); multicast->set_group(TRANSPORT); - multicast->set_supported_middleware( - Middleware::RTIDDSPRO - | Middleware::RAWTRANSPORT - | Middleware::RTIDDSMICRO - | Middleware::RTITSS); + multicast->set_supported_middleware(Middleware::ALL); create("multicast", multicast); Parameter *multicastAddr = new Parameter(); diff --git a/srcCppCommon/ParameterManager.h b/srcCppCommon/ParameterManager.h index 431b8a10..c390d71d 100644 --- a/srcCppCommon/ParameterManager.h +++ b/srcCppCommon/ParameterManager.h @@ -1,12 +1,13 @@ /* - * (c) 2005-2018 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ #ifndef __PARAMETERMANAGER_H__ #define __PARAMETERMANAGER_H__ -#if defined(RTI_LANGUAGE_CPP_TRADITIONAL) + +#if defined(RTI_LANGUAGE_CPP_TRADITIONAL) || defined(RTI_CERT) || defined(BUILD_CERT_WITH_REGULAR_MICRO) #include "perftest.h" #elif defined(RTI_LANGUAGE_CPP_MODERN) #include "perftest.hpp" diff --git a/srcDoc/compilation.rst b/srcDoc/compilation.rst index 5a156d33..b02daee4 100644 --- a/srcDoc/compilation.rst +++ b/srcDoc/compilation.rst @@ -28,9 +28,10 @@ Prerequisites For compiling *RTI Perftest*, there are a few prerequisites; if you downloaded the executables already compiled, you can skip these steps: -- *RTI Connext DDS Professional* or *RTI Connext DDS Micro* should be installed - in the system where the ``build.sh`` script is going to run. The target libraries - for the platform to be generated should also be installed. +- *RTI Connext DDS Professional*, *RTI Connext DDS Micro* or *RTI Connext DDS Cert* + should be installed in the system where the ``build.sh`` script is going + to run. The target libraries for the platform to be generated should also + be installed. .. @@ -43,9 +44,10 @@ if you downloaded the executables already compiled, you can skip these steps: Or, pass ``$NDDSHOME`` directly to the ``build.sh`` script by using the ``--nddshome `` command-line option. - When compiling for *RTI Connext DDS Micro*, the ``$RTIMEHOME`` environment - variable should be set correctly. Or, pass ``$RTIMEHOME`` directly to the - ``build.sh`` script by using the ``--rtimehome `` command-line option. + When compiling for *RTI Connext DDS Micro* or *RTI Connext DDS Cert*, + the ``$RTIMEHOME`` environment variable should be set correctly. Or, + pass ``$RTIMEHOME`` directly to the ``build.sh`` script by using the + ``--rtimehome `` command-line option. .. @@ -61,11 +63,11 @@ if you downloaded the executables already compiled, you can skip these steps: .. -- When compiling for *RTI Connext DDS Micro*, ``Cmake`` is required to be - accessible from the ``$PATH`` environment variable in order to execute - the ``makefiles`` generated by *rtiddsgen*. Or, pass the ``cmake`` - executable directly to the ``build.sh`` script by using the - ``--cmake `` command-line option. +- When compiling for *RTI Connext DDS Micro* or *RTI Connext DDS Cert*, + ``Cmake`` is required to be accessible from the ``$PATH`` environment + variable in order to execute the ``makefiles`` generated by *rtiddsgen*. + Or, pass the ``cmake`` executable directly to the ``build.sh`` script by + using the ``--cmake `` command-line option. .. @@ -141,6 +143,14 @@ The ``build.sh`` script accepts the following list of parameters: - Optional - Compile *RTI Perftest* against *RTI Connext TSS 3.1.2* over *RTI Connext Pro 6.1.1.4* or *RTI Connext Micro 2.4.13.4*. + * - ``--cert`` + - Optional + - Compile *RTI Perftest* against *RTI Connext DDS Cert* 2.4.15. + * - ``--micro-use-cert-code`` + - Optional + - Compile *RTI Perftest* against *RTI Connext DDS Micro* 2.4.14 using + the exact same code compiled when building *Perftest* against + *RTI Connext DDS Cert*. * - ``--nddshome`` - Optional - Path to the *RTI Connext DDS Professional* installation. If this parameter @@ -237,6 +247,10 @@ The ``build.sh`` script accepts the following list of parameters: * - ``--wolfssl-version`` - Optional - Same as ``--ssl-version``. + * - ``--cert-zc-datalen`` + - Optional + - The size of the array of the type used when running *RTI Perftest* + built against *RTI Connext DDS Cert* using ZeroCopy. * - ``--make`` - Optional - Path to the ``GNU make``executable. If this parameter is not present, the @@ -375,6 +389,21 @@ examples: ./build.sh --platform x64Darwin14clang6.0 --micro +- Generation and compilation for a given architecture + (``x86_64leElfgcc7.3.0CERT-Linux4``) compiling against *Connext DDS Cert*. + + .. code-block:: console + + ./build.sh --platform x86_64leElfgcc7.3.0CERT-Linux4 --cert + +- Generation and compilation for a given architecture + (``x86_64leElfgcc7.3.0CERT-Linux4``) compiling against *Connext DDS Cert* + with a ZeroCopy data length of 61000 B. + + .. code-block:: console + + ./build.sh --platform x86_64leElfgcc7.3.0CERT-Linux4 --cert --cert-zc-datalen 61000 + - Generation and compilation for *RTI Connext TSS* over *RTI Connext Pro* for a given architecture in debug mode. diff --git a/srcDoc/examples.rst b/srcDoc/examples.rst index 5250d986..88a4017d 100644 --- a/srcDoc/examples.rst +++ b/srcDoc/examples.rst @@ -455,6 +455,49 @@ Modify ``-dataLen `` to see latencies for different data sizes. Set ``-executionTime `` to be >=100 for statistically better results. +RTI Connext DDS Cert +--------------------- + +1-to-1, Unicast, Best-Effort, UDPv4, Throughput +----------------------------------------------------------- + +- Publisher: + +:: + + bin//release/perftest_cpp_cert -pub -noPrint -nic -peer -domain -dataLen -executionTime 100 + +- Subscriber: + +:: + + bin//release/perftest_cpp_cert -sub -noPrint -nic -peer -domain + +Modify ``-dataLen `` to see latencies for different data sizes. +Set ``-executionTime `` to be >=100 for statistically better +results. + +1-to-1, Unicast, Reliable, ZeroCopy, Latency +----------------------------------------------------------- + +- Publisher: + +:: + + bin//release/perftest_cpp_cert_ -pub -noPrint -nic -peer -domain -zeroCopy -reliable -executionTime 100 + +- Subscriber: + +:: + + bin//release/perftest_cpp_cert -sub -noPrint -nic -peer -domain -zeroCopy -reliable + +Note how no ``-dataLen`` argument was specified. That's because, in the case of +Cert ZeroCopy, the length of the array has to be set at build time through the build script. +That size is appended to the name of the executable, such that executables with different ZC data lengths can coexist. +Set ``-executionTime `` to be >=100 for statistically better +results. + Use-Cases ========= diff --git a/srcDoc/index.rst b/srcDoc/index.rst index 236874f3..afadf25c 100644 --- a/srcDoc/index.rst +++ b/srcDoc/index.rst @@ -38,7 +38,7 @@ Features *RTI Perftest* supports the following functionality: -- *RTI Connext DDS Professional* and *RTI Connext DDS Micro*. +- *RTI Connext DDS Professional*, *RTI Connext DDS Micro* and *RTI Connext DDS Cert*. *Perftest* also supports *RTI Connext TSS* over *RTI Connext DDS Professional* or over *RTI Connext DDS Micro*. - Multiple platforms, including Windows®, Linux®, macOS®, VxWorks®, and Android™. @@ -83,9 +83,9 @@ Prerequisites If you need to compile *RTI Perftest*, there are a few prerequisites; however, if you downloaded the executables already compiled, you can skip these steps: -- *RTI Connext DDS Professional* or *RTI Connext DDS Micro* should be installed - in the system where the ``build.sh`` script is going to run. The target libraries for - the platform to be generated should also be installed. +- *RTI Connext DDS Professional*, *RTI Connext DDS Micro* or *RTI Connext DDS Cert* + should be installed in the system where the ``build.sh`` script is going to + run. The target libraries for the platform to be generated should also be installed. - The ``$NDDSHOME`` environment variable should be set correctly. Or, pass ``$NDDSHOME`` directly to the ``build.sh`` script by using the ``--nddshome `` command-line option. diff --git a/srcDoc/introduction.rst b/srcDoc/introduction.rst index e743c739..c82d7b9f 100644 --- a/srcDoc/introduction.rst +++ b/srcDoc/introduction.rst @@ -34,8 +34,8 @@ APIs), C#, and Java. Middleware ---------- -*RTI Perftest* can be built against *RTI Connext DDS Professional* and *RTI Connext -DDS Micro* 3.0.0 (also 2.4.11 with some limitations). +*RTI Perftest* can be built against *RTI Connext DDS Professional*, *RTI Connext +DDS Micro* and *RTI Connext DDS Cert*. *RTI Perftest* can also be used to test raw ``UDPv4`` or ``SHMEM`` performance. To do this, *RTI Perftest* uses the *RTI Connext DDS Professional* internal diff --git a/srcDoc/release_notes.rst b/srcDoc/release_notes.rst index fbe34909..011e204d 100644 --- a/srcDoc/release_notes.rst +++ b/srcDoc/release_notes.rst @@ -25,6 +25,14 @@ by default. However if explicitly set via command line, batching will still be e The ``-scan`` command-line option was previously available in the *Traditional C++*, *Modern C++*, and *Java API*, it was deprecated in 4.0 and now it has been removed. +Support for **RTI Connext Cert 2.4.15** |newTag| +++++++++++++++++++++++++++++++++++++++++++++++++ + +We have added support for **RTI Connext Cert 2.4.15** for *Linux* and *QNX*. + +Examples of how to compile *Perftest* for *RTI Connext Cert 2.4.15* can be found +in section :ref:`section-linux_compilation_examples`. + What's Fixed in develop ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/srcIdl/perftest.idl b/srcIdl/perftest.idl index d5badccd..f2d13c9d 100644 --- a/srcIdl/perftest.idl +++ b/srcIdl/perftest.idl @@ -1,5 +1,5 @@ /* - * (c) 2005-2017 Copyright, Real-Time Innovations, Inc. All rights reserved. + * (c) 2005-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. * Subject to Eclipse Public License v1.0; see LICENSE.md for details. */ @@ -19,7 +19,7 @@ const unsigned long DEFAULT_THROUGHPUT_BATCH_SIZE = 8192; // 8kB /* * Topic Names for the different channel RTI Perftest will use */ -#if defined(PERFTEST_RTI_PRO) || defined(PERFTEST_RTI_MICRO) +#if defined(PERFTEST_RTI_PRO) || defined(PERFTEST_RTI_MICRO) || defined(RTI_CERT) const string THROUGHPUT_TOPIC_NAME = "Throughput"; const string LATENCY_TOPIC_NAME = "Latency"; const string ANNOUNCEMENT_TOPIC_NAME = "Announcement"; diff --git a/srcIdl/perftest_cert_zc.idl b/srcIdl/perftest_cert_zc.idl new file mode 100644 index 00000000..e290a18e --- /dev/null +++ b/srcIdl/perftest_cert_zc.idl @@ -0,0 +1,46 @@ +/* + * (c) 2023-2024 Copyright, Real-Time Innovations, Inc. All rights reserved. + * Subject to Eclipse Public License v1.0; see LICENSE.md for details. + */ + +/* + * This file contains the types for Cert with Zero Copy used by RTI Perftest. The reason + * why these types are separated from the main idl is because in RTI Connext CERT, + * sequences are not available with Zero Copy transport. Therefore, we need to create + * a new type that is equivalent but using arrays instead of sequences. + */ + + /* We need to use the definitions from the perftest.idl */ +#include "perftest.idl" + +const long CERT_ZC_ARRAY_SIZE = CERT_ZC_DATALEN - CERT_ZC_OVERHEAD; + +@transfer_mode(SHMEM_REF) +struct TestData_Cert_ZCopy_t { + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + long size; + /* Array instead of sequence becuase Cert Zcopy + * does not support sequence. + */ + octet bin_data[CERT_ZC_ARRAY_SIZE]; +}; + +@transfer_mode(SHMEM_REF) +struct TestDataKeyed_Cert_ZCopy_t { + @key + octet key[KEY_SIZE]; + + long entity_id; + unsigned long seq_num; + long timestamp_sec; + unsigned long timestamp_usec; + long latency_ping; + long size; + octet bin_data[CERT_ZC_ARRAY_SIZE]; +}; \ No newline at end of file From 19b2cd728bd2c8b9f230a9f8b8c4cefae7cb603f Mon Sep 17 00:00:00 2001 From: Lissa Loadholt Date: Mon, 21 Oct 2024 05:41:12 -0700 Subject: [PATCH 23/49] Pull request #105: DOC-532: Add copyright page Merge in PERF/rti-perftest from doc/DOC-532-perftest to develop Squashed commit of the following: commit ac2f95094d2064e608613224efed53eb6620ff33 Author: Lissa Loadholt Date: Wed Sep 11 09:44:24 2024 -0400 DOC-532: Change year to 2022 commit f114276ba960818caae93e5ecf94af7ce7f79eb8 Author: Lissa Loadholt Date: Wed Sep 4 13:44:22 2024 -0400 DOC-523: Remove ear notice commit ede8d2927fb1c88ef555419b29a5fb7c4cd941c9 Author: Lissa Loadholt Date: Tue Sep 3 09:36:40 2024 -0400 DOC-532: Resize application icon commit 0794fa3da28dde7db602dc1460e0cd48470bf33b Author: Lissa Loadholt Date: Tue Sep 3 09:16:27 2024 -0400 DOC-532: Add copyright page --- .../RTI_Launcher_Icon_Perftest_64x64.png | Bin 0 -> 3686 bytes srcDoc/conf.py | 2 +- srcDoc/copyright.rst | 59 ++++++++++++++++++ srcDoc/index.rst | 6 ++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 srcDoc/_static/RTI_Launcher_Icon_Perftest_64x64.png create mode 100644 srcDoc/copyright.rst diff --git a/srcDoc/_static/RTI_Launcher_Icon_Perftest_64x64.png b/srcDoc/_static/RTI_Launcher_Icon_Perftest_64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..0ada156c145285a446b44367368f193e0dd72b24 GIT binary patch literal 3686 zcmV-s4w>$MNIN0vq-{!@Ny-3j+8JgFo%|7| zaR^D9&`@JL*lvIX*8>C$wjlx6Mi|>dl5N>~Skh`=_jOMH*p)3~t+c|j9h-hftC_vJ zy7%|}{(k3oe&;19gYNF`g-WSgq?9*=Vep4Sh^W?DmAn7<2|@@7a5^?6ha7W+s1JmhKGkk(=^tk)0qca zTU*~d?!M7qIyyRTiN|BB;_>+Op`jtdFg(3hpCTBBK`K>ECX?;SW^?z>nl)?v$ls0% zuz!EY(r7fk#xRUXCX+#k6N2NchSr*@sw%=T^z!-aist578=)jXS6A0O+m39BL?ZR) zBKZ-Fh~Rl%pX+*8wzRbDkpM#QNHUo`r^!PxFJv+qlF4Mf5Ih1P4jycuZy3>?T5EZ( zwE2l(7zRQJ6^8kRQYmXiB9ZvmkOv6EkVGOO!CEeb&^Hzeg)?o_X-A<@Kq+pNTC>1) z-7{^^X-AQ>UMPhSj@J52+jH8XwMGcx$g`!qJr&SeD|x1kIMXms$4j&Z1V{mf6qr(C zNCCwkLZt~pO{g?VYqW+F%MlI21Tz9&7R1!}?vx3jwMGg-)HZP(6H`FmR}ANU2GcH? zLO`Gt5<$#1NyaT=F^j5*0RlWPWH|4mGzc_^2$&Lc_frI|%K!s7`P?<-0%#3}A*id4 z;(8(PA4s#kt&gpHjrLrd-0a}A;2$Bh#OxD9T4cSyDop(3fM$HLd*o z!K<-No1BbcZ~iN+H&zi`d^0L_0V3DSRCpiYq%w(8n(C?u(P)H~|F)g~+WY~rm`Q!g zp{^+bF|$ZcGjVej0(!Gtzo>~dE3YLQama}%_KWvn{`PTn6$JCXhz=Do+a#5+ryv8I zi~t%M>SDaNKh3hgeSv@e!FJlZ)0k3_idj@AZ3rqfQ5MPHw78k4AG!w9h>%e>_NMzV zcl-z)1C?wfY`&Tr$7SQIojmbu8;$jGOha%o&G#cU0U@BFKE~58?&GVEZecJ8p)tXM z0hhp6#BGxqHBt5*NP}%m{IH%Zw_i1rpL}NtzP89I2j^E`!D#y_Itd~R;e|^Pu^E_p zkX4)7dHH|Z`QUJthrY51&-KZ>!ABa(PdWmmfN8Zc9(ig9cddMxK|?^b0|I*cvgCpg z+cub8=Mp^fvxJw@^fK!cVL%w0ju3fR>-#MZVxm|4xE ztN)ijeQ+~cNa9iJBSpfb1Q5XVx;PL0_;-Bk@oiA+6g{jon3CSKORf-LnUaQ76tX_# zeQ*N^R51^TQJ|ux_%+5VG&h^%Z4rcDP+82 zPcprV^{;hu*Mpl0kwk5i$!bus09t8g)W`VVGduamC*OklSkZ_PQi0~Z&LR2-T@Y|V zOEs;tYq(@iEv=0S>KqetJ{-wI#)IA*e|G&mp8VETWIc;~C~-F4g?#^+W8?whK{$6g z(y1n!E3oFZPKcVN#HwL>oL_C<&prS2G7;OtGR35lV?{YYDb4hnDC=MC;%~mcwb-p0 zB{$|gCTL`7!s7Foma^#|Ea3YghLi}c z@dJ$%P*)Y9sm9^c3#W7MO&5Sx3=}Niw!?ZZxTfLLTe=vt9>Tmp#*-+X)XJ5VU+Q4PD<42z40^LH zYOdy`$8O~7cPu2I_vszT;fJ~+#RZBml0>UK&M#JAj6+_>YY1n4o}^h|^V^5n-<>Jn zt!f}@ai~Ab%AdYNvMN$hLL65B(-7neAuFGHyQq9$j?Z1v$i{!Uf%z>74)$aTRAt1A zMk=&jjR?}%zgUhu^qaBCGZOySqm#2Sw9A@TI*ygh<)AdwMEQ?j@8$J(`$)zo7NM*F zT0>33=9yPI*tKr}+<avp15?kH7=ER0Ik7sOg6lJ0D5zL`|eA*{K9(rhYFJn zdks!4BG-w%b{TSD=Y(O825m~hIk!<|`nyDK6OfDdZU3WOEI3w++(-Cr!cCOgiNf*>ETwXL71Q+|waf&f~BZ5zDxZZ8+i ztmf8FwQwZujxkGH23n!x4aoi-*z0aVWcQ+@R7OC9j>ZXFZ$`Um3@N$$`nljwFsdvE zA$Vu+k#TPsGXhLQva5Z7JFl5T%r*!r-5#SAIyN1na})OJ>k;`5v_s|Ib3rvNL8Z<| z1bK$D9!sxmW_C*w3PFVr8LKvSQzx$TN($Oe;-0#nj6kSARTFv@T^K>#UX zAnP-`DZ%+o2?`a|)5l)uU~Tyagf|Egj?M*&JU|RW6H#sY7f)lC)fgtY&Tr{s1+mz(pu(I}V#*jzeMRq=atj%k{H}Mz$ zJ>mQn5CmA;AH{h8KTpUD!iC`co6%KGh|FOS0s-U-0iT##%e1IPZ*LYNlbFQ|6oWY* z&kK=>2#nE+PI#Ku8p{-1Iy;5yS4bX>He(n)TM@pGE_KIOW8`!2u0DU`47icRdLPMUP94dR=&+WfcGF2k;mDH6q*3nII2SygvXa zt(Qm8b`qog*O)thi0pk6yh8{f(atQwrX>Uy-HV!W86w+9u`Qfl0Y>%*OuYcW$a0Z( zQXnKEdl-@L1!17$4d`e+_=RGhe}?uZPuT{EGLJ9*E|jvm8Aqp5r6%B(wzqJ`$dAS; z-X&HdsJ!Cm_YfcZeS)%d!02NMA%v7#>%zHwNTM8s5NNFn62wm1w$HRZryWJkVyBdn z=N!kG@E^`KIF5sqJoo=cW}2E>+kD@DHkC@9)ONG81zKxTsT98NKikyQ+9rz^xj&sw z_f=I@ozo(W9Ggq0(|uZVKa}c#mX?-1o>%yC7>3@tD#GZ4lb%=ja!X6g9vD>!H8;=N zn8{@C2!f!ezP=8_s9-7jEP-Jd)YsP$1VK+Glf7f))F@PVc-nQ{vo0z|AD&L9)1hUV z6Ca))jqdL5g}^f42BpG_fV1xSyp+Zc;CWy}x#RQy2OCRIr5SKhA^-pY07*qoM6N<$ Eg5U`_. +IT IS YOUR RESPONSIBILITY TO ENSURE THAT YOUR USE OF THIRD-PARTY SOFTWARE +COMPLIES WITH THE CORRESPONDING THIRD-PARTY LICENSE TERMS AND CONDITIONS. + +.. rubric:: Notices + +*Deprecations and Removals* + +Any deprecations or removals noted in this document serve as notice under +the Real-Time Innovations, Inc. Maintenance Policy #4220 and/or any other +agreements by and between RTI and customer regarding maintenance and support +of RTI's software. + +*Deprecated* means that the item is still supported in the release, but will +be removed in a future release. *Removed* means that the item is discontinued +or no longer supported. + +Technical Support +Real-Time Innovations, Inc. +232 E. Java Drive +Sunnyvale, CA 94089 +Phone: (408) 990-7444 +Email: support@rti.com +Website: https://support.rti.com/ diff --git a/srcDoc/index.rst b/srcDoc/index.rst index afadf25c..2f2e520f 100644 --- a/srcDoc/index.rst +++ b/srcDoc/index.rst @@ -174,6 +174,12 @@ Explore the documentation for more information. Table of Contents ================= +.. toctree:: + :maxdepth: 1 + :caption: Contents + + copyright.rst + .. toctree:: :maxdepth: 2 :numbered: From f4786b3f0c606303ab6c9d5f981fd0c833f09102 Mon Sep 17 00:00:00 2001 From: Pablo Lombardero Ros Date: Tue, 22 Oct 2024 04:40:12 -0700 Subject: [PATCH 24/49] Pull request #106: Task/PERFTEST-371: Making Perftest for Micro compatible with Micro 4.1.0 and Platofrm Independence Merge in PERF/rti-perftest from task/PERFTEST-371 to develop Squashed commit of the following: commit b263d15c3b2cc60270d1104a596c0b5e9c13eb34 Author: plombardero0 Date: Fri Oct 18 13:36:42 2024 +0200 FACETSS-371: Making Cert's CMakeLists.txt reuse the common function used for getting the PI arch commit 5d137a3d53d7708353f656c1cda9e603480dc1cd Merge: f810d22 9505d80 Author: plombardero0 Date: Fri Oct 18 13:06:49 2024 +0200 Merge branch 'develop' into task/PERFTEST-371 commit f810d2242cede81a84216100b8836e2e9818094d Author: plombardero0 Date: Fri Oct 4 13:55:58 2024 +0200 PERFTEST-371: Fixing additional defines after the latest changes, which fixes building for Micro 2.4.X again commit 7dcf77d76b3a3bf52152b42b092cf77f707d2f2a Author: plombardero0 Date: Wed Oct 2 14:04:39 2024 +0200 PERFTEST-371: Making Perftest for Micro compatible with Micro 4.1.0 Platform Independence commit e7cd4685deade604544be75efd7a164a09e1bd82 Author: plombardero0 Date: Fri Sep 27 14:06:45 2024 +0200 PERFTEST-371: Recovering the unregister of the UDP property so that Micro 4.0.1 works again commit 9d9e01c281d08ab211df5f83b1d4da6d9630e458 Author: plombardero0 Date: Fri Sep 13 13:46:56 2024 +0200 PERFTEST_371: Switching back to using C++ to set up UDP properties now that Micro 4.1.0 supports it commit 5e3fb7b024523cb9e758dfeb27f424052d2720da Author: plombardero0 Date: Mon Sep 9 16:13:42 2024 +0200 PERFTEST-371: Adding changes missing from previous commit commit d6361aa7180cf305803ac84ff713de4c6efcb958 Author: plombardero0 Date: Mon Sep 9 14:47:56 2024 +0200 FACETSS-371: Making Perftest for Micro compile with Micro 4.1.0 PI --- build.sh | 22 +- resource/cert/CMakeLists.txt | 29 +- resource/cmake/common_utils.cmake | 19 + resource/micro/CMakeLists.txt | 380 ++++++++++++++++++ srcCpp/connextDDS/micro/Configure_UDPv4.cxx | 182 +++++++++ .../connextDDS/micro/Infrastructure_micro.cxx | 24 +- 6 files changed, 614 insertions(+), 42 deletions(-) create mode 100644 resource/cmake/common_utils.cmake create mode 100644 resource/micro/CMakeLists.txt create mode 100644 srcCpp/connextDDS/micro/Configure_UDPv4.cxx diff --git a/build.sh b/build.sh index 325684c2..46c98226 100755 --- a/build.sh +++ b/build.sh @@ -765,31 +765,31 @@ function additional_defines_calculation() function additional_defines_calculation_micro() { - additional_rtiddsgen_defines="-D PERFTEST_RTI_MICRO" + additional_rtiddsgen_defines="-DPERFTEST_RTI_MICRO" if [[ $platform == *"Darwin"* ]]; then - additional_defines=" RTI_DARWIN" + additional_defines="-DRTI_DARWIN" additional_included_libraries="dl;m;pthread;" elif [[ $platform == *"Linux"* ]]; then - additional_defines=" RTI_LINUX" + additional_defines="-DRTI_LINUX" additional_included_libraries="dl;m;pthread;nsl;rt;" elif [[ $platform == *"QNX"* ]]; then - additional_defines=" RTI_QNX" + additional_defines="-DRTI_QNX" additional_included_libraries="m;socket;" fi - additional_defines="RTI_LANGUAGE_CPP_TRADITIONAL PERFTEST_RTI_MICRO O3"${additional_defines} + additional_defines="-DRTI_LANGUAGE_CPP_TRADITIONAL -DPERFTEST_RTI_MICRO -DO3 "${additional_defines} if [ "${RTI_PERFTEST_NANO_CLOCK}" == "1" ]; then - additional_defines=${additional_defines}" DRTI_PERFTEST_NANO_CLOCK" + additional_defines=${additional_defines}" -DRTI_PERFTEST_NANO_CLOCK" fi if [ "${RTI_USE_CPP_11_INFRASTRUCTURE}" == "1" ]; then echo -e "${INFO_TAG} Force using C++11 and C++11 Infrastructure." - additional_defines=${additional_defines}" DRTI_USE_CPP_11_INFRASTRUCTURE" + additional_defines=${additional_defines}" -DRTI_USE_CPP_11_INFRASTRUCTURE" fi if [ "${USE_SECURE_LIBS}" == "1" ]; then - additional_defines="${additional_defines} RTI_SECURE_PERFTEST" + additional_defines="${additional_defines} -DRTI_SECURE_PERFTEST" if [ "${STATIC_DYNAMIC}" == "dynamic" ]; then echo -e "${INFO_TAG} Using Security Plugins. Linking Dynamically." @@ -1215,7 +1215,7 @@ function build_micro_cpp() ############################################################################## # Generate files for srcCpp if [ "${BUILD_MICRO_24x_COMPATIBILITY}" -eq "1" ]; then - additional_defines=${additional_defines}" PERFTEST_RTI_MICRO_24x_COMPATIBILITY" + additional_defines=${additional_defines}" -DPERFTEST_RTI_MICRO_24x_COMPATIBILITY" else rtiddsgen_extra_options="${rtiddsgen_extra_options} -sequenceSize ${MICRO_UNBOUNDED_SEQUENCE_SIZE}" @@ -1267,7 +1267,6 @@ function build_micro_cpp() -replace -create typefiles -create makefiles \ -additionalHeaderFiles \"$additional_header_files\" \ -additionalSourceFiles \"$additional_source_files\" \ - -additionalDefines \"${additional_defines}\" \ ${rtiddsgen_extra_options} -d \"${classic_cpp_folder}\" \"${idl_location}/perftest.idl\" " echo "" @@ -1283,6 +1282,7 @@ function build_micro_cpp() cp "${classic_cpp_folder}/perftest_cpp.cxx" "${classic_cpp_folder}/perftest_publisher.cxx" cp "${classic_cpp_folder}/perftest_cpp.cxx" "${classic_cpp_folder}/perftest_subscriber.cxx" cp "${idl_location}/perftest.idl" "${classic_cpp_folder}/perftest.idl" + cp "${resource_folder}/micro/CMakeLists.txt" "${classic_cpp_folder}/CMakeLists.txt" touch "${classic_cpp_folder}/perftestApplication.cxx" touch "${classic_cpp_folder}/perftestApplication.h" @@ -1296,7 +1296,7 @@ function build_micro_cpp() echo -e "${INFO_TAG} Compiler: ${COMPILER_EXE}." cmake_c_compiler_string="-DCMAKE_C_COMPILER=${COMPILER_EXE} -DCMAKE_CXX_COMPILER=${COMPILER_EXE}" fi - cmake_generate_command="${CMAKE_EXE} -DCMAKE_BUILD_TYPE=${RELEASE_DEBUG} ${cmake_c_compiler_string} -G \"Unix Makefiles\" -B./perftest_build -H. -DRTIME_TARGET_NAME=${platform} -DPLATFORM_LIBS=\"${additional_included_libraries}\" ${ADDITIONAL_CMAKE_ARGS}" + cmake_generate_command="${CMAKE_EXE} -DCMAKE_BUILD_TYPE=${RELEASE_DEBUG} ${cmake_c_compiler_string} -G \"Unix Makefiles\" -B./perftest_build -H. -DRTIME_TARGET_NAME=${platform} -DPLATFORM_LIBS=\"${additional_included_libraries}\" -DADDITIONAL_DEFINES=\"${additional_defines}\" ${ADDITIONAL_CMAKE_ARGS}" echo -e "${INFO_TAG} Cmake Generate Command: $cmake_generate_command" eval $cmake_generate_command if [ "$?" != 0 ]; then diff --git a/resource/cert/CMakeLists.txt b/resource/cert/CMakeLists.txt index c0d81572..125aca4d 100644 --- a/resource/cert/CMakeLists.txt +++ b/resource/cert/CMakeLists.txt @@ -15,24 +15,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4) -# This funtion returns the directory name where the Core library can be found -# based on the provided . -# The function produces output containing the Core's -# directory name -function(get_core_lib_dir_name full_arch_name) - string(REPLACE "-" ";" split_arch_name ${full_arch_name}) - list(GET split_arch_name 0 core_lib_dir_name) - list(LENGTH split_arch_name split_arch_name_length) - # Set function outputs - set(core_lib_dir_name ${core_lib_dir_name} PARENT_SCOPE) - # If there's text following the "-" in the arch name, we are working with a - # Platform Independent architecture, hence a Platform Independent Cert - if(split_arch_name_length GREATER 1) - set(cert_is_pi ON PARENT_SCOPE) - else() - set(cert_is_pi OFF PARENT_SCOPE) - endif() -endfunction() +INCLUDE(../resource/cmake/common_utils.cmake) function(remove_unwanted_flags) function(remove_warning_flags_from var_name) @@ -132,11 +115,11 @@ IF (DEFINED RTI_CERT OR cert_match) IF (RTIME_ZEROCOPY_AVAILABLE) list(APPEND MICRO_C_LIBS rti_me_netiozcopy${RTI_LIB_SUFFIX}) ENDIF() - IF(cert_is_pi) + IF(arch_is_pi) list(APPEND MICRO_C_LIBS rti_me_psl${RTI_LIB_SUFFIX}) ENDIF() list(APPEND MICRO_C_LIBS rti_me${RTI_LIB_SUFFIX}) - IF(cert_is_pi) + IF(arch_is_pi) list(APPEND MICRO_C_LIBS rti_me_psl${RTI_LIB_SUFFIX}) ENDIF() add_definitions(${ADDITIONAL_DEFINES} -DRTI_CERT -DPERFTEST_CERT) @@ -152,7 +135,7 @@ ENDIF() INCLUDE_DIRECTORIES(gen/ $ENV{RTIMEHOME}/include $ENV{RTIMEHOME}/include/rti_me) -IF (${cert_is_pi}) +IF (${arch_is_pi}) INCLUDE_DIRECTORIES($ENV{RTIMEHOME}/../rti_me_psl.1.0/include $ENV{RTIMEHOME}/../rti_me_psl.1.0/include/rti_me_psl) ENDIF() @@ -160,7 +143,7 @@ ENDIF() LINK_DIRECTORIES($ENV{RTIMEHOME}/lib/${RTIME_TARGET_NAME}) # If ${core_lib_dir_name} is not empty, we are working with a # Platform Independent Cert -IF (${cert_is_pi}) +IF (${arch_is_pi}) LINK_DIRECTORIES($ENV{RTIMEHOME}/lib/${core_lib_dir_name}) ENDIF() @@ -183,7 +166,7 @@ LIST(REMOVE_ITEM MyCSources ${CMAKE_CURRENT_SOURCE_DIR}/perftest_publisher.${SOURCE_EXTENSION} ${CMAKE_CURRENT_SOURCE_DIR}/perftest_cpp.cxx) -if(${cert_is_pi}) +if(${arch_is_pi}) add_compile_definitions(RTI_CERT_IS_PI) ENDIF() diff --git a/resource/cmake/common_utils.cmake b/resource/cmake/common_utils.cmake new file mode 100644 index 00000000..4c83f3fb --- /dev/null +++ b/resource/cmake/common_utils.cmake @@ -0,0 +1,19 @@ + +# This funtion returns the directory name where the Core library can be found +# based on the provided . +# The function produces output containing the Core's +# directory name +function(get_core_lib_dir_name full_arch_name) + string(REPLACE "-" ";" split_arch_name ${full_arch_name}) + list(GET split_arch_name 0 core_lib_dir_name) + list(LENGTH split_arch_name split_arch_name_length) + # Set function outputs + set(core_lib_dir_name ${core_lib_dir_name} PARENT_SCOPE) + # If there's text following the "-" in the arch name, we are working with a + # Platform Independent architecture, hence a Platform Independent Cert + if(split_arch_name_length GREATER 1) + set(arch_is_pi ON PARENT_SCOPE) + else() + set(arch_is_pi OFF PARENT_SCOPE) + endif() +endfunction() \ No newline at end of file diff --git a/resource/micro/CMakeLists.txt b/resource/micro/CMakeLists.txt new file mode 100644 index 00000000..14cb5dca --- /dev/null +++ b/resource/micro/CMakeLists.txt @@ -0,0 +1,380 @@ + +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) + +INCLUDE(../resource/cmake/common_utils.cmake) + +IF (NOT DEFINED RTIMEHOME) + IF (DEFINED ENV{RTIMEHOME}) + SET(RTIMEHOME $ENV{RTIMEHOME}) + ELSE() + MESSAGE(FATAL_ERROR "RTIMEHOME must be defined or set as an environment variable.") + ENDIF() +ENDIF() +MESSAGE(STATUS "[RTI] RTIMEHOME ..................: ${RTIMEHOME}") + +IF (NOT DEFINED RTIME_TARGET_NAME) + IF (DEFINED ENV{RTIME_TARGET_NAME}) + SET(RTIME_TARGET_NAME $ENV{RTIME_TARGET_NAME}) + ELSE() + MESSAGE(FATAL_ERROR "RTIME_TARGET_NAME must be defined or set as an environment variable.") + ENDIF() +ENDIF() +MESSAGE(STATUS "[RTI] RTIME_TARGET_NAME ..........: ${RTIME_TARGET_NAME}") + +IF (NOT (DEFINED RTI_SHARED_LIB)) + SET(RTI_SHARED_LIB FALSE) +ENDIF() +MESSAGE(STATUS "[RTI] RTI_SHARED_LIB .............: ${RTI_SHARED_LIB}") + +message(STATUS "ADDITIONAL_DEFINES = ${ADDITIONAL_DEFINES}") +ADD_DEFINITIONS(${ADDITIONAL_DEFINES}) +LINK_DIRECTORIES() +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +PROJECT(perftest CXX C) +SET(SOURCE_EXTENSION cxx) + +# Evaluating whether 24x compatibility was specified +SET(24x_COMPATIBILITY_SPECIFIED -1) +STRING(FIND "${ADDITIONAL_DEFINES}" "PERFTEST_RTI_MICRO_24x_COMPATIBILITY" 24x_COMPATIBILITY_SPECIFIED) + +IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + SET(PLATFORM_LIBS dl nsl m pthread rt) + ADD_DEFINITIONS(-DRTI_LINUX) +ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + SET(PLATFORM_LIBS dl m pthread ) + ADD_DEFINITIONS(-DRTI_DARWIN) +ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + SET(PLATFORM_LIBS netapi32.lib advapi32.lib user32.lib winmm.lib WS2_32.lib) + ADD_DEFINITIONS(-DRTI_WIN32) +ENDIF() + +SET(RTIDDSGEN ${RTIMEHOME}/rtiddsgen/scripts/rtiddsgen) +SET(RTIDDSMAG ${RTIMEHOME}/rtiddsmag/scripts/rtiddsmag) + +SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) + +SET(IDL_SOURCE_C perftest.idl) + +SET(IDL_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +SET(XML_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME}) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME}) +SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/objs/${RTIME_TARGET_NAME}) + +IF (CMAKE_GENERATOR MATCHES "Visual Studio") + #Visual studio needs to run commands using 'call' + #if there is more than one dependency + SET(COMMAND_PREFIX call) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT.lib" CACHE INTERNAL "CMAKE_EXE_LINKER_FLAGS" FORCE) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) +ELSE() + SET(COMMAND_PREFIX) +ENDIF() + +IF (RTIME_CERT) + ADD_DEFINITIONS(-DRTI_CERT) +ENDIF() + +SET(RTI_LIB_PREFIX rti_me) +SET(RTI_LIB_SUFFIX) +SET(RTI_LIB_SUFFIX_SSL) + +SET(RTI_SECURE_INC) +SET(RTI_SECURE_LINK_DIRECTORES) + +IF (NOT RTI_SHARED_LIB) + IF (${CMAKE_BUILD_TYPE} MATCHES "[Rr]elease") + SET(RTI_LIB_SUFFIX "z") + SET(RTI_DEBUG_BUILD FALSE) + ADD_DEFINITIONS(-DNDEBUG) + ELSE() + SET(RTI_LIB_SUFFIX "zd") + SET(RTI_DEBUG_BUILD TRUE) + ENDIF() + SET(RTI_LIB_SUFFIX_SSL "z") +ELSE() + IF (${CMAKE_BUILD_TYPE} MATCHES "[Rr]elease") + SET(RTI_LIB_SUFFIX "") + SET(RTI_DEBUG_BUILD FALSE) + ADD_DEFINITIONS(-DNDEBUG) + ELSE() + SET(RTI_LIB_SUFFIX "d") + SET(RTI_DEBUG_BUILD TRUE) + ENDIF() + + IF (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + ADD_DEFINITIONS(-DRTIME_DLL_VARIABLE) + ENDIF() +ENDIF() + +get_core_lib_dir_name(${RTIME_TARGET_NAME}) + +IF (${RTIME_SECURE}) + IF (NOT DEFINE OPENSSLHOME) + IF (DEFINED ENV{OPENSSLHOME}) + SET(OPENSSLHOME $ENV{OPENSSLHOME}) + ELSE() + MESSAGE(FATAL_ERROR "OPENSSLHOME must be defined or set as an environment variable.") + ENDIF() + ENDIF() + MESSAGE(STATUS "[RTI] OPENSSLHOME ................: ${OPENSSLHOME}") + + SET(RTI_SECURE_LIB rti_me_seccore${RTI_LIB_SUFFIX}) + SET(RTI_SECURE_INC ${OPENSSLHOME}/include ${XML_INC}) + SET(RTI_SECURE_LINK_DIRECTORES ${OPENSSLHOME}/lib) + + IF (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + SET(SSL_LIBS libssl${RTI_LIB_SUFFIX_SSL} libcrypto${RTI_LIB_SUFFIX_SSL}) + SET(PLATFORM_LIBS crypt32.lib ${PLATFORM_LIBS}) + ELSE() + SET(SSL_LIBS ssl${RTI_LIB_SUFFIX_SSL} crypto${RTI_LIB_SUFFIX_SSL}) + ENDIF() + + IF (SYSLIBXML2) + IF (LIBXML2HOME) + SET(XML_INC ${LIBXML2HOME}/lib) + ENDIF() + SET(XML_LIBS xml2) + ENDIF() +ENDIF() + +IF (NOT RTIME_CERT) + IF (NOT 24x_COMPATIBILITY_SPECIFIED EQUAL -1) + SET(MICRO_C_LIBS rti_me_cpp${RTI_LIB_SUFFIX} + rti_me_rhsm${RTI_LIB_SUFFIX} + rti_me_whsm${RTI_LIB_SUFFIX} + rti_me_discdpse${RTI_LIB_SUFFIX} + rti_me_discdpde${RTI_LIB_SUFFIX} + rti_me${RTI_LIB_SUFFIX}) + ELSE() + IF (DEFINED RTIME_MAG_FILES) + SET(MICRO_APPGEN_LIB rti_me_appgen${RTI_LIB_SUFFIX}) + ENDIF() + + SET(MICRO_C_LIBS ${MICRO_APPGEN_LIB} + rti_me_cpp${RTI_LIB_SUFFIX} + rti_me_netioshmem${RTI_LIB_SUFFIX} + rti_me_netiosdm${RTI_LIB_SUFFIX} + ) + + LIST(APPEND MICRO_C_LIBS + rti_me_netioshmem${RTI_LIB_SUFFIX} + rti_me_netiosdm${RTI_LIB_SUFFIX} + rti_me_rhsm${RTI_LIB_SUFFIX} + rti_me_whsm${RTI_LIB_SUFFIX} + rti_me_discdpse${RTI_LIB_SUFFIX} + rti_me_discdpde${RTI_LIB_SUFFIX} + ) + + IF(arch_is_pi) + LIST(APPEND MICRO_C_LIBS + rti_me_netiopsl_cpp${RTI_LIB_SUFFIX} + rti_me_netiopsl${RTI_LIB_SUFFIX} + rti_me_ospsl${RTI_LIB_SUFFIX} + rti_me_psl${RTI_LIB_SUFFIX}) + ENDIF() + + LIST(APPEND MICRO_C_LIBS + rti_me${RTI_LIB_SUFFIX} + ) + ENDIF() +ELSE() + SET(MICRO_C_LIBS rti_me${RTI_LIB_SUFFIX} + ) +ENDIF() + +INCLUDE_DIRECTORIES(${RTIMEHOME}/include ${RTIMEHOME}/include/rti_me ${RTI_SECURE_INC}) +IF(${arch_is_pi}) + INCLUDE_DIRECTORIES(${RTIMEHOME}/include/rti_me/rti_me_psl) +ENDIF() + +LINK_DIRECTORIES(${RTIMEHOME}/lib/${RTIME_TARGET_NAME} ${RTI_SECURE_LINK_DIRECTORES}) +IF (${arch_is_pi}) + LINK_DIRECTORIES(${RTIMEHOME}/lib/${core_lib_dir_name}) +ENDIF() + +FOREACH(idl ${IDL_SOURCE_C}) + GET_FILENAME_COMPONENT(filename ${idl} NAME) + STRING(REGEX REPLACE "\\.idl" "" basename ${filename}) + LIST(APPEND IDL_GEN_C ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Plugin.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Support.${SOURCE_EXTENSION}) + + LIST(APPEND IDL_GEN_H ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.h + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Plugin.h + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Support.h) + + IF (RTIME_IDL_ADD_REGENERATE_TYPESUPPORT_RULE) + IF (NOT EXISTS ${idl}) + MESSAGE(FATAL_ERROR "${idl} does not exist.") + ELSEIF(IS_DIRECTORY ${idl}) + MESSAGE(FATAL_ERROR "${idl} is not a file.") + ENDIF() + + SET(IDL_GEN_FILE_C ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Plugin.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Support.${SOURCE_EXTENSION}) + + SET(IDL_GEN_FILE_H ${CMAKE_CURRENT_SOURCE_DIR}/${basename}.h + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Plugin.h + ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Support.h) + + ADD_CUSTOM_COMMAND(OUTPUT ${IDL_GEN_FILE_C} ${IDL_GEN_FILE_H} + COMMAND ${COMMAND_PREFIX} ${RTIDDSGEN} -language C++98 + -micro -verbosity 1 -update typefiles + -d ${CMAKE_CURRENT_SOURCE_DIR} + ${IDL_PATH}/${idl} + DEPENDS ${IDL_PATH}/${idl} + COMMENT "Regeneration type support plugin from ${idl}" + ) + SET_SOURCE_FILES_PROPERTIES(${IDLIDL_GEN_FILE_C_GEN_C} ${IDL_GEN_FILE_H} PROPERTIES GENERATED 1) + ENDIF() +ENDFOREACH() + +IF (DEFINED RTIME_MAG_FILES) + FOREACH(xml ${RTIME_MAG_FILES}) + IF (NOT EXISTS ${xml}) + MESSAGE(FATAL_ERROR "${xml} does not exist.") + ELSEIF(IS_DIRECTORY ${xml}) + MESSAGE(FATAL_ERROR "${xml} is not a file.") + ENDIF() + + GET_FILENAME_COMPONENT(filename ${xml} NAME) + STRING(REGEX REPLACE "\\.xml" "" basename ${filename}) + GET_FILENAME_COMPONENT(basename ${xml} NAME_WE) + + STRING(REGEX REPLACE "\\.xml" "Qos.xml" xml_qos ${xml}) + IF (EXISTS ${xml_qos}) + IF(NOT IS_DIRECTORY ${xml_qos}) + SET(REFERENCED_OPT "YES") + ENDIF() + ENDIF() + + LIST(APPEND APP_GEN_C ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Appgen.c) + + LIST(APPEND APP_GEN_H ${CMAKE_CURRENT_SOURCE_DIR}/${basename}Appgen.h) + + LIST(APPEND APP_GEN_C ${CMAKE_CURRENT_SOURCE_DIR}/${basename}AppgenPlugin.cxx) + + LIST(APPEND APP_GEN_H ${CMAKE_CURRENT_SOURCE_DIR}/${basename}AppgenPlugin.h) + + + IF (DEFINED REFERENCED_OPT) + ADD_CUSTOM_COMMAND(OUTPUT ${APP_GEN_C} ${APP_GEN_H} + COMMAND ${COMMAND_PREFIX} ${RTIDDSMAG} -verbosity 1 + -language C++98 + -replace + -d ${CMAKE_CURRENT_SOURCE_DIR} + -idlFile ${IDL_PATH}/${IDL_SOURCE_C} + -referencedFile ${XML_PATH}/${basename}Qos.xml + ${XML_PATH}/${xml} + DEPENDS ${XML_PATH}/${xml} ${XML_PATH}/${basename}Qos.xml + COMMENT "Regeneration of application support from ${xml}" + ) + ELSE() + ADD_CUSTOM_COMMAND(OUTPUT ${APP_GEN_C} ${APP_GEN_H} + COMMAND ${COMMAND_PREFIX} ${RTIDDSMAG} -verbosity 1 + -language C++98 + -replace + -d ${CMAKE_CURRENT_SOURCE_DIR} + -idlFile ${IDL_PATH}/${IDL_SOURCE_C} + ${XML_PATH}/${xml} + DEPENDS ${XML_PATH}/${xml} + COMMENT "Regeneration of application support from ${xml}" + ) + ENDIF() + ENDFOREACH() +ENDIF() + +IF (${RTIME_SECURE}) + ADD_CUSTOM_TARGET(security_material ALL + DEPENDS ${CMAKE_SOURCE_DIR}/security/ca/ca.pem + ${CMAKE_SOURCE_DIR}/security/ca/certs/publisher.pem + ${CMAKE_SOURCE_DIR}/security/ca/certs/publisher_key.pem + ${CMAKE_SOURCE_DIR}/security/ca/certs/subscriber.pem + ${CMAKE_SOURCE_DIR}/security/ca/certs/subscriber_key.pem + ${CMAKE_SOURCE_DIR}/security/xml/permissions_publisher.p7s + ${CMAKE_SOURCE_DIR}/security/xml/permissions_subscriber.p7s + ${CMAKE_SOURCE_DIR}/security/xml/governance.p7s + ) + + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/security/openssl_ca.cnf + ${CMAKE_SOURCE_DIR}/security/openssl_publisher.cnf + ${CMAKE_SOURCE_DIR}/security/openssl_subscriber.cnf + ${CMAKE_SOURCE_DIR}/security/xml/governance.xml + ${CMAKE_SOURCE_DIR}/security/xml/permissions_publisher.xml + ${CMAKE_SOURCE_DIR}/security/xml/permissions_subscriber.xml + COMMAND "${CMAKE_COMMAND}" -E copy_directory "${RTIMEHOME}/rtiddsgen/resource/rtiddsgen/security" "security" + COMMENT "Copy secure configuration files" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/security/ca/ca_key.pem ${CMAKE_SOURCE_DIR}/security/ca/ca.pem + COMMAND "${CMAKE_COMMAND}" -E make_directory ca + COMMAND "${CMAKE_COMMAND}" -E touch ca/index.txt + COMMAND echo 01 > ca/serial + COMMAND openssl genrsa -out ca/ca_key.pem 2048 + COMMAND openssl req -new -key ca/ca_key.pem -out ca/ca.csr -config openssl_ca.cnf + COMMAND openssl x509 -req -days 365 -in ca/ca.csr -signkey ca/ca_key.pem -out ca/ca.pem + COMMENT "Regenerating Certificate Authority" + DEPENDS ${CMAKE_SOURCE_DIR}/security/openssl_ca.cnf + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/security + ) + + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/security/ca/certs/publisher.pem ${CMAKE_SOURCE_DIR}/security/ca/certs/publisher_key.pem + COMMAND "${CMAKE_COMMAND}" -E make_directory ca/certs + COMMAND openssl genrsa -out ca/certs/publisher_key.pem 2048 + COMMAND openssl req -new -key ca/certs/publisher_key.pem -out ca/certs/publisher.csr -config openssl_publisher.cnf + COMMAND openssl ca -batch -config openssl_ca.cnf -in ca/certs/publisher.csr -out ca/certs/publisher.pem + COMMENT "Regenerating Publisher identity" + DEPENDS ${CMAKE_SOURCE_DIR}/security/openssl_ca.cnf ${CMAKE_SOURCE_DIR}/security/openssl_publisher.cnf + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/security + ) + + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/security/ca/certs/subscriber.pem ${CMAKE_SOURCE_DIR}/security/ca/certs/subscriber_key.pem + COMMAND "${CMAKE_COMMAND}" -E make_directory ca/certs + COMMAND openssl genrsa -out ca/certs/subscriber_key.pem 2048 + COMMAND openssl req -new -key ca/certs/subscriber_key.pem -out ca/certs/subscriber.csr -config openssl_subscriber.cnf + COMMAND openssl ca -batch -config openssl_ca.cnf -in ca/certs/subscriber.csr -out ca/certs/subscriber.pem + COMMENT "Regenerating Subscriber identity" + DEPENDS ${CMAKE_SOURCE_DIR}/security/openssl_ca.cnf ${CMAKE_SOURCE_DIR}/security/openssl_subscriber.cnf + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/security + ) + + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/security/xml/permissions_publisher.p7s + COMMAND openssl cms -in xml/permissions_publisher.xml -out xml/permissions_publisher.p7s -signer ca/ca.pem -inkey ca/ca_key.pem -sign -outform smime + COMMENT "Regenerating Publisher Permissions file" + DEPENDS ${CMAKE_SOURCE_DIR}/security/xml/permissions_publisher.xml ${CMAKE_SOURCE_DIR}/security/ca/ca.pem ${CMAKE_SOURCE_DIR}/security/ca/ca_key.pem + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/security + ) + + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/security/xml/permissions_subscriber.p7s + COMMAND openssl cms -in xml/permissions_subscriber.xml -out xml/permissions_subscriber.p7s -signer ca/ca.pem -inkey ca/ca_key.pem -sign -outform smime + COMMENT "Regenerating Subscriber Permissions file" + DEPENDS ${CMAKE_SOURCE_DIR}/security/xml/permissions_subscriber.xml ${CMAKE_SOURCE_DIR}/security/ca/ca.pem ${CMAKE_SOURCE_DIR}/security/ca/ca_key.pem + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/security + ) + + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_SOURCE_DIR}/security/xml/governance.p7s + COMMAND openssl cms -in xml/governance.xml -out xml/governance.p7s -signer ca/ca.pem -inkey ca/ca_key.pem -sign -outform smime + COMMENT "Regenerating Governance file" + DEPENDS ${CMAKE_SOURCE_DIR}/security/xml/governance.xml ${CMAKE_SOURCE_DIR}/security/ca/ca.pem ${CMAKE_SOURCE_DIR}/security/ca/ca_key.pem + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/security + ) +ENDIF() + +ADD_EXECUTABLE(perftest_publisher + ${CMAKE_CURRENT_SOURCE_DIR}/perftest_publisher.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/perftestApplication.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/perftestApplication.h + ${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_CURRENT_SOURCE_DIR}/ThreadPriorities.cxx ${CMAKE_CURRENT_SOURCE_DIR}/Parameter.cxx ${CMAKE_CURRENT_SOURCE_DIR}/ParameterManager.cxx ${CMAKE_CURRENT_SOURCE_DIR}/RTIDDSImpl.cxx ${CMAKE_CURRENT_SOURCE_DIR}/CpuMonitor.cxx ${CMAKE_CURRENT_SOURCE_DIR}/PerftestTransport.cxx ${CMAKE_CURRENT_SOURCE_DIR}/PerftestSecurity.cxx ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_common.cxx ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_micro.cxx ${CMAKE_CURRENT_SOURCE_DIR}/FileDataLoader.cxx ${CMAKE_CURRENT_SOURCE_DIR}/PerftestPrinter.cxx ${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_CURRENT_SOURCE_DIR}/ThreadPriorities.h ${CMAKE_CURRENT_SOURCE_DIR}/Parameter.h ${CMAKE_CURRENT_SOURCE_DIR}/ParameterManager.h ${CMAKE_CURRENT_SOURCE_DIR}/MessagingIF.h ${CMAKE_CURRENT_SOURCE_DIR}/RTIDDSImpl.h ${CMAKE_CURRENT_SOURCE_DIR}/perftest_cpp.h ${CMAKE_CURRENT_SOURCE_DIR}/CpuMonitor.h ${CMAKE_CURRENT_SOURCE_DIR}/PerftestTransport.h ${CMAKE_CURRENT_SOURCE_DIR}/PerftestSecurity.h ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_common.h ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_micro.h ${CMAKE_CURRENT_SOURCE_DIR}/FileDataLoader.h ${CMAKE_CURRENT_SOURCE_DIR}/PerftestPrinter.h ${IDL_GEN_C} ${IDL_GEN_H} ${APP_GEN_C} ${APP_GEN_H}) + +ADD_EXECUTABLE(perftest_subscriber + ${CMAKE_CURRENT_SOURCE_DIR}/perftest_subscriber.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/perftestApplication.${SOURCE_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/perftestApplication.h + ${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_CURRENT_SOURCE_DIR}/ThreadPriorities.cxx ${CMAKE_CURRENT_SOURCE_DIR}/Parameter.cxx ${CMAKE_CURRENT_SOURCE_DIR}/ParameterManager.cxx ${CMAKE_CURRENT_SOURCE_DIR}/RTIDDSImpl.cxx ${CMAKE_CURRENT_SOURCE_DIR}/CpuMonitor.cxx ${CMAKE_CURRENT_SOURCE_DIR}/PerftestTransport.cxx ${CMAKE_CURRENT_SOURCE_DIR}/PerftestSecurity.cxx ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_common.cxx ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_micro.cxx ${CMAKE_CURRENT_SOURCE_DIR}/FileDataLoader.cxx ${CMAKE_CURRENT_SOURCE_DIR}/PerftestPrinter.cxx ${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_CURRENT_SOURCE_DIR}/ThreadPriorities.h ${CMAKE_CURRENT_SOURCE_DIR}/Parameter.h ${CMAKE_CURRENT_SOURCE_DIR}/ParameterManager.h ${CMAKE_CURRENT_SOURCE_DIR}/MessagingIF.h ${CMAKE_CURRENT_SOURCE_DIR}/RTIDDSImpl.h ${CMAKE_CURRENT_SOURCE_DIR}/perftest_cpp.h ${CMAKE_CURRENT_SOURCE_DIR}/CpuMonitor.h ${CMAKE_CURRENT_SOURCE_DIR}/PerftestTransport.h ${CMAKE_CURRENT_SOURCE_DIR}/PerftestSecurity.h ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_common.h ${CMAKE_CURRENT_SOURCE_DIR}/Infrastructure_micro.h ${CMAKE_CURRENT_SOURCE_DIR}/FileDataLoader.h ${CMAKE_CURRENT_SOURCE_DIR}/PerftestPrinter.h ${IDL_GEN_C} ${IDL_GEN_H} ${APP_GEN_C} ${APP_GEN_H}) + +TARGET_LINK_LIBRARIES(perftest_publisher ${MICRO_C_LIBS} ${XML_LIBS} ${SSL_LIBS} ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(perftest_subscriber ${MICRO_C_LIBS} ${XML_LIBS} ${SSL_LIBS} ${PLATFORM_LIBS}) diff --git a/srcCpp/connextDDS/micro/Configure_UDPv4.cxx b/srcCpp/connextDDS/micro/Configure_UDPv4.cxx new file mode 100644 index 00000000..6ebbb247 --- /dev/null +++ b/srcCpp/connextDDS/micro/Configure_UDPv4.cxx @@ -0,0 +1,182 @@ +#include + +#include "rti_me_c.h" + +#include "PerftestTransport.h" +#include "ParameterManager.h" + +bool is_ip_address(std::string ip_string); + +bool configureUDPv4Transport( + PerftestTransport& transport, + struct DDS_DomainParticipantQos& qos, + ParameterManager *_PM) +{ + + RTRegistry *registry = DDSDomainParticipantFactory::get_instance()->get_registry(); + DPDE_DiscoveryPluginProperty dpde_properties; + + UDP_InterfaceFactoryProperty* udp_property = (struct UDP_InterfaceFactoryProperty *) + malloc(sizeof(struct UDP_InterfaceFactoryProperty)); + *udp_property = UDP_INTERFACE_FACTORY_PROPERTY_DEFAULT; + + udp_property->max_message_size = 65536; + udp_property->max_receive_buffer_size = 2097152; + udp_property->max_send_buffer_size = 524288; + + /* Configure UDP transport's allowed interfaces */ + if (!registry->unregister(NETIO_DEFAULT_UDP_NAME, NULL, NULL)) { + fprintf(stderr, "[Error] Micro failed to unregister udp\n"); + return false; + } + + /* use only interface supplied by command line? */ + if (!_PM->get("allowInterfaces").empty()) { + + if (is_ip_address(_PM->get("allowInterfaces"))) { + fprintf(stderr, + "[Error]: Micro does not support providing the allowed interfaces\n" + "(-nic/-allowInterfaces) as an ip, provide the nic name instead\n" + "(value provided: %s)\n", + _PM->get("allowInterfaces").c_str()); + return false; + } + + if (!DDS_StringSeq_set_maximum(&udp_property->allow_interface,1)) + { + printf("failed to set allow_interface maximum\n"); + return false; + } + if (!DDS_StringSeq_set_length(&udp_property->allow_interface,1)) + { + printf("failed to set allow_interface length\n"); + return false; + } + *DDS_StringSeq_get_reference(&udp_property->allow_interface,0) = + DDS_String_dup(_PM->get("allowInterfaces").c_str()); + } + + /* Safety Base or stricter, with Micro, must manually configure available + * interfaces. + * First we disable reading out the interface list. Note that on some + * platforms reading out the interface list has been compiled out, so + * this property could have no effect. + */ + udp_property->disable_auto_interface_config = RTI_TRUE; + + REDA_StringSeq_set_maximum(&udp_property->allow_interface,1); + REDA_StringSeq_set_length(&udp_property->allow_interface,1); + + /* The name of the interface can be the anything, up to + * UDP_INTERFACE_MAX_IFNAME characters including the '\0' character + */ + *DDS_StringSeq_get_reference(&udp_property->allow_interface,0) = + DDS_String_dup("loopback"); + + /* This function takes the following arguments: + * Param 1 is the iftable in the UDP property + * Param 2 is the IP address of the interface in host order + * Param 3 is the Netmask of the interface + * Param 4 is the name of the interface + * Param 5 are flags. The following flags are supported for Security and + * Safety Base (use OR for multiple): + * UDP_INTERFACE_INTERFACE_UP_FLAG - Interface is up + * + * The following flags are supported for non-Security and non-Safety + * Base: + * UDP_INTERFACE_INTERFACE_MULTICAST_FLAG - Interface supports multicast + */ + RTI_BOOL result; + result = UDP_InterfaceTable_add_entry(&udp_property->if_table, + 0x7f000001,0xff000000,"loopback", + UDP_INTERFACE_INTERFACE_UP_FLAG); + + if (!result) + { + printf("failed UDP table add entry!\n"); + return DDS_BOOLEAN_FALSE; + } + + if (!registry->register_component( + NETIO_DEFAULT_UDP_NAME, + UDP_InterfaceFactory_get_interface(), + &udp_property->_parent._parent, + NULL)) { + printf("Micro: Failed to register udp\n"); + if (udp_property != NULL) { + free(udp_property); + } + return false; + } + + /* In order to avoid MICRO-2191 */ + #if RTIME_DDS_VERSION_MAJOR >= 3 && RTIME_DDS_VERSION_MINOR > 0 + dpde_properties.max_samples_per_remote_builtin_endpoint_writer = 1; + #endif + +// For TSS, this component is already registered +#ifndef RTI_PERF_TSS_MICRO + if (!registry->register_component("dpde", + DPDEDiscoveryFactory::get_interface(), + &dpde_properties._parent, + NULL)) { + printf("Micro: Failed to register dpde\n"); + if (udp_property != NULL) { + free(udp_property); + } + return false; + } +#endif + + if (!RT_ComponentFactoryId_set_name(&qos.discovery.discovery.name, "dpde")) { + printf("Micro: Failed to set discovery plugin name\n"); + if (udp_property != NULL) { + free(udp_property); + } + return false; + } + + if (_PM->get("multicast")) { + DDS_StringSeq_set_maximum(&qos.user_traffic.enabled_transports, 1); + DDS_StringSeq_set_length(&qos.user_traffic.enabled_transports, 1); + *DDS_StringSeq_get_reference(&qos.user_traffic.enabled_transports, 0) = + DDS_String_dup("_udp://239.255.0.1"); + } + + /* if there are more remote or local endpoints, you may need to increase these limits */ + qos.resource_limits.max_destination_ports = 32; + qos.resource_limits.max_receive_ports = 32; + qos.resource_limits.local_topic_allocation = 3; + qos.resource_limits.local_type_allocation = 1; + qos.resource_limits.local_reader_allocation = 2; + qos.resource_limits.local_writer_allocation = 2; + qos.resource_limits.remote_participant_allocation = 8; + qos.resource_limits.remote_reader_allocation = 8; + qos.resource_limits.remote_writer_allocation = 8; +#ifdef RTI_PERF_TSS_MICRO + qos.resource_limits.local_publisher_allocation = 3; + qos.resource_limits.local_subscriber_allocation = 3; +#endif + + transport.minimumMessageSizeMax = udp_property->max_message_size; + + return true; +} + +/* + * Function to check if a given string is an ip (it does not check for ranges) + */ +bool is_ip_address(std::string ip_string) +{ + int octect1, octect2, octect3, octect4; + if (sscanf(ip_string.c_str(), + "%d.%d.%d.%d", + &octect1, + &octect2, + &octect3, + &octect4) + != 4) { + return false; + } + return true; +} diff --git a/srcCpp/connextDDS/micro/Infrastructure_micro.cxx b/srcCpp/connextDDS/micro/Infrastructure_micro.cxx index bade488e..6685f75b 100644 --- a/srcCpp/connextDDS/micro/Infrastructure_micro.cxx +++ b/srcCpp/connextDDS/micro/Infrastructure_micro.cxx @@ -184,10 +184,7 @@ bool configureUDPv4Transport( udp_property->max_send_buffer_size = 524288; /* Configure UDP transport's allowed interfaces */ - if (!registry->unregister(NETIO_DEFAULT_UDP_NAME, NULL, NULL)) { - fprintf(stderr, "[Error] Micro failed to unregister udp\n"); - return false; - } + registry->unregister(NETIO_DEFAULT_UDP_NAME, NULL, NULL); /* use only interface supplied by command line? */ if (!_PM->get("allowInterfaces").empty()) { @@ -315,6 +312,20 @@ bool configureUDPv4Transport( *DDS_StringSeq_get_reference(&qos.user_traffic.enabled_transports, 0) = DDS_String_dup("_udp://239.255.0.1"); } + else + { + DDS_StringSeq_set_maximum(&qos.user_traffic.enabled_transports,1); + DDS_StringSeq_set_length(&qos.user_traffic.enabled_transports,1); + *DDS_StringSeq_get_reference(&qos.user_traffic.enabled_transports,0) = DDS_String_dup("_udp://"); + } + + DDS_StringSeq_set_maximum(&qos.transports.enabled_transports,1); + DDS_StringSeq_set_length(&qos.transports.enabled_transports,1); + *DDS_StringSeq_get_reference(&qos.transports.enabled_transports,0) = DDS_String_dup("_udp"); + + DDS_StringSeq_set_maximum(&qos.discovery.enabled_transports,1); + DDS_StringSeq_set_length(&qos.discovery.enabled_transports,1); + *DDS_StringSeq_get_reference(&qos.discovery.enabled_transports,0) = DDS_String_dup("_udp://"); /* if there are more remote or local endpoints, you may need to increase these limits */ qos.resource_limits.max_destination_ports = 32; @@ -348,10 +359,7 @@ bool configureShmemTransport( NETIO_SHMEMInterfaceFactoryProperty shmem_property; /* We don't need UDP transport. Unregister it */ - if (!registry->unregister(NETIO_DEFAULT_UDP_NAME, NULL, NULL)) { - printf("Micro: Failed to unregister udp\n"); - return false; - } + registry->unregister(NETIO_DEFAULT_UDP_NAME, NULL, NULL); /* In order to avoid MICRO-2191 */ #if RTIME_DDS_VERSION_MAJOR >= 3 && RTIME_DDS_VERSION_MINOR > 0 From 439ce2f5e35f2ec7099673f01ee1f2ff20f88393 Mon Sep 17 00:00:00 2001 From: Lissa Loadholt Date: Thu, 31 Oct 2024 05:10:24 -0700 Subject: [PATCH 25/49] Pull request #109: PERFTEST-395: Review MICRO-5720 doc updates and remove DDS from product names as needed Merge in PERF/rti-perftest from doc/PERFTEST-395 to develop Squashed commit of the following: commit b00af7bf8788d411e9d50cf3946e5b754d86b092 Author: Lissa Loadholt Date: Thu Oct 24 08:40:22 2024 -0700 examples.rst edited online with Bitbucket Corrected name of Zero Copy commit ca2e895c01a826488df5f52be1acdb31460f76f0 Author: Rachel Haas Date: Thu Oct 24 08:30:04 2024 -0700 Applied suggestion commit 9c2782fb7122ee1d67faeaafe5aaece9cf232dba Author: Lissa Loadholt Date: Tue Oct 22 08:59:36 2024 -0400 PERFTEST-395: Review MICRO-5720 doc updates and remove DDS from product names as needed --- srcDoc/command_line_parameters.rst | 108 ++++++++++---------- srcDoc/compatibility.rst | 14 +-- srcDoc/compilation.rst | 100 +++++++++--------- srcDoc/examples.rst | 46 ++++----- srcDoc/extending_perftest.rst | 20 ++-- srcDoc/index.rst | 12 +-- srcDoc/introduction.rst | 10 +- srcDoc/release_notes.rst | 47 ++++----- srcDoc/tutorials/performance_validation.rst | 50 ++++----- 9 files changed, 202 insertions(+), 205 deletions(-) diff --git a/srcDoc/command_line_parameters.rst b/srcDoc/command_line_parameters.rst index fefa4da4..da156910 100644 --- a/srcDoc/command_line_parameters.rst +++ b/srcDoc/command_line_parameters.rst @@ -23,7 +23,7 @@ application. If you do not specify ``-pub``, then ``-sub`` is assumed. Some of these parameters are valid when using *RTI Connext DDS Professional*, -*RTI Connext DDS Micro*, and the Raw Transport feature; some of them are +*RTI Connext Micro*, and the Raw Transport feature; some of them are available for just some of these implementations. Whether or not a parameter is available is stated in the descriptions of the parameters and in the ``-help`` information displayed by the application. @@ -52,7 +52,7 @@ Test Parameters for Publishing and Subscribing Applications **Default:** ``false`` (use reliable communication) For an introduction to the RTI reliability model, see - `Reliable Communications, in the RTI Connext DDS Core Libraries User’s Manual `__. + `Reliable Communications, in the RTI Connext DDS Core Libraries User's Manual `__. - ``-dataLen `` @@ -69,7 +69,7 @@ Test Parameters for Publishing and Subscribing Applications If ```` is bigger than 64900, *RTI Perftest* will enable the use of *Asynchronous Publishing* and *Unbounded Sequences*. When using - *RTI Connext DDS Micro*, the type is not really unbounded; the size is + *RTI Connext Micro*, the type is not really unbounded; the size is given by the ``MICRO_UNBOUNDED_SEQUENCE_SIZE`` constant, which can be modified in the ``build.bat`` and ``build.sh`` scripts. @@ -103,7 +103,7 @@ Test Parameters for Publishing and Subscribing Applications Use the FlatData language binding API to build samples where the in-memory representation matches the wire representation. - This parameter is not available when compiling against *Connext DDS + This parameter is not available when compiling against *Connext Micro* or a *Connext DDS* version prior to 6.0.0. **Default:** ``false`` @@ -121,7 +121,7 @@ Test Parameters for Publishing and Subscribing Applications This parameter can only be used along with ``-flatData`` and the SHMEM builtin transport. - This parameter is not available when compiling against *Connext DDS + This parameter is not available when compiling against *Connext Micro* or a *Connext DDS* version prior to 6.0.0. **Default:** ``false`` @@ -165,9 +165,9 @@ Test Parameters for Publishing and Subscribing Applications For an introduction to the RTI durability model, see `Basic QoS, in the RTI Connext DDS Getting Started Guide `__. See also: - `Mechanisms for Achieving Information Durability and Persistence, in the RTI Connext DDS Core Libraries User’s Manual `__. + `Mechanisms for Achieving Information Durability and Persistence, in the RTI Connext DDS Core Libraries User's Manual `__. - ``PERSISTENT`` is not available when compiling against *Connext DDS Micro*. + ``PERSISTENT`` is not available when compiling against *Connext Micro*. - ``-domain `` @@ -180,7 +180,7 @@ Test Parameters for Publishing and Subscribing Applications | **Range:** ``0 - 200`` See - `Choosing a Domain ID and Creating Multiple Domains, in the RTI Connext DDS Core Libraries User’s Manual `__. + `Choosing a Domain ID and Creating Multiple Domains, in the RTI Connext DDS Core Libraries User's Manual `__. - ``-help`` @@ -228,7 +228,7 @@ Test Parameters for Publishing and Subscribing Applications The
will be used by the three *Perftest* topics **Latency**, **Throughput**, and **Announcement**. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** Do not use multicast @@ -249,7 +249,7 @@ Test Parameters for Publishing and Subscribing Applications gets samples from *Persistence Service*. This brokered communication pattern provides a way to guarantee eventual consistency. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** Not enabled (use direct communication) @@ -257,7 +257,7 @@ Test Parameters for Publishing and Subscribing Applications Disable use of positive ACKs in the reliable protocol. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** Not enabled (use positive ACKs) @@ -283,7 +283,7 @@ Test Parameters for Publishing and Subscribing Applications Path to the XML file containing DDS QoS profiles. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** ``perftest_qos_profiles.xml`` @@ -293,16 +293,16 @@ Test Parameters for Publishing and Subscribing Applications .. note:: - Some QoS values are ‘hard-coded’ in the application. + Some QoS values are 'hard-coded' in the application. Therefore, setting them in the XML file has no effect. See comments in ``perftest_qos_profiles.xml``, as well as in - `Configuring QoS with XML, in the RTI Connext DDS Core Libraries User’s Manual `__. + `Configuring QoS with XML, in the RTI Connext DDS Core Libraries User's Manual `__. - ``-qosLibrary `` Name of the QoS Library for DDS Qos profiles. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** ``PerftestQosLibrary`` @@ -313,7 +313,7 @@ Test Parameters for Publishing and Subscribing Applications will not be used. This parameter is recommended for operating systems without a file-system. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. .. note:: @@ -342,7 +342,7 @@ Test Parameters for Publishing and Subscribing Applications See :ref:`WaitSet Event Count and Delay`. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** ``100`` | **Range:** ``>= 0`` @@ -362,7 +362,7 @@ Test Parameters for Publishing and Subscribing Applications See :ref:`WaitSet Event Count and Delay`. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** ``5`` | **Range:** ``>= 1`` @@ -371,7 +371,7 @@ Test Parameters for Publishing and Subscribing Applications Enable asynchronous publishing in the *DataWriter* QoS. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** Not set @@ -385,7 +385,7 @@ Test Parameters for Publishing and Subscribing Applications There are several flow controllers predefined: ['default','10Gbps','1Gbps']. - This parameter is not available when compiling against *Connext DDS + This parameter is not available when compiling against *Connext Micro*; in this case, *RTI Perftest* will use the default FlowController. | **Default:** ``default`` @@ -401,7 +401,7 @@ Test Parameters for Publishing and Subscribing Applications Use unbounded sequences in the data type of the IDL. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** ``2 * dataLen up to 1 MB`` **Range:** ``28 B - 1 MB`` @@ -423,9 +423,9 @@ Test Parameters for Publishing and Subscribing Applications - **X** for the main thread, which is the one sending the data, or for the asynchronous publishing thread if that one is used. - - **Y** for the receive threads created by *Connext DDS* or, if ``-useReadThread`` is used, for + - **Y** for the receive threads created by *Connext* or, if ``-useReadThread`` is used, for the *Perftest* thread that is created to receive and process data. - - **Z** for the rest of the threads created by *Connext DDS*: event and database threads. + - **Z** for the rest of the threads created by *Connext*: event and database threads. This parameter accepts either three numeric values (whichever numeric values you choose) representing the priority of each of the threads or three characters representing @@ -440,7 +440,7 @@ Test Parameters for Publishing and Subscribing Applications - "Thread-Priority Definitions for Windows Platforms" table - "Thread-Priority Definitions for QNX Platforms" table - This parameter is not available when compiling against *RTI Connext DDS + This parameter is not available when compiling against *RTI Connext Micro* or when using the Raw Transport feature. **Default:** @@ -569,32 +569,32 @@ by using the transport-specific command-line parameters. Set the transport to be used. The rest of the transports will be disabled. - | **Options in Connext DDS Professional:** ``UDPv4``, ``UDPv6``, ``SHMEM``, ``TCP``, ``TLS``, ``DTLS``, ``WAN`` and ``UDPv4_WAN`` - | **Default in Connext DDS Professional:** Transport defined in the XML profile (``UDPv4`` and ``SHMEM`` if the XML profile is not changed) + | **Options in Connext Professional:** ``UDPv4``, ``UDPv6``, ``SHMEM``, ``TCP``, ``TLS``, ``DTLS``, ``WAN`` and ``UDPv4_WAN`` + | **Default in Connext Professional:** Transport defined in the XML profile (``UDPv4`` and ``SHMEM`` if the XML profile is not changed) - | **Options in Connext DDS Micro:** ``UDPv4``, ``SHMEM`` - | **Default in Connext DDS Micro:** ``UDPv4`` + | **Options in Connext Micro:** ``UDPv4``, ``SHMEM`` + | **Default in Connext Micro:** ``UDPv4`` | **Options for Raw Transport:** ``UDPv4``, ``SHMEM`` | **Default for Raw Transport:** ``UDPv4`` - ``-allowInterfaces / -nic `` - Restrict *Connext DDS* to sending output through this interface. + Restrict *Connext* to sending output through this interface. The value should be the IP address assigned to any of the available network interfaces on the machine. On Windows systems, use the name of the interface. This command-line parameter is mapped to the **allow_interfaces_list** - property in *Connext DDS*. + property in *Connext*. - By default, *Connext DDS* will attempt to contact all possible + By default, *Connext* will attempt to contact all possible subscribing nodes on all available network interfaces. Even on a multi-NIC machine, the performance over one NIC vs. another may be different (e.g., Gbit vs. 100 Mbit), so choosing the correct NIC is critical for a proper test. - When compiling against *Connext DDS Micro*, this option should always use + When compiling against *Connext Micro*, this option should always use the name of the interface, not the IP address (which is valid when compiling - against *Connext DDS Professional*). + against *Connext Professional*). .. note:: @@ -604,7 +604,7 @@ by using the transport-specific command-line parameters. Verbosity of the transport plugin. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** ``0`` (errors only) @@ -612,7 +612,7 @@ by using the transport-specific command-line parameters. For TCP and TLS. Port used by the transport to accept TCP/TLS connections. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** ``7400`` @@ -620,7 +620,7 @@ by using the transport-specific command-line parameters. For TCP and TLS. Use TCP across LANs and firewalls. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** Not set (LAN mode) @@ -633,7 +633,7 @@ by using the transport-specific command-line parameters. For UDPv4_WAN: public address of the UDPv4_WAN transport instantiation. Format is ``:``. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** Not set @@ -642,7 +642,7 @@ by using the transport-specific command-line parameters. For UDPv4_WAN. Internal host port associated with the transport instantiation. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** public port specified as part of ``-transportPublicAddress`` @@ -651,7 +651,7 @@ by using the transport-specific command-line parameters. For WAN transport. Address where to find the WAN server. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** Not set @@ -659,7 +659,7 @@ by using the transport-specific command-line parameters. For WAN transport. Port where to find the WAN server. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** ``Not set`` @@ -667,7 +667,7 @@ by using the transport-specific command-line parameters. For WAN transport. ID to be used for the WAN transport. Required when using WAN. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** Not set @@ -675,7 +675,7 @@ by using the transport-specific command-line parameters. For WAN transport. Use DTLS security over WAN. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** Not set @@ -683,7 +683,7 @@ by using the transport-specific command-line parameters. For TLS, DTLS, and Secure WAN. Certificate authority file to be used by TLS. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default for Publisher:** ``./resource/secure/pub.pem`` | **Default for Subscriber:** ``./resource/secure/sub.pem`` @@ -692,7 +692,7 @@ by using the transport-specific command-line parameters. For TLS, DTLS, and Secure WAN. Certificate file to be used by TLS. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default:** ``./resource/secure/cacert.pem`` @@ -700,7 +700,7 @@ by using the transport-specific command-line parameters. For TLS, DTLS, and Secure WAN. Private key file to be used by TLS. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. | **Default for Publisher:** ``./resource/secure/pubkey.pem`` | **Default for Subscriber:** ``./resource/secure/subkey.pem`` @@ -722,16 +722,16 @@ Test Parameters only for Publishing Applications **High Throughput for Streaming Data** design pattern in the *RTI Connext DDS Core Libraries Getting Started Guide*. See also: **How to Measure Latency for a Given Throughput** and the **BATCH QosPolicy** section in - the *RTI Connext DDS Core Libraries User’s Manual*. + the *RTI Connext DDS Core Libraries User's Manual*. - This parameter is not available when compiling against *RTI Connext DDS + This parameter is not available when compiling against *RTI Connext Micro*. - ``-enableAutoThrottle`` Enable the Auto Throttling feature. See :ref:`Auto-tuning and turbo mode`. - This parameter is not available when compiling against *RTI Connext DDS + This parameter is not available when compiling against *RTI Connext Micro*. **Default:** feature is disabled. @@ -742,7 +742,7 @@ Test Parameters only for Publishing Applications When turbo mode is enabled, See ``-batchSize `` is ignored. Disabled automatically if using large data or asynchronous. - This parameter is not available when compiling against *RTI Connext DDS + This parameter is not available when compiling against *RTI Connext Micro*. **Default:** feature is disabled. @@ -1002,7 +1002,7 @@ Test Parameters only for Subscribing Applications key in that range. Specify one parameter to receive samples with that exact key. - This parameter is not available when compiling against *Connext DDS + This parameter is not available when compiling against *Connext Micro*. **Default:** Not set @@ -1017,11 +1017,11 @@ Test Parameters only for Subscribing Applications Inconsistent samples will be reported as lost. See information about checking data consistency in - `Using Zero Copy Transfer Over Shared Memory, in the RTI Connext DDS Core Libraries User’s Manual `__. + `Using Zero Copy Transfer Over Shared Memory, in the RTI Connext DDS Core Libraries User's Manual `__. This parameter can only be used along with ``-zeroCopy``. - This parameter is not available when compiling against *Connext DDS + This parameter is not available when compiling against *Connext Micro* or a *Connext DDS* release before 6.0.0. **Default:** Not set @@ -1112,7 +1112,7 @@ UDPv4 and shared memory communications. ``UDPv4`` and shared memory (``SHMEM``). Some of the *Connext DDS* parameters are not supported when using sockets. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** Not set @@ -1121,7 +1121,7 @@ UDPv4 and shared memory communications. Control blocking behavior of send sockets to never block. CHANGING THIS FROM THE DEFAULT CAN CAUSE SIGNIFICANT PERFORMANCE PROBLEMS. - This parameter is not available when compiling against *Connext DDS Micro*. + This parameter is not available when compiling against *Connext Micro*. **Default:** Not set. Always block. diff --git a/srcDoc/compatibility.rst b/srcDoc/compatibility.rst index 0d28343d..fa2a3442 100644 --- a/srcDoc/compatibility.rst +++ b/srcDoc/compatibility.rst @@ -9,7 +9,7 @@ middleware. It has been compiled and tested against: - *RTI Connext DDS Professional* 6.0.0 and above. Nonetheless previous versions starting after 5.2.X should be compatible with certain exceptions. -- *RTI Connext DDS Micro* 3.0.0 and above versions. Versions for 2.4.11 and above +- *RTI Connext Micro* 3.0.0 and above versions. Versions for 2.4.11 and above should also be compatible by adding the `--micro-24x-compatibility` command-line option. @@ -21,7 +21,7 @@ Using Security ~~~~~~~~~~~~~~ Governance and Permission files have been updated to be compatible with -the latest release for *RTI Connext DDS*, and are compatible with *RTI +the latest release for *RTI Connext*, and are compatible with *RTI Connext DDS Professional* 5.2.7 and greater. If you are compiling *RTI Perftest* against 5.2.5, you will need to get @@ -83,7 +83,7 @@ using .NET 5.0. Using the Old C# Implementation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in release 3.3, *RTI Perftest* will stop supporting -the legacy C# implementation and adopt the new one provided in *RTI ConnextDDS 6.1.0*. +the legacy C# implementation and adopt the new one provided in *RTI Connext DDS 6.1.0*. However, the old implementation can still be tested using the existing code provided in the *RTI Perftest 3.2* release branch. You can easily access that code by doing: @@ -149,7 +149,7 @@ Warning when compiling the *Traditional* C++ API Implementation *RTI Perftest* might show these warnings when compiling the *Traditional* C++ API implementation for *RTI Connext DDS Pro* (in versions prior to 6.0.0) and -for *RTI Connext DDS Micro*: +for *RTI Connext Micro*: .. code-block:: console @@ -240,10 +240,10 @@ similar to this one: This warning should be innocuous. -Dynamic compilation modes for *RTI Connext DDS Micro* -+++++++++++++++++++++++++++++++++++++++++++++++++++++ +Dynamic compilation modes for *RTI Connext Micro* ++++++++++++++++++++++++++++++++++++++++++++++++++ -When building against the *RTI Connext DDS Micro* libraries, only the static +When building against the *RTI Connext Micro* libraries, only the static compilation modes are supported. Therefore the ``--dynamic`` option will have no effect. diff --git a/srcDoc/compilation.rst b/srcDoc/compilation.rst index b02daee4..04489d14 100644 --- a/srcDoc/compilation.rst +++ b/srcDoc/compilation.rst @@ -28,14 +28,14 @@ Prerequisites For compiling *RTI Perftest*, there are a few prerequisites; if you downloaded the executables already compiled, you can skip these steps: -- *RTI Connext DDS Professional*, *RTI Connext DDS Micro* or *RTI Connext DDS Cert* - should be installed in the system where the ``build.sh`` script is going +- *RTI Connext Professional*, *RTI Connext Micro*, or *RTI Connext Cert* + must be installed in the system where the ``build.sh`` script is going to run. The target libraries for the platform to be generated should also be installed. .. -- If you are building for the C# API implementation, the *RTI Connext DDS* dotnet +- If you are building for the C# API implementation, the *RTI Connext* dotnet package should be installed. .. @@ -44,7 +44,7 @@ if you downloaded the executables already compiled, you can skip these steps: Or, pass ``$NDDSHOME`` directly to the ``build.sh`` script by using the ``--nddshome `` command-line option. - When compiling for *RTI Connext DDS Micro* or *RTI Connext DDS Cert*, + When compiling for *RTI Connext Micro* or *RTI Connext Cert*, the ``$RTIMEHOME`` environment variable should be set correctly. Or, pass ``$RTIMEHOME`` directly to the ``build.sh`` script by using the ``--rtimehome `` command-line option. @@ -63,8 +63,8 @@ if you downloaded the executables already compiled, you can skip these steps: .. -- When compiling for *RTI Connext DDS Micro* or *RTI Connext DDS Cert*, - ``Cmake`` is required to be accessible from the ``$PATH`` environment +- When compiling for *RTI Connext Micro* or *RTI Connext Cert*, + ``Cmake`` must be accessible from the ``$PATH`` environment variable in order to execute the ``makefiles`` generated by *rtiddsgen*. Or, pass the ``cmake`` executable directly to the ``build.sh`` script by using the ``--cmake `` command-line option. @@ -135,63 +135,63 @@ The ``build.sh`` script accepts the following list of parameters: *RTI Perftest* * - ``--micro`` - Optional - - Compile *RTI Perftest* against *RTI Connext DDS Micro* + - Compile *RTI Perftest* against *RTI Connext Micro* * - ``--micro-24x-compatibility`` - Optional - - Compile *RTI Perftest* against *RTI Connext DDS Micro* 2.4.11 and above. + - Compile *RTI Perftest* against *RTI Connext Micro* 2.4.11 and above. * - ``--tss`` - Optional - Compile *RTI Perftest* against *RTI Connext TSS 3.1.2* over *RTI Connext Pro 6.1.1.4* or *RTI Connext Micro 2.4.13.4*. * - ``--cert`` - Optional - - Compile *RTI Perftest* against *RTI Connext DDS Cert* 2.4.15. + - Compile *RTI Perftest* against *RTI Connext Cert* 2.4.15. * - ``--micro-use-cert-code`` - Optional - - Compile *RTI Perftest* against *RTI Connext DDS Micro* 2.4.14 using - the exact same code compiled when building *Perftest* against - *RTI Connext DDS Cert*. + - Compile *RTI Perftest* against *RTI Connext Micro* 2.4.14 using + the same code compiled when building *Perftest* against + *RTI Connext Cert*. * - ``--nddshome`` - Optional - - Path to the *RTI Connext DDS Professional* installation. If this parameter + - Path to the *RTI Connext Professional* installation. If this parameter is not present, the ``$NDDSHOME`` variable should be. * - ``--rtimehome`` - Optional - - Path to the *RTI Connext DDS Micro* installation. If this is not present, + - Path to the *RTI Connext Micro* installation. If this is not present, the ``$RTIMEHOME`` variable should be set. * - ``--skip-java-build`` - Optional - Avoid ``Java ByteCode`` generation and ``.jar`` creation. Not available - when compiling for *RTI Connext DDS Micro*. + when compiling for *RTI Connext Micro*. * - ``--skip-cpp-build`` - Optional - Avoid C++ code generation and compilation. * - ``--skip-cpp11-build`` - Optional - Avoid C++ New PSM code generation and compilation. Not available when - compiling for *RTI Connext DDS Micro*. + compiling for *RTI Connext Micro*. * - ``--java-build`` - Optional - Only ``Java ByteCode`` generation and ``.jar`` creation. Not available - when compiling for *RTI Connext DDS Micro* + when compiling for *RTI Connext Micro* * - ``--cpp-build`` - Optional - Only C++ code generation and compilation * - ``--cpp11-build`` - Optional - Only C++ New PSM code generation and compilation. Not available when compiling - for *RTI Connext DDS Micro*. + for *RTI Connext Micro*. * - ``--cs-build`` - Optional - Only C# code generation and compilation. Not available when compiling for - *RTI Connext DDS Micro*. + *RTI Connext Micro*. * - ``--dynamic`` - Optional - - Compile using the RTI Connext DDS dynamic libraries. Default: Static Libraries. - Not available when compiling for *RTI Connext DDS Micro*. + - Compile using the *RTI Connext* dynamic libraries. Default: Static Libraries. + Not available when compiling for *RTI Connext Micro*. * - ``--debug`` - Optional - - Compile using the RTI Connext DDS debug libraries. Default: Release Libraries. + - Compile using the *RTI Connext* debug libraries. Default: Release Libraries. * - ``--customType`` - Optional - Use the Custom type feature with your type. See details and examples of use in @@ -212,7 +212,7 @@ The ``build.sh`` script accepts the following list of parameters: * - ``--secure`` - Optional - Enable the compilation of the Perfest code specific for security and adds the - *RTI Connext DDS Security Plugins* Libraries in the linking step (if compiling + *RTI Connext Security Plugins* Libraries in the linking step (if compiling statically). Default: Not set. * - ``--security`` - Optional @@ -220,7 +220,7 @@ The ``build.sh`` script accepts the following list of parameters: * - ``--lightWeightSecure`` - Optional - Enable the compilation of the Perfest code specific for security and adds the - *RTI Connext DDS LightWeight Security Plugins* Libraries in the linking step (if compiling + *RTI Connext LightWeight Security Plugins* Libraries in the linking step (if compiling statically). Default: Not set. * - ``--lightWeightSecurity`` - Optional @@ -250,7 +250,7 @@ The ``build.sh`` script accepts the following list of parameters: * - ``--cert-zc-datalen`` - Optional - The size of the array of the type used when running *RTI Perftest* - built against *RTI Connext DDS Cert* using ZeroCopy. + built against *RTI Connext Cert* using ZeroCopy. * - ``--make`` - Optional - Path to the ``GNU make``executable. If this parameter is not present, the @@ -383,21 +383,21 @@ examples: ./build.sh --platform armv8Linux4.4gcc5.4.0 --compiler aarch64-linux-gnu-g++ --linker aarch64-linux-gnu-g++ - Generation and compilation for a given architecture - (``x64Darwin14clang6.0``) compiling against *Connext DDS Micro*. + (``x64Darwin14clang6.0``) compiling against *Connext Micro*. .. code-block:: console ./build.sh --platform x64Darwin14clang6.0 --micro - Generation and compilation for a given architecture - (``x86_64leElfgcc7.3.0CERT-Linux4``) compiling against *Connext DDS Cert*. + (``x86_64leElfgcc7.3.0CERT-Linux4``) compiling against *Connext Cert*. .. code-block:: console ./build.sh --platform x86_64leElfgcc7.3.0CERT-Linux4 --cert - Generation and compilation for a given architecture - (``x86_64leElfgcc7.3.0CERT-Linux4``) compiling against *Connext DDS Cert* + (``x86_64leElfgcc7.3.0CERT-Linux4``) compiling against *Connext Cert* with a ZeroCopy data length of 61000 B. .. code-block:: console @@ -441,8 +441,8 @@ Build script execution for *VxWorks* kernel mode After building the *RTI Perftest* executables for *VxWorks* kernel mode, an extra step is needed: *munching.* *Munching* is automatically done in -*Connext DDS Professional* starting in 6.0.0. However, for previous versions -and for *Connext DDS Micro*, the process has to be done manually. +*Connext Professional* starting in 6.0.0. However, for previous versions +and for *Connext Micro*, the process has to be done manually. Windows Systems --------------- @@ -467,13 +467,13 @@ every Windows architecture supported by *rtiddsgen* when the Windows Prerequisites ~~~~~~~~~~~~~~~~~~~~~ -- *Connext DDS* should be installed in the system where the +- *Connext* should be installed in the system where the ``build.bat`` script is going to run. The target libraries for the platform to be generated should also be installed. .. -- If you are building for the C# API implementation, the *Connext DDS* dotnet +- If you are building for the C# API implementation, the *Connext* dotnet package should be installed. .. @@ -483,7 +483,7 @@ Windows Prerequisites ``build.bat`` script by using the ``--nddshome `` command-line option. - When compiling for *Connext DDS Micro*, the ``%RTIMEHOME%`` environment + When compiling for *Connext Micro*, the ``%RTIMEHOME%`` environment variable should be set correctly. Alternatively, ``%RTIMEHOME%`` can be passed directly to the ``build.bat`` script by using the ``--rtimehome `` command-line option. @@ -503,7 +503,7 @@ Windows Prerequisites .. -- When compiling for *Connext DDS Micro*, Cmake is required to be +- When compiling for *Connext Micro*, Cmake is required to be accessible from the ``%PATH%`` environment variable in order to execute the ``makefiles`` generated by *rtiddsgen*. Alternatively, the Cmake executable can be passed directly to the ``build.bat`` script by using the @@ -542,55 +542,55 @@ The ``build.bat`` script accepts the following list of parameters: *RTI Perftest* * - ``--micro`` - Optional - - Compile *RTI Perftest* against *RTI Connext DDS Micro* + - Compile *RTI Perftest* against *RTI Connext Micro* * - ``--micro-24x-compatibility`` - Optional - - Compile *RTI Perftest* against *RTI Connext DDS Micro* 2.4.11 and above. + - Compile *RTI Perftest* against *RTI Connext Micro* 2.4.11 and above. * - ``--tss`` - Optional - Compile *RTI Perftest* against *RTI Connext TSS 3.1.2* over *RTI Connext Pro 6.1.1.4* or *RTI Connext Micro 2.4.13.4*. * - ``--nddshome`` - Optional - - Path to the *RTI Connext DDS Professional* installation. If this parameter + - Path to the *RTI Connext Professional* installation. If this parameter is not present, the ``%NDDSHOME%`` variable should be. * - ``--rtimehome`` - Optional - - Path to the *RTI Connext DDS Micro* installation. If this is not present, + - Path to the *RTI Connext Micro* installation. If this is not present, the ``$RTIMEHOME`` variable should be set. * - ``--skip-java-build`` - Optional - Avoid ``Java ByteCode`` generation and ``.jar`` creation. Not available - when compiling for *RTI Connext DDS Micro*. + when compiling for *RTI Connext Micro*. * - ``--skip-cpp-build`` - Optional - Avoid C++ code generation and compilation. * - ``--skip-cpp11-build`` - Optional - Avoid C++ New PSM code generation and compilation. Not available when - compiling for *RTI Connext DDS Micro*. + compiling for *RTI Connext Micro*. * - ``--java-build`` - Optional - Only ``Java ByteCode`` generation and ``.jar`` creation. Not available - when compiling for *RTI Connext DDS Micro* + when compiling for *RTI Connext Micro* * - ``--cpp-build`` - Optional - Only C++ code generation and compilation * - ``--cpp11-build`` - Optional - Only C++ New PSM code generation and compilation. Not available when compiling - for *RTI Connext DDS Micro*. + for *RTI Connext Micro*. * - ``--cs-build`` - Optional - Only C# code generation and compilation. Not available when compiling for - *RTI Connext DDS Micro*. + *RTI Connext Micro*. * - ``--dynamic`` - Optional - - Compile using the RTI Connext DDS dynamic libraries. Default: Static Libraries. - Not available when compiling for *RTI Connext DDS Micro*. + - Compile using the *RTI Connext* dynamic libraries. Default: Static Libraries. + Not available when compiling for *RTI Connext Micro*. * - ``--debug`` - Optional - - Compile using the RTI Connext DDS debug libraries. Default: Release Libraries. + - Compile using the *RTI Connext* debug libraries. Default: Release Libraries. * - ``--customType`` - Optional - Use the Custom type feature with your type. See details and examples of use in @@ -611,7 +611,7 @@ The ``build.bat`` script accepts the following list of parameters: * - ``--secure`` - Optional - Enable the compilation of the Perfest code specific for security and adds the - *RTI Connext DDS Security Plugins* Libraries in the linking step (if compiling + *RTI Connext Security Plugins* Libraries in the linking step (if compiling statically). Default: Not set. * - ``--security`` - Optional @@ -619,7 +619,7 @@ The ``build.bat`` script accepts the following list of parameters: * - ``--lightWeightSecure`` - Optional - Enable the compilation of the Perfest code specific for security and adds the - *RTI Connext DDS LightWeight Security Plugins* Libraries in the linking step (if compiling + *RTI Connext LightWeight Security Plugins* Libraries in the linking step (if compiling statically). Default: Not set. * - ``--lightWeightSecurity`` - Optional @@ -729,7 +729,7 @@ examples: ./build.bat -platform x64Win64VS2012 --flatData-max-size 104857600 - Generation and compilation for a given architecture - (``x64Win64VS2012``) for *Connext DDS Micro*, specifying the ``%RTIMEHOME%`` + (``x64Win64VS2012``) for *Connext Micro*, specifying the ``%RTIMEHOME%`` path. .. code-block:: console @@ -737,7 +737,7 @@ examples: ./build.bat --platform x64Win64VS2012 --micro --rtimehome - Generation and compilation for a given architecture - (``x64Win64VS2012``) for *Connext DDS Micro* with security, using debug mode + (``x64Win64VS2012``) for *Connext Micro* with security, using debug mode and specifying the ``%RTIMEHOME%`` path. .. code-block:: console diff --git a/srcDoc/examples.rst b/srcDoc/examples.rst index 88a4017d..e1323686 100644 --- a/srcDoc/examples.rst +++ b/srcDoc/examples.rst @@ -1,7 +1,7 @@ .. _section-command_examples: ====================== -Use-Cases and Examples +Use Cases and Examples ====================== .. _section-command_line_examples: @@ -25,8 +25,8 @@ different use cases: - In case your working directory is on bin//release/ use ``-noXmlQos`` -RTI Connext DDS Professional ----------------------------- +RTI Connext Professional +------------------------ 1-to-1, Multicast, Best Latency as a Function of Message Size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -433,11 +433,11 @@ side, to limit the `send queue` of the datawriter. We suggest `50` as this is th bin/release/perftest_cs -sub -noPrintIntervals -transport UDPv4 -dataLen 1024 -bestEffort -RTI Connext DDS Micro ---------------------- +RTI Connext Micro +----------------- 1-to-1, Unicast, Best Latency as a Function of Message Size ------------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Publisher: @@ -455,11 +455,11 @@ Modify ``-dataLen `` to see latencies for different data sizes. Set ``-executionTime `` to be >=100 for statistically better results. -RTI Connext DDS Cert ---------------------- +RTI Connext Cert +---------------- 1-to-1, Unicast, Best-Effort, UDPv4, Throughput ------------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Publisher: @@ -478,7 +478,7 @@ Set ``-executionTime `` to be >=100 for statistically better results. 1-to-1, Unicast, Reliable, ZeroCopy, Latency ------------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Publisher: @@ -492,13 +492,13 @@ results. bin//release/perftest_cpp_cert -sub -noPrint -nic -peer -domain -zeroCopy -reliable -Note how no ``-dataLen`` argument was specified. That's because, in the case of -Cert ZeroCopy, the length of the array has to be set at build time through the build script. -That size is appended to the name of the executable, such that executables with different ZC data lengths can coexist. -Set ``-executionTime `` to be >=100 for statistically better -results. +Note how no ``-dataLen`` argument is specified. That's because, in the case of +Zero Copy v2, the length of the array has to be set at build time through the +build script. That size is then appended to the name of the executable so that +executables with different ZC data lengths can coexist. Set ``-executionTime +`` to >=100 for statistically better results. -Use-Cases +Use Cases ========= .. _section-large_samples_use: @@ -508,11 +508,11 @@ Large Samples *RTI Perftest* can send samples from 28 Bytes to 2,147,483,135 Bytes (2 GBytes - 512 Bytes - 8 Bytes), which corresponds to the maximum payload -that *RTI Connext DDS* is able to send in a single sample. +that *RTI Connext* is able to send in a single sample. The size of data is configured by the command-line parameter ``-dataLen ``. Depending on this parameter, *RTI Perftest* will -automatically configure certain *RTI Connext DDS* behaviors. +automatically configure certain *RTI Connext* behaviors. When the sample size is smaller than or equal to the `MAX_BOUNDED_SEQ_SIZE` (set to 65470 Bytes in the IDL file) *RTI Perftest* will, by default, use types with bounded sequences (bound @@ -530,7 +530,7 @@ command-line parameter, at execution time. See the :ref:`section-command_line_pa for more details. The reason for this behavior is that, when *RTI Perftest* -uses unbounded sequences, *RTI Connext DDS* will not pre-allocate the +uses unbounded sequences, *RTI Connext* will not pre-allocate the sequences to their maximum size (as opposed to when using bounded sequences). For unbounded members, the code generated by *RTI Connext DDS* will de-serialize the samples by dynamically allocating and @@ -542,7 +542,7 @@ Apart from the switch from bounded to unbounded sequences, there is another important behavior that occurs when setting a message size greater than the `message_size_max` (by default ~64KB except for `SHMEM`): By setting a sample size bigger than the `message_size_max`, *RTI Perftest* will enable the use of -Asynchronous Publishing, and set the *RTI Connext DDS* default FlowController. +Asynchronous Publishing, and set the *RTI Connext* default FlowController. For `SHMEM` (shared memory), this is not the case. When explicitly specifying `-transport SHMEM`, *RTI Perftest* will try to set the @@ -586,7 +586,7 @@ By using the parameter ``-sendQueueSize `` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The default value for the Send Queue in the Writer side is ``50``. That -might be a very high value, and the *RTI Connext DDS* middleware might +might be a very high value, and the *RTI Connext* middleware might not perform in optimal conditions. Therefore, for large data samples it is recommended to reduce the send Queue to lower values. @@ -689,7 +689,7 @@ Content-Filtered Topics using Content-Filtered Topics (*CFTs*). This is especially useful in scenarios with many subscribers. -*CFT* support is implemented only for *RTI Connext DDS Professional*. +*CFT* support is implemented only for *RTI Connext Professional*. Using *CFTs* will allow you to ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -854,7 +854,7 @@ Command-Line Parameters - ``-nddshome`` - Path to the *RTI Connext DDS* installation. If this parameter is not + Path to the *RTI Connext* installation. If this parameter is not present, the ``$NDDSHOME`` variable will be used. Example Command Lines for Running the Performance Test diff --git a/srcDoc/extending_perftest.rst b/srcDoc/extending_perftest.rst index ed2d7c98..a93627d1 100644 --- a/srcDoc/extending_perftest.rst +++ b/srcDoc/extending_perftest.rst @@ -8,9 +8,9 @@ The *RTI Perftest* C++ implementation is designed in a way that it can be extended to test other middlewares or communication mechanisms. An example is the **RAW transport** support *RTI Perftest* offers when -compiling against *RTI Connext DDS Professional*. In this case, although -using specific functions from the OS/Network abstraction layer from *RTI Connext -DDS*, *RTI Perftest* is testing pure socket-to-socket communication (in this +compiling against *RTI Connext Professional*. In this case, although +using specific functions from the OS/Network abstraction layer from *RTI +Connext*, *RTI Perftest* is testing pure socket-to-socket communication (in this case, even simpler than a middleware). Interface infrastructure @@ -55,7 +55,7 @@ by a callback in the middleware, or by any other way), the same actions will be Common Infrastructure --------------------- -*RTI Connext DDS Professional* and *RTI Connext DDS Micro* offer specific OS +*RTI Connext Professional* and *RTI Connext Micro* offer specific OS abstraction layers in order to be able to use semaphores, timers, threads, and other OS-dependent functions, etc., independently of the OS where the middleware is running. When *RTI Perftest* is being compiled against those @@ -75,8 +75,8 @@ sense if the target OS/platform does not have a modern compiler). Message type (idl) ------------------ -*RTI Perftest* generates its code for *RTI Connext DDS Professional* and *RTI -Connext DDS Micro* using the *rtiddsgen* tool, which generates the code from +*RTI Perftest* generates its code for *RTI Connext Professional* and *RTI +Connext Micro* using the *rtiddsgen* tool, which generates the code from some `.idl` files. These `.idl` files are used to represent the types that *RTI Perftest* uses to @@ -95,7 +95,7 @@ as input. Discovery mechanisms -------------------- -The *RTI Perftest* implementation for *RTI Connext DDS* relies on the discovery mechanisms +The *RTI Perftest* implementation for *RTI Connext* relies on the discovery mechanisms provided by the middleware. However, this is not a hard restriction, and communication patterns without discovery can be used as well. @@ -117,9 +117,9 @@ Build infrastructure -------------------- *RTI Perftest* relies on two scripts for building, `build.sh` and `build.bat`. These -scripts build against *RTI Connext DDS* for each of the different language implementations. +scripts build against *RTI Connext* for each of the different language implementations. -In every case, *RTI Perftest* for *RTI Connext DDS* uses *rtiddsgen* to generate the +In every case, *RTI Perftest* for *RTI Connext* uses *rtiddsgen* to generate the right makefiles/solutions, and then uses those files to build natively. *rtiddsgen* may not work for other middlewares, so *RTI Perftest* cannot currently offer @@ -129,7 +129,7 @@ implemented by the developer. Selecting and protecting code ----------------------------- -*RTI Perftest* for *RTI Connext DDS Professional* and *Micro* need to protect +*RTI Perftest* for *RTI Connext Professional* and *Micro* need to protect certain parts of the code to avoid interferences, or to let the compiler know what files it should include or not. This is done by checking if certain defines are present and provided at compilation time. diff --git a/srcDoc/index.rst b/srcDoc/index.rst index 2f2e520f..c244fbf7 100644 --- a/srcDoc/index.rst +++ b/srcDoc/index.rst @@ -38,14 +38,14 @@ Features *RTI Perftest* supports the following functionality: -- *RTI Connext DDS Professional*, *RTI Connext DDS Micro* and *RTI Connext DDS Cert*. - *Perftest* also supports *RTI Connext TSS* over *RTI Connext DDS Professional* - or over *RTI Connext DDS Micro*. +- *RTI Connext Professional*, *RTI Connext Micro*, and *RTI Connext Cert*. + *Perftest* also supports *RTI Connext TSS* over *RTI Connext Professional* + or over *RTI Connext Micro*. - Multiple platforms, including Windows®, Linux®, macOS®, VxWorks®, and Android™. - Multiple test setups: multicast, one-to-many communication (Pub -> Sub), latency test, throughput test, and latency vs. throughput test. - Raw transports (UDPv4 sockets and shared memory segments). -- Benchmarking of *RTI Connext DDS Professional* and *RTI Connext DDS Micro* +- Benchmarking of *RTI Connext Professional* and *RTI Connext Micro* features such as *FlatData™ language binding* and *Zero Copy transfer over shared memory.* @@ -83,8 +83,8 @@ Prerequisites If you need to compile *RTI Perftest*, there are a few prerequisites; however, if you downloaded the executables already compiled, you can skip these steps: -- *RTI Connext DDS Professional*, *RTI Connext DDS Micro* or *RTI Connext DDS Cert* - should be installed in the system where the ``build.sh`` script is going to +- *RTI Connext Professional*, *RTI Connext Micro*, or *RTI Connext Cert* + must be installed in the system where the ``build.sh`` script is going to run. The target libraries for the platform to be generated should also be installed. - The ``$NDDSHOME`` environment variable should be set correctly. Or, pass ``$NDDSHOME`` directly to the ``build.sh`` script by using the ``--nddshome `` diff --git a/srcDoc/introduction.rst b/srcDoc/introduction.rst index c82d7b9f..96823e2a 100644 --- a/srcDoc/introduction.rst +++ b/srcDoc/introduction.rst @@ -7,7 +7,7 @@ Testing Performance ------------------- This section describes the combined latency and throughput -test application for *RTI Connext DDS*. +test application for *RTI Connext*. The test measures what is sometimes called loaded latency—latency at a given throughput level. It can help you answer questions such as: @@ -34,14 +34,14 @@ APIs), C#, and Java. Middleware ---------- -*RTI Perftest* can be built against *RTI Connext DDS Professional*, *RTI Connext -DDS Micro* and *RTI Connext DDS Cert*. +*RTI Perftest* can be built against *RTI Connext Professional*, *RTI Connext +Micro*, and *RTI Connext Cert*. *RTI Perftest* can also be used to test raw ``UDPv4`` or ``SHMEM`` performance. -To do this, *RTI Perftest* uses the *RTI Connext DDS Professional* internal +To do this, *RTI Perftest* uses the *RTI Connext Professional* internal transport layer to interact with sockets. In this mode, *RTI Perftest* skips the DDS protocol to directly send the data, which is serialized using the same -functions that *RTI Connext DDS Professional* uses. +functions that *RTI Connext Professional* uses. Overview -------- diff --git a/srcDoc/release_notes.rst b/srcDoc/release_notes.rst index 011e204d..92918253 100644 --- a/srcDoc/release_notes.rst +++ b/srcDoc/release_notes.rst @@ -3,21 +3,18 @@ Release Notes ============= -Release Notes develop ---------------------- - -What's New in develop -~~~~~~~~~~~~~~~~~~~~~ +Release Notes 4.2 +----------------- -Using `-pubRate` will disable batching by default |newTag| -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +What's New in 4.2 +~~~~~~~~~~~~~~~~~ -In previous releases, using `-pubRate` would not modify the batching behavior -of *Perftest* (enabled by default for a throughput test). This would lead to -confusion and scenarios difficult to understand. +`-pubRate` parameter disables batching by default |newTag| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -This behavior has been modified and now using `-pubRate` will disable batching -by default. However if explicitly set via command line, batching will still be enabled. +When the `-pubRate` parameter is used, batching is now disabled by default to +avoid possible confusion. However, if `-pubRate` is explicitly set via +command line, batching will remain enabled. ``-scan`` option is now removed +++++++++++++++++++++++++++++++ @@ -34,8 +31,8 @@ Examples of how to compile *Perftest* for *RTI Connext Cert 2.4.15* can be found in section :ref:`section-linux_compilation_examples`. -What's Fixed in develop -~~~~~~~~~~~~~~~~~~~~~~~ +What's Fixed in 4.2 +~~~~~~~~~~~~~~~~~~~ <- Nothing new yet -> @@ -57,11 +54,11 @@ results of the test. This issue has been fixed. -Updated property names for *RTI Connext DDS LightWeight Security* PSK |fixedTag| -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Updated property names for *RTI Connext LightWeight Security* PSK |fixedTag| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -The property names for the *RTI Connext DDS LightWeight Security* PSK have been updated to -match the new names used in *RTI Connext DDS 7.3.0*. +The property names for the *RTI Connext LightWeight Security* PSK have been updated to +match the new names used in *RTI Connext 7.3.0*. Release Notes 4.1 --------------------- @@ -91,7 +88,7 @@ Provide `ssl` version |newTag| ++++++++++++++++++++++++++++++ If more than one set of cryptography libraries or versions (`openSSL` or `wolfSSL`) are found -in the *RTI Connext DDS* Middleware installation, by using the the `--openssl-version` +in the *RTI Connext* Middleware installation, by using the the `--openssl-version` parameter, you can select the desired one. Secure parameters have been simplified |newTag| @@ -186,10 +183,10 @@ sending samples, instead of the pure TSS approach that's followed by default. Find more information on this argument in section :ref:`section-pubsub_command_line_parameters`. -Support for *RTI Connext DDS 7.0.0* |newTag| -++++++++++++++++++++++++++++++++++++++++++++ +Support for *RTI Connext 7.0.0* |newTag| +++++++++++++++++++++++++++++++++++++++++ -We modified *RTI Perftest* to add support for *RTI Connext DDS 7.0.0*, since we +We modified *RTI Perftest* to add support for *RTI Connext 7.0.0*, since we were using some internal APIs to retrieve certain information that have changed from the previous version. @@ -278,11 +275,11 @@ an unhandled exception might be raised if a sample wasn't answered before a cert level, stopping the flow of the program, however it should simply be ignored (and treat the failure as a sample lost). This issue has been corrected. -Issue compiling Connext DDS Micro on Windows |fixedTag| -+++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Issue compiling Connext Micro on Windows |fixedTag| ++++++++++++++++++++++++++++++++++++++++++++++++++++ The build scripts for *Windows* (``build.bat``) failed with the following error when trying to compile *Perftest* -against *RTI Connext DDS Micro*. The error displayed was: +against *RTI Connext Micro*. The error displayed was: .. code-block:: console diff --git a/srcDoc/tutorials/performance_validation.rst b/srcDoc/tutorials/performance_validation.rst index 23193b4e..f87d40ef 100644 --- a/srcDoc/tutorials/performance_validation.rst +++ b/srcDoc/tutorials/performance_validation.rst @@ -15,14 +15,14 @@ information about the environment: | NIC: 100Mbps - IP1: 10.45.3.119 / IP2: 10.45.3.120 | Software: RTI Perftest 3.0, C++ Implementation. | RTI Connext DDS Professional 6.0.0 - | RTI Connext DDS Micro 3.0.0 + | RTI Connext Micro 3.0.0 | Switch: 1Gbps switch Prepare the tools ~~~~~~~~~~~~~~~~~ To run this test, we will need *RTI Perftest 3.1* (Perftest). We will compile it against -*RTI Connext DDS Professional 6.0.0* and *RTI Connext DDS Micro 3.0.0*. +*RTI Connext DDS Professional 6.0.0* and *RTI Connext Micro 3.0.0*. Get Perftest ^^^^^^^^^^^^ @@ -84,17 +84,17 @@ because we are going to use only the C++ executable to test with. After executing this command, you should have a statically linked binary in `./bin/armv6vfphLinux3.xgcc4.7.2/release`. This is all you should need for your testing. -Compile against Connext DDS Micro 3.0.0 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Compile against Connext Micro 3.0.0 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This process should be equivalent to the one described in the previous step, and it is also covered in the `compilation `__ section of the *RTI Perftest* documentation. **Note:** Although you will need to call the build script two times for compiling for *Connext DDS Professional* -and *Connext DDS Micro*, you don't need to use two different directories, since the executables will be stored +and *Connext Micro*, you don't need to use two different directories, since the executables will be stored with different names. It is also worth mentioning that cross-testing (using a *RTI Perftest* Publisher from *Connext DDS Professional* -and a Subscriber from *Connext DDS Micro* or vice-versa) is supported. +and a Subscriber from *Connext Micro* or vice-versa) is supported. Therefore, the command we will need to execute should look like this: @@ -121,7 +121,7 @@ differences). Once that is done, we will have a baseline, which is going to tell us the minimum latency we can expect and the maximum throughput achievable in the system when not using *RTPS* and *DDS*. The next step -is to execute *RTI Perftest* using DDS with *Connext DDS Professional* and *Connext DDS Micro* and see the equivalent results. +is to execute *RTI Perftest* using DDS with *Connext DDS Professional* and *Connext Micro* and see the equivalent results. UDPv4 Communication (Raw Transport) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -434,11 +434,11 @@ Latency Results -- Connext DDS Professional (UDPv4) 63000,7073,214.1,6772,9722,7041,7260,7694,9722,9722 -Connext DDS Micro 3.0.0 (UDPv4) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Connext Micro 3.0.0 (UDPv4) +^^^^^^^^^^^^^^^^^^^^^^^^^^^ We will now repeat the same tests we did for *Connext DDS Professional* but for -*Connext DDS Micro*. +*Connext Micro*. Throughput Test --------------- @@ -456,13 +456,13 @@ Throughput Test bin/armv6vfphLinux3.xgcc4.7.2/release/perftest_cpp_micro -sub -nic eth0 -noPrint; Note that we don't use the `-batchSize` option, because this option is not yet available -in *Connext DDS Micro* 3.0.0. +in *Connext Micro* 3.0.0. The initial summary *RTI Perftest* shows is the following: .. code:: - RTI Perftest 3.0.0 (RTI Connext DDS Micro 3.0.0) + RTI Perftest 3.0.0 (RTI Connext Micro 3.0.0) Mode: THROUGHPUT TEST (Use "-latencyTest" for Latency Mode) @@ -487,8 +487,8 @@ The initial summary *RTI Perftest* shows is the following: See below the output results of executing this test. Again, the information displayed here is only what the subscriber side showed. -Throughput Results -- Connext DDS Micro (UDPv4) -::::::::::::::::::::::::::::::::::::::::::::::: +Throughput Results -- Connext Micro (UDPv4) +::::::::::::::::::::::::::::::::::::::::::: .. csv-table:: :align: center @@ -527,7 +527,7 @@ The initial summary *RTI Perftest* shows is the following: .. code:: - RTI Perftest 3.0.0 (RTI Connext DDS Micro 3.0.0) + RTI Perftest 3.0.0 (RTI Connext Micro 3.0.0) Mode: LATENCY TEST (Ping-Pong test) @@ -550,8 +550,8 @@ The initial summary *RTI Perftest* shows is the following: And these are the results (taken from the Publisher side): -Latency Results -- Connext DDS Micro (UDPv4) -:::::::::::::::::::::::::::::::::::::::::::: +Latency Results -- Connext Micro (UDPv4) +:::::::::::::::::::::::::::::::::::::::: .. csv-table:: :align: center @@ -593,8 +593,8 @@ Now we can extract more information about the graphs: 1. If we take out the test where we make use of *batching* we can see that using Raw Transport (plain sockets) gives us the best performance. -2. *Connext DDS Professional* and *Connext DDS Micro* behave similarly, - with *Connext DDS Micro* performing slightly faster. +2. *Connext DDS Professional* and *Connext Micro* behave similarly, + with *Connext Micro* performing slightly faster. 3. The use of *batching* really makes a difference for small samples sizes. @@ -613,11 +613,11 @@ stated in 3 and 4: The advantage of *Plain Sockets* is only noticeable when the is quite small, and even in those cases, by using certain features, *Connext DDS* can keep up, or even improve, the performance provided by Raw Sockets. -Another important point is if we choose *Connext DDS Micro* instead of -*Connext DDS Professional* based on the performance you want to achieve. Although *Connext DDS Micro* +Another important point is if we choose *Connext Micro* instead of +*Connext DDS Professional* based on the performance you want to achieve. Although *Connext Micro* will achieve better performance for simple scenarios like the -one given in this tutorial, *Connext DDS Professional* offers more features than *Connext DDS Micro* (like batching or -*ContentFilteredTopics*). On the other hand, *Connext DDS Micro* is ideal for running in resource-constrained devices where *Connext DDS Professional* may not fit. +one given in this tutorial, *Connext DDS Professional* offers more features than *Connext Micro* (like batching or +*ContentFilteredTopics*). On the other hand, *Connext Micro* is ideal for running in resource-constrained devices where *Connext DDS Professional* may not fit. Let's continue now by plotting the latency results (we will plot the linear and logarithmic scale graphs): @@ -626,12 +626,12 @@ scale graphs): .. image:: performance_validation_files/Latency_log.svg -As we saw with the throughput test, *Connext DDS Professional* and *Connext DDS Micro* +As we saw with the throughput test, *Connext DDS Professional* and *Connext Micro* have pretty similar performance results, the latter being slightly better (mainly because the code complexity is smaller). It is also interesting to note that the difference in terms of microseconds -between Raw Sockets, *Connext DDS Professional*, and *Connext DDS Micro* remains +between Raw Sockets, *Connext DDS Professional*, and *Connext Micro* remains constant across the different data sizes. The reason is that the difference in time is due to the extra logic we use to send and receive (send and receive queues, etc.); however, that extra logic is independent of the data size. From da54ec2ed1e38a93ec915578097ec16eb08fbb24 Mon Sep 17 00:00:00 2001 From: Pablo Lombardero Ros Date: Wed, 6 Nov 2024 01:54:03 -0800 Subject: [PATCH 26/49] Pull request #110: task/PERFTEST-397: Fixing the build for Micro 4.1.0 Merge in PERF/rti-perftest from task/PERFTEST-397 to develop Squashed commit of the following: commit 69642e69bc038247fe10a62556a5af384c245442 Author: plombardero0 Date: Wed Oct 23 18:34:18 2024 +0200 Fixing the build for Micro 4.1.0 --- resource/micro/CMakeLists.txt | 3 +-- srcCpp/connextDDS/micro/Infrastructure_micro.cxx | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resource/micro/CMakeLists.txt b/resource/micro/CMakeLists.txt index 14cb5dca..66b37e30 100644 --- a/resource/micro/CMakeLists.txt +++ b/resource/micro/CMakeLists.txt @@ -171,8 +171,7 @@ IF (NOT RTIME_CERT) LIST(APPEND MICRO_C_LIBS rti_me_netiopsl_cpp${RTI_LIB_SUFFIX} rti_me_netiopsl${RTI_LIB_SUFFIX} - rti_me_ospsl${RTI_LIB_SUFFIX} - rti_me_psl${RTI_LIB_SUFFIX}) + rti_me_ospsl${RTI_LIB_SUFFIX}) ENDIF() LIST(APPEND MICRO_C_LIBS diff --git a/srcCpp/connextDDS/micro/Infrastructure_micro.cxx b/srcCpp/connextDDS/micro/Infrastructure_micro.cxx index 6685f75b..66774041 100644 --- a/srcCpp/connextDDS/micro/Infrastructure_micro.cxx +++ b/srcCpp/connextDDS/micro/Infrastructure_micro.cxx @@ -7,6 +7,8 @@ #include "Infrastructure_common.h" +#include "dds_cpp/dds_cpp_netio.hxx" + #ifndef RTI_USE_CPP_11_INFRASTRUCTURE /********************************************************************/ From 6b8522b11778ad2577004a2b3ae4af4274fcabfe Mon Sep 17 00:00:00 2001 From: Pablo Lombardero Ros Date: Thu, 7 Nov 2024 03:47:07 -0800 Subject: [PATCH 27/49] Pull request #111: PERFTEST-398: Fixing linker error introduced with the latest changes to Micro 4.1.0 Merge in PERF/rti-perftest from task/PERFTEST-398 to develop Squashed commit of the following: commit 92a18871e3e285874627ac9ad818e7ea2583f5d6 Author: plombardero0 Date: Thu Nov 7 11:23:43 2024 +0100 PERFTEST-398: Fixing linker error introduced with the latest changes to Micro 4.1.0 --- resource/micro/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resource/micro/CMakeLists.txt b/resource/micro/CMakeLists.txt index 66b37e30..42544a33 100644 --- a/resource/micro/CMakeLists.txt +++ b/resource/micro/CMakeLists.txt @@ -38,10 +38,10 @@ SET(24x_COMPATIBILITY_SPECIFIED -1) STRING(FIND "${ADDITIONAL_DEFINES}" "PERFTEST_RTI_MICRO_24x_COMPATIBILITY" 24x_COMPATIBILITY_SPECIFIED) IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - SET(PLATFORM_LIBS dl nsl m pthread rt) + SET(PLATFORM_LIBS nsl m pthread rt) ADD_DEFINITIONS(-DRTI_LINUX) ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - SET(PLATFORM_LIBS dl m pthread ) + SET(PLATFORM_LIBS m pthread ) ADD_DEFINITIONS(-DRTI_DARWIN) ELSEIF (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") SET(PLATFORM_LIBS netapi32.lib advapi32.lib user32.lib winmm.lib WS2_32.lib) @@ -170,13 +170,17 @@ IF (NOT RTIME_CERT) IF(arch_is_pi) LIST(APPEND MICRO_C_LIBS rti_me_netiopsl_cpp${RTI_LIB_SUFFIX} - rti_me_netiopsl${RTI_LIB_SUFFIX} - rti_me_ospsl${RTI_LIB_SUFFIX}) + rti_me_netiopsl${RTI_LIB_SUFFIX}) ENDIF() LIST(APPEND MICRO_C_LIBS rti_me${RTI_LIB_SUFFIX} ) + + IF(arch_is_pi) + LIST(APPEND MICRO_C_LIBS + rti_me_ospsl${RTI_LIB_SUFFIX}) + ENDIF() ENDIF() ELSE() SET(MICRO_C_LIBS rti_me${RTI_LIB_SUFFIX} From f4891496fcc9706153b857df3610ddc384547706 Mon Sep 17 00:00:00 2001 From: Borja Garcia Date: Fri, 8 Nov 2024 05:28:09 -0800 Subject: [PATCH 28/49] Pull request #112: Added support for message and buffer sizes on cert PILPSL Merge in PERF/rti-perftest from task/PLATFORMS-4802 to develop Squashed commit of the following: commit 9bca1da01b99b45c4eceda62ecb576f8cd955298 Author: Borja Garcia Date: Fri Nov 8 13:06:44 2024 +0100 PLATFORMS-4802: Removed more instrumentation code commit ab90065b19391226fd57aa64199ca1bab7349bf4 Author: Borja Garcia Date: Fri Nov 8 13:05:36 2024 +0100 PLATFORMS-4802: Removed instrumentation code commit 42b2399cf2ef80dd245f576370bd9c989019323b Author: Borja Garcia Date: Fri Nov 8 12:59:40 2024 +0100 PLATFORMS-4802: Added support for message and buffer sizes on cert PILPSL --- srcCpp/connextDDS/cert/RTICertImpl.cxx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/srcCpp/connextDDS/cert/RTICertImpl.cxx b/srcCpp/connextDDS/cert/RTICertImpl.cxx index 382cac3d..853703ac 100644 --- a/srcCpp/connextDDS/cert/RTICertImpl.cxx +++ b/srcCpp/connextDDS/cert/RTICertImpl.cxx @@ -2539,8 +2539,26 @@ namespace { ParameterManager *_PM) { RTI_BOOL brc; - Udpv4_TransportProperties_T *udp_property = UDPv4_TransportProperties_new(); - CHECK_PTR(udp_property, "Udpv4_TransportProperties_new"); + UDPv4_TransportProperty_T *udp_property = UDPv4_TransportProperty_new(); + CHECK_PTR(udp_property, "UDPv4_TransportProperty_new"); + + if (!UDPv4_TransportProperty_set_max_message_size( + udp_property, + 65536)) { + printf("failed to set max message size\n"); + } + + if (!UDPv4_TransportProperty_set_max_receive_buffer_size( + udp_property, + _PM->get("receiveBufferSize"))) { + printf("failed to set max receive buffer size\n"); + } + + if (!UDPv4_TransportProperty_set_max_send_buffer_size( + udp_property, + _PM->get("sendBufferSize"))) { + printf("failed to set max send buffer size\n"); + } /* Set interface to use if provided */ if (!_PM->get("allowInterfaces").empty()) { @@ -2581,7 +2599,7 @@ namespace { } /* Re-register UDP under its default name */ - brc = Udpv4_Interface_register(registry, NETIO_DEFAULT_UDP_NAME, + brc = UDPv4_Interface_register(registry, NETIO_DEFAULT_UDP_NAME, udp_property); CHECK_BOOL(brc, "RT_Registry_register"); From b3b788bb233810bcf46ea82352627c69d9300634 Mon Sep 17 00:00:00 2001 From: Pablo Lombardero Ros Date: Mon, 11 Nov 2024 04:39:14 -0800 Subject: [PATCH 29/49] Pull request #113: PERFTEST-399: Explicitly unregistering the UDP property during shutdown Merge in PERF/rti-perftest from task/PERFTEST-399 to develop Squashed commit of the following: commit 429d02da0a701f807e7981c5bb6cdb90e52e5b43 Author: plombardero0 Date: Thu Nov 7 15:44:04 2024 +0100 PERFTEST-399: Explicitly unregistering the UDP property during shutdown --- srcCpp/connextDDS/RTIDDSImpl.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/srcCpp/connextDDS/RTIDDSImpl.cxx b/srcCpp/connextDDS/RTIDDSImpl.cxx index 9798c651..defd13d5 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.cxx +++ b/srcCpp/connextDDS/RTIDDSImpl.cxx @@ -198,6 +198,8 @@ void RTIDDSImpl::shutdown() if (!registry->unregister("_shmem", NULL, NULL)) { //printf("failed to unregister _shmem\n"); } + + registry->unregister("_udp", NULL, NULL); #ifdef RTI_SECURE_PERFTEST if (!SECCORE_SecurePluginFactory::unregister_suite( registry, From af42587f3c49f5e57f96117f1ea229e4878ffccd Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Mon, 11 Nov 2024 10:23:01 -0800 Subject: [PATCH 30/49] Pull request #114: Wrap get_address call in Perftest function Merge in PERF/rti-perftest from feature/PERFTEST-400 to develop Squashed commit of the following: commit 8b694b4e2cbe00c49254b4d5cce85fb0f5237ca4 Author: Javier Morales-Castro Date: Mon Nov 11 16:38:02 2024 +0000 Add CR feedback commit 5e0d448553b0fa5663049fcb7f4e3195b1fd2d1d Author: Javier Morales-Castro Date: Mon Nov 11 15:56:28 2024 +0000 Wrap get_address call in Perftest function commit f714575c1b69448907bcdc0cb22bd101b8c8f7eb Author: Javier Morales-Castro Date: Mon Nov 11 13:18:11 2024 +0000 Fix typos --- srcCpp/PerftestTransport.cxx | 54 +++++++++++---- srcCpp/PerftestTransport.h | 6 ++ srcCpp/connextDDS/pro/Infrastructure_pro.h | 7 +- srcCpp11/PerftestTransport.cxx | 54 +++++++++++---- srcCpp11/PerftestTransport.h | 32 +++++++++ srcCppCommon/qos_string.h | 79 +++++++++------------- 6 files changed, 157 insertions(+), 75 deletions(-) diff --git a/srcCpp/PerftestTransport.cxx b/srcCpp/PerftestTransport.cxx index 49d5d55f..c8e58ac3 100644 --- a/srcCpp/PerftestTransport.cxx +++ b/srcCpp/PerftestTransport.cxx @@ -363,26 +363,54 @@ bool PerftestTransport::increase_address_by_one( return true; } +bool PerftestTransport::get_number_of_addresses_in_string( + unsigned int *number, + const char *input_string) +{ + #ifdef PERFTEST_CONNEXT_PRO_750 + return NDDS_Transport_get_number_of_addresses_in_string( + number, + input_string); + #else + return NDDS_Transport_get_number_of_addresses_in_string( + input_string, + number); + #endif +} + +bool PerftestTransport::get_address( + char *output_address, + size_t output_buffer_size, + const char *input_string, + int index) +{ + #ifdef PERFTEST_CONNEXT_PRO_750 + return NDDS_Transport_get_address(output_address, output_buffer_size, input_string, index); + #else + return NDDS_Transport_get_address(input_string, index, output_address); + #endif +} + bool PerftestTransport::parse_multicast_addresses(const char *arg) { char throughput[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; char latency[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; - char annonuncement[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; - unsigned int numberOfAddressess = 0; + char announcement[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; + unsigned int numberOfAddresses = 0; /* Get number of addresses on the string */ - if (!NDDS_Transport_get_number_of_addresses_in_string( - arg, - &numberOfAddressess)) { + if (!get_number_of_addresses_in_string( + &numberOfAddresses, + arg)) { fprintf(stderr, "Error parsing Address for -multicastAddr option\n"); return false; } /* If three addresses are given */ - if (numberOfAddressess == 3) { - if (!NDDS_Transport_get_address(arg, 0, throughput) - || !NDDS_Transport_get_address(arg, 1, latency) - || !NDDS_Transport_get_address(arg, 2, annonuncement)){ + if (numberOfAddresses == 3) { + if (!get_address(throughput, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 0) + || !get_address(latency, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 1) + || !get_address(announcement, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 2)) { fprintf(stderr, "Error parsing Address for -multicastAddr option\n"); return false; @@ -390,11 +418,11 @@ bool PerftestTransport::parse_multicast_addresses(const char *arg) multicastAddrMap[THROUGHPUT_TOPIC_NAME] = throughput; multicastAddrMap[LATENCY_TOPIC_NAME] = latency; - multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = annonuncement; + multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = announcement; - } else if (numberOfAddressess == 1) { + } else if (numberOfAddresses == 1) { /* If only one address is given */ - if (!NDDS_Transport_get_address(arg, 0, throughput)) { + if (!get_address(throughput, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 0)) { fprintf(stderr, "Error parsing Address for -multicastAddr option\n"); return false; @@ -435,7 +463,7 @@ bool PerftestTransport::parse_multicast_addresses(const char *arg) fprintf(stderr, "Error parsing the address/es '%s' for -multicastAddr option\n", arg); - if (numberOfAddressess == 1) { + if (numberOfAddresses == 1) { fprintf(stderr, "\tThe calculated addresses are outsite of multicast range.\n"); } else { diff --git a/srcCpp/PerftestTransport.h b/srcCpp/PerftestTransport.h index aa6a6b8d..d8a5aa7e 100644 --- a/srcCpp/PerftestTransport.h +++ b/srcCpp/PerftestTransport.h @@ -142,6 +142,12 @@ class PerftestTransport { bool setTransport(std::string transportString); void populateSecurityFiles(); #ifdef PERFTEST_RTI_PRO + bool get_number_of_addresses_in_string(unsigned int *number, const char *input_string); + bool get_address( + char *output_address, + size_t output_buffer_size, + const char *input_string, + int index); bool parse_multicast_addresses(const char *arg); bool increase_address_by_one(const std::string addr, std::string &nextAddr); #endif diff --git a/srcCpp/connextDDS/pro/Infrastructure_pro.h b/srcCpp/connextDDS/pro/Infrastructure_pro.h index 0282f066..0a81614a 100644 --- a/srcCpp/connextDDS/pro/Infrastructure_pro.h +++ b/srcCpp/connextDDS/pro/Infrastructure_pro.h @@ -40,9 +40,14 @@ #define PERFTEST_CONNEXT_PRO_720 #endif #if RTI_DDS_VERSION_MINOR >= 3 - #define PERFTEST_CONNEXT_PRO_720 #define PERFTEST_CONNEXT_PRO_730 #endif + #if RTI_DDS_VERSION_MINOR >= 4 + #define PERFTEST_CONNEXT_PRO_740 + #endif + #if RTI_DDS_VERSION_MINOR >= 5 + #define PERFTEST_CONNEXT_PRO_750 + #endif #endif #include "PerftestTransport.h" diff --git a/srcCpp11/PerftestTransport.cxx b/srcCpp11/PerftestTransport.cxx index 353019c5..a9d035be 100644 --- a/srcCpp11/PerftestTransport.cxx +++ b/srcCpp11/PerftestTransport.cxx @@ -1072,26 +1072,54 @@ bool PerftestTransport::increase_address_by_one( return true; } +bool PerftestTransport::get_number_of_addresses_in_string( + unsigned int *number, + const char *input_string) +{ + #ifdef PERFTEST_CONNEXT_PRO_750 + return NDDS_Transport_get_number_of_addresses_in_string( + number, + input_string); + #else + return NDDS_Transport_get_number_of_addresses_in_string( + input_string, + number); + #endif +} + +bool PerftestTransport::get_address( + char *output_address, + size_t output_buffer_size, + const char *input_string, + int index) +{ + #ifdef PERFTEST_CONNEXT_PRO_750 + return NDDS_Transport_get_address(output_address, output_buffer_size, input_string, index); + #else + return NDDS_Transport_get_address(input_string, index, output_address); + #endif +} + bool PerftestTransport::parse_multicast_addresses(const char *arg) { char throughput[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; char latency[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; - char annonuncement[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; - unsigned int numberOfAddressess = 0; + char announcement[NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE]; + unsigned int numberOfAddresses = 0; /* Get number of addresses on the string */ - if (!NDDS_Transport_get_number_of_addresses_in_string( - arg, - &numberOfAddressess)) { + if (!get_number_of_addresses_in_string( + &numberOfAddresses, + arg)) { fprintf(stderr, "Error parsing Address for -multicastAddr option\n"); return false; } /* If three addresses are given */ - if (numberOfAddressess == 3) { - if (!NDDS_Transport_get_address(arg, 0, throughput) - || !NDDS_Transport_get_address(arg, 1, latency) - || !NDDS_Transport_get_address(arg, 2, annonuncement)) { + if (numberOfAddresses == 3) { + if (!get_address(throughput, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 0) + || !get_address(latency, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 1) + || !get_address(announcement, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 2)) { fprintf(stderr, "Error parsing Address for -multicastAddr option\n"); return false; @@ -1099,11 +1127,11 @@ bool PerftestTransport::parse_multicast_addresses(const char *arg) multicastAddrMap[THROUGHPUT_TOPIC_NAME] = throughput; multicastAddrMap[LATENCY_TOPIC_NAME] = latency; - multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = annonuncement; + multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = announcement; - } else if (numberOfAddressess == 1) { + } else if (numberOfAddresses == 1) { /* If only one address are given */ - if (!NDDS_Transport_get_address(arg, 0, throughput)) { + if (!get_address(throughput, NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE, arg, 0)) { fprintf(stderr, "Error parsing Address for -multicastAddr option\n"); return false; @@ -1144,7 +1172,7 @@ bool PerftestTransport::parse_multicast_addresses(const char *arg) fprintf(stderr, "Error parsing the address/es '%s' for -multicastAddr option\n", arg); - if (numberOfAddressess == 1) { + if (numberOfAddresses == 1) { fprintf(stderr, "\tThe calculated addresses are outsite of multicast range.\n"); } else { diff --git a/srcCpp11/PerftestTransport.h b/srcCpp11/PerftestTransport.h index 3f129010..01a19488 100644 --- a/srcCpp11/PerftestTransport.h +++ b/srcCpp11/PerftestTransport.h @@ -21,6 +21,32 @@ #define DEFAULT_MESSAGE_SIZE_MAX 65536 #define MESSAGE_SIZE_MAX_NOT_SET LONG_MAX +/* + * The way in which we do this is the following: If the minor version is == X + * we will define *_PRO_7X0 and every other version below X. + */ +#if RTI_DDS_VERSION_MAJOR >= 7 + // 6.1.X features are also in 7.0.0 + #define PERFTEST_CONNEXT_PRO_610 + #define PERFTEST_CONNEXT_PRO_700 + #if RTI_DDS_VERSION_MINOR >= 1 + #define PERFTEST_CONNEXT_PRO_710 + #endif + #if RTI_DDS_VERSION_MINOR >= 2 + #define PERFTEST_CONNEXT_PRO_720 + #endif + #if RTI_DDS_VERSION_MINOR >= 3 + #define PERFTEST_CONNEXT_PRO_730 + #endif + #if RTI_DDS_VERSION_MINOR >= 4 + #define PERFTEST_CONNEXT_PRO_740 + #endif + #if RTI_DDS_VERSION_MINOR >= 5 + #define PERFTEST_CONNEXT_PRO_750 + #endif +#endif + + /* * This const is used to calculate the maximum size that a packet can have. This * number has to be substracted to the message_size_max. @@ -138,6 +164,12 @@ class PerftestTransport { bool setTransport(std::string transportString); void populateSecurityFiles(); + bool get_number_of_addresses_in_string(unsigned int *number, const char *input_string); + bool get_address( + char *output_address, + size_t output_buffer_size, + const char *input_string, + int index); bool parse_multicast_addresses(const char *arg); bool increase_address_by_one(const std::string addr, std::string &nextAddr); }; diff --git a/srcCppCommon/qos_string.h b/srcCppCommon/qos_string.h index 8b87d98c..94e949f1 100644 --- a/srcCppCommon/qos_string.h +++ b/srcCppCommon/qos_string.h @@ -1,53 +1,36 @@ #include -#define PERFTEST_QOS_STRING_SIZE 46 -#define PERFTEST_QOS_STRING_TOTAL_SIZE 46273 +#define PERFTEST_QOS_STRING_SIZE 29 +#define PERFTEST_QOS_STRING_TOTAL_SIZE 28725 const char * PERFTEST_QOS_STRING[PERFTEST_QOS_STRING_SIZE] = { -"\n\n\n\n\n\n\n\n\n\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n\n \n \n 2048\n\n \n 4096\n\n \n 64\n \n 512\n \n\n \n\n \n\n \n \n\n \n \n dds.participant.property_validation_action\n 1\n \n\n ", -" \n \n dds.transport.UDPv4.builtin.parent.message_size_max\n 65536\n \n \n dds.transport.UDPv4.builtin.send_socket_buffer_size\n 1048576\n \n \n dds.transport.UDPv4.builtin.recv_socket_buffer_size\n 2097152\n \n\n \n\n \n \n dds.transport.TCPv4.tcp1.library\n nddstransporttcp\n \n \n dds.transport.TCPv4.tcp1.create_function\n NDDS_Transport_TCPv4_create\n \n \n dds.transport.TCPv4.tcp1.disable_nagle\n 1\n \n \n dds.transport.TCPv4.tcp1.parent.message_size_max\n 65536\n \n\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.max_tokens\n 300\n \n ", -" \n dds.flow_controller.token_bucket.10Gbps.token_bucket.tokens_added_per_period\n 200\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.nanosec\n 10000000\n \n\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.max_tokens\n 30\n \n \n dds.flow_controller.token_bucket.1Gbps.t", -"oken_bucket.tokens_added_per_period\n 20\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.nanosec\n 10000000\n \n\n \n \n com.rti.serv.secure.cryptography.encryption_algorithm\n aes-128-gcm\n \n\n \n \n\n \n \n PerfTest Participant\n \n\n \n\n \n \n \n \n TOPIC_PRESENTAT", -"ION_QOS\n true\n \n \n\n \n \n \n \n TOPIC_PRESENTATION_QOS\n true\n ", -"\n \n\n \n \n \n \n \n\n \n \n \n \n DURATION_ZERO_SEC\n 100000\n \n \n \n\n \n\n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n\n \n \n \n 256\n \n \n \n KEEP_ALL_HISTORY_QOS\n \n \n \n RELIABLE_RELIABILITY_QOS\n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n \n\n \n \n \n\n \n", -" \n \n\n \n\n \n\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n \n DURATION_ZERO_SEC\n 1000000\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n LENGTH_UNLIMITED\n\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n\n \n\n \n\n \n\n \n \n false\n\n \n LENGTH_UNLIMITED\n LENGTH_UNLIMITED\n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n false\n \n\n \n fa", -"lse\n \n\n \n\n \n\n \n \n\n \n \n KEEP_ALL_HISTORY_QOS\n \n\n \n \n RELIABLE_RELIABILITY_QOS\n \n\n \n\n \n \n 10000\n 128\n\n \n 10000\n \n\n \n \n 10000\n\n ", -" \n 65536\n \n\n \n \n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n ", -" \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n\n \n\n\n \n \n \n\n \n \n\n \n \n \n \n KEEP_ALL_HISTORY_QOS\n \n\n \n \n RELIABLE_RELIABILITY_QOS\n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n \n\n \n\n \n \n LENGTH_UNLIMITED\n 100\n LENGTH_UNLIMITED\n \n\n \n \n \n 10\n 100\n 1000\n \n DURATION_ZERO_SEC\n 10000000\n \n \n DURATION_ZERO_SEC\n 1000000\n \n \n DURATION_ZERO_SEC\n 10000000\n \n LENGTH_UNLIMITED\n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n LENGTH_UNLIM", -"ITED\n LENGTH_UNLIMITED\n \n \n\n \n false\n \n\n \n\n\n \n \n \n \n RELIABLE_RELIABILITY_QOS\n \n\n \n\n \n \n 100\n 100\n 100\n \n\n \n 100\n \n\n \n \n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_S", -"EC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n \n\n \n \n \n\n \n \n\n \n\n \n \n RELIABLE_RELIABILITY_QOS\n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n \n\n \n KEEP_ALL_HISTORY_QOS\n \n \n DDS_TRANSIENT_LOCAL_DURABILITY_QOS\n \n \n\n \n\n \n \n RELIABLE_RELIABILITY_QOS\n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n \n\n \n KEEP_ALL_HISTORY_QOS\n \n \n DDS_TRANSIENT_LOCAL_DURABILITY_QOS\n \n \n \n \n\n" }; +"\n\n\n\n\n\n\n\n \n\n \n\n \n \n BuiltinQosSnippetLib::QosPolicy.Reliability.Reliable\n BuiltinQosSnippetLib::QosPolicy.History.KeepAll\n \n\n \n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n \n\n \n \n LENGTH_UNLIMITED\n \n \n \n\n\n \n \n\n \n \n \n \n TOPIC_PRESENTATION_QOS\n true\n \n \n\n \n \n TOPIC_PRESENTATION_QOS\n true\n \n \n \n\n \n\n \n \n \n 64\n \n 512\n \n \n\n \n\n \n\n \n \n \n \n dds.transport.TCPv4.tcp1.library\n nddstransporttcp\n \n \n dds.transport.TCPv4.tcp1.create_function\n NDDS_Transport_TCPv4_create\n \n \n dds.transport.TCPv4.tcp1.disable_nagle\n 1\n \n \n \n \n \n\n\n \n \n \n \n \n dds.transport.TCPv4.tcp1.send_socket_buffer_size\n 1048576\n \n \n dds.transport.TCPv4.tcp1.recv_socket_buffer_size\n 2097152\n \n \n \n \n \n\n \n \n \n \n \n \n dds.transport.UDPv4.builtin.send_socket_buffer_size\n 1048576\n \n \n dds.transport.UDPv4.builtin.recv_socket_buffer_size\n 2097152\n \n \n \n \n \n\n \n \n \n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.max_tokens\n 30\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.tokens_added_per_period\n 20\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.nanosec\n 10000000\n \n \n \n \n \n\n \n \n \n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.max_tokens\n 300\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.tokens_added_per_period\n 200\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.nanosec\n 10000000", +"\n \n \n \n \n \n\n \n \n \n \n\n \n\n \n\n \n\n \n\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n \n DURATION_ZERO_SEC\n 1000000\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n LENGTH_UNLIMITED\n\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n\n \n \n DURATION_ZERO_SEC\n 100000\n \n \n \n\n \n\n \n \n \n \n \n ", +" DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n \n\n \n \n PerftestQosLibrary::Perftest.ReliableSettings\n \n \n\n \n\n \n \n \n\n \n \n \n 10000\n 128\n\n \n 10000\n \n\n \n \n 10000\n\n \n 65536\n \n \n \n\n \n \n \n\n \n\n \n \n false\n\n \n LENGTH_UNLIMITED\n LENGTH_UNLIMITED\n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n false\n \n \n \n\n \n \n PerftestQosLibrary::Perfte", +"st.ReliableSettings\n \n\n \n \n \n 10\n 100\n 1000\n LENGTH_UNLIMITED\n LENGTH_UNLIMITED\n \n \n \n\n \n \n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n\n \n\n \n\n \n \n LENGTH_UNLIMI", +"TED\n 100\n LENGTH_UNLIMITED\n \n \n\n \n \n \n 100\n 100\n 100\n \n\n \n 100\n \n \n \n\n \n \n \n \n \n ", +" \n com.rti.serv.secure.cryptography.encryption_algorithm\n aes-128-gcm\n \n\n \n \n\n \n \n\n \n \n\n \n \n PerftestQosLibrary::Presentation.TopicPresentation\n\n \n PerftestQosLibrary::Perftest.Transport.UDPv4.IncreaseSendReceiveBuffers\n PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration\n PerftestQosLibrary::Perftest.Transport.TCPv4.IncreaseSendReceiveBuffers\n\n \n ", +" PerftestQosLibrary::Perftest.IncreaseResourceLimits\n\n \n PerftestQosLibrary::Perftest.FlowController.1Gbps\n PerftestQosLibrary::Perftest.FlowController.10Gbps\n\n \n PerftestQosLibrary::Perftest.Security\n \n\n \n \n Perftest Participant\n \n\n \n \n \n \n dds.participant.property_validation_action\n 1\n \n \n \n \n \n\n \n \n\n \n PerftestQosLibrary::Reliability.StrictReliable\n PerftestQosLibrary::Perftest.Throughput.ReliableSettings\n PerftestQosLibrary::Perftest.Throughput.BatchingConfig\n PerftestQosLibrary::Perftest.Throughput.ResourceLimits\n \n \n \n \n 256\n \n \n\n \n\n \n \n\n \n PerftestQosLibrary::Reliability.StrictReliable\n PerftestQosLibrary::Perftest.Latency.ReliableSettings\n PerftestQosLibrary::Perftest.Latency.ResourceLimits\n \n\n \n \n KEEP_LAST_HISTORY_QOS\n \n \n\n \n\n \n \n\n \n BuiltinQosSnippetLib::QosPolicy.Durability.TransientLocal\n \n\n \n\n \n" }; #define PERFTEST_QOS_STRING_asString(str) {\ int i;\ From 4eccd05f63203eb980bf8437af9cf29ee8380b7e Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Thu, 21 Nov 2024 11:35:32 +0000 Subject: [PATCH 31/49] PERFTEST-406 - Fixed issue with debug libraries --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index 46c98226..666e9ea6 100755 --- a/build.sh +++ b/build.sh @@ -612,6 +612,11 @@ function additional_defines_calculation() additional_defines=${additional_defines}" O3" else additional_defines=${additional_defines}" O0" + export DEBUG=1 + fi + + if [ "${STATIC_DYNAMIC}" == "dynamic" ]; then + export SHAREDLIB=1 fi if [ "${RTI_MONITORING_2}" == "1" ]; then @@ -634,6 +639,7 @@ function additional_defines_calculation() additional_defines=${additional_defines}" DRTI_PERFTEST_DYNAMIC_LINKING" echo -e "${INFO_TAG} Linking Dynamically." + else # Linking Statically. if [ "${USE_LW_SECURE_LIBS}" == "1" ]; then From a9c296f989d7b8c77f63e525246b3bdb365668f2 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Mon, 20 Jan 2025 02:16:07 -0800 Subject: [PATCH 32/49] Pull request #116: PERFTEST-412: Add underlying allocator for bounded Merge in PERF/rti-perftest from feature/PERFTEST-412 to develop Squashed commit of the following: commit 05431daa0315038e15a07adc78c40c124e8fbb57 Author: Javier Morales-Castro Date: Mon Jan 20 08:04:50 2025 +0000 Add underlying allocator for unbounded --- srcCpp/connextDDS/RTIDDSImpl.cxx | 5 +++++ srcCpp/connextDDS/TSS/CustomQosSupport.cpp | 5 +++++ srcCpp11/RTIDDSImpl.cxx | 3 +++ srcCs/ConnextDDS/RTIDDSImpl.cs | 4 ++++ srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java | 4 ++++ 5 files changed, 21 insertions(+) diff --git a/srcCpp/connextDDS/RTIDDSImpl.cxx b/srcCpp/connextDDS/RTIDDSImpl.cxx index defd13d5..965d544b 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.cxx +++ b/srcCpp/connextDDS/RTIDDSImpl.cxx @@ -3471,6 +3471,11 @@ bool RTIDDSImpl::configure_writer_qos( "dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size", buf, false); + } else { + DDSPropertyQosPolicyHelper::add_property(dw_qos.property, + "dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator", + "fast_buffer_pool", + false); } if (_PM->get("instances") > 1) { diff --git a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp index bd2a3ea7..ae72863f 100644 --- a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp +++ b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp @@ -380,6 +380,11 @@ RTI_TSS_datawriter_qos(struct DDS_DataWriterQos *dw_qos, void *data) "dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size", buf, false); + } else { + DDSPropertyQosPolicyHelper::add_property(dw_qos.property, + "dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator", + "fast_buffer_pool", + false); } if (ctx->pm->get("instances") > 1) { diff --git a/srcCpp11/RTIDDSImpl.cxx b/srcCpp11/RTIDDSImpl.cxx index 76102b2d..86148d88 100755 --- a/srcCpp11/RTIDDSImpl.cxx +++ b/srcCpp11/RTIDDSImpl.cxx @@ -2638,6 +2638,9 @@ dds::pub::qos::DataWriterQos RTIDDSImpl::configure_reader_qos( : _PM->get("unbounded"))); properties["dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size"] = buf; + } else { + properties["dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator"] = + "fast_buffer_pool"; } #ifdef RTI_FLATDATA_AVAILABLE diff --git a/srcCs/ConnextDDS/RTIDDSImpl.cs b/srcCs/ConnextDDS/RTIDDSImpl.cs index bcfb807e..b305e8e2 100755 --- a/srcCs/ConnextDDS/RTIDDSImpl.cs +++ b/srcCs/ConnextDDS/RTIDDSImpl.cs @@ -1271,6 +1271,10 @@ private DataWriterQos GetWriterQos(string topicName) dataWriterQos = dataWriterQos.WithProperty(policy => policy.Add("dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size", parameters.UnboundedSize.ToString())); + } else { + dataWriterQos = dataWriterQos.WithProperty(policy => + policy.Add("dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator", + "fast_buffer_pool")); } return dataWriterQos; diff --git a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java index 477d7c85..4fea87ff 100644 --- a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java +++ b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java @@ -1044,6 +1044,10 @@ private void configureWriterQos( PropertyQosPolicyHelper.add_property( dwQos.property, "dds.data_writer.history.memory_manager.java_stream.trim_to_size", "1", false); + } else { + PropertyQosPolicyHelper.add_property( + dwQos.property, "dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator", + "fast_buffer_pool", false); } if (_isLargeData || _IsAsynchronous) From 5bce3dc6dfe9904ba8d1d3659d201c0a616879a7 Mon Sep 17 00:00:00 2001 From: Marcos Rivera Date: Tue, 11 Feb 2025 01:18:02 -0800 Subject: [PATCH 33/49] Pull request #117: PERF-506: Updated C# support Merge in PERF/rti-perftest from feature/PERF-506 to develop Squashed commit of the following: commit 1edbfb4011d01f481624a2f908d765c530e9d6c9 Author: Marcos Rivera Date: Mon Feb 10 21:59:34 2025 +0100 PERF-506: Marcos stop inventing commit 02095274b7da2c6357699d5556b613671a776c82 Author: Marcos Rivera Date: Mon Feb 10 21:58:33 2025 +0100 PERF-506: Jenkins owns everything commit b3614ab1889334d132733d6de5984f9e8026baf1 Author: Marcos Rivera Date: Mon Feb 10 21:43:54 2025 +0100 PERF-506: Restore other languages commit d6ba3ec784a3012a912b0875df7ad6bc59be4cc4 Author: Marcos Rivera Date: Mon Feb 10 21:41:02 2025 +0100 PERF-506: Please work commit 3543d69badbf3fb2ed3900999824505e3110f1ca Author: Marcos Rivera Date: Mon Feb 10 21:13:25 2025 +0100 PERF-506: Please work commit f52e3bc3a9bcf845f94c8b77242e48908bace696 Author: Marcos Rivera Date: Mon Feb 10 21:10:44 2025 +0100 PERF-506: Please work commit 07c5d997ac29817bba3a77b7e990c564ab6ad547 Author: Marcos Rivera Date: Mon Feb 10 21:03:48 2025 +0100 PERF-506: Please work commit be3e6102df76e2516214f88bf23b620b07a16b7b Author: Marcos Rivera Date: Mon Feb 10 20:57:46 2025 +0100 PERF-506: Only dotnet commit 71785fcb59f937e78cdc5e4901de9f0aa5782c2a Author: Marcos Rivera Date: Mon Feb 10 18:55:26 2025 +0100 PERF-506: Please work x2 commit 7d81f57c95915c644f5ddd3ac8064328df9b166c Author: Marcos Rivera Date: Mon Feb 10 18:37:50 2025 +0100 PERF-506: Please work commit 820a416a63c17dd6ae2b43ab7ebf354b16cda1ce Author: Marcos Rivera Date: Mon Feb 10 18:22:55 2025 +0100 PERF-506: Why it always has to be harder than expected commit 6caee5e0c6b3e0ba503a924cd7323c452f3cd512 Author: Marcos Rivera Date: Mon Feb 10 18:18:56 2025 +0100 PERF-506: Jenkins please x2 commit c5a2afb4f34b97992e7cde8e966b745f59d928a4 Author: Marcos Rivera Date: Mon Feb 10 18:16:14 2025 +0100 PERF-506: Jenkins please commit ec2769e41bcd5f621b104cfd25ce1fb86b523277 Author: Marcos Rivera Date: Mon Feb 10 18:12:32 2025 +0100 PERF-506: Fix env commit 491fb58e546eec6ce199330aa139a5138760b442 Author: Marcos Rivera Date: Mon Feb 10 18:00:00 2025 +0100 PERF-506: Updated C# support --- resource/jenkins/ci/BuildPerftest.groovy | 11 ++++++----- resource/jenkins/docker/Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 resource/jenkins/docker/Dockerfile diff --git a/resource/jenkins/ci/BuildPerftest.groovy b/resource/jenkins/ci/BuildPerftest.groovy index 8305120c..7f80195b 100644 --- a/resource/jenkins/ci/BuildPerftest.groovy +++ b/resource/jenkins/ci/BuildPerftest.groovy @@ -22,13 +22,14 @@ pipeline { } axis { name 'LANGUAGE_FLAG' - values '--cpp-build', '--cpp11-build', '--java-build' + values '--cpp-build', '--cpp11-build', '--java-build', '--cs-build' } } agent { - docker { - image "repo.rti.com/connext-containers/connext-sdk:BUILD_7.3.0.0_20240308T000000Z_RTI_REL-20240521" - args CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? '--platform linux/amd64' : '--platform linux/arm64' + dockerfile { + filename 'resource/jenkins/docker/Dockerfile' + additionalBuildArgs "--build-arg PLATFORM=${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? 'amd64' : 'arm64'} --build-arg TAG=7.3.0-20240812" + args "${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? '--platform linux/amd64' : '--platform linux/arm64'}" } } stages { @@ -41,4 +42,4 @@ pipeline { } } } -} \ No newline at end of file +} diff --git a/resource/jenkins/docker/Dockerfile b/resource/jenkins/docker/Dockerfile new file mode 100644 index 00000000..7dd26923 --- /dev/null +++ b/resource/jenkins/docker/Dockerfile @@ -0,0 +1,21 @@ +ARG PLATFORM=amd64 +ARG TAG=7.3.0-20240812 +ARG IMAGE_USER=jenkins +ARG IMAGE_GROUP=jenkins +ARG USER_ID=789 +ARG GROUP_ID=789 + + +FROM --platform=${PLATFORM} repo.rti.com/connext-containers/connext-sdk:${TAG} + +ARG IMAGE_USER +ARG IMAGE_GROUP +ARG USER_ID +ARG GROUP_ID + +RUN groupadd -g ${GROUP_ID} ${IMAGE_GROUP} && \ + useradd -u ${USER_ID} -g ${GROUP_ID} -ms /bin/bash ${IMAGE_USER} + +RUN chown -R ${IMAGE_USER}:${IMAGE_GROUP} /root/.dotnet + +USER ${IMAGE_USER} \ No newline at end of file From c9cdcee65b2e0d76c06bb1552e62e2faa30f27dc Mon Sep 17 00:00:00 2001 From: Pablo Lombardero Ros Date: Tue, 18 Feb 2025 00:38:32 -0800 Subject: [PATCH 34/49] Pull request #118: FACETSS-415: Adding documentation for new Cert params Merge in PERF/rti-perftest from task/PERFTEST-415 to develop Squashed commit of the following: commit f2bbace032eaef1c4974ee2d0972961cdc8fb804 Author: plombardero0 Date: Wed Feb 12 18:12:02 2025 +0100 FACETSS-415: Adding documentation for the new params --- srcDoc/command_line_parameters.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/srcDoc/command_line_parameters.rst b/srcDoc/command_line_parameters.rst index da156910..44aacced 100644 --- a/srcDoc/command_line_parameters.rst +++ b/srcDoc/command_line_parameters.rst @@ -96,6 +96,26 @@ Test Parameters for Publishing and Subscribing Applications Not yet supported in the C# API implementation. +- ``-receiveBufferSize`` + + Size of the buffer of the UDP socket used to receive samples. + + **Default:** ``2097152`` + + .. note:: + + Only supported for Cert. + +- ``-sendBufferSize`` + + Size of the buffer of the UDP socket used to send samples. + + **Default:** ``524288`` + + .. note:: + + Only supported for Cert. + .. _FlatData: - ``-flatData`` From 2f7967705e4d48543f5c222fa289961ec35a3a04 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Wed, 19 Feb 2025 11:32:43 -0800 Subject: [PATCH 35/49] Pull request #102: PERFTEST-363 - Add message_size_max command line argument and decouple async publishing Merge in PERF/rti-perftest from feature/PERFTEST-363 to develop Squashed commit of the following: commit 720e3ecd32b5f1104e000a385f591fa5e09f14ee Author: Javi Morales Date: Tue Feb 18 20:52:10 2025 +0100 CR Changes commit fb3ed759f55faa3f5896c53327c544dc5e21c1ae Author: Alvaro Fernandez Date: Tue Feb 18 03:54:25 2025 -0800 Applied suggestion commit 5744158eb266a095c4e6ab9fbe3508fb8242730f Author: Alvaro Fernandez Date: Tue Feb 18 03:54:08 2025 -0800 Applied suggestion commit c090a869d455dc31e29bf0cdf717db406458a48d Author: Alvaro Fernandez Date: Tue Feb 18 03:53:56 2025 -0800 Applied suggestion commit a4af5b9eaad0f40c2d0f40ecec700baea399f0ce Author: Alvaro Fernandez Date: Tue Feb 18 03:53:43 2025 -0800 Applied suggestion commit 9fec9736a4c5665a444237d2239e5f4330d08134 Author: Alvaro Fernandez Date: Tue Feb 18 03:53:31 2025 -0800 Applied suggestion commit a14bcca7733204aec728f97ca4738ddb3a487e5f Author: Javier Morales-Castro Date: Wed Feb 12 15:43:00 2025 +0000 CR feedback commit d0d7f18579771b87e77cfd056c9b8357530dd1a1 Author: Lissa Loadholt Date: Wed Feb 12 07:14:58 2025 -0800 Applied suggestion commit d9eecd2b5c8ec316360b3269ae2c7dc52e439606 Author: Lissa Loadholt Date: Mon Feb 10 12:16:04 2025 -0800 Applied suggestion commit 9cf79237f57460d739eec9919298e0ca2a9d78f1 Author: Lissa Loadholt Date: Mon Feb 10 12:15:55 2025 -0800 Applied suggestion commit 532f8f3da51a68436234b66a1b29a8c9798d94a3 Author: Lissa Loadholt Date: Mon Feb 10 12:15:08 2025 -0800 Applied suggestion commit 2feafa9049b26985812207e6c669e265ede430f6 Author: Lissa Loadholt Date: Mon Feb 10 12:15:00 2025 -0800 Applied suggestion commit 5280827b6c9cc18b21721fcb7a2f717ddf204407 Author: Javier Morales-Castro Date: Mon Feb 10 16:53:21 2025 +0000 Add documentation feedback commit 999c3d0927c5b018c5ad7b19fbc111ee392dcec5 Author: Javier Morales-Castro Date: Mon Feb 10 13:11:47 2025 +0000 Fix compilation issue for C++11. commit e6561cb8711d5401a276bf4d436551aaa39a9991 Merge: f72e5c7 a9c296f Author: Javier Morales-Castro Date: Mon Feb 10 13:03:28 2025 +0000 Merge branch 'develop' into feature/PERFTEST-363 commit f72e5c77b0adc190e835df33b1618fd56a29028b Author: Alvaro Fernandez Date: Mon Jul 1 09:17:04 2024 -0700 Applied suggestion commit b46b4d8f21a7cf0d5526aee326513222da796502 Author: Alvaro Fernandez Date: Mon Jul 1 09:16:48 2024 -0700 Applied suggestion commit c11039b81050afa965601b845583a42973367d68 Author: Javier Morales-Castro Date: Mon Jul 1 12:43:17 2024 +0000 CR feedback commit 605b745d712e9083a2ac9e1ee129ea3fc73407db Author: Javier Morales-Castro Date: Fri Jun 28 12:19:41 2024 +0000 Apply feedback commit a77f52b602dd973cc8da7ced2dfef0f62594a043 Author: Javier Morales-Castro Date: Thu Jun 27 15:22:22 2024 +0000 Doc review ... and 23 more commits --- perftest_qos_profiles.xml | 28 ++ resource/jenkins/compilation.groovy | 2 +- srcCpp/PerftestTransport.cxx | 15 +- srcCpp/connextDDS/RTIDDSImpl.cxx | 71 ++- srcCpp/connextDDS/RTIDDSImpl.h | 2 +- srcCpp/connextDDS/TSS/CustomQosSupport.cpp | 11 +- srcCpp/connextDDS/TSS/CustomQosSupport.hpp | 2 +- srcCpp/connextDDS/TSS/RTITSSImpl.cxx | 6 +- srcCpp/connextDDS/TSS/RTITSSImpl.h | 2 +- srcCpp/connextDDS/pro/Infrastructure_pro.cxx | 342 +++++++++----- srcCpp/connextDDS/pro/Infrastructure_pro.h | 4 +- srcCpp/perftest_cpp.cxx | 2 +- srcCpp11/PerftestTransport.cxx | 425 ++++++++++++------ srcCpp11/PerftestTransport.h | 5 +- srcCpp11/RTIDDSImpl.cxx | 43 +- srcCpp11/RTIDDSImpl.h | 2 +- srcCpp11/perftest_cpp.cxx | 2 +- srcCppCommon/ParameterManager.cxx | 10 + srcCppCommon/qos_string.h | 53 +-- srcCs/ConnextDDS/RTIDDSImpl.cs | 49 +- srcCs/Infrastructure/Parameters.cs | 7 + srcCs/Infrastructure/PerftestTransport.cs | 118 +++-- srcDoc/command_line_parameters.rst | 27 +- srcDoc/examples.rst | 52 ++- srcDoc/old_release_notes.rst | 18 +- srcDoc/release_notes.rst | 28 +- .../perftest/ddsimpl/PerftestTransport.java | 141 ++++-- .../com/rti/perftest/ddsimpl/RTIDDSImpl.java | 52 +-- 28 files changed, 958 insertions(+), 561 deletions(-) diff --git a/perftest_qos_profiles.xml b/perftest_qos_profiles.xml index c40b8981..6b17d7df 100644 --- a/perftest_qos_profiles.xml +++ b/perftest_qos_profiles.xml @@ -151,6 +151,29 @@ and Utilities User's Manual in the chapter titled "Configuring QoS with XML." + + + + + + + + dds.transport.UDPv4_WAN.builtin.send_socket_buffer_size + 1048576 + + + dds.transport.UDPv4_WAN.builtin.recv_socket_buffer_size + 2097152 + + + + + + @@ -629,6 +652,7 @@ and Utilities User's Manual in the chapter titled "Configuring QoS with XML." PerftestQosLibrary::Perftest.Transport.UDPv4.IncreaseSendReceiveBuffers + PerftestQosLibrary::Perftest.Transport.UDPv4_WAN.IncreaseSendReceiveBuffers PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration PerftestQosLibrary::Perftest.Transport.TCPv4.IncreaseSendReceiveBuffers @@ -659,6 +683,10 @@ and Utilities User's Manual in the chapter titled "Configuring QoS with XML." dds.participant.property_validation_action 1 + + dds.type_consistency.ignore_sequence_bounds + false + diff --git a/resource/jenkins/compilation.groovy b/resource/jenkins/compilation.groovy index b0df753d..4a41a50a 100644 --- a/resource/jenkins/compilation.groovy +++ b/resource/jenkins/compilation.groovy @@ -10,7 +10,7 @@ import java.text.SimpleDateFormat /* Global variables used in multiple stages of the pipeline */ -executionMachine = 'bld-ubuntu1804.rti.com' +executionMachine = 'x64lin-gcc73-dev.sjcvirt.rti.com' executionMachineMicro = 'sjc01perf13.rti.com' user = 'perfuser' perftestRepo = 'ssh://git@bitbucket.rti.com:7999/perf/rti-perftest.git' diff --git a/srcCpp/PerftestTransport.cxx b/srcCpp/PerftestTransport.cxx index c8e58ac3..51452b85 100644 --- a/srcCpp/PerftestTransport.cxx +++ b/srcCpp/PerftestTransport.cxx @@ -11,17 +11,14 @@ PerftestTransport::PerftestTransport() { - multicastAddrMap[LATENCY_TOPIC_NAME] = - TRANSPORT_MULTICAST_ADDR_LATENCY; - multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = - TRANSPORT_MULTICAST_ADDR_ANNOUNCEMENT; - multicastAddrMap[THROUGHPUT_TOPIC_NAME] = - TRANSPORT_MULTICAST_ADDR_THROUGHPUT; + multicastAddrMap[LATENCY_TOPIC_NAME] = TRANSPORT_MULTICAST_ADDR_LATENCY; + multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = TRANSPORT_MULTICAST_ADDR_ANNOUNCEMENT; + multicastAddrMap[THROUGHPUT_TOPIC_NAME] = TRANSPORT_MULTICAST_ADDR_THROUGHPUT; transportConfigMap["Use XML"] = TransportConfig( - TRANSPORT_NOT_SET, - "--", - "--"); + TRANSPORT_NOT_SET, + "--", + "--"); transportConfigMap["UDPv4"] = TransportConfig( TRANSPORT_UDPv4, "UDPv4", diff --git a/srcCpp/connextDDS/RTIDDSImpl.cxx b/srcCpp/connextDDS/RTIDDSImpl.cxx index 965d544b..72123cca 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.cxx +++ b/srcCpp/connextDDS/RTIDDSImpl.cxx @@ -103,7 +103,7 @@ RTIDDSImpl::RTIDDSImpl() _instanceMaxCountReader = 1; #endif _isLargeData = false; - _maxSynchronousSize = MESSAGE_SIZE_MAX_NOT_SET; + _maxUnfragmentedRTPSPayloadSize = MESSAGE_SIZE_MAX_NOT_SET; _isFlatData = false; _isZeroCopy = false; _factory = NULL; @@ -346,32 +346,17 @@ bool RTIDDSImpl::data_size_related_calculations() return false; } - // If the user wants to use asynchronous we enable it - if (_PM->get("asynchronous")) { - _isLargeData = true; - } else { //If the message size max is lower than the datalen - _isLargeData = (_PM->get("dataLen") > _maxSynchronousSize); - } + // We consider large data those that will not fit in the + // _maxUnfragmentedRTPSPayloadSize + _isLargeData = (_PM->get("dataLen") > _maxUnfragmentedRTPSPayloadSize); // Manage parameter -batchSize if (_PM->get("batchSize") > 0) { - // Check if using asynchronous - if (_PM->get("asynchronous")) { - if (_PM->is_set("batchSize") && _PM->get("batchSize") != 0) { - fprintf(stderr, - "Batching cannot be used with asynchronous writing.\n"); - return false; - } else { - _PM->set("batchSize", 0); // Disable Batching - } - } - /* - * Large Data + batching cannot be set. But batching is enabled by default, - * so in that case, we just disabled batching, else, the customer set it up, - * so we explitly fail - */ + // Large Data + batching cannot be set. But batching is enabled by default, + // so in that case, we just disabled batching, else, the customer set it up, + // so we explicitly fail if (_isLargeData) { if (_PM->is_set("batchSize") && _PM->get("batchSize") != 0) { fprintf(stderr, "Batching cannot be used with Large Data.\n"); @@ -379,13 +364,14 @@ bool RTIDDSImpl::data_size_related_calculations() } else { _PM->set("batchSize", -2); } - } else if (((unsigned long)_PM->get("batchSize") - < _PM->get("dataLen") * 2)) { - /* - * We don't want to use batching if the batch size is not large - * enough to contain at least two samples (in this case we avoid the - * checking at the middleware level). - */ + } + + // We don't want to use batching if the batch size is not large + // enough to contain at least two samples (in this case we avoid a check + // at the middleware level). + if (((unsigned long)_PM->get("batchSize") + < _PM->get("dataLen") * 2)) { + if (_PM->is_set("batchSize")) { /* * Batchsize disabled. A message will be print if batchSize < 0 @@ -417,7 +403,8 @@ bool RTIDDSImpl::data_size_related_calculations() if (_PM->get("asynchronous")) { fprintf(stderr, "Turbo Mode cannot be used with asynchronous writing.\n"); return false; - } if (_isLargeData) { + } + if (_isLargeData) { fprintf(stderr, "Turbo Mode disabled, using large data.\n"); _PM->set("enableTurboMode", false); } @@ -560,8 +547,7 @@ std::string RTIDDSImpl::print_configuration() // Asynchronous Publishing if (_PM->get("pub")) { stringStream << "\tAsynchronous Publishing: "; - if ((_isLargeData || _PM->get("asynchronous")) - && !_PM->get("zerocopy")) { + if (_PM->get("asynchronous") && !_PM->get("zerocopy")) { stringStream << "Yes\n"; stringStream << "\tFlow Controller: " << _PM->get("flowController") @@ -617,14 +603,14 @@ std::string RTIDDSImpl::print_configuration() #endif // Large Data - if (_PM->get("dataLen") > _maxSynchronousSize) { - stringStream << "\n[IMPORTANT]: Enabling Asynchronous publishing: -datalen (" + if (_PM->get("dataLen") > _maxUnfragmentedRTPSPayloadSize) { + stringStream << "\n[IMPORTANT]: -datalen (" << perftest::to_string(_PM->get("dataLen")) - << ") is \n" - << " larger than the minimum message_size_max across\n" - << " all enabled transports (" - << perftest::to_string(_maxSynchronousSize) - << ")\n"; + << ") is greater than\n" + << " the minimum message_size_max across all\n" + << " enabled transports (" + << perftest::to_string(_maxUnfragmentedRTPSPayloadSize) + << "). Samples will be fragmented.\n"; } return stringStream.str(); @@ -2613,16 +2599,15 @@ bool RTIDDSImpl::configure_participant_qos(DDS_DomainParticipantQos &qos) /* * At this point, and not before is when we know the transport message size. - * Now we can decide if we need to use asynchronous or not. */ - _maxSynchronousSize = _transport.minimumMessageSizeMax - (MESSAGE_OVERHEAD_BYTES); + _maxUnfragmentedRTPSPayloadSize = _transport.minimumMessageSizeMax - (MESSAGE_OVERHEAD_BYTES); /* * We need to account for the different size of the headers when using * flatData. */ if (_isFlatData) { - _maxSynchronousSize -= 17; + _maxUnfragmentedRTPSPayloadSize -= 17; } if (!data_size_related_calculations()) { @@ -3271,7 +3256,7 @@ bool RTIDDSImpl::configure_writer_qos( } } - if ((_isLargeData && !_isZeroCopy) || _PM->get("asynchronous")) { + if (_PM->get("asynchronous")) { dw_qos.publish_mode.kind = DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS; if (_PM->get("flowController") != "default") { dw_qos.publish_mode.flow_controller_name = diff --git a/srcCpp/connextDDS/RTIDDSImpl.h b/srcCpp/connextDDS/RTIDDSImpl.h index 575088c6..08f45713 100644 --- a/srcCpp/connextDDS/RTIDDSImpl.h +++ b/srcCpp/connextDDS/RTIDDSImpl.h @@ -137,7 +137,7 @@ class RTIDDSImpl : public IMessaging long _instanceMaxCountReader; unsigned long _sendQueueSize; bool _isLargeData; - unsigned long long _maxSynchronousSize; + unsigned long long _maxUnfragmentedRTPSPayloadSize; bool _isFlatData; bool _isZeroCopy; PerftestTransport _transport; diff --git a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp index ae72863f..60e2b9e8 100644 --- a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp +++ b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp @@ -106,9 +106,8 @@ RTI_TSS_participant_qos(struct DDS_DomainParticipantQos *dp_qos, void *data) /* * At this point, and not before is when we know the transport message size. - * Now we can decide if we need to use asynchronous or not. */ - *ctx->maxSynchronousSize = ctx->transport->minimumMessageSizeMax - (MESSAGE_OVERHEAD_BYTES); + *ctx->maxUnfragmentedRTPSPayloadSize = ctx->transport->minimumMessageSizeMax - (MESSAGE_OVERHEAD_BYTES); if (!data_size_related_calculations(ctx)) { fprintf(stderr, "Failed to configure the data size settings\n"); @@ -138,12 +137,8 @@ bool data_size_related_calculations(QoSBundle* ctx) return false; } - // If the user wants to use asynchronous we enable it - if (ctx->pm->get("asynchronous")) { - *ctx->isLargeData = true; - } else { //If the message size max is lower than the datalen - *ctx->isLargeData = (ctx->pm->get("dataLen") > *ctx->maxSynchronousSize); - } + // If the message size max is lower than the datalen + *ctx->isLargeData = (ctx->pm->get("dataLen") > *ctx->maxUnfragmentedRTPSPayloadSize); // Manage parameter -batchSize if (ctx->pm->get("batchSize") > 0) { diff --git a/srcCpp/connextDDS/TSS/CustomQosSupport.hpp b/srcCpp/connextDDS/TSS/CustomQosSupport.hpp index bee7e452..5d80cebe 100644 --- a/srcCpp/connextDDS/TSS/CustomQosSupport.hpp +++ b/srcCpp/connextDDS/TSS/CustomQosSupport.hpp @@ -22,7 +22,7 @@ typedef struct QoSBundle { std::string topic_name; long instanceMaxCountReader; bool* isLargeData; - unsigned long long* maxSynchronousSize; + unsigned long long* maxUnfragmentedRTPSPayloadSize; } QoSBundle; std::string stringValueQoS(DDS_Long resourceLimitValue); diff --git a/srcCpp/connextDDS/TSS/RTITSSImpl.cxx b/srcCpp/connextDDS/TSS/RTITSSImpl.cxx index 298cb0d7..dc774c58 100644 --- a/srcCpp/connextDDS/TSS/RTITSSImpl.cxx +++ b/srcCpp/connextDDS/TSS/RTITSSImpl.cxx @@ -43,7 +43,7 @@ RTITSSImpl::RTITSSImpl(const char*type_name) : _instanceMaxCountReader = 1; #endif - _maxSynchronousSize = MESSAGE_SIZE_MAX_NOT_SET; + _maxUnfragmentedRTPSPayloadSize = MESSAGE_SIZE_MAX_NOT_SET; _isLargeData = false; } @@ -184,7 +184,7 @@ RTITSSImpl::SetDomainParticipantConfig( participant_qos_bundle->isLargeData = &_isLargeData; - participant_qos_bundle->maxSynchronousSize = &_maxSynchronousSize; + participant_qos_bundle->maxUnfragmentedRTPSPayloadSize = &_maxUnfragmentedRTPSPayloadSize; FACE::RETURN_CODE_TYPE::Value return_code; FACE::Configuration::HANDLE_TYPE domain_config_handler; @@ -456,7 +456,7 @@ RTITSSImpl::InstrumentConnection( connection_qos_bundle->isLargeData = &_isLargeData; - connection_qos_bundle->maxSynchronousSize = &_maxSynchronousSize; + connection_qos_bundle->maxUnfragmentedRTPSPayloadSize = &_maxUnfragmentedRTPSPayloadSize; if (!GetConnectionConfig(connection_name, connection_config)) { diff --git a/srcCpp/connextDDS/TSS/RTITSSImpl.h b/srcCpp/connextDDS/TSS/RTITSSImpl.h index 480b8379..e91893cb 100644 --- a/srcCpp/connextDDS/TSS/RTITSSImpl.h +++ b/srcCpp/connextDDS/TSS/RTITSSImpl.h @@ -159,7 +159,7 @@ class RTITSSImpl : public IMessaging bool _isLargeData; - unsigned long long _maxSynchronousSize; + unsigned long long _maxUnfragmentedRTPSPayloadSize; DDS_Boolean GetSystemConfig( diff --git a/srcCpp/connextDDS/pro/Infrastructure_pro.cxx b/srcCpp/connextDDS/pro/Infrastructure_pro.cxx index 31ab227c..5504dfe3 100644 --- a/srcCpp/connextDDS/pro/Infrastructure_pro.cxx +++ b/srcCpp/connextDDS/pro/Infrastructure_pro.cxx @@ -141,9 +141,9 @@ bool assertPropertyToParticipantQos( bool setAllowInterfacesList( PerftestTransport &transport, DDS_DomainParticipantQos &qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { - if (!_PM->get("allowInterfaces").empty()) { + if (!parameterManager->get("allowInterfaces").empty()) { if (transport.transportConfig.kind == TRANSPORT_NOT_SET) { fprintf(stderr, @@ -165,7 +165,7 @@ bool setAllowInterfacesList( if (!addPropertyToParticipantQos( qos, propertyName, - _PM->get("allowInterfaces"))) { + parameterManager->get("allowInterfaces"))) { return false; } @@ -175,7 +175,7 @@ bool setAllowInterfacesList( if (!addPropertyToParticipantQos( qos, propertyName, - _PM->get("allowInterfaces"))) { + parameterManager->get("allowInterfaces"))) { return false; } @@ -191,7 +191,7 @@ bool setAllowInterfacesList( return addPropertyToParticipantQos( qos, propertyName, - _PM->get("allowInterfaces")); + parameterManager->get("allowInterfaces")); } } @@ -201,9 +201,9 @@ bool setAllowInterfacesList( bool setTransportVerbosity( PerftestTransport &transport, DDS_DomainParticipantQos &qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { - if (!_PM->get("transportVerbosity").empty()) { + if (!parameterManager->get("transportVerbosity").empty()) { if (transport.transportConfig.kind == TRANSPORT_NOT_SET) { fprintf(stderr, "%s Ignoring -transportVerbosity option\n", @@ -232,7 +232,7 @@ bool setTransportVerbosity( return addPropertyToParticipantQos( qos, propertyName, - _PM->get("transportVerbosity")); + parameterManager->get("transportVerbosity")); } return true; } @@ -240,34 +240,34 @@ bool setTransportVerbosity( bool configureSecurityFiles( PerftestTransport &transport, DDS_DomainParticipantQos& qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { - if (!_PM->get("transportCertAuthority").empty()) { + if (!parameterManager->get("transportCertAuthority").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".tls.verify.ca_file", - _PM->get("transportCertAuthority"))) { + parameterManager->get("transportCertAuthority"))) { return false; } } - if (!_PM->get("transportCertFile").empty()) { + if (!parameterManager->get("transportCertFile").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".tls.identity.certificate_chain_file", - _PM->get("transportCertFile"))) { + parameterManager->get("transportCertFile"))) { return false; } } - if (!_PM->get("transportPrivateKey").empty()) { + if (!parameterManager->get("transportPrivateKey").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".tls.identity.private_key_file", - _PM->get("transportPrivateKey"))) { + parameterManager->get("transportPrivateKey"))) { return false; } } @@ -278,7 +278,7 @@ bool configureSecurityFiles( bool configureTcpTransport( PerftestTransport &transport, DDS_DomainParticipantQos& qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { qos.transport_builtin.mask = DDS_TRANSPORTBUILTIN_MASK_NONE; @@ -289,16 +289,16 @@ bool configureTcpTransport( return false; } - if (!_PM->get("transportServerBindPort").empty()) { + if (!parameterManager->get("transportServerBindPort").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".server_bind_port", - _PM->get("transportServerBindPort"))) { + parameterManager->get("transportServerBindPort"))) { return false; } } - if (_PM->get("transportWan")) { + if (parameterManager->get("transportWan")) { if (!assertPropertyToParticipantQos( qos, transport.transportConfig.prefixString @@ -307,13 +307,13 @@ bool configureTcpTransport( return false; } - if (_PM->get("transportServerBindPort") != "0") { - if (!_PM->get("transportPublicAddress").empty()) { + if (parameterManager->get("transportServerBindPort") != "0") { + if (!parameterManager->get("transportPublicAddress").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".public_address", - _PM->get("transportPublicAddress"))) { + parameterManager->get("transportPublicAddress"))) { return false; } } else { @@ -327,7 +327,7 @@ bool configureTcpTransport( } if (transport.transportConfig.kind == TRANSPORT_TLSv4) { - if (_PM->get("transportWan")) { + if (parameterManager->get("transportWan")) { if (!assertPropertyToParticipantQos( qos, transport.transportConfig.prefixString @@ -345,7 +345,7 @@ bool configureTcpTransport( } } - if (!configureSecurityFiles(transport, qos, _PM)) { + if (!configureSecurityFiles(transport, qos, parameterManager)) { return false; } } @@ -356,7 +356,7 @@ bool configureTcpTransport( bool configureDtlsTransport( PerftestTransport &transport, DDS_DomainParticipantQos& qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { qos.transport_builtin.mask = DDS_TRANSPORTBUILTIN_MASK_NONE; @@ -382,7 +382,7 @@ bool configureDtlsTransport( return false; } - if (!configureSecurityFiles(transport, qos, _PM)) { + if (!configureSecurityFiles(transport, qos, parameterManager)) { return false; } @@ -392,7 +392,7 @@ bool configureDtlsTransport( bool configureWanTransport( PerftestTransport &transport, DDS_DomainParticipantQos& qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { qos.transport_builtin.mask = DDS_TRANSPORTBUILTIN_MASK_NONE; @@ -418,11 +418,11 @@ bool configureWanTransport( return false; } - if (!_PM->get("transportWanServerAddress").empty()) { + if (!parameterManager->get("transportWanServerAddress").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".server", - _PM->get("transportWanServerAddress"))) { + parameterManager->get("transportWanServerAddress"))) { return false; } } else { @@ -432,21 +432,21 @@ bool configureWanTransport( return false; } - if (!_PM->get("transportWanServerPort").empty()) { + if (!parameterManager->get("transportWanServerPort").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".server_port", - _PM->get("transportWanServerPort"))) { + parameterManager->get("transportWanServerPort"))) { return false; } } - if (!_PM->get("transportWanId").empty()) { + if (!parameterManager->get("transportWanId").empty()) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".transport_instance_id", - _PM->get("transportWanId"))) { + parameterManager->get("transportWanId"))) { return false; } } else { @@ -454,7 +454,7 @@ bool configureWanTransport( return false; } - if (_PM->get("transportSecureWan")) { + if (parameterManager->get("transportSecureWan")) { if (!addPropertyToParticipantQos( qos, transport.transportConfig.prefixString + ".enable_security", @@ -462,7 +462,7 @@ bool configureWanTransport( return false; } - if (!configureSecurityFiles(transport, qos, _PM)) { + if (!configureSecurityFiles(transport, qos, parameterManager)) { return false; } } @@ -473,16 +473,16 @@ bool configureWanTransport( bool configureUdpv4WanTransport( PerftestTransport &transport, DDS_DomainParticipantQos& qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { qos.transport_builtin.mask = DDS_TRANSPORTBUILTIN_UDPv4_WAN; - if (!_PM->get("transportPublicAddress").empty()) { + if (!parameterManager->get("transportPublicAddress").empty()) { std::string publicAddress - = _PM->get("transportPublicAddress"); + = parameterManager->get("transportPublicAddress"); std::string delimiter = ":"; size_t pos = publicAddress.find(delimiter); @@ -499,10 +499,10 @@ bool configureUdpv4WanTransport( std::string publicAddressPort = publicAddress.substr(pos+1, std::string::npos); - // If transportRWTHostPort is defined use transportPort + // If transportHostPort is defined use that port for the transport std::string publicAddressHostPort; - if (!_PM->get("transportHostPort").empty()) { - std::string transportHostPort = _PM->get("transportHostPort"); + if (!parameterManager->get("transportHostPort").empty()) { + std::string transportHostPort = parameterManager->get("transportHostPort"); publicAddressHostPort = transportHostPort; } else { // Use Internal Port as external port publicAddressHostPort = publicAddressPort; @@ -538,7 +538,7 @@ bool configureUdpv4WanTransport( bool configureShmemTransport( PerftestTransport &transport, DDS_DomainParticipantQos& qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { /** * OSAPI do not support SHMEM for Android yet @@ -548,7 +548,7 @@ bool configureShmemTransport( DDSPropertyQosPolicyHelper::lookup_property(qos.property, "dds.transport.shmem.builtin.parent.message_size_max"); - unsigned long long datalen = _PM->get("dataLen"); + unsigned long long datalen = parameterManager->get("dataLen"); long parentMsgSizeMax = transport.minimumMessageSizeMax; std::ostringstream ss; @@ -557,8 +557,12 @@ bool configureShmemTransport( /* * If the property defining the message_size_max for shared memory is not * set and we are using exclusively SHMEM, then we will calculate - * automatically the message_size_max to accomodate the sample in a single + * automatically the message_size_max to accommodate the sample in a single * packet and avoid fragmentation. + * + * Note that if we have set message_size_max via the command line argument + * we will not change it and we will use that value, because we call this + * function after setting the message_size_max for shmem. */ if (parentProp != NULL && parentProp->value != NULL) { parentMsgSizeMax = atoi(parentProp->value); @@ -569,7 +573,7 @@ bool configureShmemTransport( > (unsigned long long) parentMsgSizeMax) { parentMsgSizeMax = datalen + MESSAGE_OVERHEAD_BYTES; - if (_PM->get("flatdata")) { + if (parameterManager->get("flatdata")) { /* * This 17 is due to the incorrecty setting OVERHEAD_BYTES in * perftest_cpp: In the case of Flat Data is not right. @@ -697,7 +701,7 @@ bool configureShmemTransport( #ifdef RTI_FLATDATA_AVAILABLE // Zero Copy sends 16-byte references - if (_PM->get("zerocopy")) { + if (parameterManager->get("zerocopy")) { datalen = 16; } #endif @@ -714,7 +718,7 @@ bool configureShmemTransport( 1ull, (datalen / fragmentSize) + 1); unsigned long long receivedMessageCountMax = - 2 * (_PM->get("sendQueueSize") + 1) * rtpsMessagesPerSample; + 2 * (parameterManager->get("sendQueueSize") + 1) * rtpsMessagesPerSample; unsigned long long receiveBufferSize = (std::min)( (unsigned long long) maxBufferSize, @@ -795,58 +799,153 @@ long getTransportMessageSizeMax( } /* - * Configures the minimumMessageSizeMax value in the PerftestTransport object with - * the minimum value for all the enabled transports in the XML configuration. + * Sets the MessageSizeMax property given the name (String) of a transport in a + * DDS_DomainParticipantQos object. + */ +bool setTransportMessageSizeMax( + std::string targetTransportName, + PerftestTransport &transport, + DDS_DomainParticipantQos& qos, + long messageSizeMax) +{ + std::string propertyName = + transport.transportConfigMap[targetTransportName].prefixString + + ".parent.message_size_max"; + + return assertPropertyToParticipantQos( + qos, + propertyName, + std::to_string(messageSizeMax).c_str()); +} + + +/* + * Setup the transport minimumMessageSize max. If the message_size_max is set via + * command line, then we will use that and set the properties for every transport. + * Otherwise, what we will do is get the minimum value for all the enabled transports + * in the XML configuration. */ -void getTransportMinimumMessageSizeMax( +bool setupTransportMinimumMessageSizeMax( + ParameterManager *parameterManager, PerftestTransport &transport, DDS_DomainParticipantQos& qos) { long qosConfigurationMessageSizeMax = MESSAGE_SIZE_MAX_NOT_SET; long transportMessageSizeMax = MESSAGE_SIZE_MAX_NOT_SET; - if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_SHMEM) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax("SHMEM", transport, qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + + if (parameterManager->is_set("messageSizeMax")) { + + transportMessageSizeMax = parameterManager->get("messageSizeMax"); + qosConfigurationMessageSizeMax = transportMessageSizeMax; + transport.loggingString += ("\tmessage_size_max: " + + std::to_string(transportMessageSizeMax) + + " (set via command line)\n"); + + if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_SHMEM) != 0) { + if (!setTransportMessageSizeMax("SHMEM", transport, qos, transportMessageSizeMax)){ + printf("[Error]: error in setupTransportMinimumMessageSizeMax setting message_size_max to SHMEM\n"); + return false; + } } - } - if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_UDPv4) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax("UDPv4", transport, qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_UDPv4) != 0) { + if (!setTransportMessageSizeMax("UDPv4", transport, qos, transportMessageSizeMax)){ + printf("[Error]: error in setupTransportMinimumMessageSizeMax setting message_size_max to UDPv4\n"); + return false; + } } - } - if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_UDPv6) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax("UDPv6", transport, qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_UDPv6) != 0) { + if (!setTransportMessageSizeMax("UDPv6", transport, qos, transportMessageSizeMax)){ + printf("[Error]: error in setupTransportMinimumMessageSizeMax setting message_size_max to UDPv6\n"); + return false; + } } - } - if (transport.transportConfig.kind == TRANSPORT_TCPv4 - || transport.transportConfig.kind == TRANSPORT_TLSv4) { - transportMessageSizeMax = getTransportMessageSizeMax("TCP", transport, qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transport.transportConfig.kind == TRANSPORT_TCPv4 + || transport.transportConfig.kind == TRANSPORT_TLSv4) { + if (!setTransportMessageSizeMax("TCP", transport, qos, transportMessageSizeMax)){ + printf("[Error]: error in setupTransportMinimumMessageSizeMax setting message_size_max to TCP\n"); + return false; + } } - } else if (transport.transportConfig.kind == TRANSPORT_DTLSv4) { - transportMessageSizeMax = getTransportMessageSizeMax("DTLS", transport, qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transport.transportConfig.kind == TRANSPORT_DTLSv4) { + if (!setTransportMessageSizeMax("DTLS", transport, qos, transportMessageSizeMax)){ + printf("[Error]: error in setupTransportMinimumMessageSizeMax setting message_size_max to DTLS\n"); + return false; + } + } + if (transport.transportConfig.kind == TRANSPORT_WANv4) { + if (!setTransportMessageSizeMax("WAN", transport, qos, transportMessageSizeMax)){ + printf("[Error]: error in setupTransportMinimumMessageSizeMax setting message_size_max to WAN\n"); + return false; + } + } + #ifdef PERFTEST_CONNEXT_PRO_610 + if (transport.transportConfig.kind == TRANSPORT_UDPv4_WAN) { + if (!setTransportMessageSizeMax("UDPv4_WAN", transport, qos, transportMessageSizeMax)){ + printf("[Error]: error in setupTransportMinimumMessageSizeMax setting message_size_max to UDPv4_WAN\n"); + return false; + } + } + #endif + + } else { + if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_SHMEM) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax("SHMEM", transport, qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_UDPv4) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax("UDPv4", transport, qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_UDPv6) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax("UDPv6", transport, qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if (transport.transportConfig.kind == TRANSPORT_TCPv4 + || transport.transportConfig.kind == TRANSPORT_TLSv4) { + transportMessageSizeMax = getTransportMessageSizeMax("TCP", transport, qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if (transport.transportConfig.kind == TRANSPORT_DTLSv4) { + transportMessageSizeMax = getTransportMessageSizeMax("DTLS", transport, qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } - } else if (transport.transportConfig.kind == TRANSPORT_WANv4) { - transportMessageSizeMax = getTransportMessageSizeMax("WAN", transport, qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transport.transportConfig.kind == TRANSPORT_WANv4) { + transportMessageSizeMax = getTransportMessageSizeMax("WAN", transport, qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + #ifdef PERFTEST_CONNEXT_PRO_610 + if (transport.transportConfig.kind == TRANSPORT_UDPv4_WAN) { + transportMessageSizeMax = getTransportMessageSizeMax("UDPv4_WAN", transport, qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } + #endif + transport.loggingString += ("\tmessage_size_max: " + + std::to_string(qosConfigurationMessageSizeMax) + + " (minimum across all transports)\n"); } - transport.minimumMessageSizeMax = transportMessageSizeMax; + transport.minimumMessageSizeMax = qosConfigurationMessageSizeMax; + return true; } bool PerftestConfigureTransport( PerftestTransport &transport, DDS_DomainParticipantQos &qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { /* @@ -901,6 +1000,14 @@ bool PerftestConfigureTransport( "UDPv4 & UDPv6 & SHMEM", "dds.transport.UDPv4.builtin"); break; + #ifdef PERFTEST_CONNEXT_PRO_610 + case DDS_TRANSPORTBUILTIN_UDPv4_WAN: + transport.transportConfig = TransportConfig( + TRANSPORT_UDPv4_WAN, + "UDPv4_WAN", + "dds.transport.UDPv4_WAN.builtin"); + break; + #endif default: /* * This would mean that the mask is either empty or a @@ -930,11 +1037,12 @@ bool PerftestConfigureTransport( }; /* - * Once the configurations have been stablished, we can get the + * Once the configurations have been established, we can get the * MessageSizeMax for the Transport, which should be the minimum of - * all the enabled transports + * all the enabled transports, unless the message size max has been + * provided, which will be used instead. */ - getTransportMinimumMessageSizeMax(transport, qos); + setupTransportMinimumMessageSizeMax(parameterManager, transport, qos); switch (transport.transportConfig.kind) { @@ -943,7 +1051,7 @@ bool PerftestConfigureTransport( break; case TRANSPORT_SHMEM: - if (!configureShmemTransport(transport, qos, _PM)) { + if (!configureShmemTransport(transport, qos, parameterManager)) { fprintf(stderr, "%s Failed to configure SHMEM plugin\n", classLoggingString.c_str()); @@ -952,7 +1060,7 @@ bool PerftestConfigureTransport( break; case TRANSPORT_TCPv4: - if (!configureTcpTransport(transport, qos, _PM)) { + if (!configureTcpTransport(transport, qos, parameterManager)) { fprintf(stderr, "%s Failed to configure TCP plugin\n", classLoggingString.c_str()); @@ -961,7 +1069,7 @@ bool PerftestConfigureTransport( break; case TRANSPORT_TLSv4: - if (!configureTcpTransport(transport, qos, _PM)) { + if (!configureTcpTransport(transport, qos, parameterManager)) { fprintf(stderr, "%s Failed to configure TCP + TLS plugin\n", classLoggingString.c_str()); @@ -970,7 +1078,7 @@ bool PerftestConfigureTransport( break; case TRANSPORT_DTLSv4: - if (!configureDtlsTransport(transport, qos, _PM)) { + if (!configureDtlsTransport(transport, qos, parameterManager)) { fprintf(stderr, "%s Failed to configure DTLS plugin\n", classLoggingString.c_str()); @@ -979,7 +1087,7 @@ bool PerftestConfigureTransport( break; case TRANSPORT_WANv4: - if (!configureWanTransport(transport, qos, _PM)) { + if (!configureWanTransport(transport, qos, parameterManager)) { fprintf(stderr, "%s Failed to configure WAN plugin\n", classLoggingString.c_str()); @@ -988,7 +1096,7 @@ bool PerftestConfigureTransport( break; #ifdef PERFTEST_CONNEXT_PRO_610 case TRANSPORT_UDPv4_WAN: - if (!configureUdpv4WanTransport(transport, qos, _PM)) { + if (!configureUdpv4WanTransport(transport, qos, parameterManager)) { fprintf(stderr, "%s Failed to configure UDPv4_WAN plugin\n", classLoggingString.c_str()); @@ -1004,7 +1112,7 @@ bool PerftestConfigureTransport( */ if ((qos.transport_builtin.mask & DDS_TRANSPORTBUILTIN_SHMEM) != 0) { - if (!configureShmemTransport(transport, qos, _PM)) { + if (!configureShmemTransport(transport, qos, parameterManager)) { fprintf(stderr, "%s Failed to configure SHMEM plugin\n", classLoggingString.c_str()); @@ -1021,15 +1129,15 @@ bool PerftestConfigureTransport( */ if (transport.transportConfig.kind != TRANSPORT_NOT_SET && transport.transportConfig.kind != TRANSPORT_SHMEM) { - if (!setAllowInterfacesList(transport, qos, _PM)) { + if (!setAllowInterfacesList(transport, qos, parameterManager)) { return false; } } else { // We are not using the allow interface string, so it is clean - _PM->set("allowInterfaces", std::string("")); + parameterManager->set("allowInterfaces", std::string("")); } - if (!setTransportVerbosity(transport, qos, _PM)) { + if (!setTransportVerbosity(transport, qos, parameterManager)) { return false; } @@ -1040,7 +1148,7 @@ bool PerftestConfigureTransport( bool PerftestConfigureSecurity( PerftestSecurity &security, DDS_DomainParticipantQos &qos, - ParameterManager *_PM) + ParameterManager *parameterManager) { if (!addPropertyToParticipantQos( @@ -1067,7 +1175,7 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.library", - _PM->get("secureLibrary"))) { + parameterManager->get("secureLibrary"))) { return false; } @@ -1106,14 +1214,14 @@ bool PerftestConfigureSecurity( // In the case where we are dynamic, we should not set these properties if // we are using the lightweight security library. - if (!_PM->is_set("lightWeightSecurity") - && !_PM->is_set("secureRtpsHmacOnly")) { + if (!parameterManager->is_set("lightWeightSecurity") + && !parameterManager->is_set("secureRtpsHmacOnly")) { // check if governance file provided - if (!_PM->get("secureGovernanceFile").empty()) { + if (!parameterManager->get("secureGovernanceFile").empty()) { if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.access_control.governance_file", - _PM->get("secureGovernanceFile"))) { + parameterManager->get("secureGovernanceFile"))) { return false; } } else { @@ -1126,7 +1234,7 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.access_control.permissions_file", - _PM->get("securePermissionsFile"))) { + parameterManager->get("securePermissionsFile"))) { return false; } @@ -1134,7 +1242,7 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.access_control.permissions_authority_file", - _PM->get("secureCertAuthority"))) { + parameterManager->get("secureCertAuthority"))) { return false; } @@ -1142,7 +1250,7 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.authentication.ca_file", - _PM->get("secureCertAuthority"))) { + parameterManager->get("secureCertAuthority"))) { return false; } @@ -1150,7 +1258,7 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.authentication.certificate_file", - _PM->get("secureCertFile"))) { + parameterManager->get("secureCertFile"))) { return false; } @@ -1165,15 +1273,15 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.authentication.private_key_file", - _PM->get("securePrivateKey"))) { + parameterManager->get("securePrivateKey"))) { return false; } - if (_PM->is_set("secureEncryptionAlgo")) { + if (parameterManager->is_set("secureEncryptionAlgo")) { if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.cryptography.encryption_algorithm", - _PM->get("secureEncryptionAlgo"))) { + parameterManager->get("secureEncryptionAlgo"))) { return false; } } @@ -1181,20 +1289,20 @@ bool PerftestConfigureSecurity( #endif // !defined(RTI_LW_SECURE_PERFTEST) - if (_PM->is_set("securePSK") || _PM->is_set("securePSKAlgorithm")) { + if (parameterManager->is_set("securePSK") || parameterManager->is_set("securePSKAlgorithm")) { - if (!_PM->is_set("securePSK")) { - _PM->set("securePSK", "DefaultValue"); + if (!parameterManager->is_set("securePSK")) { + parameterManager->set("securePSK", "DefaultValue"); } if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.dds.sec.crypto.rtps_psk_secret_passphrase", - _PM->get("securePSK").c_str())) { + parameterManager->get("securePSK").c_str())) { return false; } - if (_PM->get("securePSKAlgorithm").find("GMAC") != std::string::npos) { + if (parameterManager->get("securePSKAlgorithm").find("GMAC") != std::string::npos) { if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.dds.sec.access.rtps_psk_protection_kind", @@ -1206,13 +1314,13 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.cryptography.rtps_psk_symmetric_cipher_algorithm", - _PM->get("securePSKAlgorithm").c_str())) { + parameterManager->get("securePSKAlgorithm").c_str())) { return false; } } - if (_PM->is_set("secureRtpsHmacOnly")) { + if (parameterManager->is_set("secureRtpsHmacOnly")) { if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.hmac_only.enabled", @@ -1222,12 +1330,12 @@ bool PerftestConfigureSecurity( if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.hmac_only.cryptography.key", - _PM->get("secureRtpsHmacOnly").c_str())) { + parameterManager->get("secureRtpsHmacOnly").c_str())) { return false; } } - if (_PM->is_set("secureEnableAAD")) { + if (parameterManager->is_set("secureEnableAAD")) { if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.cryptography.enable_additional_authenticated_data", @@ -1236,12 +1344,12 @@ bool PerftestConfigureSecurity( } } - if (_PM->is_set("secureDebug")) { + if (parameterManager->is_set("secureDebug")) { // private key if (!addPropertyToParticipantQos( qos, "com.rti.serv.secure.logging.log_level", - perftest::to_string(_PM->get("secureDebug")))) { + perftest::to_string(parameterManager->get("secureDebug")))) { return false; } } diff --git a/srcCpp/connextDDS/pro/Infrastructure_pro.h b/srcCpp/connextDDS/pro/Infrastructure_pro.h index 0a81614a..67246164 100644 --- a/srcCpp/connextDDS/pro/Infrastructure_pro.h +++ b/srcCpp/connextDDS/pro/Infrastructure_pro.h @@ -175,13 +175,13 @@ struct PerftestThread* PerftestThread_new( bool PerftestConfigureTransport( PerftestTransport &transport, DDS_DomainParticipantQos &qos, - ParameterManager *_PM); + ParameterManager *parameterManager); #ifdef RTI_SECURE_PERFTEST bool PerftestConfigureSecurity( PerftestSecurity &security, DDS_DomainParticipantQos &qos, - ParameterManager *_PM); + ParameterManager *parameterManager); #endif #endif /* INFRASTRUCTURE_PRO_H_ */ diff --git a/srcCpp/perftest_cpp.cxx b/srcCpp/perftest_cpp.cxx index 4f606caf..65305d7b 100644 --- a/srcCpp/perftest_cpp.cxx +++ b/srcCpp/perftest_cpp.cxx @@ -704,7 +704,7 @@ void perftest_cpp::print_configuration() } } else if (_PM.get("batchSize") == -2) { stringStream << "\t\t BatchSize cannot be used with\n" - << "\t\t Large Data.\n"; + << "\t\t Fragmented Samples.\n"; } else if (_PM.get("batchSize") == -3) { stringStream << "\t\t BatchSize cannot be used with\n" << "\t\t FlatData and/or Zero-Copy.\n"; diff --git a/srcCpp11/PerftestTransport.cxx b/srcCpp11/PerftestTransport.cxx index a9d035be..9c60bd61 100644 --- a/srcCpp11/PerftestTransport.cxx +++ b/srcCpp11/PerftestTransport.cxx @@ -34,11 +34,11 @@ void setAllowInterfacesList( PerftestTransport &transport, dds::domain::qos::DomainParticipantQos &qos, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { using namespace rti::core::policy; - if (!_PM->get("allowInterfaces").empty()) { + if (!parameterManager->get("allowInterfaces").empty()) { if (transport.transportConfig.kind == TRANSPORT_NOT_SET) { fprintf(stderr, @@ -56,12 +56,12 @@ void setAllowInterfacesList( std::string propertyName = "dds.transport.UDPv4.builtin.parent.allow_interfaces"; qos_properties[propertyName] = - _PM->get("allowInterfaces"); + parameterManager->get("allowInterfaces"); propertyName = "dds.transport.UDPv6.builtin.parent.allow_interfaces"; qos_properties[propertyName] = - _PM->get("allowInterfaces"); + parameterManager->get("allowInterfaces"); } else { @@ -74,7 +74,7 @@ void setAllowInterfacesList( propertyName += ".parent.allow_interfaces"; qos_properties[propertyName] = - _PM->get("allowInterfaces"); + parameterManager->get("allowInterfaces"); } } } @@ -83,11 +83,11 @@ void setTransportVerbosity( PerftestTransport &transport, dds::domain::qos::DomainParticipantQos &qos, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { using namespace rti::core::policy; - if (!_PM->get("transportVerbosity").empty()) { + if (!parameterManager->get("transportVerbosity").empty()) { if (transport.transportConfig.kind == TRANSPORT_NOT_SET) { fprintf(stderr, @@ -116,60 +116,60 @@ void setTransportVerbosity( } qos_properties[propertyName] = - _PM->get("transportVerbosity"); + parameterManager->get("transportVerbosity"); } } void configureSecurityFiles( PerftestTransport &transport, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { - if (!_PM->get("transportCertAuthority").empty()) { + if (!parameterManager->get("transportCertAuthority").empty()) { qos_properties[transport.transportConfig.prefixString + ".tls.verify.ca_file"] = - _PM->get("transportCertAuthority"); + parameterManager->get("transportCertAuthority"); } - if (!_PM->get("transportCertFile").empty()) { + if (!parameterManager->get("transportCertFile").empty()) { qos_properties[transport.transportConfig.prefixString + ".tls.identity.certificate_chain_file"] = - _PM->get("transportCertFile"); + parameterManager->get("transportCertFile"); } - if (!_PM->get("transportPrivateKey").empty()) { + if (!parameterManager->get("transportPrivateKey").empty()) { qos_properties[transport.transportConfig.prefixString + ".tls.identity.private_key_file"] = - _PM->get("transportPrivateKey"); + parameterManager->get("transportPrivateKey"); } } bool configureTcpTransport( PerftestTransport &transport, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { qos_properties["dds.transport.load_plugins"] = transport.transportConfig.prefixString; - if (!_PM->get("transportServerBindPort").empty()) { + if (!parameterManager->get("transportServerBindPort").empty()) { qos_properties[transport.transportConfig.prefixString + ".server_bind_port"] = - _PM->get("transportServerBindPort"); + parameterManager->get("transportServerBindPort"); } - if (_PM->get("transportWan")) { + if (parameterManager->get("transportWan")) { qos_properties[transport.transportConfig.prefixString + ".parent.classid"] = "NDDS_TRANSPORT_CLASSID_TCPV4_WAN"; - if (_PM->get("transportServerBindPort") != "0") { - if (!_PM->get("transportPublicAddress").empty()) { + if (parameterManager->get("transportServerBindPort") != "0") { + if (!parameterManager->get("transportPublicAddress").empty()) { qos_properties[transport.transportConfig.prefixString + ".public_address"] = - _PM->get("transportPublicAddress"); + parameterManager->get("transportPublicAddress"); } else { fprintf(stderr, "%s Public Address is required if " @@ -182,7 +182,7 @@ bool configureTcpTransport( if (transport.transportConfig.kind == TRANSPORT_TLSv4) { - if (_PM->get("transportWan")) { + if (parameterManager->get("transportWan")) { qos_properties[transport.transportConfig.prefixString + ".parent.classid"] = "NDDS_TRANSPORT_CLASSID_TLSV4_WAN"; } else { @@ -190,7 +190,7 @@ bool configureTcpTransport( + ".parent.classid"] = "NDDS_TRANSPORT_CLASSID_TLSV4_LAN"; } - configureSecurityFiles(transport, qos_properties, _PM); + configureSecurityFiles(transport, qos_properties, parameterManager); } return true; @@ -199,7 +199,7 @@ bool configureTcpTransport( void configureDtlsTransport( PerftestTransport &transport, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { qos_properties["dds.transport.load_plugins"] = transport.transportConfig .prefixString; @@ -210,13 +210,13 @@ void configureDtlsTransport( qos_properties[transport.transportConfig.prefixString + ".create_function"] = "NDDS_Transport_DTLS_create"; - configureSecurityFiles(transport, qos_properties, _PM); + configureSecurityFiles(transport, qos_properties, parameterManager); } bool configureWanTransport( PerftestTransport &transport, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { qos_properties["dds.transport.load_plugins"] = @@ -228,10 +228,10 @@ bool configureWanTransport( qos_properties[transport.transportConfig.prefixString + ".create_function"] = "NDDS_Transport_WAN_create"; - if (!_PM->get("transportWanServerAddress").empty()) { + if (!parameterManager->get("transportWanServerAddress").empty()) { qos_properties[transport.transportConfig.prefixString + ".server"] = - _PM->get("transportWanServerAddress"); + parameterManager->get("transportWanServerAddress"); } else { fprintf(stderr, "%s Wan Server Address is required\n", @@ -239,38 +239,91 @@ bool configureWanTransport( return false; } - if (!_PM->get("transportWanServerPort").empty()) { + if (!parameterManager->get("transportWanServerPort").empty()) { qos_properties[transport.transportConfig.prefixString + ".server_port"] = - _PM->get("transportWanServerPort"); + parameterManager->get("transportWanServerPort"); } - if (!_PM->get("transportWanId").empty()) { + if (!parameterManager->get("transportWanId").empty()) { qos_properties[transport.transportConfig.prefixString + ".transport_instance_id"] = - _PM->get("transportWanId"); + parameterManager->get("transportWanId"); } else { fprintf(stderr, "%s Wan ID is required\n", classLoggingString.c_str()); return false; } - if (_PM->get("transportSecureWan")) { + if (parameterManager->get("transportSecureWan")) { qos_properties[transport.transportConfig.prefixString + ".enable_security"] = "1"; - configureSecurityFiles(transport, qos_properties, _PM); + configureSecurityFiles(transport, qos_properties, parameterManager); } return true; } + +#ifdef PERFTEST_CONNEXT_PRO_610 +bool configureUdpv4WanTransport( + PerftestTransport &transport, + std::map &qos_properties, + ParameterManager *parameterManager) +{ + + if (!parameterManager->get("transportPublicAddress").empty()) { + + std::string publicAddress + = parameterManager->get("transportPublicAddress"); + std::string delimiter = ":"; + + size_t pos = publicAddress.find(delimiter); + if (pos == std::string::npos) { + fprintf(stderr, + "%s Wan Public Address format invalid. Use " + ":\n", + classLoggingString.c_str()); + return false; + } + + std::string publicAddressIp + = publicAddress.substr(0, pos); + std::string publicAddressPort + = publicAddress.substr(pos+1, std::string::npos); + + // If transportHostPort is defined use that port for the transport + std::string publicAddressHostPort; + if (!parameterManager->get("transportHostPort").empty()) { + std::string transportHostPort = parameterManager->get("transportHostPort"); + publicAddressHostPort = transportHostPort; + } else { // Use Internal Port as external port + publicAddressHostPort = publicAddressPort; + } + + qos_properties[transport.transportConfig.prefixString + ".public_address"] = publicAddressIp; + + std::string json_string_comm_ports( + "{ \"default\": { \"host\": " + + publicAddressHostPort + + ", \"public\": " + + publicAddressPort + + " } }"); + + qos_properties[transport.transportConfig.prefixString + ".comm_ports"] = json_string_comm_ports; + } + + return true; +} +#endif // PERFTEST_CONNEXT_PRO_610 + void configureShmemTransport( PerftestTransport &transport, dds::domain::qos::DomainParticipantQos &qos, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { using namespace rti::core::policy; - unsigned long long datalen = _PM->get("dataLen"); + unsigned long long datalen = parameterManager->get("dataLen"); long parentMsgSizeMax = transport.minimumMessageSizeMax; std::ostringstream ss; @@ -292,7 +345,7 @@ void configureShmemTransport( > (unsigned long long) parentMsgSizeMax) { parentMsgSizeMax = datalen + MESSAGE_OVERHEAD_BYTES; - if (_PM->get("flatdata")) { + if (parameterManager->get("flatdata")) { /* * TODO: This should not be needed after adding changes for #265 * Rework idls to handle better custom types and Flat Data @@ -413,7 +466,7 @@ void configureShmemTransport( #ifdef RTI_FLATDATA_AVAILABLE // Zero Copy sends 16-byte references - if (_PM->get("zerocopy")) { + if (parameterManager->get("zerocopy")) { datalen = 16; } #endif @@ -430,7 +483,7 @@ void configureShmemTransport( 1ull, (datalen / fragmentSize) + 1); unsigned long long receivedMessageCountMax = - 2 * (_PM->get("sendQueueSize") + 1) * rtpsMessagesPerSample; + 2 * (parameterManager->get("sendQueueSize") + 1) * rtpsMessagesPerSample; unsigned long long receiveBufferSize = (std::min)( (unsigned long long) maxBufferSize, @@ -481,14 +534,33 @@ long getTransportMessageSizeMax( } } +/* + * Sets the MessageSizeMax given the name (String) of a transport in a + * property object. + */ +void setTransportMessageSizeMax( + std::string targetTransportName, + PerftestTransport &transport, + std::map &qos_properties, + long messageSizeMax) +{ + std::string propertyName = + transport.transportConfigMap[targetTransportName].prefixString + + ".parent.message_size_max"; + + qos_properties[propertyName] = std::to_string(messageSizeMax); + +} + /* * Configures the minimumMessageSizeMax value in the PerftestTransport object with * the minimum value for all the enabled transports in the XML configuration. */ -void getTransportMinimumMessageSizeMax( +bool setupTransportMinimumMessageSizeMax( PerftestTransport &transport, dds::domain::qos::DomainParticipantQos &qos, - std::map &qos_properties) + std::map &qos_properties, + ParameterManager *parameterManager) { using namespace rti::core::policy; @@ -496,71 +568,125 @@ void getTransportMinimumMessageSizeMax( long transportMessageSizeMax = MESSAGE_SIZE_MAX_NOT_SET; TransportBuiltinMask mask = qos.policy().mask(); - if ((mask & TransportBuiltinMask::shmem()) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax("SHMEM", transport, qos_properties); + if (parameterManager->is_set("messageSizeMax")) { - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; - } - } - if ((mask & TransportBuiltinMask::udpv4()) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax( - "UDPv4", - transport, - qos_properties); + transportMessageSizeMax = parameterManager->get("messageSizeMax"); + qosConfigurationMessageSizeMax = transportMessageSizeMax; + transport.loggingString += ("\tmessage_size_max: " + + std::to_string(transportMessageSizeMax) + + " (set via command line)\n"); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if ((mask & TransportBuiltinMask::shmem()) != 0) { + setTransportMessageSizeMax("SHMEM", transport, qos_properties, transportMessageSizeMax); } - } - if ((mask & TransportBuiltinMask::udpv6()) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax( - "UDPv6", - transport, - qos_properties); + if ((mask & TransportBuiltinMask::udpv4()) != 0) { + setTransportMessageSizeMax("UDPv4", transport, qos_properties, transportMessageSizeMax); + } + if ((mask & TransportBuiltinMask::udpv6()) != 0) { + setTransportMessageSizeMax("UDPv6", transport, qos_properties, transportMessageSizeMax); + } + if (transport.transportConfig.kind == TRANSPORT_TCPv4 + || transport.transportConfig.kind == TRANSPORT_TLSv4) { + setTransportMessageSizeMax("TCP", transport, qos_properties, transportMessageSizeMax); + } + if (transport.transportConfig.kind == TRANSPORT_DTLSv4) { + setTransportMessageSizeMax("DTLS", transport, qos_properties, transportMessageSizeMax); + } + if (transport.transportConfig.kind == TRANSPORT_WANv4) { + setTransportMessageSizeMax("WAN", transport, qos_properties, transportMessageSizeMax); + } + #ifdef PERFTEST_CONNEXT_PRO_610 + if (transport.transportConfig.kind == TRANSPORT_UDPv4_WAN) { + setTransportMessageSizeMax("UDPv4_WAN", transport, qos_properties, transportMessageSizeMax); + } + #endif + + } else { + + if ((mask & TransportBuiltinMask::shmem()) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax("SHMEM", transport, qos_properties); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } - } - if (transport.transportConfig.kind == TRANSPORT_TCPv4 - || transport.transportConfig.kind == TRANSPORT_TLSv4) { - transportMessageSizeMax = getTransportMessageSizeMax( - "TCP", - transport, - qos_properties); - - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if ((mask & TransportBuiltinMask::udpv4()) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax( + "UDPv4", + transport, + qos_properties); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } - } else if (transport.transportConfig.kind == TRANSPORT_DTLSv4) { - transportMessageSizeMax = getTransportMessageSizeMax( - "DTLS", - transport, - qos_properties); - - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if ((mask & TransportBuiltinMask::udpv6()) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax( + "UDPv6", + transport, + qos_properties); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } - } else if (transport.transportConfig.kind == TRANSPORT_WANv4) { - transportMessageSizeMax = getTransportMessageSizeMax( - "WAN", - transport, - qos_properties); - - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transport.transportConfig.kind == TRANSPORT_TCPv4 + || transport.transportConfig.kind == TRANSPORT_TLSv4) { + transportMessageSizeMax = getTransportMessageSizeMax( + "TCP", + transport, + qos_properties); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if (transport.transportConfig.kind == TRANSPORT_DTLSv4) { + transportMessageSizeMax = getTransportMessageSizeMax( + "DTLS", + transport, + qos_properties); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if (transport.transportConfig.kind == TRANSPORT_WANv4) { + transportMessageSizeMax = getTransportMessageSizeMax( + "WAN", + transport, + qos_properties); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + #ifdef PERFTEST_CONNEXT_PRO_610 + if (transport.transportConfig.kind == TRANSPORT_UDPv4_WAN) { + transportMessageSizeMax = getTransportMessageSizeMax( + "UDPv4_WAN", + transport, + qos_properties); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } + #endif + transport.loggingString += ("\tmessage_size_max: " + + std::to_string(qosConfigurationMessageSizeMax) + + " (minimum across all transports)\n"); } - transport.minimumMessageSizeMax = transportMessageSizeMax; + transport.minimumMessageSizeMax = qosConfigurationMessageSizeMax; + return true; } bool configureTransport( PerftestTransport &transport, dds::domain::qos::DomainParticipantQos &qos, std::map &qos_properties, - ParameterManager *_PM) + ParameterManager *parameterManager) { using namespace rti::core::policy; @@ -615,7 +741,14 @@ bool configureTransport( "UDPv4 & UDPv6 & SHMEM", "dds.transport.UDPv4.builtin"); } - + #ifdef PERFTEST_CONNEXT_PRO_610 + else if (mask == TransportBuiltinMask::udpv4_wan()) { + transport.transportConfig = TransportConfig( + TRANSPORT_UDPv4_WAN, + "UDPv4_WAN", + "dds.transport.UDPv4_WAN.builtin"); + } + #endif /* * If we do not enter in any of these if statements, it * would mean that the mask is either empty or a @@ -642,6 +775,13 @@ bool configureTransport( qos << rti::core::policy::TransportBuiltin( TransportBuiltinMask::shmem()); break; + + #ifdef PERFTEST_CONNEXT_PRO_610 + case TRANSPORT_UDPv4_WAN: + qos << rti::core::policy::TransportBuiltin( + TransportBuiltinMask::udpv4_wan()); + break; + #endif // PERFTEST_CONNEXT_PRO_610 default: break; @@ -652,7 +792,7 @@ bool configureTransport( * MessageSizeMax for the Transport, which should be the minimum of * all the enabled transports */ - getTransportMinimumMessageSizeMax(transport, qos, qos_properties); + setupTransportMinimumMessageSizeMax(transport, qos, qos_properties, parameterManager); switch (transport.transportConfig.kind) { @@ -661,11 +801,17 @@ bool configureTransport( break; case TRANSPORT_SHMEM: - configureShmemTransport(transport, qos, qos_properties, _PM); + configureShmemTransport(transport, qos, qos_properties, parameterManager); + break; + + #ifdef PERFTEST_CONNEXT_PRO_610 + case TRANSPORT_UDPv4_WAN: + configureUdpv4WanTransport(transport, qos_properties, parameterManager); break; + #endif // PERFTEST_CONNEXT_PRO_610 case TRANSPORT_TCPv4: - if (!configureTcpTransport(transport, qos_properties, _PM)) { + if (!configureTcpTransport(transport, qos_properties, parameterManager)) { fprintf(stderr, "%s Failed to configure TCP plugin\n", classLoggingString.c_str()); @@ -676,7 +822,7 @@ bool configureTransport( break; case TRANSPORT_TLSv4: - if (!configureTcpTransport(transport, qos_properties, _PM)) { + if (!configureTcpTransport(transport, qos_properties, parameterManager)) { fprintf(stderr, "%s Failed to configure TCP + TLS plugin\n", classLoggingString.c_str()); @@ -687,13 +833,13 @@ bool configureTransport( break; case TRANSPORT_DTLSv4: - configureDtlsTransport(transport, qos_properties, _PM); + configureDtlsTransport(transport, qos_properties, parameterManager); qos << TransportBuiltin( TransportBuiltinMask::none()); break; case TRANSPORT_WANv4: - if (!configureWanTransport(transport, qos_properties, _PM)) { + if (!configureWanTransport(transport, qos_properties, parameterManager)) { fprintf(stderr, "%s Failed to configure Wan plugin\n", classLoggingString.c_str()); @@ -711,7 +857,7 @@ bool configureTransport( */ TransportBuiltinMask mask = qos.policy().mask(); if ((mask & TransportBuiltinMask::shmem()) != 0) { - configureShmemTransport(transport, qos, qos_properties, _PM); + configureShmemTransport(transport, qos, qos_properties, parameterManager); } break; @@ -724,13 +870,13 @@ bool configureTransport( */ if (transport.transportConfig.kind != TRANSPORT_NOT_SET && transport.transportConfig.kind != TRANSPORT_SHMEM) { - setAllowInterfacesList(transport, qos, qos_properties, _PM); + setAllowInterfacesList(transport, qos, qos_properties, parameterManager); } else { // We are not using the allow interface string, so it is clean - _PM->set("allowInterfaces", std::string("")); + parameterManager->set("allowInterfaces", std::string("")); } - setTransportVerbosity(transport, qos, qos_properties, _PM); + setTransportVerbosity(transport, qos, qos_properties, parameterManager); return true; } @@ -742,8 +888,7 @@ PerftestTransport::PerftestTransport() { multicastAddrMap[LATENCY_TOPIC_NAME] = TRANSPORT_MULTICAST_ADDR_LATENCY; - multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = - TRANSPORT_MULTICAST_ADDR_ANNOUNCEMENT; + multicastAddrMap[ANNOUNCEMENT_TOPIC_NAME] = TRANSPORT_MULTICAST_ADDR_ANNOUNCEMENT; multicastAddrMap[THROUGHPUT_TOPIC_NAME] = TRANSPORT_MULTICAST_ADDR_THROUGHPUT; transportConfigMap["Use XML"] = TransportConfig( @@ -789,7 +934,7 @@ PerftestTransport::~PerftestTransport() void PerftestTransport::initialize(ParameterManager *PM) { - _PM = PM; + parameterManager = PM; } /******************************************************************************/ @@ -820,24 +965,24 @@ bool PerftestTransport::setTransport(std::string transportString) void PerftestTransport::populateSecurityFiles() { - if (_PM->get("transportCertFile").empty()) { - if (_PM->get("pub")) { - _PM->set("transportCertFile", TRANSPORT_CERTIFICATE_FILE_PUB); + if (parameterManager->get("transportCertFile").empty()) { + if (parameterManager->get("pub")) { + parameterManager->set("transportCertFile", TRANSPORT_CERTIFICATE_FILE_PUB); } else { - _PM->set("transportCertFile", TRANSPORT_CERTIFICATE_FILE_SUB); + parameterManager->set("transportCertFile", TRANSPORT_CERTIFICATE_FILE_SUB); } } - if (_PM->get("transportPrivateKey").empty()) { - if (_PM->get("pub")) { - _PM->set("transportPrivateKey", TRANSPORT_PRIVATEKEY_FILE_PUB); + if (parameterManager->get("transportPrivateKey").empty()) { + if (parameterManager->get("pub")) { + parameterManager->set("transportPrivateKey", TRANSPORT_PRIVATEKEY_FILE_PUB); } else { - _PM->set("transportPrivateKey", TRANSPORT_PRIVATEKEY_FILE_SUB); + parameterManager->set("transportPrivateKey", TRANSPORT_PRIVATEKEY_FILE_SUB); } } - if (_PM->get("transportCertAuthority").empty()) { - _PM->set("transportCertAuthority", TRANSPORT_CERTAUTHORITY_FILE); + if (parameterManager->get("transportCertAuthority").empty()) { + parameterManager->set("transportCertAuthority", TRANSPORT_CERTAUTHORITY_FILE); } } @@ -854,22 +999,22 @@ std::string PerftestTransport::printTransportConfigurationSummary() } stringStream << std::endl; - if (!_PM->get("allowInterfaces").empty()) { + if (!parameterManager->get("allowInterfaces").empty()) { stringStream << "\tNic: " - << _PM->get("allowInterfaces") + << parameterManager->get("allowInterfaces") << "\n"; } stringStream << "\tUse Multicast: " - << ((allowsMulticast() && _PM->get("multicast")) + << ((allowsMulticast() && parameterManager->get("multicast")) ? "True" : "False"); - if (!allowsMulticast() && _PM->get("multicast")) { + if (!allowsMulticast() && parameterManager->get("multicast")) { stringStream << " (Multicast is not supported for " << transportConfig.nameString << ")"; } stringStream << "\n"; - if (_PM->is_set("multicastAddr")) { + if (parameterManager->is_set("multicastAddr")) { stringStream << "\tUsing custom Multicast Addresses:" << "\n\t\tThroughtput Address: " << multicastAddrMap[THROUGHPUT_TOPIC_NAME].c_str() @@ -887,29 +1032,29 @@ std::string PerftestTransport::printTransportConfigurationSummary() if (transportConfig.kind == TRANSPORT_TCPv4 || transportConfig.kind == TRANSPORT_TLSv4) { stringStream << "\tTCP Server Bind Port: " - << _PM->get("transportServerBindPort") + << parameterManager->get("transportServerBindPort") << "\n"; stringStream << "\tTCP LAN/WAN mode: " - << (_PM->get("transportWan") ? "WAN\n" : "LAN\n"); - if (_PM->get("transportWan")) { + << (parameterManager->get("transportWan") ? "WAN\n" : "LAN\n"); + if (parameterManager->get("transportWan")) { stringStream << "\tTCP Public Address: " - << _PM->get("transportPublicAddress") + << parameterManager->get("transportPublicAddress") << "\n"; } } if (transportConfig.kind == TRANSPORT_WANv4) { stringStream << "\tWAN Server Address: " - << _PM->get("transportWanServerAddress") + << parameterManager->get("transportWanServerAddress") << ":" - << _PM->get("transportWanServerPort") + << parameterManager->get("transportWanServerPort") << "\n"; stringStream << "\tWAN Id: " - << _PM->get("transportWanId") + << parameterManager->get("transportWanId") << "\n"; stringStream << "\tWAN Secure: " - << _PM->get("transportSecureWan") + << parameterManager->get("transportSecureWan") << "\n"; } @@ -917,21 +1062,21 @@ std::string PerftestTransport::printTransportConfigurationSummary() if (transportConfig.kind == TRANSPORT_TLSv4 || transportConfig.kind == TRANSPORT_DTLSv4 || (transportConfig.kind == TRANSPORT_WANv4 - && _PM->get("transportSecureWan"))) { + && parameterManager->get("transportSecureWan"))) { stringStream << "\tCertificate authority file: " - << _PM->get("transportCertAuthority") + << parameterManager->get("transportCertAuthority") << "\n"; stringStream << "\tCertificate file: " - << _PM->get("transportCertFile") + << parameterManager->get("transportCertFile") << "\n"; stringStream << "\tPrivate key file: " - << _PM->get("transportPrivateKey") + << parameterManager->get("transportPrivateKey") << "\n"; } - if (!_PM->get("transportVerbosity").empty()) { + if (!parameterManager->get("transportVerbosity").empty()) { stringStream << "\tVerbosity: " - << _PM->get("transportVerbosity") + << parameterManager->get("transportVerbosity") << "\n"; } @@ -950,12 +1095,12 @@ bool PerftestTransport::validate_input() * "-allowInterfaces" and "-nic" are the same parameter, * so now use only one: "allowInterfaces" */ - if (_PM->get("allowInterfaces").empty()) { - _PM->set("allowInterfaces", _PM->get("nic")); + if (parameterManager->get("allowInterfaces").empty()) { + parameterManager->set("allowInterfaces", parameterManager->get("nic")); } // Manage parameter -transport - if (!setTransport(_PM->get("transport"))) { + if (!setTransport(parameterManager->get("transport"))) { fprintf(stderr, "%s Error Setting the transport\n", classLoggingString.c_str()); @@ -963,13 +1108,13 @@ bool PerftestTransport::validate_input() } // Manage parameter -multicastAddr - if(_PM->is_set("multicastAddr")) { + if(parameterManager->is_set("multicastAddr")) { if (!parse_multicast_addresses( - _PM->get("multicastAddr").c_str())) { + parameterManager->get("multicastAddr").c_str())) { fprintf(stderr, "Error parsing -multicastAddr\n"); return false; } - _PM->set("multicast", true); + parameterManager->set("multicast", true); } // We only need to set the secure properties for this diff --git a/srcCpp11/PerftestTransport.h b/srcCpp11/PerftestTransport.h index 01a19488..4d74d773 100644 --- a/srcCpp11/PerftestTransport.h +++ b/srcCpp11/PerftestTransport.h @@ -73,6 +73,7 @@ enum Transport { TRANSPORT_TLSv4, TRANSPORT_DTLSv4, TRANSPORT_WANv4, + TRANSPORT_UDPv4_WAN, TRANSPORT_SHMEM, TRANSPORT_UDPv4_SHMEM, TRANSPORT_UDPv4_UDPv6, @@ -159,7 +160,7 @@ class PerftestTransport { private: std::map multicastAddrMap; - ParameterManager *_PM; + ParameterManager *parameterManager; /**************************************************************************/ bool setTransport(std::string transportString); @@ -178,6 +179,6 @@ bool configureTransport( PerftestTransport &transport, dds::domain::qos::DomainParticipantQos &qos, std::map &properties, - ParameterManager *_PM); + ParameterManager *parameterManager); #endif /* PERFTEST_2_0_SRCCPP_PERFTESTTRANSPORT_H_ */ diff --git a/srcCpp11/RTIDDSImpl.cxx b/srcCpp11/RTIDDSImpl.cxx index 86148d88..f6d528d2 100755 --- a/srcCpp11/RTIDDSImpl.cxx +++ b/srcCpp11/RTIDDSImpl.cxx @@ -101,7 +101,7 @@ RTIDDSImpl::RTIDDSImpl(): _sendQueueSize(0), _InstanceHashBuckets(dds::core::LENGTH_UNLIMITED), _isLargeData(false), - _maxSynchronousSize(MESSAGE_SIZE_MAX_NOT_SET), + _maxUnfragmentedRTPSPayloadSize(MESSAGE_SIZE_MAX_NOT_SET), _isFlatData(false), _isZeroCopy(false), @@ -166,27 +166,11 @@ bool RTIDDSImpl::data_size_related_calculations() return false; } - // If the user wants to use asynchronous we enable it - if (_PM->get("asynchronous")) { - _isLargeData = true; - } else { //If the message size max is lower than the datalen - _isLargeData = (_PM->get("dataLen") > _maxSynchronousSize); - } + _isLargeData = (_PM->get("dataLen") > _maxUnfragmentedRTPSPayloadSize); // Manage parameter -batchSize if (_PM->get("batchSize") > 0) { - // Check if using asynchronous - if (_PM->get("asynchronous")) { - if (_PM->is_set("batchSize") && _PM->get("batchSize") != 0) { - std::cerr << "[Error] Batching cannot be used with asynchronous writing." - << std::endl; - return false; - } else { - _PM->set("batchSize", 0); // Disable Batching - } - } - /* * Large Data + batching cannot be set. But batching is enabled by default, * so in that case, we just disabled batching, else, the customer set it up, @@ -381,8 +365,7 @@ std::string RTIDDSImpl::print_configuration() // Dynamic Data if (_PM->get("pub")) { stringStream << "\tAsynchronous Publishing: "; - if ((_isLargeData || _PM->get("asynchronous")) - && !_PM->get("zerocopy")) { + if (_PM->get("asynchronous")) { stringStream << "Yes\n"; stringStream << "\tFlow Controller: " << _PM->get("flowController") @@ -445,14 +428,14 @@ std::string RTIDDSImpl::print_configuration() #endif // Large Data - if (_PM->get("dataLen") > _maxSynchronousSize) { - stringStream << "\n[IMPORTANT]: Enabling Asynchronous publishing: -datalen (" + if (_PM->get("dataLen") > _maxUnfragmentedRTPSPayloadSize) { + stringStream << "\n[IMPORTANT]: -datalen (" << perftest::to_string(_PM->get("dataLen")) - << ") is \n" - << " larger than the minimum message_size_max across\n" - << " all enabled transports (" - << perftest::to_string(_maxSynchronousSize) - << ")\n"; + << ") is greater than\n" + << " the minimum message_size_max across all\n" + << " enabled transports (" + << perftest::to_string(_maxUnfragmentedRTPSPayloadSize) + << "). Samples will be fragmented.\n"; } return stringStream.str(); @@ -1776,14 +1759,14 @@ bool RTIDDSImpl::initialize(ParameterManager &PM, perftest_cpp *parent) * At this point, and not before is when we know the transport message size. * Now we can decide if we need to use asynchronous or not. */ - _maxSynchronousSize = _transport.minimumMessageSizeMax - (MESSAGE_OVERHEAD_BYTES); + _maxUnfragmentedRTPSPayloadSize = _transport.minimumMessageSizeMax - (MESSAGE_OVERHEAD_BYTES); /* * TODO: This should not be needed after adding changes for #265 * Rework idls to handle better custom types and Flat Data */ if (_isFlatData) { - _maxSynchronousSize -= 17; + _maxUnfragmentedRTPSPayloadSize -= 17; } if (!data_size_related_calculations()) { @@ -2494,7 +2477,7 @@ dds::pub::qos::DataWriterQos RTIDDSImpl::configure_reader_qos( } } - if ((_isLargeData && !_isZeroCopy) || _PM->get("asynchronous")) { + if (_PM->get("asynchronous")) { if (_PM->get("flowController") != "default") { dwPublishMode = PublishMode::Asynchronous( "dds.flow_controller.token_bucket." diff --git a/srcCpp11/RTIDDSImpl.h b/srcCpp11/RTIDDSImpl.h index 8206f30a..d979ee68 100644 --- a/srcCpp11/RTIDDSImpl.h +++ b/srcCpp11/RTIDDSImpl.h @@ -110,7 +110,7 @@ class RTIDDSImpl : public IMessaging unsigned long _sendQueueSize; int _InstanceHashBuckets; bool _isLargeData; - unsigned long long _maxSynchronousSize; + unsigned long long _maxUnfragmentedRTPSPayloadSize; bool _isFlatData; bool _isZeroCopy; PerftestTransport _transport; diff --git a/srcCpp11/perftest_cpp.cxx b/srcCpp11/perftest_cpp.cxx index 0991647d..7d48bbf0 100755 --- a/srcCpp11/perftest_cpp.cxx +++ b/srcCpp11/perftest_cpp.cxx @@ -609,7 +609,7 @@ void perftest_cpp::print_configuration() } } else if (_PM.get("batchSize") == -2) { stringStream << "\t\t BatchSize cannot be used with\n" - << "\t\t Large Data.\n"; + << "\t\t Fragmented Samples.\n"; } else if (_PM.get("batchSize") == -3) { stringStream << "\t\t BatchSize cannot be used with\n" << "\t\t FlatData.\n"; diff --git a/srcCppCommon/ParameterManager.cxx b/srcCppCommon/ParameterManager.cxx index 2c99fbf2..565dcd3d 100644 --- a/srcCppCommon/ParameterManager.cxx +++ b/srcCppCommon/ParameterManager.cxx @@ -263,6 +263,16 @@ void ParameterManager::initialize() | Middleware::RTITSSPRO); create("asynchronous", asynchronous); + Parameter *messageSizeMax = new Parameter(false); + messageSizeMax->set_command_line_argument("-messageSizeMax", ""); + messageSizeMax->set_description("Set the value of the transport message_size_max.\nDefault: Connext's default"); + messageSizeMax->set_type(T_NUMERIC_LD); + messageSizeMax->set_extra_argument(YES); + messageSizeMax->set_range(0, MAX_PERFTEST_SAMPLE_SIZE); + messageSizeMax->set_group(GENERAL); + messageSizeMax->set_supported_middleware(Middleware::RTIDDSPRO); + create("messageSizeMax", messageSizeMax); + Parameter *flowController = new Parameter("default"); flowController->set_command_line_argument("-flowController", ""); flowController->set_description( diff --git a/srcCppCommon/qos_string.h b/srcCppCommon/qos_string.h index 94e949f1..afc4f910 100644 --- a/srcCppCommon/qos_string.h +++ b/srcCppCommon/qos_string.h @@ -1,36 +1,37 @@ #include -#define PERFTEST_QOS_STRING_SIZE 29 -#define PERFTEST_QOS_STRING_TOTAL_SIZE 28725 +#define PERFTEST_QOS_STRING_SIZE 30 +#define PERFTEST_QOS_STRING_TOTAL_SIZE 29821 const char * PERFTEST_QOS_STRING[PERFTEST_QOS_STRING_SIZE] = { "\n\n\n\n\n\n\n\n \n\n \n\n \n \n BuiltinQosSnippetLib::QosPolicy.Reliability.Reliable\n BuiltinQosSnippetLib::QosPolicy.History.KeepAll\n \n\n \n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n \n\n \n \n LENGTH_UNLIMITED\n \n \n \n\n\n \n \n\n \n \n \n \n TOPIC_PRESENTATION_QOS\n true\n \n \n\n \n \n TOPIC_PRESENTATION_QOS\n true\n \n \n \n\n \n\n \n \n \n 64\n \n 512\n \n \n\n \n\n \n\n \n \n \n \n dds.transport.TCPv4.tcp1.library\n nddstransporttcp\n \n \n dds.transport.TCPv4.tcp1.create_function\n NDDS_Transport_TCPv4_create\n \n \n dds.transport.TCPv4.tcp1.disable_nagle\n 1\n \n \n \n \n \n\n\n \n \n \n \n \n dds.transport.TCPv4.tcp1.send_socket_buffer_size\n 1048576\n \n \n dds.transport.TCPv4.tcp1.recv_socket_buffer_size\n 2097152\n \n \n \n \n \n\n \n \n \n \n \n \n dds.transport.UDPv4.builtin.send_socket_buffer_size\n 1048576\n \n \n dds.transport.UDPv4.builtin.recv_socket_buffer_size\n 2097152\n \n \n \n \n \n\n \n \n \n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.max_tokens\n 30\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.tokens_added_per_period\n 20\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.nanosec\n 10000000\n \n \n \n \n \n\n \n \n \n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.max_tokens\n 300\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.tokens_added_per_period\n 200\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.nanosec\n 10000000", -"\n \n \n \n \n \n\n \n \n \n \n\n \n\n \n\n \n\n \n\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n \n DURATION_ZERO_SEC\n 1000000\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n LENGTH_UNLIMITED\n\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n\n \n \n DURATION_ZERO_SEC\n 100000\n \n \n \n\n \n\n \n \n \n \n \n ", -" DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n \n\n \n \n PerftestQosLibrary::Perftest.ReliableSettings\n \n \n\n \n\n \n \n \n\n \n \n \n 10000\n 128\n\n \n 10000\n \n\n \n \n 10000\n\n \n 65536\n \n \n \n\n \n \n \n\n \n\n \n \n false\n\n \n LENGTH_UNLIMITED\n LENGTH_UNLIMITED\n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n false\n \n \n \n\n \n \n PerftestQosLibrary::Perfte", -"st.ReliableSettings\n \n\n \n \n \n 10\n 100\n 1000\n LENGTH_UNLIMITED\n LENGTH_UNLIMITED\n \n \n \n\n \n \n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n\n \n\n \n\n \n \n LENGTH_UNLIMI", -"TED\n 100\n LENGTH_UNLIMITED\n \n \n\n \n \n \n 100\n 100\n 100\n \n\n \n 100\n \n \n \n\n \n \n \n \n \n ", -" \n com.rti.serv.secure.cryptography.encryption_algorithm\n aes-128-gcm\n \n\n \n \n\n \n \n\n \n \n\n \n \n PerftestQosLibrary::Presentation.TopicPresentation\n\n \n PerftestQosLibrary::Perftest.Transport.UDPv4.IncreaseSendReceiveBuffers\n PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration\n PerftestQosLibrary::Perftest.Transport.TCPv4.IncreaseSendReceiveBuffers\n\n \n ", -" PerftestQosLibrary::Perftest.IncreaseResourceLimits\n\n \n PerftestQosLibrary::Perftest.FlowController.1Gbps\n PerftestQosLibrary::Perftest.FlowController.10Gbps\n\n \n PerftestQosLibrary::Perftest.Security\n \n\n \n \n Perftest Participant\n \n\n \n \n \n \n dds.participant.property_validation_action\n 1\n \n \n \n \n \n\n \n \n\n \n PerftestQosLibrary::Reliability.StrictReliable\n PerftestQosLibrary::Perftest.Throughput.ReliableSettings\n PerftestQosLibrary::Perftest.Throughput.BatchingConfig\n PerftestQosLibrary::Perftest.Throughput.ResourceLimits\n \n \n \n \n 256\n \n \n\n \n\n \n \n\n \n PerftestQosLibrary::Reliability.StrictReliable\n PerftestQosLibrary::Perftest.Latency.ReliableSettings\n PerftestQosLibrary::Perftest.Latency.ResourceLimits\n \n\n \n \n KEEP_LAST_HISTORY_QOS\n \n \n\n \n\n \n \n\n \n BuiltinQosSnippetLib::QosPolicy.Durability.TransientLocal\n \n\n \n\n \n" }; +"_qos>\n \n\n\n \n \n \n \n \n \n dds.transport.UDPv4_WAN.builtin.send_socket_buffer_size\n 1048576\n \n \n dds.transport.UDPv4_WAN.builtin.recv_socket_buffer_size\n 2097152\n \n \n \n \n \n\n \n \n \n \n \n dd", +"s.flow_controller.token_bucket.1Gbps.token_bucket.max_tokens\n 30\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.tokens_added_per_period\n 20\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.1Gbps.token_bucket.period.nanosec\n 10000000\n \n \n \n \n \n\n \n \n \n \n ", +" \n dds.flow_controller.token_bucket.10Gbps.token_bucket.max_tokens\n 300\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.tokens_added_per_period\n 200\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.bytes_per_token\n 65536\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.sec\n 0\n \n \n dds.flow_controller.token_bucket.10Gbps.token_bucket.period.nanosec\n 10000000\n \n \n \n \n \n\n \n \n \n \n\n \n\n \n\n \n\n \n\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n \n DURATION_ZERO_SEC\n 1000000\n \n\n \n \n DURATION_ZERO_SEC\n 10000000\n \n\n \n LENGTH_UNLIMITED\n\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n\n \n \n DURATION_ZERO_SEC\n 100000\n \n \n \n\n \n\n \n \n \n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n ", +" DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n \n\n \n \n PerftestQosLibrary::Perftest.ReliableSettings\n \n \n\n \n\n \n \n \n\n \n \n \n 10000\n 128\n\n \n 10000\n \n\n \n \n 10000\n\n \n 65536\n \n \n \n\n \n \n \n\n \n\n \n \n false\n\n \n LENGTH_UNLIMITED\n LENGTH_UNLIMITED\n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n \n DURATION_INFINITE_SEC\n DURATION_INFINITE_NSEC\n \n\n \n false\n \n \n \n\n \n \n PerftestQosLibrary::Perftest.ReliableSettings\n \n\n \n \n \n 10\n 100\n 1000\n LENGTH_UNLIMITED\n LENGTH_UNLIMITED\n \n \n \n\n \n \n \n \n DURATION_ZERO_SEC\n DURATION_ZERO_NSEC\n \n \n \n \n\n \n\n \n\n \n \n LENGTH_UNLIMITED\n 100\n LENGTH_UNLIMITED\n \n \n\n \n \n \n 100\n 100\n 100\n \n\n \n 100\n \n \n \n\n \n \n \n \n \n \n com.rti.serv.secure.cryptography.encryption_algorithm\n aes-128-gcm\n \n\n \n", +" \n\n \n \n\n \n \n\n \n \n PerftestQosLibrary::Presentation.TopicPresentation\n\n \n PerftestQosLibrary::Perftest.Transport.UDPv4.IncreaseSendReceiveBuffers\n PerftestQosLibrary::Perftest.Transport.UDPv4_WAN.IncreaseSendReceiveBuffers\n PerftestQosLibrary::Perftest.Transport.TCPv4.BaseConfiguration\n PerftestQosLibrary::Perftest.Transport.TCPv4.IncreaseSendReceiveBuffers\n\n \n PerftestQosLibrary::Perftest.IncreaseResourceLimits\n\n \n PerftestQosLibrary::Perftest.FlowController.1Gbps\n PerftestQosLibrary::Perftest.FlowController.10Gbps\n\n \n PerftestQosLibrary::Perftest.Security\n \n\n \n \n Perftest Participant\n \n\n \n \n \n \n dds.participant.property_validation_action\n 1\n \n \n dds.type_consistency.ignore_sequence_", +"bounds\n false\n \n \n \n \n \n\n \n \n\n \n PerftestQosLibrary::Reliability.StrictReliable\n PerftestQosLibrary::Perftest.Throughput.ReliableSettings\n PerftestQosLibrary::Perftest.Throughput.BatchingConfig\n PerftestQosLibrary::Perftest.Throughput.ResourceLimits\n \n \n \n \n 256\n \n \n\n \n\n <", +"!--\n Latency QoS Profile:\n This is the profile used by the latency-testing portion of the application,\n in the topic that sends the pongs (from the Perftest subscriber to the Perftest\n publisher).\n -->\n \n\n \n PerftestQosLibrary::Reliability.StrictReliable\n PerftestQosLibrary::Perftest.Latency.ReliableSettings\n PerftestQosLibrary::Perftest.Latency.ResourceLimits\n \n\n \n \n KEEP_LAST_HISTORY_QOS\n \n \n\n \n\n \n \n\n \n BuiltinQo", +"sSnippetLib::QosPolicy.Durability.TransientLocal\n \n\n \n\n \n" }; #define PERFTEST_QOS_STRING_asString(str) {\ int i;\ diff --git a/srcCs/ConnextDDS/RTIDDSImpl.cs b/srcCs/ConnextDDS/RTIDDSImpl.cs index b305e8e2..64a44622 100755 --- a/srcCs/ConnextDDS/RTIDDSImpl.cs +++ b/srcCs/ConnextDDS/RTIDDSImpl.cs @@ -26,7 +26,7 @@ public class RTIDDSImpl : IMessaging where T : class, IEquatable private int instanceMaxCountReader = -1; private readonly bool directCommunication = true; private bool isLargeData; - private ulong maxSynchronousSize = PerftestTransport.MessageSizeMaxNotSet; + private ulong maxUnfragmentedRTPSPayloadSize = PerftestTransport.MessageSizeMaxNotSet; private readonly string[] validFlowController = { "default", "1Gbps", "10Gbps" }; private int peerHostCount = 0; private readonly string[] peerHostArray = new string[RTIPERFTEST_MAX_PEERS]; @@ -173,34 +173,11 @@ public int ConfigureInitialBurstSampleCount() public bool DataSizeRelatedCalculations() { - // If the user wants to use asynchronous we enable it - if (parameters.Asynchronous) - { - isLargeData = true; - } - else //If the message size max is lower than the datalen - { - isLargeData = parameters.DataLen > maxSynchronousSize; - } + isLargeData = parameters.DataLen > maxUnfragmentedRTPSPayloadSize; // Manage parameter -batchSize if (parameters.BatchSize > 0) { - /* Check if using asynchronous */ - if (parameters.Asynchronous) - { - if (parameters.BatchSizeSet) - { - Console.Error.Write( - "Batching cannot be used with asynchronous writing.\n"); - return false; - } - else - { - parameters.batchSize = 0; // Disable Batching - } - } - /* * Large Data + batching cannot be set. But batching is enabled by default, * so in that case, we just disabled batching, else, the customer set it up, @@ -346,15 +323,15 @@ public string PrintConfiguration() } // Large Data - if (parameters.DataLen > maxSynchronousSize) + if (parameters.DataLen > maxUnfragmentedRTPSPayloadSize) { - sb.Append("\n[IMPORTANT]: Enabling Asynchronous publishing: -datalen ("); + sb.Append("\n[IMPORTANT]: -datalen ("); sb.Append(parameters.DataLen); - sb.Append(") is \n"); - sb.Append(" larger than the minimum message_size_max across\n"); - sb.Append(" all enabled transports ("); - sb.Append(maxSynchronousSize); - sb.Append(")\n"); + sb.Append(") is greater than\n"); + sb.Append(" the minimum message_size_max across all\n"); + sb.Append(" enabled transports ("); + sb.Append(maxUnfragmentedRTPSPayloadSize); + sb.Append("). Samples will be fragmented.\n"); } // We want to expose if we are using or not the unbounded type @@ -1026,11 +1003,7 @@ private DomainParticipantQos GetParticipantQos(string profile) return null; } - /* - * At this point, and not before is when we know the transport message size. - * Now we can decide if we need to use asynchronous or not. - */ - maxSynchronousSize = transport.MinimumMessageSizeMax - (PerftestTransport.MessageOverheadBytes); + maxUnfragmentedRTPSPayloadSize = transport.MinimumMessageSizeMax - (PerftestTransport.MessageOverheadBytes); if (!DataSizeRelatedCalculations()) { @@ -1192,7 +1165,7 @@ private DataWriterQos GetWriterQos(string topicName) }); } - if (isLargeData || parameters.Asynchronous) + if (parameters.Asynchronous) { dataWriterQos = dataWriterQos.WithPublishMode(policy => { diff --git a/srcCs/Infrastructure/Parameters.cs b/srcCs/Infrastructure/Parameters.cs index 91530068..07e6fb0d 100644 --- a/srcCs/Infrastructure/Parameters.cs +++ b/srcCs/Infrastructure/Parameters.cs @@ -27,6 +27,7 @@ public class Parameters private bool noMulticast; private string multicastAddr; private ulong unboundedSize; + private ulong messageSizeMax; private string configureTransportCertAuthority; private int verbosity; private bool latencyTest; @@ -47,6 +48,7 @@ public class Parameters public bool NoMulticastSet { get; set; } public bool MulticastAddrSet { get; set; } public bool UnboundedSizeSet { get; set; } + public bool messageSizeMaxSet { get; set; } public bool ConfigureTransportCertAuthoritySet { get; set; } public bool ConfigureTransportCertFileSet { get; set; } public bool ConfigureTransportPrivateKeySet { get; set; } @@ -133,6 +135,11 @@ public ulong UnboundedSize get => unboundedSize; set { unboundedSize = value; UnboundedSizeSet = true; } } + public ulong MessageSizeMax + { + get => messageSizeMax; + set { messageSizeMax = value; messageSizeMaxSet = true; } + } public int Domain { get; set; } public string Transport { diff --git a/srcCs/Infrastructure/PerftestTransport.cs b/srcCs/Infrastructure/PerftestTransport.cs index 13fa61c1..2041da22 100755 --- a/srcCs/Infrastructure/PerftestTransport.cs +++ b/srcCs/Infrastructure/PerftestTransport.cs @@ -849,45 +849,113 @@ private static ulong GetTransportMessageSizeMax( } } + private static void SetTransportMessageSizeMax( + String targetTransportName, + DomainParticipantQos qos, + ulong messageSizeMax) + { + string propertyName = TransportConfigMap[targetTransportName].PrefixString + ".parent.message_size_max"; + + qos = qos.WithProperty(policy => + policy.Add(propertyName, messageSizeMax.ToString())); + } + /* * Configures the minimumMessageSizeMax value in the PerftestTransport object with * the minimum value for all the enabled transports in the XML configuration. */ - private void GetTransportMinimumMessageSizeMax(DomainParticipantQos qos) + private void setupTransportMinimumMessageSizeMax(DomainParticipantQos qos) { + ulong qosConfigurationMessageSizeMax = MessageSizeMaxNotSet; ulong transportMessageSizeMax = MessageSizeMaxNotSet; int mask = (int)qos.TransportBuiltin.Mask; - if ((mask & (int)TransportBuiltinMask.Shmem) != 0) + if (parameters.messageSizeMaxSet) { - transportMessageSizeMax = GetTransportMessageSizeMax("SHMEM", qos); - } - if ((mask & (int)TransportBuiltinMask.Udpv4) != 0) - { - transportMessageSizeMax = GetTransportMessageSizeMax("UDPv4", qos); - } - if ((mask & (int)TransportBuiltinMask.Udpv6) != 0) - { - transportMessageSizeMax = GetTransportMessageSizeMax("UDPv6", qos); - } + transportMessageSizeMax = parameters.MessageSizeMax; + qosConfigurationMessageSizeMax = transportMessageSizeMax; - if (TransportConfig.Kind == Transport.Tcpv4 - || TransportConfig.Kind == Transport.Tlsv4) - { - transportMessageSizeMax = GetTransportMessageSizeMax("TCP", qos); - } + if ((mask & (int)TransportBuiltinMask.Shmem) != 0) + { + SetTransportMessageSizeMax("SHMEM", qos, transportMessageSizeMax); + } + if ((mask & (int)TransportBuiltinMask.Udpv4) != 0) + { + SetTransportMessageSizeMax("UDPv4", qos, transportMessageSizeMax); + } + if ((mask & (int)TransportBuiltinMask.Udpv6) != 0) + { + SetTransportMessageSizeMax("UDPv6", qos, transportMessageSizeMax); + } + if (TransportConfig.Kind == Transport.Tcpv4 + || TransportConfig.Kind == Transport.Tlsv4) + { + SetTransportMessageSizeMax("TCP", qos, transportMessageSizeMax); + } + if (TransportConfig.Kind == Transport.Dtlsv4) + { + SetTransportMessageSizeMax("DTLS", qos, transportMessageSizeMax); + } + if (TransportConfig.Kind == Transport.Wanv4) + { + SetTransportMessageSizeMax("WAN", qos, transportMessageSizeMax); + } - if (TransportConfig.Kind == Transport.Dtlsv4) - { - transportMessageSizeMax = GetTransportMessageSizeMax("DTLS", qos); } - - if (TransportConfig.Kind == Transport.Wanv4) + else { - transportMessageSizeMax = GetTransportMessageSizeMax("WAN", qos); + if ((mask & (int)TransportBuiltinMask.Shmem) != 0) + { + transportMessageSizeMax = GetTransportMessageSizeMax("SHMEM", qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) + { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if ((mask & (int)TransportBuiltinMask.Udpv4) != 0) + { + transportMessageSizeMax = GetTransportMessageSizeMax("UDPv4", qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) + { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if ((mask & (int)TransportBuiltinMask.Udpv6) != 0) + { + transportMessageSizeMax = GetTransportMessageSizeMax("UDPv6", qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) + { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if (TransportConfig.Kind == Transport.Tcpv4 + || TransportConfig.Kind == Transport.Tlsv4) + { + transportMessageSizeMax = GetTransportMessageSizeMax("TCP", qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) + { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if (TransportConfig.Kind == Transport.Dtlsv4) + { + transportMessageSizeMax = GetTransportMessageSizeMax("DTLS", qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) + { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if (TransportConfig.Kind == Transport.Wanv4) + { + transportMessageSizeMax = GetTransportMessageSizeMax("WAN", qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) + { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } } - MinimumMessageSizeMax = transportMessageSizeMax; + MinimumMessageSizeMax = qosConfigurationMessageSizeMax; } public bool ConfigureTransport(ref DomainParticipantQos qos) @@ -963,7 +1031,7 @@ public bool ConfigureTransport(ref DomainParticipantQos qos) * MessageSizeMax for the Transport, which should be the minimum of * all the enabled transports */ - GetTransportMinimumMessageSizeMax(qos); + setupTransportMinimumMessageSizeMax(qos); switch (TransportConfig.Kind) { diff --git a/srcDoc/command_line_parameters.rst b/srcDoc/command_line_parameters.rst index 44aacced..6fbd48ba 100644 --- a/srcDoc/command_line_parameters.rst +++ b/srcDoc/command_line_parameters.rst @@ -67,8 +67,7 @@ Test Parameters for Publishing and Subscribing Applications wire protocol is added, it doesn't overflow the UDP maximum datagram size of 64KB. - If ```` is bigger than 64900, *RTI Perftest* will enable the - use of *Asynchronous Publishing* and *Unbounded Sequences*. When using + If ```` is bigger than 64900, *RTI Perftest* will enable *unbounded sequences*. When using *RTI Connext Micro*, the type is not really unbounded; the size is given by the ``MICRO_UNBOUNDED_SEQUENCE_SIZE`` constant, which can be modified in the ``build.bat`` and ``build.sh`` scripts. @@ -389,19 +388,33 @@ Test Parameters for Publishing and Subscribing Applications - ``-asynchronous`` - Enable asynchronous publishing in the *DataWriter* QoS. + Enable asynchronous publishing in the *DataWriter* QoS. In *Connext* releases + prior to 7.4.0, this option is required to send *Reliable* data that will be fragmented + at the DDS level. Connext 7.4.0 and later do support fragmented synchronous data, so this + option is not required. This parameter is not available when compiling against *Connext Micro*. **Default:** Not set +- ``-messageSizeMax `` + + Overrides the value that *RTI Connext Pro* will use for the ``message_size_max`` transport + property for all the enabled transports. The property controls the maximum allowed size + for a serialized message. If your message size is greater than this maximum, + the message will be fragmented (you can control the size of the messages using the + ``-dataLen`` argument). + + This parameter is not available when compiling against *Connext Micro*. + + **Default:** Not set: The middleware will use the minimum value of ``message_size_max`` + for all the enabled transports, except for ``SHMEM``, where the middleware will use the + size of the sample to avoid fragmentation. + - ``-flowController `` Specify the name of the flow controller that will be used by the - *DataWriters*. This parameter will only have effect if the *DataWriter* uses - Asynchronous Publishing, either because it is using samples greater - than the maximum synchronous size in bytes or because the ``-asynchronous`` - option is present. + *DataWriters*. This parameter requires using ``-asynchronous`` publishing. There are several flow controllers predefined: ['default','10Gbps','1Gbps']. diff --git a/srcDoc/examples.rst b/srcDoc/examples.rst index e1323686..e1915f91 100644 --- a/srcDoc/examples.rst +++ b/srcDoc/examples.rst @@ -538,27 +538,27 @@ de-allocating memory to accommodate the actual size of the unbounded member. Unbounded sequences and strings are also supported with DynamicData (command-line parameter ``-DynamicData``). -Apart from the switch from bounded to unbounded sequences, there is another -important behavior that occurs when setting a message size greater than the -`message_size_max` (by default ~64KB except for `SHMEM`): By setting a sample -size bigger than the `message_size_max`, *RTI Perftest* will enable the use of -Asynchronous Publishing, and set the *RTI Connext* default FlowController. - -For `SHMEM` (shared memory), this is not the case. When -explicitly specifying `-transport SHMEM`, *RTI Perftest* will try to set the -`message_size_max` to a value big enough so it can fit samples of the size -specified by the `-datalen ` command-line option. This way, the -application does not need to use Asynchronous Publishing, which helps improve -the performance. If this behavior is not the desired one, you can change it by -setting in `perftest_qos_profiles.xml` a fixed value for the `SHMEM` -`message_size_max`. - -You can force the use of Asynchronous Publishing, or specify a flow controller that -is different than the default, for any sample size, by using the command-line +In releases prior to 7.4.0, asynchronous publishing must be enabled +to send reliable data when the sample size is bigger than ``message_size_max``. +In releases 7.4.0 and higher, this adjustment is not required because reliable +fragmented data can be sent synchronously. `Perftest` does not enable asynchronous +publishing by default, so you must enable it as needed. + +Nonetheless, *RTI Perftest* will automatically calculate the minimum value for the +``message_size_max`` across all the enabled transport and indicate if samples +will be fragmented or not. + +You can still force the use of asynchronous publishing, or specify a flow controller that +is different from the default, for any sample size, by using the command-line parameters ``-asynchronous`` and ``-flowController``. See the :ref:`section-command_line_parameters` section for more details. --------------- +For ``SHMEM`` (shared memory), *Perftest* manages large samples differently. When +the transport is limited to just shared memory (``-transport SHMEM``), and the +``-messageSizeMax `` option is not explicitly set, `Perftest` will try to +set the ``message_size_max`` property to a value large enough to fit the sample +size specified by the ``-datalen `` command-line option. Using this approach, +the application does not need to fragment samples, which helps improve performance. Adjusting the configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -601,12 +601,12 @@ throughput numbers. By using a flow controller ``-flowController `` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Since the sample size is bigger than 63000 Bytes, *RTI Perftest* will -enable Asynchronous Publishing. By enabling Asynchronous Publishing, you also -make use of the default FlowController, which might not be optimal. -Therefore, it is a good practice to also specify a FlowController that fits -with the characteristics (bandwidth, latency, etc.) of the network where the -*RTI Perftest* applications are going to run. +In certain networks, sending data too fast may result in lost samples and/or network +congestion (for example, in Wi-Fi networks). Using a flow controller can limit the +amount of data sent per second. Flow controllers are only available when using asynchronous +publishing. When the ``-asynchronous`` command-line option is added, the default flow controller +tries to send data as fast as possible. +To select other flow controllers, use the ``-flowController`` parameter. *RTI Perftest* provides options to use a flow controller designed for a 10Gbps network and a 1Gbps one. However, by accessing the @@ -647,9 +647,7 @@ requirements. -The specific values for the flow controller and the Send Queue will -highly depend on the scenario and machines performing the test, but as a -general suggestion, these changes are recommended: +For example, to limit the publication rate to 1Gbps, the following commands can be used: - Publisher: diff --git a/srcDoc/old_release_notes.rst b/srcDoc/old_release_notes.rst index 9f46f9e0..fd199048 100644 --- a/srcDoc/old_release_notes.rst +++ b/srcDoc/old_release_notes.rst @@ -247,8 +247,8 @@ which return the time in *microseconds*. This option can be enabled at compilation time by using `--ns-resolution`. This option is only implemented for Linux/macOS/QNX Systems. -Decloupled Asynchronous Publishing and switching to unbounded sequences |enhancedTag| -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Decoupled asynchronous publishing and switching to unbounded sequences |enhancedTag| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *RTI Perftest* uses by default bounded sequences, this is in certain cases more efficient, but it involves allocating more memory. In order to avoid reserving @@ -1378,13 +1378,13 @@ What's New in 2.2 Added command-line parameters "-asynchronous" and "-flowController ``<``\ flow\ ``>``" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -In previous releases Asynchronous Publishing was only enabled for the +In previous releases asynchronous publishing was only enabled for the DataWriters when the samples were greater than 63000 bytes and in such case, RTI Perftest would only use a custom flow controller defined for 1Gbps networks. This behavior has been modified: Starting with this release, -Asynchronous Publishing will be activated if the samples to send are +asynchronous publishing will be activated if the samples to send are bigger than 63000 bytes or if the ``-asynchronous`` command-line parameter is used. In that case, *RTI Perftest* will use the ``Default`` flow controller. However, now you can change this behavior by specifying @@ -1422,10 +1422,10 @@ send. The sample size can be set via the ``-dataLen `` command-line parameter. If this value is larger than 63,000 bytes *RTI Perftest* will -enable the use of *Asynchronous Publishing* and *Unbounded Sequences*. +enable the use of *asynchronous publishing* and *Unbounded Sequences*. It is also possible to enable the use of *Unbounded Sequences* or -*Asynchronous Publishing* independently of the sample size by specifying +*asynchronous publishing* independently of the sample size by specifying the command-line parameters ``unbounded `` and ``-asynchronous``. @@ -1785,6 +1785,6 @@ we could get into the following error: [D0001|ENABLE]NDDS_Transport_Shmem_Property_verify:received_message_count_max < 1 [D0001|ENABLE]NDDS_Transport_Shmem_newI:Invalid transport properties. -.. |newTag| image:: _static/new.png -.. |fixedTag| image:: _static/fixed.png -.. |enhancedTag| image:: _static/enhanced.png +.. |newTag| :bdg-secondary:`New` +.. |fixedTag| :bdg-secondary:`Fixed` +.. |enhancedTag| :bdg-secondary:`New` diff --git a/srcDoc/release_notes.rst b/srcDoc/release_notes.rst index 92918253..8e95b3c7 100644 --- a/srcDoc/release_notes.rst +++ b/srcDoc/release_notes.rst @@ -20,7 +20,33 @@ command line, batching will remain enabled. +++++++++++++++++++++++++++++++ The ``-scan`` command-line option was previously available in the *Traditional C++*, -*Modern C++*, and *Java API*, it was deprecated in 4.0 and now it has been removed. +*Modern C++*, and *Java API*. This option was deprecated in 4.0 and has been removed in this release. + +Reliable fragmented data can now be sent in synchronous publish mode. |newTag| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +*Connext 7.4.0* introduced synchronous support for sending fragmented data with *Reliable* reliability. +In prior releases, this feature required enabling *asynchronous publishing*, and synchronous support +was only available for *Best-Effort* reliability. + +*Perftest* now supports synchronous fragmentation for both `reliable` and `best-effort` communications. +In previous releases, *Perftest* automatically enabled asynchronous publishing when fragmented samples +were detected, even for `best-effort`. Asynchronous publishing is still controlled by the ``-asynchronous`` +command-line option. + +*Note:* This behavior implies that for previous *RTI Connext* releases, the ``-asynchronous`` +option must be used when sending reliable large data (at the DDS level). + +``message_size_max`` can now be changed via command line |newTag| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +The ``message_size_max`` transport property can now be provided with the +``-messageSizeMax `` parameter. This parameter overrides the default +value, which is the minimum ``message_size_max`` across all the +enabled transports. + +Modifying the ``message_size_max`` property to a value lower than the data length +will not automatically enable asynchronous publishing. Support for **RTI Connext Cert 2.4.15** |newTag| ++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java b/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java index 8dee06bb..a3249c16 100644 --- a/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java +++ b/srcJava/com/rti/perftest/ddsimpl/PerftestTransport.java @@ -100,6 +100,7 @@ public class WanTransportOptions { * This is the minimum size across all the active transports * message_size_max */ + public long messageSizeMax = MESSAGE_SIZE_MAX_NOT_SET; public long minimumMessageSizeMax = MESSAGE_SIZE_MAX_NOT_SET; /* @@ -166,6 +167,7 @@ public static HashMap getTransportCmdLineArgs() { cmdLineArgsMap.put("-nic", new Integer(1)); cmdLineArgsMap.put("-allowInterfaces", new Integer(1)); cmdLineArgsMap.put("-transportServerBindPort", new Integer(1)); + cmdLineArgsMap.put("-messageSizeMax", new Integer(1)); cmdLineArgsMap.put("-transportVerbosity", new Integer(1)); cmdLineArgsMap.put("-transportWan", new Integer(0)); cmdLineArgsMap.put("-transportPublicAddress", new Integer(1)); @@ -277,6 +279,10 @@ public String printTransportConfigurationSummary() { } sb.append( "\n"); + if (messageSizeMax != MESSAGE_SIZE_MAX_NOT_SET) { + sb.append("\tMessage Size Max: ").append(messageSizeMax).append("\n"); + } + if (customMulticastAddrSet) { sb.append( "\tUsing custom Multicast Addresses:"); sb.append("\n\t\tThroughtput Address: "); @@ -417,6 +423,20 @@ else if ("-dataLen".toLowerCase().startsWith(argv[i].toLowerCase())) { } allowInterfaces = argv[i]; + } else if ("-messageSizeMax".toLowerCase().startsWith(argv[i].toLowerCase())) { + + if ((i == (argc - 1)) || argv[++i].startsWith("-")) { + System.err.println(classLoggingString + + " Missing after -messageSizeMax"); + return false; + } + try { + messageSizeMax = Long.parseLong(argv[i]); + } catch (NumberFormatException nfx) { + System.err.print("Bad messageSizeMax\n"); + return false; + } + } else if ("-transportVerbosity".toLowerCase().startsWith(argv[i].toLowerCase())) { if ((i == (argc - 1)) || argv[++i].startsWith("-")) { @@ -921,7 +941,7 @@ private void configureShmemTransport(DomainParticipantQos qos) { /* * If the property defining the message_size_max for shared memory is not * set and we are using exclusively SHMEM, then we will calculate - * automatically the message_size_max to accomodate the sample in a single + * automatically the message_size_max to accommodate the sample in a single * packet and avoid fragmentation. */ @@ -1064,64 +1084,117 @@ private long getTransportMessageSizeMax( } } + /* + * Sets the MessageSizeMax property given the name (String) of a transport in a + * DDS_DomainParticipantQos object. + */ + private void setTransportMessageSizeMax( + String targetTransportName, + DomainParticipantQos qos, + long messageSizeMax) + { + + HashMap configMap = getTransportConfigMap(); + String propertyName = + configMap.get(targetTransportName).prefixString + + ".parent.message_size_max"; + + PropertyQosPolicyHelper.add_property( + qos.property, + propertyName, + Long.toString(messageSizeMax), + false); + } + /* * Configures the minimumMessageSizeMax value in the PerftestTransport object with * the minimum value for all the enabled transports in the XML configuration. */ - private void getTransportMinimumMessageSizeMax(DomainParticipantQos qos) + private void setupTransportMinimumMessageSizeMax(DomainParticipantQos qos) { long qosConfigurationMessageSizeMax = MESSAGE_SIZE_MAX_NOT_SET; long transportMessageSizeMax = MESSAGE_SIZE_MAX_NOT_SET; int mask = qos.transport_builtin.mask; - if ((mask & TransportBuiltinKind.SHMEM) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax("SHMEM", qos); + if (messageSizeMax != MESSAGE_SIZE_MAX_NOT_SET) { - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + qosConfigurationMessageSizeMax = messageSizeMax; + transportMessageSizeMax = messageSizeMax; + + if ((mask & TransportBuiltinKind.SHMEM) != 0) { + setTransportMessageSizeMax("SHMEM", qos, qosConfigurationMessageSizeMax); + } + if ((mask & TransportBuiltinKind.UDPv4) != 0) { + setTransportMessageSizeMax("UDPv4", qos, qosConfigurationMessageSizeMax); + } + if ((mask & TransportBuiltinKind.UDPv6) != 0) { + setTransportMessageSizeMax("UDPv6", qos, qosConfigurationMessageSizeMax); } - } - if ((mask & TransportBuiltinKind.UDPv4) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax("UDPv4", qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transportConfig.kind == Transport.TRANSPORT_TCPv4 + || transportConfig.kind == Transport.TRANSPORT_TLSv4) { + setTransportMessageSizeMax("TCP", qos, qosConfigurationMessageSizeMax); } - } - if ((mask & TransportBuiltinKind.UDPv6) != 0) { - transportMessageSizeMax = getTransportMessageSizeMax("UDPv6", qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transportConfig.kind == Transport.TRANSPORT_DTLSv4) { + setTransportMessageSizeMax("DTLS", qos, qosConfigurationMessageSizeMax); } - } - if (transportConfig.kind == Transport.TRANSPORT_TCPv4 - || transportConfig.kind == Transport.TRANSPORT_TLSv4) { - transportMessageSizeMax = getTransportMessageSizeMax("TCP", qos); + if (transportConfig.kind == Transport.TRANSPORT_WANv4) { + setTransportMessageSizeMax("WAN", qos, qosConfigurationMessageSizeMax); + } + + } else { - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if ((mask & TransportBuiltinKind.SHMEM) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax("SHMEM", qos); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } - } + if ((mask & TransportBuiltinKind.UDPv4) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax("UDPv4", qos); - if (transportConfig.kind == Transport.TRANSPORT_DTLSv4) { - transportMessageSizeMax = getTransportMessageSizeMax("DTLS", qos); + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + if ((mask & TransportBuiltinKind.UDPv6) != 0) { + transportMessageSizeMax = getTransportMessageSizeMax("UDPv6", qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } - } - if (transportConfig.kind == Transport.TRANSPORT_WANv4) { - transportMessageSizeMax = getTransportMessageSizeMax("WAN", qos); + if (transportConfig.kind == Transport.TRANSPORT_TCPv4 + || transportConfig.kind == Transport.TRANSPORT_TLSv4) { + transportMessageSizeMax = getTransportMessageSizeMax("TCP", qos); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + + if (transportConfig.kind == Transport.TRANSPORT_DTLSv4) { + transportMessageSizeMax = getTransportMessageSizeMax("DTLS", qos); - if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { - qosConfigurationMessageSizeMax = transportMessageSizeMax; + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } + } + + if (transportConfig.kind == Transport.TRANSPORT_WANv4) { + transportMessageSizeMax = getTransportMessageSizeMax("WAN", qos); + + if (transportMessageSizeMax < qosConfigurationMessageSizeMax) { + qosConfigurationMessageSizeMax = transportMessageSizeMax; + } } } - minimumMessageSizeMax = transportMessageSizeMax; + minimumMessageSizeMax = qosConfigurationMessageSizeMax; } public boolean configureTransport(DomainParticipantQos qos) { @@ -1208,7 +1281,7 @@ public boolean configureTransport(DomainParticipantQos qos) { * MessageSizeMax for the Transport, which should be the minimum of * all the enabled transports */ - getTransportMinimumMessageSizeMax(qos); + setupTransportMinimumMessageSizeMax(qos); switch (transportConfig.kind) { diff --git a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java index 4fea87ff..a62a80e6 100644 --- a/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java +++ b/srcJava/com/rti/perftest/ddsimpl/RTIDDSImpl.java @@ -112,10 +112,10 @@ public final class RTIDDSImpl implements IMessaging { private boolean _isDebug = false; private boolean _latencyTest = false; private boolean _isLargeData = false; - private long _maxSynchronousSize = PerftestTransport.MESSAGE_SIZE_MAX_NOT_SET; + private long _maxUnfragmentedRTPSPayloadSize = PerftestTransport.MESSAGE_SIZE_MAX_NOT_SET; private boolean _isPublisher = false; private boolean _isPubRateSet = false; - private boolean _IsAsynchronous = false; + private boolean _isAsynchronous = false; private boolean _isDynamicData = false; private String _FlowControllerCustom = "default"; String[] valid_flow_controller = {"default", "1Gbps", "10Gbps"}; @@ -334,28 +334,14 @@ public void printCmdLineHelp() { } public boolean data_size_related_calculations() { - // If the user wants to use asynchronous we enable it - if (_IsAsynchronous) { - _isLargeData = true; - } else { //If the message size max is lower than the datalen - _isLargeData = _dataLen > _maxSynchronousSize; - } + + // We consider large data those that will not fit in the + // _maxUnfragmentedRTPSPayloadSize + _isLargeData = _dataLen > _maxUnfragmentedRTPSPayloadSize; // Manage parameter -batchSize if (_batchSize > 0) { - /* Check if using asynchronous */ - if (_IsAsynchronous) { - if (_isBatchSizeProvided) { - System.err.println( - "Batching cannot be used with asynchronous writing.\n"); - return false; - } - else { - _batchSize = 0; // Disable Batching - } - } - /* * Large Data + batching cannot be set. But batching is enabled by default, * so in that case, we just disabled batching, else, the customer set it up, @@ -364,7 +350,7 @@ public boolean data_size_related_calculations() { if (_isLargeData) { if (_isBatchSizeProvided) { System.err.println( - "Batching cannot be used with Large Data."); + "Batching cannot be used with Fragmented Samples."); return false; } else { _batchSize = -2; @@ -392,7 +378,7 @@ public boolean data_size_related_calculations() { } if (_TurboMode) { - if (_IsAsynchronous) { + if (_isAsynchronous) { System.err.println("Turbo Mode cannot be used with asynchronous writing."); return false; } @@ -483,7 +469,7 @@ public boolean initialize(int argc, String[] argv) { * At this point, and not before is when we know the transport message size. * Now we can decide if we need to use asynchronous or not. */ - _maxSynchronousSize = _transport.minimumMessageSizeMax - (PerftestTransport.MESSAGE_OVERHEAD_BYTES); + _maxUnfragmentedRTPSPayloadSize = _transport.minimumMessageSizeMax - (PerftestTransport.MESSAGE_OVERHEAD_BYTES); if (!data_size_related_calculations()) { System.err.print("[Error] Failed to configure the data size settings.\n"); @@ -1050,7 +1036,7 @@ private void configureWriterQos( "fast_buffer_pool", false); } - if (_isLargeData || _IsAsynchronous) + if (_isAsynchronous) { dwQos.publish_mode.kind = PublishModeQosPolicyKind.ASYNCHRONOUS_PUBLISH_MODE_QOS; if (!_FlowControllerCustom.toLowerCase().startsWith("default".toLowerCase())) { @@ -1314,7 +1300,7 @@ public String printConfiguration() { // Dynamic Data if (_isPublisher) { sb.append("\tAsynchronous Publishing: "); - if (_isLargeData || _IsAsynchronous) { + if (_isAsynchronous) { sb.append("Yes\n"); sb.append("\tFlow Controller: "); sb.append(_FlowControllerCustom); @@ -1374,14 +1360,14 @@ public String printConfiguration() { } // Large Data - if (_dataLen > _maxSynchronousSize) { - sb.append("\n[IMPORTANT]: Enabling Asynchronous publishing: -datalen ("); + if (_dataLen > _maxUnfragmentedRTPSPayloadSize) { + sb.append("\n[IMPORTANT]: -datalen ("); sb.append(_dataLen); - sb.append(") is \n"); - sb.append(" larger than the minimum message_size_max across\n"); - sb.append(" all enabled transports ("); - sb.append(_maxSynchronousSize); - sb.append(")\n"); + sb.append(") is greater than\n"); + sb.append(" the minimum message_size_max across all\n"); + sb.append(" enabled transports ("); + sb.append(_maxUnfragmentedRTPSPayloadSize); + sb.append("). Samples will be fragmented.\n"); } // We want to expose if we are using or not the unbounded type @@ -1772,7 +1758,7 @@ else if ("-noPositiveAcks".toLowerCase().startsWith(argv[i].toLowerCase())) { _secureUseSecure = true; _secureEnableAAD = true; } else if ("-asynchronous".toLowerCase().startsWith(argv[i].toLowerCase())) { - _IsAsynchronous = true; + _isAsynchronous = true; } else if ("-flowController".toLowerCase().startsWith(argv[i].toLowerCase())) { if ((i == (argc - 1)) || argv[++i].startsWith("-")) { System.err.print("Missing after -flowController\n"); From 10c6d3ca80ff0fdc1cd30aa2ddf53d625789ffe3 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Thu, 20 Feb 2025 07:55:27 -0800 Subject: [PATCH 36/49] Pull request #119: PERFTEST-449 - Add option to set the SDK to be used by RTI Perftest compilation CI Merge in PERF/rti-perftest from feature/PERFTEST-449 to develop Squashed commit of the following: commit 4ee6e221c1b4c8e6c021853bce34eedbb5912995 Author: Marcos Rivera Date: Thu Feb 20 13:02:56 2025 +0100 PERFTEST-449: Fix typo commit 9285c37b10260dff5ef15f1d3d2868603724656b Author: Marcos Rivera Date: Thu Feb 20 12:58:57 2025 +0100 PERFTEST-449: Fix typo commit 1564fcb470019ebc6c6ca10b854df2590b3c77fa Author: Marcos Rivera Date: Thu Feb 20 12:52:21 2025 +0100 PERFTEST-449: Fix typo commit 049cd2d1fe45e289a4426d62827114653c42afec Author: Marcos Rivera Date: Thu Feb 20 12:50:02 2025 +0100 PERFTEST-449: Fix typo commit 5fc875e8461b3ccb294b8c9b72767e2501d6b9e7 Author: Marcos Rivera Date: Thu Feb 20 12:47:29 2025 +0100 PERFTEST-449: Update pipeline commit 819550e3d29bb88be0893d930b34b08f6cd0fac1 Author: Javi Morales Date: Mon Feb 17 19:43:19 2025 +0100 Revert changes commit 5ed2b76c0a4aad9e639110aecdce428948cb25a9 Author: Javi Morales Date: Mon Feb 17 19:42:29 2025 +0100 WIP commit fac6a54bf5f774c54d88f43c923bfa0caef3d8cc Author: Javi Morales Date: Mon Feb 17 19:40:48 2025 +0100 WIP commit f213ef0a5653b4bca340060615fe65a3e8c07090 Author: Javi Morales Date: Mon Feb 17 19:37:56 2025 +0100 WIP commit e5cfc49cd7c94cb949f0a7d019af411411875a8e Author: Javi Morales Date: Mon Feb 17 19:35:04 2025 +0100 WIP commit 77471b1ba549ba074c052e9d4c834f47702607c9 Author: Javi Morales Date: Mon Feb 17 19:33:34 2025 +0100 Test commit bc96d0b5052e4628927c5f40829d40142498571d Author: Javi Morales Date: Mon Feb 17 19:15:55 2025 +0100 Revert commit 2c1e7f67c305b20aa7285ed8421e93c055bc1052 Author: Javi Morales Date: Mon Feb 17 18:58:47 2025 +0100 Improvement commit 9caf59b71cef9957be0c09f0f635349c8a66c061 Author: Javi Morales Date: Mon Feb 17 18:56:49 2025 +0100 Fix commit f13b814010d0a750e424629bdfe9d3310b820250 Author: Javi Morales Date: Mon Feb 17 18:54:38 2025 +0100 Move to a different approach commit 3fa462d0b38a70100e7ee2861f6b775265bd3a80 Author: Javi Morales Date: Mon Feb 17 18:49:47 2025 +0100 Revert changes to a working stage commit 96d2d634bbc0943743173ae5b3864c877bad4ff7 Author: Javi Morales Date: Mon Feb 17 18:48:01 2025 +0100 WIP commit 380bf60aa2bea993a1042822e99ab4cc74f7aba7 Author: Javi Morales Date: Mon Feb 17 18:41:05 2025 +0100 WIP commit 8ccff30f0d7d9de96eda837b4af9321683e44b9f Author: Javi Morales Date: Mon Feb 17 18:37:52 2025 +0100 WIP commit 1d5b947e08458f892fbb6a6c4804fcb5ec030282 Author: Javi Morales Date: Mon Feb 17 18:31:41 2025 +0100 WIP ... and 8 more commits --- resource/jenkins/ci/BuildPerftest.groovy | 77 +++++++++++++++++++++--- 1 file changed, 70 insertions(+), 7 deletions(-) diff --git a/resource/jenkins/ci/BuildPerftest.groovy b/resource/jenkins/ci/BuildPerftest.groovy index 7f80195b..d2bebe22 100644 --- a/resource/jenkins/ci/BuildPerftest.groovy +++ b/resource/jenkins/ci/BuildPerftest.groovy @@ -5,15 +5,77 @@ * This code contains trade secrets of Real-Time Innovations, Inc. */ -def buildPerftestAgainstPro(connext_arch, nddshome, flags) { - sh "./build.sh --platform ${connext_arch} --nddshome ${nddshome} ${flags}" +def buildPerftestAgainstPro(String connextArch, String nddsHome, String flags) { + sh "./build.sh --platform ${connextArch} --nddshome ${nddsHome} ${flags}" } pipeline { agent none - + parameters { + string(name: 'DEVELOP_VERSION', defaultValue: 'latest', description: 'RTI Connext Pro version to build against') + string(name: 'LATEST_RELEASE_VERSION', defaultValue: '7.4.0', description: 'RTI Connext Pro version to build against') + string(name: 'LATEST_LTS_VERSION', defaultValue: '7.3.0', description: 'RTI Connext Pro version to build against') + } stages { - stage('Build Perftest against RTI Connext Pro') { + stage('Build Perftest against Connext in develop') { + matrix { + axes { + axis { + name 'CONNEXT_ARCH' + values 'x64Linux4gcc7.3.0', 'armv8Linux4gcc7.3.0' + } + axis { + name 'LANGUAGE_FLAG' + values '--cpp-build', '--cpp11-build', '--java-build', '--cs-build' + } + } + agent { + dockerfile { + filename 'resource/jenkins/docker/Dockerfile' + additionalBuildArgs "--build-arg PLATFORM=${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? 'amd64' : 'arm64'} --build-arg TAG=${params.DEVELOP_VERSION}" + args "${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? '--platform linux/amd64' : '--platform linux/arm64'}" + } + } + stages { + stage('Build') { + steps { + echo "Building perftest against RTI Connext Pro (tag: ${params.DEVELOP_VERSION}) ${CONNEXT_ARCH} with ${LANGUAGE_FLAG}" + buildPerftestAgainstPro(CONNEXT_ARCH, '$NDDSHOME', "${LANGUAGE_FLAG} --secure") + } + } + } + } + } + stage('Build Perftest against Latest Release') { + matrix { + axes { + axis { + name 'CONNEXT_ARCH' + values 'x64Linux4gcc7.3.0', 'armv8Linux4gcc7.3.0' + } + axis { + name 'LANGUAGE_FLAG' + values '--cpp-build', '--cpp11-build', '--java-build', '--cs-build' + } + } + agent { + dockerfile { + filename 'resource/jenkins/docker/Dockerfile' + additionalBuildArgs "--build-arg PLATFORM=${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? 'amd64' : 'arm64'} --build-arg TAG=${params.LATEST_RELEASE_VERSION}" + args "${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? '--platform linux/amd64' : '--platform linux/arm64'}" + } + } + stages { + stage('Build') { + steps { + echo "Building perftest against RTI Connext Pro (tag: ${params.LATEST_RELEASE_VERSION}) ${CONNEXT_ARCH} with ${LANGUAGE_FLAG}" + buildPerftestAgainstPro(CONNEXT_ARCH, '$NDDSHOME', "${LANGUAGE_FLAG} --secure") + } + } + } + } + } + stage('Build Perftest against Latest LTS') { matrix { axes { axis { @@ -28,14 +90,15 @@ pipeline { agent { dockerfile { filename 'resource/jenkins/docker/Dockerfile' - additionalBuildArgs "--build-arg PLATFORM=${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? 'amd64' : 'arm64'} --build-arg TAG=7.3.0-20240812" + additionalBuildArgs "--build-arg PLATFORM=${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? 'amd64' : 'arm64'} --build-arg TAG=${params.LATEST_LTS_VERSION}" args "${CONNEXT_ARCH == 'x64Linux4gcc7.3.0' ? '--platform linux/amd64' : '--platform linux/arm64'}" } } stages { - stage("Build") { + stage('Build') { steps { - buildPerftestAgainstPro("${CONNEXT_ARCH}", "\$NDDSHOME", "${LANGUAGE_FLAG} --secure") + echo "Building perftest against RTI Connext Pro (tag: ${params.LATEST_LTS_VERSION}) ${CONNEXT_ARCH} with ${LANGUAGE_FLAG}" + buildPerftestAgainstPro(CONNEXT_ARCH, '$NDDSHOME', "${LANGUAGE_FLAG} --secure") } } } From ffcf9e2e1a15495e99036e3f2a04b50b3e465201 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Tue, 25 Mar 2025 15:05:47 +0000 Subject: [PATCH 37/49] Add changes --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 666e9ea6..b450a062 100755 --- a/build.sh +++ b/build.sh @@ -609,7 +609,8 @@ function additional_defines_calculation() # Avoid optimized out variables when debugging if [ "${RELEASE_DEBUG}" == "release" ]; then echo -e "${INFO_TAG} C++ code will be optimized." - additional_defines=${additional_defines}" O3" + additional_defines=${additional_defines}" O3 flto fno-semantic-interposition" + export ADDITIONAL_LINKER_FLAGS="$ADDITIONAL_LINKER_FLAGS -flto -fno-semantic-interposition" else additional_defines=${additional_defines}" O0" export DEBUG=1 From bc7ea477969a170847c2942f51ce264cd9ba7987 Mon Sep 17 00:00:00 2001 From: Javier Morales-Castro Date: Tue, 25 Mar 2025 15:06:51 +0000 Subject: [PATCH 38/49] Revert "Add changes" This reverts commit ffcf9e2e1a15495e99036e3f2a04b50b3e465201. --- build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sh b/build.sh index b450a062..666e9ea6 100755 --- a/build.sh +++ b/build.sh @@ -609,8 +609,7 @@ function additional_defines_calculation() # Avoid optimized out variables when debugging if [ "${RELEASE_DEBUG}" == "release" ]; then echo -e "${INFO_TAG} C++ code will be optimized." - additional_defines=${additional_defines}" O3 flto fno-semantic-interposition" - export ADDITIONAL_LINKER_FLAGS="$ADDITIONAL_LINKER_FLAGS -flto -fno-semantic-interposition" + additional_defines=${additional_defines}" O3" else additional_defines=${additional_defines}" O0" export DEBUG=1 From 8dfe0c5201af86d15d6015b90a06af646d00506c Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Thu, 27 Mar 2025 04:50:15 -0700 Subject: [PATCH 39/49] Pull request #121: Refactor LatencyListener to reset latency counters in a separate method Merge in PERF/rti-perftest from feature/PERFTEST-453 to develop Squashed commit of the following: commit 2ab90bfc5e11de381744b104a9c295dbcacb0aa9 Author: Lissa Loadholt Date: Wed Mar 26 05:21:26 2025 -0700 Applied suggestion commit ce0c07d92ba15a338c5ab14ec8a4cecc52af68d5 Author: Lissa Loadholt Date: Wed Mar 26 05:21:14 2025 -0700 Applied suggestion commit 06edba8ca9dce0d0f2817f2e0c31a499e2450c16 Author: Isaac Morales Date: Wed Mar 26 10:58:32 2025 +0100 Applied suggestion commit 978d26af3aa700079df797429a3f47addbeb40d5 Author: Lissa Loadholt Date: Wed Mar 26 02:56:27 2025 -0700 Applied suggestion commit 2643f5df610bb10a5f50adfe04d8e05e905b39bc Author: Lissa Loadholt Date: Wed Mar 26 02:54:50 2025 -0700 Applied suggestion commit cceb1ad975261bea434c9cc6c4b1c02d56c2402f Author: Lissa Loadholt Date: Wed Mar 26 02:54:36 2025 -0700 Applied suggestion commit baf1119d15f86046f7c5d4305c34736322cdc525 Author: Isaac Morales Date: Mon Mar 24 14:08:32 2025 +0100 Add PERFTEST-453 release note commit 5b21cc88b1b6ddbcc580b555dd1ff213d24734a9 Author: Isaac Morales Date: Fri Mar 21 11:45:12 2025 +0100 Refactor LatencyListener to reset latency counters in a separate method - Extracted the repeated code for resetting latency counters into a new method `ResetLatencyCounters()`. - Improved code readability and maintainability by reducing redundancy. --------------------------------------------------- INFO - JIRA ISSUE: PERFTTEST-453 - Author: Isaac Morales - Date: 03/21/2025 --------------------------------------------------- Shall be included into the Release branch?: YES --- srcCpp/perftest_cpp.cxx | 15 ++++++++++----- srcCpp11/perftest_cpp.cxx | 15 ++++++++++----- srcCs/Harness/LatencyListener.cs | 12 +++++++++++- srcDoc/release_notes.rst | 6 +++++- .../com/rti/perftest/harness/LatencyListener.java | 11 +++++++++-- 5 files changed, 45 insertions(+), 14 deletions(-) diff --git a/srcCpp/perftest_cpp.cxx b/srcCpp/perftest_cpp.cxx index 65305d7b..9b0f07a2 100644 --- a/srcCpp/perftest_cpp.cxx +++ b/srcCpp/perftest_cpp.cxx @@ -1446,6 +1446,14 @@ class LatencyListener : public IMessagingCB bool printIntervals; bool showCpu; + void resetLatencyCounters() { + latency_sum = 0; + latency_sum_square = 0; + latency_min = perftest_cpp::LATENCY_RESET_VALUE; + latency_max = 0; + count = 0; + } + public: IMessagingReader *_reader; CpuMonitor cpu; @@ -1743,11 +1751,7 @@ class LatencyListener : public IMessagingCB } if (last_data_length != message.size) { - latency_sum = 0; - latency_sum_square = 0; - latency_min = perftest_cpp::LATENCY_RESET_VALUE; - latency_max = 0; - count = 0; + resetLatencyCounters(); } sec = message.timestamp_sec; @@ -1796,6 +1800,7 @@ class LatencyListener : public IMessagingCB _printer->_dataLength = last_data_length + perftest_cpp::OVERHEAD_BYTES; _printer->print_latency_header(); + resetLatencyCounters(); } else { if (printIntervals) { latency_ave = (double) latency_sum / (double) count; diff --git a/srcCpp11/perftest_cpp.cxx b/srcCpp11/perftest_cpp.cxx index 7d48bbf0..e7d39c3b 100755 --- a/srcCpp11/perftest_cpp.cxx +++ b/srcCpp11/perftest_cpp.cxx @@ -1228,6 +1228,14 @@ class LatencyListener : public IMessagingCB bool printIntervals; bool showCpu; + void resetLatencyCounters() { + latency_sum = 0; + latency_sum_square = 0; + latency_min = perftest_cpp::LATENCY_RESET_VALUE; + latency_max = 0; + count = 0; + } + public: IMessagingReader *_reader; CpuMonitor cpu; @@ -1314,11 +1322,7 @@ class LatencyListener : public IMessagingCB } if (last_data_length != message.size) { - latency_sum = 0; - latency_sum_square = 0; - latency_min = perftest_cpp::LATENCY_RESET_VALUE; - latency_max = 0; - count = 0; + resetLatencyCounters(); } sec = message.timestamp_sec; @@ -1367,6 +1371,7 @@ class LatencyListener : public IMessagingCB _printer->_dataLength = last_data_length + perftest_cpp::OVERHEAD_BYTES; _printer->print_latency_header(); + resetLatencyCounters(); } else { if (printIntervals) { latency_ave = (double) latency_sum / (double) count; diff --git a/srcCs/Harness/LatencyListener.cs b/srcCs/Harness/LatencyListener.cs index 8354440b..c9300d9d 100644 --- a/srcCs/Harness/LatencyListener.cs +++ b/srcCs/Harness/LatencyListener.cs @@ -29,6 +29,15 @@ public class LatencyListener : IMessagingCallback public CpuMonitor cpu = new CpuMonitor(); private int NumLatency => latencyHistory.Length; + private void ResetLatencyCounters() + { + latencySum = 0; + latencySumSquare = 0; + latencyMin = Perftest.LATENCY_RESET_VALUE; + latencyMax = 0; + count = 0; + } + public LatencyListener( IMessagingWriter writer, Parameters parameters, @@ -130,7 +139,7 @@ public void ProcessMessage(TestMessage message) latencySum += latency; latencySumSquare += (ulong)latency * (ulong)latency; - // if data sized changed + // if data size changed, print out stats and zero counters if (lastDataLength != message.Size) { lastDataLength = message.Size; @@ -141,6 +150,7 @@ public void ProcessMessage(TestMessage message) + (int)Perftest.OVERHEAD_BYTES); printer.PrintLatencyHeader(); } + ResetLatencyCounters(); } else { diff --git a/srcDoc/release_notes.rst b/srcDoc/release_notes.rst index 8e95b3c7..e6c1a70f 100644 --- a/srcDoc/release_notes.rst +++ b/srcDoc/release_notes.rst @@ -60,7 +60,11 @@ in section :ref:`section-linux_compilation_examples`. What's Fixed in 4.2 ~~~~~~~~~~~~~~~~~~~ -<- Nothing new yet -> +Incorrect latency calculations when data size changed ++++++++++++++++++++++++++++++++++++++++++++++++++++++ +At the beginning of a test, some samples were sent indicating that a new data size would be used. +Those samples were discarded, but *Perftest* incorrectly kept the samples' latency information and used it to calculate the different latency statistics. +This issue caused some inconsistencies in the results displayed, though it did not affect the final results. Release Notes 4.1.1 --------------------- diff --git a/srcJava/com/rti/perftest/harness/LatencyListener.java b/srcJava/com/rti/perftest/harness/LatencyListener.java index 027065bb..5d18499e 100644 --- a/srcJava/com/rti/perftest/harness/LatencyListener.java +++ b/srcJava/com/rti/perftest/harness/LatencyListener.java @@ -82,7 +82,13 @@ public void readThread() { } } - + private void resetLatencyCounters() { + _latencySum = 0; + _latencySumSquare = 0; + _latencyMin = PerfTest.LATENCY_RESET_VALUE; + _latencyMax = 0; + _count = 0; + } // --- From IMessagingCB: ------------------------------------------------ public void processMessage(TestMessage message) { @@ -156,12 +162,13 @@ public void processMessage(TestMessage message) { outputCpu = CpuMonitor.get_cpu_instant(); } - // if data sized changed + // if data size changed, print out stats and zero counters if (_lastDataLength != message.size) { _lastDataLength = message.size; PerfTest._printer.set_data_length(message.size + PerfTest.OVERHEAD_BYTES); PerfTest._printer.print_latency_header(); + resetLatencyCounters(); } else if (PerfTest.printIntervals) { double latency_ave = (double)_latencySum / (double)_count; From fdc7a0aa1c04549a38d35f8e4402b4ae0852fd45 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 3 Apr 2025 15:25:04 +0200 Subject: [PATCH 40/49] PERFTEST-442: Create 4.2 branch and update release number --- srcCpp/perftest_cpp.cxx | 2 +- srcCpp11/perftest_cpp.cxx | 2 +- srcCs/Perftest.cs | 2 +- srcDoc/compatibility.rst | 2 +- srcJava/com/rti/perftest/ddsimpl/PerftestVersion.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/srcCpp/perftest_cpp.cxx b/srcCpp/perftest_cpp.cxx index 9b0f07a2..afef5672 100644 --- a/srcCpp/perftest_cpp.cxx +++ b/srcCpp/perftest_cpp.cxx @@ -76,7 +76,7 @@ extern "C" void RTIAndroid_registerOnPrintf(RTIAndroidOnPrintfMethod onPrintf) { bool perftest_cpp::_testCompleted = false; const int timeout_wait_for_ack_sec = 0; const unsigned int timeout_wait_for_ack_nsec = 100000000; -const Perftest_ProductVersion_t perftest_cpp::_version = {0, 0, 0, 0}; +const Perftest_ProductVersion_t perftest_cpp::_version = {4, 2, 0, 0}; /* * PERFTEST-108 diff --git a/srcCpp11/perftest_cpp.cxx b/srcCpp11/perftest_cpp.cxx index e7d39c3b..c6f542df 100755 --- a/srcCpp11/perftest_cpp.cxx +++ b/srcCpp11/perftest_cpp.cxx @@ -84,7 +84,7 @@ bool perftest_cpp::_testCompleted = false; const long timeout_wait_for_ack_sec = 0; const unsigned long timeout_wait_for_ack_nsec = 100000000; -const Perftest_ProductVersion_t perftest_cpp::_version = {0, 0, 0, 0}; +const Perftest_ProductVersion_t perftest_cpp::_version = {4, 2, 0, 0}; ThreadPriorities _threadPriorities; /* diff --git a/srcCs/Perftest.cs b/srcCs/Perftest.cs index 5ef74318..6b2db2f0 100755 --- a/srcCs/Perftest.cs +++ b/srcCs/Perftest.cs @@ -36,7 +36,7 @@ public class Perftest : IDisposable private static bool showCpu; private static bool testCompleted; public readonly TimeSpan timeoutWaitForAckTimeSpan = new TimeSpan(0, 0, 0, 0, 10); - public static readonly PerftestVersion version = new PerftestVersion(0, 0, 0, 0); + public static readonly PerftestVersion version = new PerftestVersion(4, 2, 0, 0); /* * PERFTEST-108 diff --git a/srcDoc/compatibility.rst b/srcDoc/compatibility.rst index fa2a3442..1e95c66c 100644 --- a/srcDoc/compatibility.rst +++ b/srcDoc/compatibility.rst @@ -3,7 +3,7 @@ Compatibility ============= -*RTI Perftest Develop* is designed to be compatible with the *RTI Connext DDS* +*RTI Perftest 4.2.0* is designed to be compatible with the *RTI Connext DDS* middleware. It has been compiled and tested against: - *RTI Connext DDS Professional* 6.0.0 and above. Nonetheless previous versions diff --git a/srcJava/com/rti/perftest/ddsimpl/PerftestVersion.java b/srcJava/com/rti/perftest/ddsimpl/PerftestVersion.java index ea2d90b4..823cec6c 100644 --- a/srcJava/com/rti/perftest/ddsimpl/PerftestVersion.java +++ b/srcJava/com/rti/perftest/ddsimpl/PerftestVersion.java @@ -14,7 +14,7 @@ public final class PerftestVersion { private final ProductVersion_t _productVersion; private PerftestVersion() { - _productVersion = new ProductVersion_t(new int[] { 0, 0, 0, 0 }); + _productVersion = new ProductVersion_t(new int[] { 4, 2, 0, 0 }); } public static PerftestVersion getInstance() { From 6cf1675f35036cc4df2cb16f9ee8e51da3037012 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 3 Apr 2025 15:29:28 +0200 Subject: [PATCH 41/49] PERF-442: Update documentation version numbers --- srcDoc/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srcDoc/conf.py b/srcDoc/conf.py index db594c6f..5ff10168 100644 --- a/srcDoc/conf.py +++ b/srcDoc/conf.py @@ -44,7 +44,7 @@ # General information about the project. project = u'RTI Perftest' -copyright = u'2022, Real-Time Innovations, Inc' +copyright = u'2025, Real-Time Innovations, Inc' author = u'Real-Time Innovations, Inc.' # The version info for the project you're documenting, acts as replacement for @@ -52,9 +52,9 @@ # built documents. # # The short X.Y version. -version = u'4.1' +version = u'4.2' # The full version, including alpha/beta/rc tags. -release = u'4.1' +release = u'4.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From effbe7d3dffba8d40eb261294dae6937eb9219e1 Mon Sep 17 00:00:00 2001 From: plombardero0 Date: Thu, 3 Apr 2025 16:24:34 +0200 Subject: [PATCH 42/49] Fixing TSS + Pro build --- srcCpp/connextDDS/TSS/CustomQosSupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp index 60e2b9e8..a02b2e16 100644 --- a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp +++ b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp @@ -376,7 +376,7 @@ RTI_TSS_datawriter_qos(struct DDS_DataWriterQos *dw_qos, void *data) buf, false); } else { - DDSPropertyQosPolicyHelper::add_property(dw_qos.property, + DDSPropertyQosPolicyHelper::add_property(dw_qos->property, "dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator", "fast_buffer_pool", false); From 86bc65c774b04e4e0363ef7dc457d54f5070c939 Mon Sep 17 00:00:00 2001 From: plombardero0 Date: Thu, 3 Apr 2025 16:24:49 +0200 Subject: [PATCH 43/49] Fixing TSS + Micro build --- srcCpp/Infrastructure_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcCpp/Infrastructure_common.h b/srcCpp/Infrastructure_common.h index e06192b0..a9270ab3 100644 --- a/srcCpp/Infrastructure_common.h +++ b/srcCpp/Infrastructure_common.h @@ -210,7 +210,7 @@ struct DDS_Duration_t { }; #endif -#ifdef PERFTEST_NO_INFRASTRUCTURE_AVAILABLE +#if defined(PERFTEST_NO_INFRASTRUCTURE_AVAILABLE) || defined(RTI_PERF_TSS_MICRO) class NDDSUtility { public: /*e \dref_Utility_sleep */ From 59cf7287a7d800525ecbebf44a891b02c818efa4 Mon Sep 17 00:00:00 2001 From: plombardero0 Date: Thu, 3 Apr 2025 16:39:31 +0200 Subject: [PATCH 44/49] Fixing building and running for TSS + Pro --- srcCpp/connextDDS/TSS/CustomQosSupport.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp index a02b2e16..6cc17037 100644 --- a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp +++ b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp @@ -375,11 +375,6 @@ RTI_TSS_datawriter_qos(struct DDS_DataWriterQos *dw_qos, void *data) "dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size", buf, false); - } else { - DDSPropertyQosPolicyHelper::add_property(dw_qos->property, - "dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator", - "fast_buffer_pool", - false); } if (ctx->pm->get("instances") > 1) { From cbfc0ab7022bae9fe64ed742caa117e34bacf8c9 Mon Sep 17 00:00:00 2001 From: plombardero0 Date: Thu, 3 Apr 2025 16:40:32 +0200 Subject: [PATCH 45/49] Adjusting compatibility statements --- srcDoc/compatibility.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/srcDoc/compatibility.rst b/srcDoc/compatibility.rst index 1e95c66c..d163689e 100644 --- a/srcDoc/compatibility.rst +++ b/srcDoc/compatibility.rst @@ -9,10 +9,12 @@ middleware. It has been compiled and tested against: - *RTI Connext DDS Professional* 6.0.0 and above. Nonetheless previous versions starting after 5.2.X should be compatible with certain exceptions. -- *RTI Connext Micro* 3.0.0 and above versions. Versions for 2.4.11 and above +- *RTI Connext Micro* 4.0.0 and above versions. Versions for 2.4.11 and above should also be compatible by adding the `--micro-24x-compatibility` command-line option. +- *RTI Connext Cert* 2.4.15. + - *RTI Connext TSS* 3.1.2 over *RTI Connext Pro* 6.1.1.4, or over *RTI Connext Micro* 2.4.13.4. The only supported FACE profile is GeneralPurpose. From 7bd5fbe216aa8965c60e9b135c86f0eaf2936dff Mon Sep 17 00:00:00 2001 From: plombardero0 Date: Thu, 3 Apr 2025 16:24:49 +0200 Subject: [PATCH 46/49] Fixing TSS + Micro build --- srcCpp/Infrastructure_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcCpp/Infrastructure_common.h b/srcCpp/Infrastructure_common.h index e06192b0..a9270ab3 100644 --- a/srcCpp/Infrastructure_common.h +++ b/srcCpp/Infrastructure_common.h @@ -210,7 +210,7 @@ struct DDS_Duration_t { }; #endif -#ifdef PERFTEST_NO_INFRASTRUCTURE_AVAILABLE +#if defined(PERFTEST_NO_INFRASTRUCTURE_AVAILABLE) || defined(RTI_PERF_TSS_MICRO) class NDDSUtility { public: /*e \dref_Utility_sleep */ From 3efd84050da7f9c26f15a6d688d66a9dece10117 Mon Sep 17 00:00:00 2001 From: plombardero0 Date: Thu, 3 Apr 2025 16:39:31 +0200 Subject: [PATCH 47/49] Fixing building and running for TSS + Pro --- srcCpp/connextDDS/TSS/CustomQosSupport.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp index 60e2b9e8..6cc17037 100644 --- a/srcCpp/connextDDS/TSS/CustomQosSupport.cpp +++ b/srcCpp/connextDDS/TSS/CustomQosSupport.cpp @@ -375,11 +375,6 @@ RTI_TSS_datawriter_qos(struct DDS_DataWriterQos *dw_qos, void *data) "dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size", buf, false); - } else { - DDSPropertyQosPolicyHelper::add_property(dw_qos.property, - "dds.data_writer.history.memory_manager.pluggable_allocator.underlying_allocator", - "fast_buffer_pool", - false); } if (ctx->pm->get("instances") > 1) { From 9eca37251cd62c1bf7a5a85469f469b8c75f553e Mon Sep 17 00:00:00 2001 From: plombardero0 Date: Thu, 3 Apr 2025 16:40:32 +0200 Subject: [PATCH 48/49] Adjusting compatibility statements --- srcDoc/compatibility.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/srcDoc/compatibility.rst b/srcDoc/compatibility.rst index fa2a3442..0b4a0432 100644 --- a/srcDoc/compatibility.rst +++ b/srcDoc/compatibility.rst @@ -9,10 +9,12 @@ middleware. It has been compiled and tested against: - *RTI Connext DDS Professional* 6.0.0 and above. Nonetheless previous versions starting after 5.2.X should be compatible with certain exceptions. -- *RTI Connext Micro* 3.0.0 and above versions. Versions for 2.4.11 and above +- *RTI Connext Micro* 4.0.0 and above versions. Versions for 2.4.11 and above should also be compatible by adding the `--micro-24x-compatibility` command-line option. +- *RTI Connext Cert* 2.4.15. + - *RTI Connext TSS* 3.1.2 over *RTI Connext Pro* 6.1.1.4, or over *RTI Connext Micro* 2.4.13.4. The only supported FACE profile is GeneralPurpose. From 897a4b6839ccd7214a42ef6efbbdfc1ce042811c Mon Sep 17 00:00:00 2001 From: Marcos Rivera Date: Fri, 4 Apr 2025 03:40:01 -0700 Subject: [PATCH 49/49] Pull request #122: PERF-445:Update pipeline Merge in PERF/rti-perftest from feature/PERF-445 to develop Squashed commit of the following: commit 5508d8b32c9b36e6eb8bf2dd2fd1ac065c999b50 Author: Marcos Rivera Date: Fri Apr 4 09:28:29 2025 +0200 Update path commit 182232c21932c68e9a47ac2efee265606ef0a274 Author: Marcos Rivera Date: Fri Apr 4 02:58:36 2025 +0200 Update path commit 7b380e0ce6b2dc80bdf3cb933d7bb3d6af7ec53c Author: Marcos Rivera Date: Fri Apr 4 02:40:27 2025 +0200 Update path commit a78231a9efc05a2531aa948f117ca5b3736ecfc3 Author: Marcos Rivera Date: Fri Apr 4 02:28:10 2025 +0200 Update path commit 3a7a79a9db2dfa491a2cf840b75bde2f6c2a2e2e Author: Marcos Rivera Date: Fri Apr 4 01:44:24 2025 +0200 Update path commit a84c6439c5d998106feec9c484a0fcfda1dce9a6 Author: Marcos Rivera Date: Thu Apr 3 22:41:33 2025 +0200 Update path commit 6f23252ef074b095fb7e20d6c9b8d370162a51d6 Author: Marcos Rivera Date: Thu Apr 3 22:27:12 2025 +0200 Update path commit d491b305c588c34fe4f319412a068b2008be12a6 Author: Marcos Rivera Date: Thu Apr 3 10:49:53 2025 +0200 Update path commit 0c55bda9922f1392faba47079aaf11aee396e4b9 Author: Marcos Rivera Date: Thu Apr 3 10:28:19 2025 +0200 Update path commit 37e553bdc6a4c46f1dc95a25cd2c27a0ed207ba9 Author: Marcos Rivera Date: Thu Apr 3 09:38:34 2025 +0200 Update path commit 58d5bdf592aca2ce2d99468d49c42bea3497f7e9 Author: Marcos Rivera Date: Wed Apr 2 19:34:24 2025 +0200 Update path commit 55d861624e9820f9adf488823fafefb8a7cfe12c Author: Marcos Rivera Date: Wed Apr 2 12:26:53 2025 +0200 Update path commit c5d06283f4631702d838a50a0ca696d1b40fad7d Author: Marcos Rivera Date: Wed Apr 2 12:20:03 2025 +0200 Update path commit 2c0ec2968568d99d467d7695d1bb3dc3b5c6ffe4 Author: Marcos Rivera Date: Wed Apr 2 12:00:14 2025 +0200 Update path commit 97bf043c3c1780e6a89c2f3035adb728447d5c06 Author: Marcos Rivera Date: Wed Apr 2 11:50:20 2025 +0200 Update path commit 98364540b4c18e3e8dee7eda2286afba1444cba2 Author: Marcos Rivera Date: Wed Apr 2 11:48:19 2025 +0200 Update path commit daf12bc6516711b484a99ab8bc67e9332c088af1 Author: Marcos Rivera Date: Wed Apr 2 11:46:33 2025 +0200 Update path commit b6ed2623ec54e7f82dc6935b77be665141479e45 Author: Marcos Rivera Date: Wed Apr 2 11:42:56 2025 +0200 Update path commit 7456bf557f74e26b1e1fe1fe08cfa6f48ae6adf6 Author: Marcos Rivera Date: Wed Apr 2 11:35:32 2025 +0200 Update path commit 8ce4c82f7a7148120f44d2f36128ce3d1145f029 Author: Marcos Rivera Date: Wed Apr 2 11:32:19 2025 +0200 Update path ... and 95 more commits --- build.bat | 128 +++++++-- build.sh | 42 ++- ...BuildAndUploadPerftestToArtifactory.groovy | 249 ++++++++++++++++++ 3 files changed, 386 insertions(+), 33 deletions(-) create mode 100644 resource/jenkins/manual/BuildAndUploadPerftestToArtifactory.groovy diff --git a/build.bat b/build.bat index 142442d1..181d0ee0 100755 --- a/build.bat +++ b/build.bat @@ -1,4 +1,3 @@ - @echo off setlocal EnableDelayedExpansion @@ -28,6 +27,7 @@ set MICRO_UNBOUNDED_SEQUENCE_SIZE=1048576 set BUILD_CPP=1 set BUILD_CPP11=1 set BUILD_JAVA=1 +set USER_RTIDDSGEN_EXECUTABLE="" set BUILD_CS=0 @REM # If this value is != 0, then it means the user specified specific APIS to be @@ -73,6 +73,7 @@ set "custom_idl_file=%custom_type_folder%\custom.idl" @REM #3.0.0 -- 3 We just need the Major first value of the version. set flatdata_ddsgen_version=3 set FLATDATA_AVAILABLE=0 +set rtiddsgen_extra_options= ::------------------------------------------------------------------------------ @REM # Initial message @@ -218,6 +219,9 @@ if NOT "%1"=="" ( exit /b 1 ) SHIFT + ) ELSE if "%1"=="--rtiddsgen-path" ( + SET "USER_RTIDDSGEN_EXECUTABLE=%2" + SHIFT ) ELSE ( echo [ERROR]: Unknown argument "%1" call:help @@ -227,6 +231,11 @@ if NOT "%1"=="" ( GOTO :parse_arguments ) +if defined VSDEVCMD ( + echo [INFO]: Sourcing Visual Studio environment from "!VSDEVCMD!" + call "!VSDEVCMD!" +) + ::------------------------------------------------------------------------------ if "x!architecture!" == "x" ( echo [ERROR]: The platform argument is missing. @@ -334,10 +343,14 @@ if !BUILD_MICRO! == 1 ( ) else ( @REM # This calls the function in charge of getting the name of the solution for C++ @REM # given the architecture. - echo . call::get_solution_name set "rtiddsgen_executable=!NDDSHOME!/bin/rtiddsgen.bat" + + if not !USER_RTIDDSGEN_EXECUTABLE!=="" ( + echo [INFO]: Using user-provided rtiddsgen executable: !USER_RTIDDSGEN_EXECUTABLE! + set "rtiddsgen_executable=!USER_RTIDDSGEN_EXECUTABLE!" + ) ) ::------------------------------------------------------------------------------ @@ -427,11 +440,19 @@ if !BUILD_CPP! == 1 ( ) ) - REM If the SSL_VERSION is empty and the $RTI_CRYPTOHOME is empty too + REM If the SSL_VERSION is empty and the $RTI_OPENSSLHOME is empty too REM we need to be creative. If we set the $SSL_VERSION before, we will REM not enter here. if "!RTI_OPENSSLHOME!"=="" ( call :crypto_path_calculation + ) else ( + if not exist "%RTI_OPENSSLHOME%\" ( + echo [ERROR] %RTI_OPENSSLHOME% is not a folder. + exit /b -1 + ) + + call :get_rti_security_lib_path_for_crypto_path + echo [INFO] ndds_security_crypto_lib_folder = "!ndds_security_crypto_lib_folder!" ) if "%USE_LW_SECURE_LIBS%"=="1" ( @@ -440,8 +461,9 @@ if !BUILD_CPP! == 1 ( set additional_rti_libs=nddssecurity !additional_rti_libs! ) - set rtiddsgen_extra_options=-additionalLibraries "crypt32 libcrypto libssl" - set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib" + set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraries "crypt32 libcrypto libssl" + set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib !ndds_security_crypto_lib_folder!" + echo [INFO] rtiddsgen_extra_options=!rtiddsgen_extra_options! echo [INFO] Using security plugin. Linking Statically. ) set "additional_header_files=PerftestSecurity.h !additional_header_files!" @@ -577,7 +599,7 @@ if !BUILD_CPP! == 1 ( call::clean_copied_files if "x!STATIC_DYNAMIC!" == "xdynamic" ( - echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%platform%" + echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%architecture%" if !USE_SECURE_LIBS! == 1 ( echo and \!RELEASE_DEBUG!\bin ) @@ -601,7 +623,7 @@ if !BUILD_CPP11! == 1 ( set "LWS_TAG=Lightweight " ) - echo [INFO_TAG] Using RTI !LWS_TAG!Security Libraries + echo [INFO] Using RTI !LWS_TAG!Security Libraries set "ADDITIONAL_DEFINES=!ADDITIONAL_DEFINES! RTI_SECURE_PERFTEST" @@ -625,11 +647,20 @@ if !BUILD_CPP11! == 1 ( ) ) - REM If the SSL_VERSION is empty and the $RTI_CRYPTOHOME is empty too + REM If the SSL_VERSION is empty and the $RTI_OPENSSLHOME is empty too REM we need to be creative. If we set the $SSL_VERSION before, we will REM not enter here. if "!RTI_OPENSSLHOME!"=="" ( call :crypto_path_calculation + ) else ( + if not exist "%RTI_OPENSSLHOME%\" ( + echo [ERROR] %RTI_OPENSSLHOME% is not a folder. + exit /b -1 + ) + + call :get_rti_security_lib_path_for_crypto_path + echo [INFO] ndds_security_crypto_lib_folder = "!ndds_security_crypto_lib_folder!" + echo [INFO] rtiddsgen_extra_options=!rtiddsgen_extra_options! ) if "%USE_LW_SECURE_LIBS%"=="1" ( @@ -639,7 +670,8 @@ if !BUILD_CPP11! == 1 ( ) set rtiddsgen_extra_options=-additionalLibraries "crypt32 libcrypto libssl" - set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib" + set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib !ndds_security_crypto_lib_folder!" + echo [INFO] rtiddsgen_extra_options=!rtiddsgen_extra_options! echo [INFO] Using security plugin. Linking Statically. ) ) @@ -762,7 +794,7 @@ if !BUILD_CPP11! == 1 ( call::clean_copied_files if "x!STATIC_DYNAMIC!" == "xdynamic" ( - echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%platform%" + echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%architecture%" if !USE_SECURE_LIBS! == 1 ( echo and \!RELEASE_DEBUG!\bin ) @@ -1087,11 +1119,9 @@ goto:EOF GOTO:EOF :get_ddsgen_version - for /F "delims=" %%i in ('"%NDDSHOME%\bin\rtiddsgen.bat" -version ^| findstr /R /C:rtiddsgen') do ( - set version_line=%%i + for /F "tokens=5 delims= " %%i in ('call "%NDDSHOME%\bin\rtiddsgen.bat" -version ^| findstr /R /C:"rtiddsgen version"') do ( + set version_string=%%i ) - set version_string=%version_line:~49,6% - for /F "tokens=1,2,3 delims=." %%a in ("%version_string%") do ( set Major=%%a set Minor=%%b @@ -1101,26 +1131,68 @@ GOTO:EOF set /a version_number=%Major%%Minor%%Revision% GOTO:EOF +:get_rti_security_lib_path_for_crypto_path + + set "ssl_version=openssl-3" + echo %RTI_OPENSSLHOME% | findstr /C:"%ssl_version%" >nul + if not errorlevel 1 ( + call :rti_security_lib_path_calculation %ssl_version% + goto :eof + ) + + set "ssl_version=openssl-1" + echo %RTI_OPENSSLHOME% | findstr /C:"%ssl_version%" >nul + if not errorlevel 1 ( + call :rti_security_lib_path_calculation %ssl_version% + goto :eof + ) + + set "ssl_version=wolfssl-" + echo %RTI_OPENSSLHOME% | findstr /C:"%ssl_version%" >nul + if not errorlevel 1 ( + call :rti_security_lib_path_calculation %ssl_version% + goto :eof + ) + +GOTO:EOF + :crypto_path_calculation + echo. + echo [INFO] Finding crypto libraries to use: set "ssl_version=openssl-3" call :find_ssl_libraries %ssl_version% if not "!RTI_OPENSSLHOME!" == "" ( + call :rti_security_lib_path_calculation %ssl_version% + set "USE_OPENSSL=1" + set "USE_OPENSSL=%USE_OPENSSL%" exit /b ) set "ssl_version=openssl-1" call :find_ssl_libraries %ssl_version% - if not "!RTI_OPENSSLHOME!" == "" ( + if not "!RTI_OPENSSLHOME!"=="" ( + call :rti_security_lib_path_calculation %ssl_version% + set "USE_OPENSSL=1" + set "USE_OPENSSL=%USE_OPENSSL%" + exit /b + ) + + set "ssl_version=wolfssl-" + call :find_ssl_libraries %ssl_version% + if not "!RTI_OPENSSLHOME!"=="" ( + call :rti_security_lib_path_calculation %ssl_version% + set "USE_OPENSSL=0" + set "USE_OPENSSL=%USE_OPENSSL%" exit /b ) REM Well, we tried... - echo. - echo [ERROR] We couldn't find Any SSL libraries in your Connext installation folder. - echo You need to provide us with a path to a crypto library. Set the OpenSSL - echo home path by using the --openssl-home option. - exit /b + echo [ERROR] We couldn't find any SSL libraries in your Connext installation folder. + echo You need to provide a path to a crypto library. + echo Set either the OpenSSL home path using --openssl-home, + echo or the WolfSSL home path using --wolfssl-home. + exit /b -1 :find_ssl_libraries @@ -1147,6 +1219,18 @@ GOTO:EOF ) exit /b +:rti_security_lib_path_calculation + set "find_pattern=%~1" + + set "full_path=" + call :get_absolute_folder_path "%NDDSHOME%\lib\%architecture%\%find_pattern%" + if not "!full_path!"=="" ( + set "ndds_security_crypto_lib_folder=!full_path!" + echo [INFO] Using the Connext Security libs from: "!ndds_security_crypto_lib_folder!" + ) + + set "ndds_security_crypto_lib_folder=%ndds_security_crypto_lib_folder%" + GOTO:EOF :get_absolute_folder_path @@ -1239,6 +1323,10 @@ GOTO:EOF echo. --flatData-max-size size Specify the maximum bounded size in bytes echo. for sequences when using FlatData language echo. binding. Default 10MB + echo. --rtiddsgen-path Use a specific path for the rtiddsgen tool, + echo. overriding NDDSHOME, RTIMEHOME, etc. + echo. If this parameter is not specified, the + echo. default logic in this script will be used. echo. --help -h Display this message. echo[ echo ================================================================================ diff --git a/build.sh b/build.sh index 666e9ea6..1db0abde 100755 --- a/build.sh +++ b/build.sh @@ -48,6 +48,7 @@ MICRO_UNBOUNDED_SEQUENCE_SIZE=1048576 BUILD_CPP=1 BUILD_CPP11=1 BUILD_JAVA=1 +USER_RTIDDSGEN_EXECUTABLE="" # Will hold the user-provided rtiddsgen path BUILD_CS=0 # If this value is != 0, then it means the user specified specific APIS to be @@ -214,8 +215,12 @@ function usage() echo " --micro-use-cert-code [Experimental] Build RTI Perftest for Connext " echo " Micro using the same Perftest code used for " echo " Connext CERT. " - echo " --cert-zc-datalen Size of the array for the ZeroCopy Type in CERT" + echo " --cert-zc-datalen Size of the array for the ZeroCopy Type in CERT" echo " Default is 1024. " + echo " --rtiddsgen-path Use a specific path for the rtiddsgen tool, " + echo " overriding NDDSHOME, RTIMEHOME, etc. " + echo " If this parameter is not specified, the " + echo " default logic in this script will be used. " echo " --help -h Display this message. " echo " " echo "================================================================================" @@ -486,7 +491,7 @@ function find_ssl_libraries() } # If the NDDSHOME is staged, we might find that the nddssecurity library -# is not under $NDDSHOME/lib/$platform/ but under $NDDSHOME/lib/$platform/$ndds_security_cryto_lib_folder +# is not under $NDDSHOME/lib/$platform/ but under $NDDSHOME/lib/$platform/$ndds_security_crypto_lib_folder # lets try to find this path. This is a best effort approach if we cannof find # we will not fail. function rti_security_lib_path_calculation() @@ -496,17 +501,17 @@ function rti_security_lib_path_calculation() export result="" get_absolute_folder_path "${NDDSHOME}/lib/${platform}/${find_pattern}" if [[ "$result" != "" ]]; then - export ndds_security_cryto_lib_folder=$result - echo -e "${INFO_TAG} Using the Connext Security libs from: \"${ndds_security_cryto_lib_folder}\"" + export ndds_security_crypto_lib_folder=$result + echo -e "${INFO_TAG} Using the Connext Security libs from: \"${ndds_security_crypto_lib_folder}\"" return fi } # If the NDDSHOME is staged, we might find that the nddssecurity library -# is not under $NDDSHOME/lib/$platform/ but under $NDDSHOME/lib/$platform/$ndds_security_cryto_lib_folder +# is not under $NDDSHOME/lib/$platform/ but under $NDDSHOME/lib/$platform/$ndds_security_crypto_lib_folder # lets try to find this path. This is a best effort approach if we cannof find # we will not fail. -function get_rti_security_lib_path_for_cryto_path() +function get_rti_security_lib_path_for_crypto_path() { local ssl_version="openssl-3" if [[ "${RTI_CRYPTOHOME}" == *"$ssl_version"* ]]; then @@ -527,7 +532,7 @@ function get_rti_security_lib_path_for_cryto_path() fi } -# Function to try and get the RTI_CRYPTOHOME and ndds_security_cryto_lib_folder when no +# Function to try and get the RTI_CRYPTOHOME and ndds_security_crypto_lib_folder when no # SSL version is provided function crypto_path_calculation() { @@ -668,8 +673,8 @@ function additional_defines_calculation() exit -1 fi - # Lets try to load the ndds_security_cryto_lib_folder if we can. - get_rti_security_lib_path_for_cryto_path + # Lets try to load the ndds_security_crypto_lib_folder if we can. + get_rti_security_lib_path_for_crypto_path fi if [ "${USE_LW_SECURE_LIBS}" == "1" ]; then @@ -682,14 +687,14 @@ function additional_defines_calculation() # libraries will be in a folder specific to the crypto library, we should # have calculated this in advance. - # At this point RTI_CRYPTOHOME must be set. ndds_security_cryto_lib_folder + # At this point RTI_CRYPTOHOME must be set. ndds_security_crypto_lib_folder # will be set only if the $NDDSHOME points to a staging directory. - # In a staging directory, ndds_security_cryto_lib_folder is where + # In a staging directory, ndds_security_crypto_lib_folder is where # the security libraries are (a folder specific to the crypto library). In a normal # installation, the security libraries are in # "${NDDSHOME}/lib/${platform}/", which is already in the path. - if [ -d "${ndds_security_cryto_lib_folder}" ]; then - additional_lib_paths="${ndds_security_cryto_lib_folder} ${additional_lib_paths}" + if [ -d "${ndds_security_crypto_lib_folder}" ]; then + additional_lib_paths="${ndds_security_crypto_lib_folder} ${additional_lib_paths}" fi # Add the path to the crypto libraries. additional_lib_paths="${RTI_CRYPTOHOME}/${RELEASE_DEBUG}/lib ${additional_lib_paths}" @@ -2272,6 +2277,10 @@ while [ "$1" != "" ]; do RTI_USE_CPP_11_INFRASTRUCTURE=0 shift ;; + --rtiddsgen-path) + USER_RTIDDSGEN_EXECUTABLE=$2 + shift + ;; # These options are not exposed to the user (yet) --just-generate) JUST_GENERATE=1 @@ -2325,6 +2334,13 @@ elif [ "${BUILD_MICRO}" -eq "1" ]; then else # Build for ConnextDDS Pro rtiddsgen_executable="$NDDSHOME/bin/rtiddsgen" + # -------------------------------------------------------------------------- + # If the user explicitly set --rtiddsgen-path , override it + if [ -n "${USER_RTIDDSGEN_EXECUTABLE}" ]; then + echo -e "${INFO_TAG} Using user-provided rtiddsgen executable: ${USER_RTIDDSGEN_EXECUTABLE}" + rtiddsgen_executable="${USER_RTIDDSGEN_EXECUTABLE}" + fi + classic_cpp_lang_string=C++ modern_cpp_lang_string=C++11 java_lang_string=java diff --git a/resource/jenkins/manual/BuildAndUploadPerftestToArtifactory.groovy b/resource/jenkins/manual/BuildAndUploadPerftestToArtifactory.groovy new file mode 100644 index 00000000..c1f30d1e --- /dev/null +++ b/resource/jenkins/manual/BuildAndUploadPerftestToArtifactory.groovy @@ -0,0 +1,249 @@ +/* (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +* No duplications, whole or partial, manual or electronic, may be made +* without express written permission. Any such copies, or revisions thereof, +* must display this notice unaltered. +* This code contains trade secrets of Real-Time Innovations, Inc. +*/ + +////////////////////ENV/////////////////// +CONNEXT_VERSION = '' +CONNEXT_VERSION_SHORT = '' +BUILD_IDENTIFIER = '' +BRANCHNAME = '' +ARCHITECTURES = [] +LANGUAGES = [] +////////////////////////////////////////// + +////////////////////UTILS///////////////// +def extractConnextVersion(String artifactoryPath) { + def matcher = artifactoryPath =~ /release(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?/ + if (matcher.find()) { + def major = matcher[0][1] + def minor = matcher[0][2] + def patch = matcher[0][3] + def build = matcher[0][4] // might be null + return build ? "${major}.${minor}.${patch}.${build}" : "${major}.${minor}.${patch}" + } else { + error("Could not extract Connext version from path: ${artifactoryPath}") + } +} + +def extractBuildIdentifier(String artifactoryPath) { + def matcher = artifactoryPath =~ /(BUILD_\d+\.\d+\.\d+\.\d+_\d{8}T\d{6}Z_RTI_REL)/ + if (matcher.find()) { + return matcher[0][1] + } else { + error("Could not extract build identifier from path: ${artifactoryPath}") + } +} + +def getScriptExtension() { + return isUnix() ? 'sh' : 'bat' +} + +def downloadArtifactoryStage(String connextArch) { + echo "Downloading files for ${connextArch}" + def pattern = ARTIFACTORY_PATH + "/staging/connextdds-staging-${connextArch}.tgz" + rtDownload( + serverId: getRtiArtifactoryServerId(), + spec: + """{ + "files": [ + { + "pattern": "${pattern}", + "target": "${env.WORKSPACE}/connextdds-staging-${connextArch}.tgz", + "flat": "true" + } + ] + }""" + ) + runCommand "tar -xzf connextdds-staging-${connextArch}.tgz" +} + +def getVSDevCmdPatternForArch(String connextArch) { + def archMap = [ + 'x64Win64VS2017': "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\*\\Common7\\Tools\\VsDevCmd.bat", + 'x64Win64VS2015': "C:\\Program Files (x86)\\Microsoft Visual Studio\\2015\\*\\Common7\\Tools\\VsDevCmd.bat" + ] + return archMap[connextArch] ?: "" +} + +def getScriptExtensionForArch(String connextArch) { + return connextArch.contains('Win') ? 'zip' : 'tar.gz' +} +///////////////////////////////////////// + +///////////Stages Generation//////////// +def generateBuildStages(List architectures, List languages) { + def stages = [:] + architectures.each { arch -> + stages[arch] = { + node(arch) { + stage(arch) { + cleanWs() + checkout scm + downloadArtifactoryStage(arch) + languages.each { lang -> + stage(lang) { + buildPerftestAgainstPro("${arch}", "${env.WORKSPACE}/unlicensed/rti_connext_dds-${CONNEXT_VERSION_SHORT}", "--${lang} --secure --openssl-home ${env.WORKSPACE}/unlicensed/rti_connext_dds-${CONNEXT_VERSION_SHORT}/third_party/openssl-3.0.12/${arch} --rtiddsgen-path ${env.WORKSPACE}/unlicensed/rti_rtiddsgen/bin/rtiddsgen") } + } + } + } + } + } + return stages +} +def generateUploadBundleStageContent() { + def stages = [:] + stages['Results'] = { + stage('Results') { + node('docker') { + docker.image('repo.rti.com:443/build-docker-prod-hq/docbuilder:latest') + .inside() { + try { + checkout scm + script { + runCommand './build.sh --build-doc' + for (arch in ARCHITECTURES) { + generateBundle(arch) + } + } + } + catch (Exception e) { + error('Error building the uploading packages: ' + e.message) + } + } + } + } + } + return stages +} +///////////////////////////////////////// + +////////////Stages Functions//////////// +def buildPerftestAgainstPro(String connextArch, String nddsHome, String flags) { + def vsDevCmdPath = "" + if (!isUnix()) { + try { + vsDevCmdPath = powershell(script: """ + \$file = Get-ChildItem '${getVSDevCmdPatternForArch(connextArch)}' -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName + if (-not \$file) { exit 1 } + Write-Output \$file + """, returnStdout: true).trim() + } catch (err) { + error "VSDevCmd.bat not found for architecture: ${connextArch}" + } + } + + withEnv(["VSDEVCMD=${vsDevCmdPath}"]) { + echo "Building Perftest against Connext Pro ${connextArch}" + runCommand "./build.${getScriptExtension()} --platform ${connextArch} --nddshome ${nddsHome} ${flags}" + } + stash includes: 'bin/', name: "perftest-${connextArch}" +} + +def generateBundle(String arch) { + unstash "perftest-${arch}" + def folder = "rti_perftest_Connext-${arch}" + + runCommand "mkdir -p ${folder}/bin" + runCommand "mkdir -p ${folder}/resource" + runCommand "mkdir -p ${folder}/doc" + + runCommand "cp -r bin/${arch} ${folder}/bin/" + runCommand "cp -r resource/secure ${folder}/resource/" + runCommand "cp -r doc/* ${folder}/doc/" + runCommand "cp -r perftest_qos_profiles.xml ${folder}/" + + if (!arch.contains('Win')) { + runCommand """ + tar czvf ${folder}.tar.gz ${folder} + """ + } else { + runCommand """ + zip -r ${folder}.zip ${folder}/ + """ + } + rtUpload ( + serverId: getRtiArtifactoryServerId(), + spec: + """{ + "files": [ + { + "pattern": "${env.WORKSPACE}/${folder}.${getScriptExtensionForArch(arch)}", + "target": "perftest-ci/${BRANCHNAME}/connext/${CONNEXT_VERSION}/${BUILD_IDENTIFIER}/${folder}.${getScriptExtensionForArch(arch)}", + "props": "rti.artifact.kind=bundle;rti.product.name=perftest;rti.product.version=${CONNEXT_VERSION}" + } + ] + }""", + failNoOp: true + ) +} +///////////////////////////////////////// + +pipeline { + agent none + + parameters { + string( + name: 'ARTIFACTORY_PATH', + defaultValue: 'connext-ci/pro/release7.5.0.0/BUILD_7.5.0.0_20250313T000000Z_RTI_REL', + description: 'Path where connext will be pulled i.e. connext-ci/pro/release7.5.0.0/BUILD_7.5.0.0_20250313T000000Z_RTI_REL/installers', + trim: true + ) + string( + name: 'CONNEXT_BUILD_PLATFORMS', + defaultValue: 'arm64Darwin20clang12.0,armv8Linux4gcc7.3.0,x64Linux4gcc7.3.0,x64Win64VS2017', + description: 'Comma-separated list of architectures.', + trim: true + ) + string( + name: 'CONNEXT_BUILD_LANGUAGES', + defaultValue: 'cpp-build', + description: 'Comma-separated list of language flags to build.', + trim: true + ) + } + + stages { + stage('Set-Up Environment') { + steps { + script { + ARCHITECTURES = params.CONNEXT_BUILD_PLATFORMS + .split(',') + .collect { it.trim() as String } + + LANGUAGES = params.CONNEXT_BUILD_LANGUAGES + .split(',') + .collect { it.trim() as String } + + CONNEXT_VERSION = extractConnextVersion(params.ARTIFACTORY_PATH) + CONNEXT_VERSION_SHORT = CONNEXT_VERSION.tokenize('.')[0..2].join('.') + BUILD_IDENTIFIER = extractBuildIdentifier(params.ARTIFACTORY_PATH) + BRANCHNAME = (env.CHANGE_ID ? env.CHANGE_BRANCH : env.BRANCH_NAME).tokenize('/')[-1] + echo "Artifactory Path: ${params.ARTIFACTORY_PATH}" + echo "Build Identifier: ${BUILD_IDENTIFIER}" + echo "Connext Version: ${CONNEXT_VERSION}" + echo "Connext Version Short: ${CONNEXT_VERSION_SHORT}" + echo "Perftest Version: ${BRANCHNAME}" + echo "Architectures: ${ARCHITECTURES}" + echo "Languages: ${LANGUAGES}" + } + } + } + stage('Build Perftest') { + steps { + script { + parallel generateBuildStages(ARCHITECTURES, LANGUAGES) + } + } + } + stage('Upload Bundles') { + steps { + script { + parallel generateUploadBundleStageContent() + } + } + } + } +} \ No newline at end of file