Skip to content

Commit

Permalink
Merge pull request #2395 from elBoberido/iox-2394-make-max-client-and…
Browse files Browse the repository at this point in the history
…-server-independently-configurable

iox-#2394 Make max number of Client and Server configurable
  • Loading branch information
elBoberido authored Dec 16, 2024
2 parents f7f07b2 + 0dcaa10 commit e088257
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
- Add //:iceoryx Bazel alias [#2368](https://github.com/eclipse-iceoryx/iceoryx/issues/2368)
- Depend on @ncurses when building with Bazel [#2372](https://github.com/eclipse-iceoryx/iceoryx/issues/2372)
- Fix windows performance issue [#2377](https://github.com/eclipse-iceoryx/iceoryx/issues/2377)
- Max Client and Server cannot be configured independently of Max Publisher and Subscriber [#2394](https://github.com/eclipse-iceoryx/iceoryx/issues/2394)

**Refactoring:**

Expand Down
2 changes: 2 additions & 0 deletions iceoryx_examples/small_memory/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ set(IOX_MAX_NUMBER_OF_CONDITION_VARIABLES 8 CACHE STRING "")
set(IOX_MAX_NODE_NAME_LENGTH 30 CACHE STRING "")
set(IOX_MAX_ID_STRING_LENGTH 30 CACHE STRING "")
set(IOX_MAX_RUNTIME_NAME_LENGTH 30 CACHE STRING "")
set(IOX_MAX_CLIENTS 4 CACHE STRING "")
set(IOX_MAX_SERVERS 2 CACHE STRING "")
set(IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY 2 CACHE STRING "")
set(IOX_MAX_RESPONSE_QUEUE_CAPACITY 2 CACHE STRING "")
set(IOX_MAX_REQUEST_QUEUE_CAPACITY 2 CACHE STRING "")
Expand Down
4 changes: 4 additions & 0 deletions iceoryx_posh/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ configure_file(
"IOX_INTERPROCESS_SEMAPHORE": "UnnamedSemaphore",
"IOX_MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY": "8",
"IOX_MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY": "256",
"IOX_MAX_CLIENTS": "512",
"IOX_MAX_CLIENTS_PER_SERVER": "256",
"IOX_MAX_ID_STRING_LENGTH": "100",
"IOX_MAX_INTERFACE_NUMBER": "4",
Expand All @@ -52,6 +53,7 @@ configure_file(
"IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY": "16",
"IOX_MAX_RESPONSE_QUEUE_CAPACITY": "16",
"IOX_MAX_RUNTIME_NAME_LENGTH": "85",
"IOX_MAX_SERVERS": "128",
"IOX_MAX_SHM_SEGMENTS": "100",
"IOX_MAX_SUBSCRIBERS": "1024",
"IOX_MAX_SUBSCRIBERS_PER_PUBLISHER": "256",
Expand All @@ -64,6 +66,7 @@ configure_file(
"IOX_INTERPROCESS_SEMAPHORE": "UnnamedSemaphore",
"IOX_MAX_CHUNKS_ALLOCATED_PER_PUBLISHER_SIMULTANEOUSLY": "8",
"IOX_MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY": "256",
"IOX_MAX_CLIENTS": "512",
"IOX_MAX_CLIENTS_PER_SERVER": "256",
"IOX_MAX_ID_STRING_LENGTH": "100",
"IOX_MAX_INTERFACE_NUMBER": "4",
Expand All @@ -81,6 +84,7 @@ configure_file(
"IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY": "16",
"IOX_MAX_RESPONSE_QUEUE_CAPACITY": "16",
"IOX_MAX_RUNTIME_NAME_LENGTH": "87",
"IOX_MAX_SERVERS": "128",
"IOX_MAX_SHM_SEGMENTS": "100",
"IOX_MAX_SUBSCRIBERS": "1024",
"IOX_MAX_SUBSCRIBERS_PER_PUBLISHER": "256",
Expand Down
8 changes: 8 additions & 0 deletions iceoryx_posh/cmake/IceoryxPoshDeployment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ configure_option(
NAME IOX_MAX_RUNTIME_NAME_LENGTH
DEFAULT_VALUE ${IOX_MAX_RUNTIME_NAME_LENGTH_DEFAULT}
)
configure_option(
NAME IOX_MAX_SERVERS
DEFAULT_VALUE 128
)
configure_option(
NAME IOX_MAX_CLIENTS
DEFAULT_VALUE 512
)
configure_option(
NAME IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY
DEFAULT_VALUE 16
Expand Down
2 changes: 2 additions & 0 deletions iceoryx_posh/cmake/iceoryx_posh_deployment.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ constexpr uint32_t IOX_MAX_NUMBER_OF_CONDITION_VARIABLES =
constexpr uint32_t IOX_MAX_NODE_NAME_LENGTH = static_cast<uint32_t>(@IOX_MAX_NODE_NAME_LENGTH@);
constexpr uint32_t IOX_MAX_ID_STRING_LENGTH = static_cast<uint32_t>(@IOX_MAX_ID_STRING_LENGTH@);
constexpr uint32_t IOX_MAX_RUNTIME_NAME_LENGTH = static_cast<uint32_t>(@IOX_MAX_RUNTIME_NAME_LENGTH@);
constexpr uint32_t IOX_MAX_CLIENTS = static_cast<uint32_t>(@IOX_MAX_CLIENTS@);
constexpr uint32_t IOX_MAX_SERVERS = static_cast<uint32_t>(@IOX_MAX_SERVERS@);
constexpr uint32_t IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY =
static_cast<uint32_t>(@IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY@);
constexpr uint32_t IOX_MAX_RESPONSE_QUEUE_CAPACITY = static_cast<uint32_t>(@IOX_MAX_RESPONSE_QUEUE_CAPACITY@);
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ constexpr uint32_t MAX_INTERFACE_CAPRO_FIFO_SIZE = MAX_PUBLISHERS;
constexpr uint32_t MAX_CHANNEL_NUMBER = MAX_PUBLISHERS + MAX_SUBSCRIBERS;
constexpr uint32_t MAX_GATEWAY_SERVICES = 2 * MAX_CHANNEL_NUMBER;
// Client
constexpr uint32_t MAX_CLIENTS = build::IOX_MAX_SUBSCRIBERS;
constexpr uint32_t MAX_CLIENTS = build::IOX_MAX_CLIENTS;
constexpr uint32_t MAX_REQUESTS_ALLOCATED_SIMULTANEOUSLY = 4U;
constexpr uint32_t MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY = build::IOX_MAX_RESPONSES_PROCESSED_SIMULTANEOUSLY;
constexpr uint32_t MAX_RESPONSE_QUEUE_CAPACITY = build::IOX_MAX_RESPONSE_QUEUE_CAPACITY;
// Server
constexpr uint32_t MAX_SERVERS = build::IOX_MAX_PUBLISHERS;
constexpr uint32_t MAX_SERVERS = build::IOX_MAX_SERVERS;
constexpr uint32_t MAX_CLIENTS_PER_SERVER = build::IOX_MAX_CLIENTS_PER_SERVER;
constexpr uint32_t MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY = build::IOX_MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY;
constexpr uint32_t MAX_RESPONSES_ALLOCATED_SIMULTANEOUSLY = MAX_REQUESTS_PROCESSED_SIMULTANEOUSLY;
Expand Down
20 changes: 11 additions & 9 deletions iceoryx_posh/test/integrationtests/test_service_discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,19 +1002,19 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices)
{
::testing::Test::RecordProperty("TEST_ID", "e0b292c2-49ce-47b4-b38e-456732240c41");
// maximum number of producers to generate
auto constexpr MAX = TestFixture::maxProducers(TestFixture::Variation::PATTERN);
auto constexpr SUT_MAX = TestFixture::maxProducers(TestFixture::Variation::PATTERN);
// first threshold to change generation strategy at (about 1/3 of max)
auto constexpr N1 = MAX / 3;
auto constexpr SUT_N1 = SUT_MAX / 3;
// second threshold to change generation strategy at (about 2/3 of max)
auto constexpr N2 = 2 * N1;
auto constexpr SUT_N2 = 2 * SUT_N1;

// phase 1 : generate random services (no Umlaut)
auto s1 = randomService();
this->add(s1);

uint32_t created = 1;

for (; created < N1; ++created)
for (; created < SUT_N1; ++created)
{
this->add(randomService());
}
Expand All @@ -1025,13 +1025,13 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices)
++created;

// phase 2 : fix service, generate random instances (no Umlaut)
for (; created < N2; ++created)
for (; created < SUT_N2; ++created)
{
this->add(randomService("Ferdinand"));
}

// phase 3 : fix service and instance, generate random events (no Umlaut)
for (; created < MAX - 1; ++created)
for (; created < SUT_MAX - 1; ++created)
{
this->add(randomService("Ferdinand", "Spitz"));
}
Expand All @@ -1040,21 +1040,23 @@ TYPED_TEST(ServiceDiscoveryFindService_test, FindInMaximumMixedServices)
this->add(s3);
++created;

EXPECT_EQ(created, MAX);
EXPECT_EQ(created, SUT_MAX);

// create some services of the other kind
created = 0;

auto constexpr OTHER_MAX = TestFixture::maxProducers(TestFixture::otherPattern());
auto constexpr OTHER_N1 = OTHER_MAX / 3;
auto constexpr OTHER_N2 = 2 * OTHER_N1;

// same phases, but now for the other service type
// note that thresholds N1, N2 are chosen in a way that we can reuse them
for (; created < N1; ++created)
for (; created < OTHER_N1; ++created)
{
this->addOther(randomService());
}

for (; created < N2; ++created)
for (; created < OTHER_N2; ++created)
{
this->addOther(randomService("Spitz"));
}
Expand Down

0 comments on commit e088257

Please sign in to comment.