Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute the start tag within the federation #81

Merged
merged 15 commits into from
Oct 25, 2024
Merged

Conversation

erlingrj
Copy link
Collaborator

This PR addresses #79 with following changes:

  • Introduce a protobuf message hierarchy with TaggedMessage and various Signals (StartTagSignal being one of them)
  • Assumes a very simple setup where one federate must be chosen as the leader and only it will send out start tags to others. This will of course not work if several federates think they are the leader
  • Any federate that is not the leader will block indefintely waiting for receiving the start_time
  • When start_time is received for this first time by a federate it will be forwarded on all other connections.

Copy link
Contributor

Memory usage after merging this PR will be:

Memory Report

action_microstep_test_c

from to increase (%)
text 71299 82664 15.94
data 960 1344 40.00
bss 480 480 0.00
total 72739 84488 16.15

action_test_c

from to increase (%)
text 71099 82464 15.98
data 960 1344 40.00
bss 480 480 0.00
total 72539 84288 16.20

delayed_conn_test_c

from to increase (%)
text 75610 82207 8.73
data 952 1336 40.34
bss 480 480 0.00
total 77042 84023 9.06

event_queue_test_c

from to increase (%)
text 23406 23406 0.00
data 648 648 0.00
bss 320 320 0.00
total 24374 24374 0.00

physical_action_test_c

from to increase (%)
text 72123 83488 15.76
data 961 1345 39.96
bss 1952 1952 0.00
total 75036 86785 15.66

port_test_c

from to increase (%)
text 75576 82141 8.69
data 952 1336 40.34
bss 480 480 0.00
total 77008 83957 9.02

reaction_queue_test_c

from to increase (%)
text 23083 23083 0.00
data 648 648 0.00
bss 320 320 0.00
total 24051 24051 0.00

shutdown_test_c

from to increase (%)
text 67430 79730 18.24
data 960 1344 40.00
bss 480 480 0.00
total 68870 81554 18.42

startup_test_c

from to increase (%)
text 66746 79046 18.43
data 960 1344 40.00
bss 480 480 0.00
total 68186 80870 18.60

timer_test_c

from to increase (%)
text 66583 78799 18.35
data 952 1336 40.34
bss 480 480 0.00
total 68015 80615 18.53

trigger_data_queue_test_c

from to increase (%)
text 19344 19344 0.00
data 648 648 0.00
bss 320 320 0.00
total 20312 20312 0.00

Copy link
Contributor

Memory usage after merging this PR will be:

Memory Report

action_microstep_test_c

from to increase (%)
text 43239 54117 25.16
data 752 752 0.00
bss 480 480 0.00
total 44471 55349 24.46

action_test_c

from to increase (%)
text 43028 53920 25.31
data 752 752 0.00
bss 480 480 0.00
total 44260 55152 24.61

delayed_conn_test_c

from to increase (%)
text 47434 54626 15.16
data 744 744 0.00
bss 480 480 0.00
total 48658 55850 14.78

event_payload_pool_test_c

from to increase (%)
text 18297 18297 0.00
data 624 624 0.00
bss 320 320 0.00
total 19241 19241 0.00

event_queue_test_c

from to increase (%)
text 27185 27185 0.00
data 728 728 0.00
bss 480 480 0.00
total 28393 28393 0.00

nanopb_test_c

from to increase (%)
text 42362 42661 0.71
data 744 904 21.51
bss 320 320 0.00
total 43426 43885 1.06

physical_action_test_c

from to increase (%)
text 44240 55105 24.56
data 769 769 0.00
bss 2048 2048 0.00
total 47057 57922 23.09

port_test_c

from to increase (%)
text 47309 54501 15.20
data 744 744 0.00
bss 480 480 0.00
total 48533 55725 14.82

reaction_queue_test_c

from to increase (%)
text 26849 26849 0.00
data 728 728 0.00
bss 480 480 0.00
total 28057 28057 0.00

request_shutdown_test_c

from to increase (%)
text 43819 54679 24.78
data 744 744 0.00
bss 480 480 0.00
total 45043 55903 24.11

shutdown_test_c

from to increase (%)
text 40411 51815 28.22
data 752 752 0.00
bss 2720 2720 0.00
total 43883 55287 25.99

startup_test_c

from to increase (%)
text 39742 51146 28.70
data 752 752 0.00
bss 2496 2496 0.00
total 42990 54394 26.53

timer_test_c

from to increase (%)
text 39815 51047 28.21
data 744 744 0.00
bss 2528 2528 0.00
total 43087 54319 26.07

Copy link
Contributor

Memory usage after merging this PR will be:

Memory Report

action_microstep_test_c

from to increase (%)
text 43239 54117 25.16
data 752 752 0.00
bss 480 480 0.00
total 44471 55349 24.46

action_test_c

from to increase (%)
text 43028 53920 25.31
data 752 752 0.00
bss 480 480 0.00
total 44260 55152 24.61

delayed_conn_test_c

from to increase (%)
text 47434 54626 15.16
data 744 744 0.00
bss 480 480 0.00
total 48658 55850 14.78

event_payload_pool_test_c

from to increase (%)
text 18297 18297 0.00
data 624 624 0.00
bss 320 320 0.00
total 19241 19241 0.00

event_queue_test_c

from to increase (%)
text 27185 27185 0.00
data 728 728 0.00
bss 480 480 0.00
total 28393 28393 0.00

nanopb_test_c

from to increase (%)
text 42362 42661 0.71
data 744 904 21.51
bss 320 320 0.00
total 43426 43885 1.06

physical_action_test_c

from to increase (%)
text 44240 55105 24.56
data 769 769 0.00
bss 2048 2048 0.00
total 47057 57922 23.09

port_test_c

from to increase (%)
text 47309 54501 15.20
data 744 744 0.00
bss 480 480 0.00
total 48533 55725 14.82

reaction_queue_test_c

from to increase (%)
text 26849 26849 0.00
data 728 728 0.00
bss 480 480 0.00
total 28057 28057 0.00

request_shutdown_test_c

from to increase (%)
text 43819 54679 24.78
data 744 744 0.00
bss 480 480 0.00
total 45043 55903 24.11

shutdown_test_c

from to increase (%)
text 40411 51815 28.22
data 752 752 0.00
bss 2720 2720 0.00
total 43883 55287 25.99

startup_test_c

from to increase (%)
text 39742 51146 28.70
data 752 752 0.00
bss 2496 2496 0.00
total 42990 54394 26.53

timer_test_c

from to increase (%)
text 39815 51047 28.21
data 744 744 0.00
bss 2528 2528 0.00
total 43087 54319 26.07

Copy link
Contributor

Memory usage after merging this PR will be:

Memory Report

action_microstep_test_c

from to increase (%)
text 43239 54117 25.16
data 752 752 0.00
bss 480 480 0.00
total 44471 55349 24.46

action_test_c

from to increase (%)
text 43028 53920 25.31
data 752 752 0.00
bss 480 480 0.00
total 44260 55152 24.61

delayed_conn_test_c

from to increase (%)
text 47434 54626 15.16
data 744 744 0.00
bss 480 480 0.00
total 48658 55850 14.78

event_payload_pool_test_c

from to increase (%)
text 18297 18297 0.00
data 624 624 0.00
bss 320 320 0.00
total 19241 19241 0.00

event_queue_test_c

from to increase (%)
text 27185 27185 0.00
data 728 728 0.00
bss 480 480 0.00
total 28393 28393 0.00

nanopb_test_c

from to increase (%)
text 42362 42661 0.71
data 744 904 21.51
bss 320 320 0.00
total 43426 43885 1.06

physical_action_test_c

from to increase (%)
text 44240 55105 24.56
data 769 769 0.00
bss 2048 2048 0.00
total 47057 57922 23.09

port_test_c

from to increase (%)
text 47309 54501 15.20
data 744 744 0.00
bss 480 480 0.00
total 48533 55725 14.82

reaction_queue_test_c

from to increase (%)
text 26849 26849 0.00
data 728 728 0.00
bss 480 480 0.00
total 28057 28057 0.00

request_shutdown_test_c

from to increase (%)
text 43819 54679 24.78
data 744 744 0.00
bss 480 480 0.00
total 45043 55903 24.11

shutdown_test_c

from to increase (%)
text 40411 51815 28.22
data 752 752 0.00
bss 2720 2720 0.00
total 43883 55287 25.99

startup_test_c

from to increase (%)
text 39742 51146 28.70
data 752 752 0.00
bss 2496 2496 0.00
total 42990 54394 26.53

timer_test_c

from to increase (%)
text 39815 51047 28.21
data 744 744 0.00
bss 2528 2528 0.00
total 43087 54319 26.07

Copy link
Collaborator Author

@erlingrj erlingrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks OK. @LasseRosenow and @tanneberger, would you please take a look? Summarized the changes are:

  • Federates are now either leader or not, this defines how the start_tag is obtained.
  • I add another level of hierarchy in the messages. I call it FederateMessage which contains TaggedMessage and StartTagSignal currently
  • We must now defer scheduling timers and startups until we have acquired the start tag.
  • Some pico fixes

Copy link
Contributor

Memory usage after merging this PR will be:

Memory Report

action_microstep_test_c

from to increase (%)
text 43239 54117 25.16
data 752 752 0.00
bss 480 480 0.00
total 44471 55349 24.46

action_test_c

from to increase (%)
text 43028 53920 25.31
data 752 752 0.00
bss 480 480 0.00
total 44260 55152 24.61

delayed_conn_test_c

from to increase (%)
text 47434 54626 15.16
data 744 744 0.00
bss 480 480 0.00
total 48658 55850 14.78

event_payload_pool_test_c

from to increase (%)
text 18297 18297 0.00
data 624 624 0.00
bss 320 320 0.00
total 19241 19241 0.00

event_queue_test_c

from to increase (%)
text 27185 27185 0.00
data 728 728 0.00
bss 480 480 0.00
total 28393 28393 0.00

nanopb_test_c

from to increase (%)
text 42362 42661 0.71
data 744 904 21.51
bss 320 320 0.00
total 43426 43885 1.06

physical_action_test_c

from to increase (%)
text 44240 55105 24.56
data 769 769 0.00
bss 2048 2048 0.00
total 47057 57922 23.09

port_test_c

from to increase (%)
text 47309 54501 15.20
data 744 744 0.00
bss 480 480 0.00
total 48533 55725 14.82

reaction_queue_test_c

from to increase (%)
text 26849 26849 0.00
data 728 728 0.00
bss 480 480 0.00
total 28057 28057 0.00

request_shutdown_test_c

from to increase (%)
text 43819 54679 24.78
data 744 744 0.00
bss 480 480 0.00
total 45043 55903 24.11

shutdown_test_c

from to increase (%)
text 40411 51815 28.22
data 752 752 0.00
bss 2720 2720 0.00
total 43883 55287 25.99

startup_test_c

from to increase (%)
text 39742 51146 28.70
data 752 752 0.00
bss 2496 2496 0.00
total 42990 54394 26.53

tcp_channel_test_c

from to increase (%)
text 55002 55382 0.69
data 1000 1160 16.00
bss 11072 11072 0.00
total 67074 67614 0.81

timer_test_c

from to increase (%)
text 39815 51047 28.21
data 744 744 0.00
bss 2528 2528 0.00
total 43087 54319 26.07

Copy link
Contributor

Coverage after merging get-start-tag into main will be

57.94%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
external/nanopb
   pb_common.c48.82%35.94%63.64%53.68%100, 100, 100, 102, 110, 14–15, 152, 166, 168, 171–172, 172, 172, 177, 181, 184–185, 20, 20, 201, 203, 210, 215, 226, 231–232, 238, 238, 238, 241–242, 246, 248, 248, 248, 250, 254, 260, 263, 265, 265, 265, 267, 269, 269, 269, 272–273, 295, 297, 300, 302, 302, 302, 304, 306, 306, 306, 308, 308, 308, 308, 308, 310, 313, 313, 313, 313, 313, 315, 320, 44, 46–48, 50–55, 58, 60–63, 65–70, 74, 77–78, 88–89, 89, 89–90, 90, 90, 93
   pb_decode.c30.06%20.38%54.05%38%100, 1007, 1011–1012, 1012, 1012, 1022, 1024, 1024, 1024–1025, 1027, 1030, 1032, 1032, 1032, 1034, 1038, 1038, 1038, 104, 1042, 1042, 1045, 1045, 1045, 1047, 1047, 1047, 1049, 105, 105, 105, 1050, 1053, 1053, 1053, 1055, 1059, 1059, 1059, 1061, 1063, 1063, 1063–1064, 1066, 1066, 1066, 1069, 1074, 1074, 1074–1076, 108, 1082, 1082, 1082, 1084, 1084, 1084, 1089, 1089, 1089, 109, 109, 109, 1090, 1090, 1090, 1092, 1092, 1092, 1095–1097, 1100, 1104, 1110–1111, 1115–1116, 1116, 1116, 1118, 1118, 1118, 1125, 1129–1130, 1133, 1135, 1135, 1135–1136, 1136, 1136, 1140, 1143, 1145, 1145, 1145, 115, 1154, 1158, 1158, 1158, 116, 1160, 1165, 1165, 1165–1166, 1168, 1170, 1170, 1170–1171, 1179, 127–128, 128, 128, 131–132, 132, 132, 1336, 1341, 1346, 1349, 1349, 1349–1350, 1352–1353, 1356, 1359, 1359, 1359–1360, 1362, 1362, 1362–1363, 1365, 1367, 1370, 1377, 1377, 1377–1378, 1382, 1389, 1393, 1400, 1400, 1400–1401, 1405, 1416, 1420, 1422, 1430–1431, 1434–1436, 1438, 1438, 1438–1440, 1440, 1440–1441, 1443, 1443, 1443, 1445–1446, 1446, 1446, 1456, 1458, 1458, 1458–1459, 1463–1464, 1481, 1483, 1483, 1483–1485, 1485, 1485–1486, 1488, 1488, 1488, 1490–1491, 1491, 1491, 1503–1504, 1506–1507, 1507, 1507, 1510–1511, 1511, 1511, 1513, 1516, 1516, 1516, 1528–1529, 1529, 1529, 1537, 1541, 1543, 1543, 1543–1544, 1546, 1546, 1546–1547, 1547, 1547, 1550, 1552, 1552, 1552–1553, 1553, 1553, 1555, 1555, 1555, 1558, 1558, 1558, 1570, 1570, 1570–1571, 1571, 1571, 1574, 1576, 1576, 1576–1577, 1584, 1593–1594, 1596–1597, 1597, 1597, 1602, 1602, 1602, 1605–1606, 1606, 1606, 1608, 1610, 1610, 1610, 1612, 1618, 1618, 1624–1625, 1633–1634, 1639, 1643, 1643, 1643–1644, 1646, 1646, 1646–1647, 1647, 1647, 1649, 1649, 1649, 1652–1653, 1656, 1656, 1656–1657, 1657, 1657, 1659, 176, 178, 178, 178, 180, 180, 180, 182, 186, 189, 197–198, 202, 202, 202–203, 205, 205, 205, 208, 208, 208–209, 209, 209–210, 210, 210, 210, 210, 212, 212, 212, 212, 212, 214, 214, 214, 217, 217, 217, 219, 219, 219, 219, 219, 221, 221, 221, 223, 227, 229–230, 230, 230, 251–252, 254, 254, 254–255, 255, 255, 259, 266, 271, 271, 271–273, 273, 273–274, 277, 280, 280, 280–281, 288, 298, 300, 308, 310, 310, 310, 310, 310, 310, 312–316, 316, 316, 323, 325–326, 326, 326, 326, 326, 328–329, 332–333, 333, 333–334, 334, 334, 336, 336, 336–338, 338, 338–339, 341–343, 345–347, 349, 355, 355, 355, 365–366, 369–370, 370, 370, 379–380, 380, 380–381, 398, 398, 398, 398, 398, 398, 400–401, 401, 401, 401, 401–402, 402, 402, 404, 409,

@tanneberger tanneberger merged commit 6eb74b1 into main Oct 25, 2024
2 checks passed
@erlingrj erlingrj deleted the get-start-tag branch October 25, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants