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

Add pinnedness planning #300

Merged
merged 5 commits into from
Oct 5, 2021
Merged

Add pinnedness planning #300

merged 5 commits into from
Oct 5, 2021

Conversation

patrickkwang
Copy link
Contributor

No description provided.

strider/query_planner.py Outdated Show resolved Hide resolved
def get_pinnedness(qgraph, qnode_id):
"""Get pinnedness of each node."""
adjacency_mat = get_adjacency_matrix(qgraph)
return -_get_pinnedness_recursively(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is there a minus sign here? I think it's easy to miss and should be more obvious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified some naming/documentation to try and make this more readable.

num_ids = ids
A[qnode_id][qnode_id] = num_ids
for qedge in qgraph["edges"].values():
A[qedge["subject"]][qedge["object"]] = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about self-edges?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch... this will break somewhat if self edges are present, and also will not work as we perhaps hope if there are multi-edges. I think it can be made to work nicely, it will just take a little more thought.

@patrickkwang patrickkwang merged commit 0343e37 into master Oct 5, 2021
@patrickkwang patrickkwang deleted the pinnedness-planning branch October 5, 2021 15:51
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