NEST behaves incorrectly or fails when connecting sliced layers while using MPI #3108
Labels
I: No breaking change
Previously written code will work as before, no one should note anything changing (aside the fix)
S: High
Should be handled next
T: Bug
Wrong statements in the code or documentation
Projects
This issue is based on a recent post on the NEST User Mailing List. Thanks to Miriam Kempter for reporting it!
A minimal reproducer with two different cases triggering errors in different locations is
First issue
In the first case (with 7 neurons), the call to
neurons[pick].spatial
leads to use of an invalid access here:nest-simulator/nestkernel/nest.cpp
Line 438 in 8e85268
To protect against uncaught invalid access, one should add in
nest-simulator/sli/tokenarray.h
Lines 186 to 196 in 8e85268
an
assert( index_is_valid( i ) );
Second issue
In the other case (with 5 neurons), the
Connect()
call in presence of amask
leads to and out-of-bounds exception herenest-simulator/nestkernel/free_layer.h
Line 302 in 8e85268
which calls
https://github.com/nest/nest-simulator/blob/8e85268ca512e0f509240fb5ef06f62a4e61a67e/nestkernel/free_layer.h#L270-275
Analysis
The most critical parts are probably
nest-simulator/nestkernel/nest.cpp
Line 420 in 8e85268
NodeCollection::const_iterator
, especially fromNodeCollection::MPI_local_begin()
andNodeCollection::local_begin()
and the increment operators for the iterator.The logic of these in relation to slicing and MPI needs review.
The text was updated successfully, but these errors were encountered: