Skip to content

Fix get_data() hanging on NEST when an MPI process has no cells of a population - #867

Merged
apdavison merged 1 commit into
NeuralEnsemble:masterfrom
apdavison:fix-nest-mpi-empty-rank
Nov 19, 2026
Merged

apdavison merged 1 commit into
NeuralEnsemble:masterfrom
apdavison:fix-nest-mpi-empty-rank

Conversation

@apdavison

Copy link
Copy Markdown
Member

With NEST, get_data() hangs when a population has fewer cells than there are MPI processes. On a process with no cells of the population, Population.id_to_index() is called with an empty array of spike source IDs and fails, so the other processes wait forever in gather().

Here, we make id_to_index() return an empty array in that case. The script from #767 now runs on 2, 3 and 4 processes. NEURON is not affected, since its recorder returns spike times as a dict, which takes a different code path. Arbor's recorder takes the same path as NEST's, so it was probably affected too, but this has not been tested with MPI.

The new unit test fakes MPI process 2 of 3 with the mock backend, and fails without the fix with the error seen in #767.

The cause identified in #767 (only some MPI processes reading NEST's current time) no longer applies on master.

Fixes #767

…population

On a process with no local cells, id_to_index() failed on the empty array of spike source IDs, so the other processes waited forever in gather(). Checked with the script from NeuralEnsemble#767 on 2, 3 and 4 processes.

Fixes NeuralEnsemble#767
@apdavison apdavison added this to the 0.14.0 milestone Nov 19, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 74.194% (+0.004%) from 74.19% — apdavison:fix-nest-mpi-empty-rank into NeuralEnsemble:master

@apdavison
apdavison merged commit 7251754 into NeuralEnsemble:master Nov 19, 2026
9 checks passed
@apdavison
apdavison deleted the fix-nest-mpi-empty-rank branch November 19, 2026 22:50
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.

The simulations freeze when the number of neuron in a population is lower than the number of MPI processes

2 participants