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

Support for non-trivial array connections #9

Open
klausschuch opened this issue Apr 28, 2023 · 4 comments
Open

Support for non-trivial array connections #9

klausschuch opened this issue Apr 28, 2023 · 4 comments
Assignees

Comments

@klausschuch
Copy link
Contributor

klausschuch commented Apr 28, 2023

Based on discussion in #8, trivial connections between array connectors will be possible. Trivial here means that both arrays match regarding the number of dimensions and the sizes of these dimensions.
It needs to be decided which other connections should be supported by SSP.

some examples of connections that could/should be considered (a is a scalar; A,B,C are 2d arrays)

  1. from a scalar to a single element of an array: a -> A(1,1)
  2. from a single element of an array to a single element of an array: A(1,1) -> B(1,1)
  3. from a scalar to an array: a -> A (each element of A gets connected with a)
  4. from a single element of an array to an array: A(1,1) -> B (each element of B gets connected with A(1,1))

We might also consider slices of arrays:
5. fixed slices: a -> A(1:3,2), A(1:3,1:2) -> B(2:4,1:2)
6. semi-defined slices: A(1:4,:) -> B(2:5,:)

Or even more complex connections like:
7. A(1:x;:) -> C(1:x;:), B(1:x;:) -> C(x:2*x;:), where x is a structuralParameter

@pmai
Copy link
Collaborator

pmai commented Jul 7, 2023

Absolute minimal semantics is:

  1. Only same-shaped arrays can be connected.

Full, but potentially inconvenient, functionality for fixed-size arrays is provided by 1 + 2, since all other connections can be built up from this for fixed-size arrays.

For dynamic arrays something like 5/6 (slices, semi-defined slices) is needed at a minimum, and very convenient for fixed-size arrays.

3+4 might then be handled as special cases of 5+6.

Start initial PR with just 0/1/2, then expand for 5/6 (+3/4).

Case 7 can be postponed to a later release.

@DagBruck
Copy link
Contributor

DagBruck commented Jul 10, 2023

I think part of this proposal is reasonable, specifically:

  1. Only same-shaped arrays can be connected.
  2. from a scalar to a single element of an array: a -> A(1,1).
  3. from a single element of an array to a single element of an array: A(1,1) -> B(1,1).

I'm against the suggestion to allow connection of scalar to an entire array, meaning every element in the array. I believe it is a rare special case, and the semantic would be too hidden. If needed you can handle that with a block that does conversion between array and scalar.

@JochenKoehler
Copy link
Collaborator

Web meeting 2023-09-15
There should be a first simple (80/20) solution (discussion in a short round) in form of a pull request.
Canditate for a deep dive session.

@pmai
Copy link
Collaborator

pmai commented Sep 20, 2023

I have implemented 0-2 in the #8 PR via start/endIndices attributes on connections.

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

No branches or pull requests

4 participants