From 50be38619108180405c084220ae27453224def70 Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Fri, 13 Dec 2019 11:55:24 +0100 Subject: [PATCH] Support and require DDS 3.0 --- CMakeLists.txt | 10 ++-------- examples/dds/CMakeLists.txt | 7 ------- examples/dds/fairmq-start-ex-dds.sh.in | 25 +++++++++++-------------- fairmq/plugins/DDS/DDS.h | 3 +-- fairmq/plugins/DDS/runDDSCommandUI.cxx | 2 +- fairmq/sdk/DDSEnvironment.cxx | 10 +++------- fairmq/sdk/DDSSession.cxx | 2 +- fairmq/sdk/DDSTopology.cxx | 12 ++++-------- fairmq/sdk/Topology.cxx | 3 +-- test/sdk/_dds.cxx | 3 +-- test/sdk/_topology.cxx | 3 +-- 11 files changed, 26 insertions(+), 54 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 131be4e9..a796b649 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,21 +85,15 @@ if(BUILD_NANOMSG_TRANSPORT) ) endif() -if(BUILD_SDK) - set(required_dds_version 2.5.100) -else() - set(required_dds_version 2.4) -endif() - if(BUILD_SDK_COMMANDS) find_package2(PRIVATE Flatbuffers REQUIRED) endif() if(BUILD_DDS_PLUGIN OR BUILD_SDK) find_package2(PRIVATE DDS REQUIRED - VERSION ${required_dds_version} + VERSION 3.0 ) - set(DDS_Boost_COMPONENTS system log log_setup) + set(DDS_Boost_COMPONENTS system log log_setup regex filesystem thread) set(DDS_Boost_VERSION 1.67) endif() diff --git a/examples/dds/CMakeLists.txt b/examples/dds/CMakeLists.txt index 675e4ed9..55de9157 100644 --- a/examples/dds/CMakeLists.txt +++ b/examples/dds/CMakeLists.txt @@ -28,12 +28,6 @@ target_link_libraries(fairmq-ex-dds-sink PRIVATE ExampleDDSLib) add_custom_target(ExampleDDS DEPENDS fairmq-ex-dds-sampler fairmq-ex-dds-processor fairmq-ex-dds-sink) -if(DDS_VERSION VERSION_LESS 2.5.25) - set(WAIT_COMMAND "dds-info --wait-for-idle-agents") -else() - set(WAIT_COMMAND "dds-info --idle-count --wait") -endif() - set(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_BINARY_DIR}/fairmq/plugins/DDS) set(DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ex-dds-topology.xml ${CMAKE_CURRENT_BINARY_DIR}/ex-dds-topology.xml @ONLY) @@ -47,7 +41,6 @@ if(DDS_FOUND) add_test(NAME Example.DDS.localhost COMMAND ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-dds.sh localhost) set_tests_properties(Example.DDS.localhost PROPERTIES TIMEOUT 15 - RUN_SERIAL true PASS_REGULAR_EXPRESSION "Example successful" ) endif() diff --git a/examples/dds/fairmq-start-ex-dds.sh.in b/examples/dds/fairmq-start-ex-dds.sh.in index 33cf1abb..d0398142 100755 --- a/examples/dds/fairmq-start-ex-dds.sh.in +++ b/examples/dds/fairmq-start-ex-dds.sh.in @@ -36,20 +36,18 @@ if [[ "$plugin" == "ssh" ]]; then else dds-submit -r ${plugin} --slots ${requiredNofSlots} fi -echo "...waiting for ${requiredNofSlots} slots..." -@WAIT_COMMAND@ ${requiredNofSlots} +echo "...waiting for ${requiredNofSlots} idle slots..." +dds-info --idle-count --wait ${requiredNofSlots} topologyFile=@DATA_DIR@/ex-dds-topology.xml echo "TOPOLOGY FILE: ${topologyFile}" -# TODO Uncomment once DDS 2.6 is released -# echo "TOPOLOGY NAME: $(dds-topology --disable-validation --topology-name ${topologyFile})" +echo "TOPOLOGY NAME: $(dds-topology --disable-validation --topology-name ${topologyFile})" -# TODO Uncomment once DDS 2.6 is released -# dds-info --active-topology +dds-info --active-topology dds-topology --activate ${topologyFile} -# dds-info --active-topology -# dds-info --wait-for-executing-agents ${requiredNofSlots} -sleep 1 +dds-info --active-topology +echo "...waiting for ${requiredNofSlots} executing slots..." +dds-info --executing-count --wait ${requiredNofSlots} echo "------------------------" echo "...waiting for Topology to finish..." @@ -69,14 +67,13 @@ fairmq-dds-command-ui -c s -w "RUNNING->READY" -n ${requiredNofSlots} fairmq-dds-command-ui -c t -w "DEVICE READY" -n ${requiredNofSlots} fairmq-dds-command-ui -c d -w "IDLE" -n ${requiredNofSlots} fairmq-dds-command-ui -c q -w "EXITING" -n ${requiredNofSlots} -echo "...waiting for ${requiredNofSlots} slots..." -@WAIT_COMMAND@ ${requiredNofSlots} +echo "...waiting for ${requiredNofSlots} idle slots..." +dds-info --idle-count --wait ${requiredNofSlots} echo "------------------------" -# TODO Uncomment once DDS 2.6 is released -# dds-info --active-topology +dds-info --active-topology dds-topology --stop -# dds-info --active-topology +dds-info --active-topology dds-agent-cmd getlog -a logDir="${wrkDir}/logs" diff --git a/fairmq/plugins/DDS/DDS.h b/fairmq/plugins/DDS/DDS.h index cd1c3228..b9c94ab5 100644 --- a/fairmq/plugins/DDS/DDS.h +++ b/fairmq/plugins/DDS/DDS.h @@ -13,8 +13,7 @@ #include #include -#include -#include +#include #include #include diff --git a/fairmq/plugins/DDS/runDDSCommandUI.cxx b/fairmq/plugins/DDS/runDDSCommandUI.cxx index 22a7c5b5..5c7389ee 100644 --- a/fairmq/plugins/DDS/runDDSCommandUI.cxx +++ b/fairmq/plugins/DDS/runDDSCommandUI.cxx @@ -9,7 +9,7 @@ #include #include -#include +#include #include diff --git a/fairmq/sdk/DDSEnvironment.cxx b/fairmq/sdk/DDSEnvironment.cxx index 2d383ebd..e880a99f 100644 --- a/fairmq/sdk/DDSEnvironment.cxx +++ b/fairmq/sdk/DDSEnvironment.cxx @@ -8,15 +8,11 @@ #include "DDSEnvironment.h" +#include +#include +#include #include #include - -#include - -#include -#include - -#include #include #include diff --git a/fairmq/sdk/DDSSession.cxx b/fairmq/sdk/DDSSession.cxx index 76213906..a4866cd4 100644 --- a/fairmq/sdk/DDSSession.cxx +++ b/fairmq/sdk/DDSSession.cxx @@ -8,11 +8,11 @@ #include "DDSSession.h" -#include #include #include #include #include +#include #include #include #include diff --git a/fairmq/sdk/DDSTopology.cxx b/fairmq/sdk/DDSTopology.cxx index f4715f3d..0a24cd31 100644 --- a/fairmq/sdk/DDSTopology.cxx +++ b/fairmq/sdk/DDSTopology.cxx @@ -9,18 +9,14 @@ #include "DDSTopology.h" #include - -#include -#include - +#include #include - -#include - +#include +#include +#include #include #include #include -#include namespace fair { namespace mq { diff --git a/fairmq/sdk/Topology.cxx b/fairmq/sdk/Topology.cxx index 0bc1d422..af35ad48 100644 --- a/fairmq/sdk/Topology.cxx +++ b/fairmq/sdk/Topology.cxx @@ -8,8 +8,7 @@ #include "Topology.h" -#include -#include +#include namespace fair { namespace mq { diff --git a/test/sdk/_dds.cxx b/test/sdk/_dds.cxx index 47b56659..6a420a6b 100644 --- a/test/sdk/_dds.cxx +++ b/test/sdk/_dds.cxx @@ -8,8 +8,7 @@ #include "Fixtures.h" -#include -#include +#include namespace { diff --git a/test/sdk/_topology.cxx b/test/sdk/_topology.cxx index 1d80d302..420790f6 100644 --- a/test/sdk/_topology.cxx +++ b/test/sdk/_topology.cxx @@ -9,8 +9,7 @@ #include "Fixtures.h" #include -#include -#include +#include #include #include