-
Notifications
You must be signed in to change notification settings - Fork 130
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
Rename misleading topological_sort to bfs_nodes #1590
Rename misleading topological_sort to bfs_nodes #1590
Conversation
6b2f543
to
355cabd
Compare
355cabd
to
fe23f49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
@@ -1848,7 +1848,7 @@ def get_next_scope_entries(self, sdfg, dfg, scope_entry): | |||
parent_scope = dfg.scope_subgraph(parent_scope_entry) | |||
|
|||
# Get all scopes from the same level | |||
all_scopes = [node for node in parent_scope.topological_sort() if isinstance(node, dace.sdfg.nodes.EntryNode)] | |||
all_scopes = [node for node in parent_scope.bfs_nodes() if isinstance(node, dace.sdfg.nodes.EntryNode)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this not .nodes()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, a bit of a guess, but maybe because of the next line:
return all_scopes[all_scopes.index(scope_entry) + 1:]
.nodes()
might return a different order.
@@ -2096,7 +2096,7 @@ def get_next_scope_entries(self, dfg, scope_entry): | |||
|
|||
# Get all non-sequential scopes from the same level | |||
all_scopes = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not exactly sure why this does not use scope_subgraph
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I'll try to look into this later. But for now I'd like to wrap up this PR. If we should change this, I think it should be in a separate PR.
But thanks for pointing it out. Looks like there's a potential to improve the code there.
This is currently work in progress to see how we can best fix this misleading naming.
Fixes #1560
Since #1560 is still in flux, we have to make sure the PR stays in sync with what we are discussing in #1560.
Additionally, at the call-sites of the previous topological_sort (before renaming), there are various comments to use a topoligical sort. After the renaming, they become misleading, so we should probably fix/improve those comments.