lingua-franca
lingua-franca copied to clipboard
Federated Modal Models
Activated federated code generation for modal reactors. Also added tests for both C and Python
@Soroosh129 Could you help me here?
I created test models for federates with modes in C and Python but I wasn't able to test them in a distributed way on my machine, so I am not sure if I configured them correctly. C has a Segmentation fault
but Python seems to run, at least on Ubuntu.
What do you think, is this a problems with the tests, the runtime implementation, or a larger conceptual one?
I created test models for federates with modes in C and Python but I wasn't able to test them in a distributed way on my machine, so I am not sure if I configured them correctly.
If you want to create a true distributed version of a test (where federates run on distinct hosts), you could utilize our Docker support, built by @housengw. Here is an test that imports an existing federated test with the addition of a docker: true
flag in the target property of the test. This test will automatically run in multiple Docker containers (one for the RTI and one for each federate) in our CI.
C has a Segmentation fault but Python seems to run, at least on Ubuntu.
Looking at the failed test on GitHub Actions, it looks like the TraceTesting reactor is causing the test failure. I'm surprised that the Python test passes but not the C test.
Does this segfault happen on your local machine? Could you please share the output?
What do you think, is this a problems with the tests, the runtime implementation, or a larger conceptual one?
I don't see a conceptual issue unless modes are at the top-level federated reactor. If the Python tests pass (which looks like they do), then I also don't see how this could be a runtime implementation issue.
Have you tried to set logging: debug
or use gdb to launch the segfaulting federate after setting the build-type: RelWithDebInfo
target property for the failing test? I will also have a bit of free time tomorrow morning and can take a look.
One note: I think the federated tests should be put in the federated
folder instead of modal_models
simply because federated execution is not supported on Windows and the federated
test category is excluded from Windows test runs.
I was able to resolve the segfault in C, but the Python tests and the decentralized test still fail.
For Python, I think the same strategy employed in 0c8c9877e3be0c61130551071349deaf16218f77 should work. I.e., we need to make sure that only timers, state variables, etc. that actually belong to a federate are considered while generating code for that federate.
I will have a bit free time later this week to work on this if needed.