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.

EdgePopulation.get_attribute with significant number of non-consecutive edge ids #225

@joni-herttuainen

Description

@joni-herttuainen

I stumbled on a case in which I have a big number of scattered (i.e., generally non-consecutive) edge ids. If I wrap the selection in libsonata.Selection, the call for EdgePopulation.get_attribute(...) takes a significant amount of time.

For example, if I

edge_pop.get_attribute("afferent_section_id", libsonata.Selection(edge_ids))

the performance is significantly worse than doing:

edge_pop.get_attribute("afferent_section_id", edge_pop.select_all())[edge_ids]

There's a test case to demonstrate this effect in:

/gpfs/bbp.cscs.ch/project/proj30/home/herttuai/libsonata_sel_test/

It can be run with the run.sh. Example of the run output:

$ ./run_test.sh 
Autoloading python/3.9.7
Autoloading hpe-mpi/2.25.hmpt

Running test...
number of total edge_ids 267023294
number of wanted edge ids: 2244619
length of selection ranges: 2231745

Duration, 'select_all and take edge_ids': 0.31s
Duration, 'Selection(edge_ids)': 30.92s

For smaller circuits, I guess doing select_all is not an issue, but for bigger ones, there might be concerns such as memory usage.

Metadata

Metadata

Assignees

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