Skip to content

NEST hangs when setting connection weight in parallel simulations #3099

@heplesser

Description

@heplesser

The tests below will pass if run serially, but hang when run with mpirun -np 2 pytest .... This also holds if only one of the three tests is executed. Usually, one MPI process will report success while the other never completes. Note that for two processes, only one will actually have the connection. Presumably, this leads to incorrect MPI communication, where one rank hangs.

This PR is based on a bug report by Xavier Otzau on the NEST User Mailing List.

import nest
import pytest


@pytest.fixture
def conns():
    nest.ResetKernel()
    nrn = nest.Create('parrot_neuron')
    nest.Connect(nrn, nrn)
    return nest.GetConnections()

def test_conn_weight(conns):
    if conns:
        conns.weight = 2.5

def test_set_weight(conns):
    if conns:    
        conns.set({'weight': 2.5})

def test_set_status_weight(conns):
    if conns:
        nest.SetStatus(conns, 'weight', 2.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)S: HighShould be handled nextT: BugWrong statements in the code or documentation

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions