Skip to content

Commit 2823a5e

Browse files
ktfdavidrohr
authored andcommitted
DPL: provide unique DDS id as --id when running with --dds
This makes sure the XML is generated with the template macro we then need to make sure FairMQ sees a unique id across the whole DDS deployment.
1 parent fbcb35d commit 2823a5e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Framework/Core/src/DDSConfigHelpers.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ void dumpDeviceSpec2DDS(std::ostream& out,
145145
if (!arg) {
146146
break;
147147
}
148+
if (strcmp(arg, "--id") == 0 && ai + 1 < execution.args.size()) {
149+
out << fmt::format(R"(--id {}_dds%TaskIndex%_%CollectionIndex% )", execution.args[ai + 1]);
150+
ai++;
151+
continue;
152+
}
148153
// Do not print out the driver client explicitly
149154
if (strcmp(arg, "--driver-client-backend") == 0) {
150155
ai++;

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 --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-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 --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-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 --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-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 --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-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>

0 commit comments

Comments
 (0)