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

Ordering edge IDs by a space-filling curve #12

Open
matz-e opened this issue Nov 17, 2024 · 0 comments
Open

Ordering edge IDs by a space-filling curve #12

matz-e opened this issue Nov 17, 2024 · 0 comments

Comments

@matz-e
Copy link
Member

matz-e commented Nov 17, 2024

From JIRA, by @1uc:

Currently, edge IDs are sorted by the tuple (target_gid, source_gid). Which means that a consecutive range of target GIDs has a consecutive range of edge IDs.

edge_ids = population.efferent_edges(gids)
# Perfect access pattern:
population.get_attribute("foo", edge_ids)

However, consecutive source GIDs have edge IDs scattered across the entire available range in small blocks.

edge_ids = population.afferent_edges(gids)
# Very bad access pattern:
population.get_attribute("foo", edge_ids) 

This can be improves by sorting all edges as follows:

sorted(edges, key=lambda edge: space_filling_curve(edge.target_gid, edge.source_gid))

Response by @mgeplf:

This is an interesting trade off to consider; since neurodamus generally reads by target_gid, I think it works well for the 'expensive' case.
IIRC, in the original paper, some effort was done to see if different layouts were tried, but I don't think a space filling curve was used:
https://journals.plos.org/ploscompbiol/article/file?id=10.1371/journal.pcbi.1007696&type=printable (see pg 19)

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

1 participant