Skip to content

Commit 45baf28

Browse files
committed
DPL: Forward --shm-allocation option to FairMQ
1 parent bd76ac3 commit 45baf28

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Framework/Core/src/DeviceSpecHelpers.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,7 @@ void DeviceSpecHelpers::prepareArguments(bool defaultQuiet, bool defaultStopped,
11971197
realOdesc.add_options()("shm-zero-segment", bpo::value<std::string>());
11981198
realOdesc.add_options()("shm-throw-bad-alloc", bpo::value<std::string>());
11991199
realOdesc.add_options()("shm-segment-id", bpo::value<std::string>());
1200+
realOdesc.add_options()("shm-allocation", bpo::value<std::string>());
12001201
realOdesc.add_options()("shm-monitor", bpo::value<std::string>());
12011202
realOdesc.add_options()("channel-prefix", bpo::value<std::string>());
12021203
realOdesc.add_options()("network-interface", bpo::value<std::string>());
@@ -1351,6 +1352,7 @@ boost::program_options::options_description DeviceSpecHelpers::getForwardedDevic
13511352
("shm-zero-segment", bpo::value<std::string>()->default_value("false"), "zero shared memory segment") //
13521353
("shm-throw-bad-alloc", bpo::value<std::string>()->default_value("true"), "throw if insufficient shm memory") //
13531354
("shm-segment-id", bpo::value<std::string>()->default_value("0"), "shm segment id") //
1355+
("shm-allocation", bpo::value<std::string>()->default_value("rbtree_best_fit"), "shm allocation method") //
13541356
("environment", bpo::value<std::string>(), "comma separated list of environment variables to set for the device") //
13551357
("stacktrace-on-signal", bpo::value<std::string>()->default_value("all"), //
13561358
"dump stacktrace on specified signal(s) (any of `all`, `segv`, `bus`, `ill`, `abrt`, `fpe`, `sys`.)") //

Framework/Core/test/test_FrameworkDataFlowToDDS.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ BOOST_AUTO_TEST_CASE(TestDDS)
115115
dumpDeviceSpec2DDS(ss, "", devices, executions, command);
116116
auto expected = R"EXPECTED(<topology name="o2-dataflow">
117117
<decltask name="A">
118-
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id A_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --channel-config "name=from_A_to_B,type=push,method=bind,address=ipc://@localhostworkflow-id_22000,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_A_to_C,type=push,method=bind,address=ipc://@localhostworkflow-id_22001,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
118+
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id A_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-allocation rbtree_best_fit --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --channel-config "name=from_A_to_B,type=push,method=bind,address=ipc://@localhostworkflow-id_22000,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_A_to_C,type=push,method=bind,address=ipc://@localhostworkflow-id_22001,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
119119
</decltask>
120120
<decltask name="B">
121-
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id B_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --channel-config "name=from_B_to_D,type=push,method=bind,address=ipc://@localhostworkflow-id_22002,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_A_to_B,type=pull,method=connect,address=ipc://@localhostworkflow-id_22000,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
121+
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id B_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-allocation rbtree_best_fit --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --channel-config "name=from_B_to_D,type=push,method=bind,address=ipc://@localhostworkflow-id_22002,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_A_to_B,type=pull,method=connect,address=ipc://@localhostworkflow-id_22000,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
122122
</decltask>
123123
<decltask name="C">
124-
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id C_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --channel-config "name=from_C_to_D,type=push,method=bind,address=ipc://@localhostworkflow-id_22003,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_A_to_C,type=pull,method=connect,address=ipc://@localhostworkflow-id_22001,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
124+
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id C_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-allocation rbtree_best_fit --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --channel-config "name=from_C_to_D,type=push,method=bind,address=ipc://@localhostworkflow-id_22003,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_A_to_C,type=pull,method=connect,address=ipc://@localhostworkflow-id_22001,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
125125
</decltask>
126126
<decltask name="D">
127-
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id D_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --a-param 1 --b-param "" --c-param "foo;bar" --channel-config "name=from_B_to_D,type=pull,method=connect,address=ipc://@localhostworkflow-id_22002,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_C_to_D,type=pull,method=connect,address=ipc://@localhostworkflow-id_22003,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
127+
<exe reachable="true">foo | LD_PRELOAD=libSegFault.so SEGFAULT_SIGNALS="all" foo --id D_dds%TaskIndex%_%CollectionIndex% --shm-monitor false --log-color false --color false --early-forward-policy never --jobs 4 --severity info --shm-allocation rbtree_best_fit --shm-mlock-segment false --shm-mlock-segment-on-creation false --shm-segment-id 0 --shm-throw-bad-alloc true --shm-zero-segment false --stacktrace-on-signal all --a-param 1 --b-param "" --c-param "foo;bar" --channel-config "name=from_B_to_D,type=pull,method=connect,address=ipc://@localhostworkflow-id_22002,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --channel-config "name=from_C_to_D,type=pull,method=connect,address=ipc://@localhostworkflow-id_22003,transport=shmem,rateLogging=0,rcvBufSize=1,sndBufSize=1" --session dpl_workflow-id --plugin odc</exe>
128128
</decltask>
129129
<declcollection name="DPL">
130130
<tasks>

Framework/Core/test/test_FrameworkDataFlowToO2Control.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ const std::vector expectedTasks{
180180
- "'1'"
181181
- "--severity"
182182
- "'info'"
183+
- "--shm-allocation"
184+
- "'rbtree_best_fit'"
183185
- "--shm-mlock-segment"
184186
- "'false'"
185187
- "--shm-mlock-segment-on-creation"
@@ -247,6 +249,8 @@ const std::vector expectedTasks{
247249
- "'1'"
248250
- "--severity"
249251
- "'info'"
252+
- "--shm-allocation"
253+
- "'rbtree_best_fit'"
250254
- "--shm-mlock-segment"
251255
- "'false'"
252256
- "--shm-mlock-segment-on-creation"
@@ -314,6 +318,8 @@ const std::vector expectedTasks{
314318
- "'1'"
315319
- "--severity"
316320
- "'info'"
321+
- "--shm-allocation"
322+
- "'rbtree_best_fit'"
317323
- "--shm-mlock-segment"
318324
- "'false'"
319325
- "--shm-mlock-segment-on-creation"
@@ -382,6 +388,8 @@ const std::vector expectedTasks{
382388
- "'1'"
383389
- "--severity"
384390
- "'info'"
391+
- "--shm-allocation"
392+
- "'rbtree_best_fit'"
385393
- "--shm-mlock-segment"
386394
- "'false'"
387395
- "--shm-mlock-segment-on-creation"

0 commit comments

Comments
 (0)