Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Ordering edge IDs by a space-filling curve #12

@matz-e

Description

@matz-e

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions