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

Banks, multi ports and special connection patterns #209

Closed
cmnrd opened this issue Sep 3, 2020 · 4 comments
Closed

Banks, multi ports and special connection patterns #209

cmnrd opened this issue Sep 3, 2020 · 4 comments
Assignees
Labels
compiler runtime Related to the runtime implementation

Comments

@cmnrd
Copy link
Collaborator

cmnrd commented Sep 3, 2020

This issue is closely related to #190. Since this issue grew to be quite extensive, I figured it would be best to break certain aspects down into a separate issue.

So while discussing the issue in #190 we often said that there is no use-case for referencing individual ports and that we should always connect entire banks and/or multi ports. However, as it turns out there is at least one use-case... meet the All-Pairs Shortest Path (APSP) benchmark from the Savina suite. The benchmark essentially consists of a grid of workers, where each worker solves a part of the problem and sends updates to its neighbors. A grid of 4x4 workers looks like this:
rect834
where each of the rectangle represents a worker actor/reactor and each worker is connected to its neighbors.

So how can such a grid be build in Lingua Franca elegantly? Of course, all the workers can be placed in a bank, but then there is no way to draw individual connections. Even if there would be such a mechanism, listing all the connections explicitly is not a real solution.

In order to solve this issues properly, I think we would need an expressive syntax in LF. But I don't think that's the way to go, as we will only get more problems (similar to the parameterized widths). Maybe it is a good alternative to use the expressiveness of our target languages instead. We could expose the connection mechanism in a callable function and allow drawing of connection in a startup mutation. Saroush also proposed, that the target code could generate an adjacency matrix, that then is respected while creating reactions.

@edwardalee
Copy link
Collaborator

Yes, this could be another higher-order pattern similar to the ScatterGather example. It could be realized today in a manner similar to ScatterGather, but a better approach would be to first abstract what ScatterGather does into an API. Today, ScatterGather reaches directly into the guts of the C implementation.

@lhstrh
Copy link
Member

lhstrh commented Sep 3, 2020

I've been building the API for mutations in the TypeScript runtime. I'll take a stab at implementing All-Pairs Shortest Path using a startup mutation.

@cmnrd
Copy link
Collaborator Author

cmnrd commented Sep 4, 2020

Yes, a higher level function could help to solve this. It just should be general enough so that various connection patterns and not just a plain grid can be created. I am not sure how this could be achieved. I think you are right, and we should take small steps and find a general solution for ScatterGather first.

@lhstrh lhstrh added the runtime Related to the runtime implementation label Jan 23, 2021
@cmnrd cmnrd self-assigned this Aug 20, 2021
@cmnrd
Copy link
Collaborator Author

cmnrd commented Sep 15, 2021

Closing this. #406 proves that our current connection syntax is sufficient for covering all benchmarks from the Savina suite that do not support mutations.

@cmnrd cmnrd closed this as completed Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler runtime Related to the runtime implementation
Projects
None yet
Development

No branches or pull requests

3 participants