Skip to content

DumpLayerConnections fails when connecting source layer to more than one target layer #2629

@nicolossus

Description

@nicolossus

This is a follow-up to an issue reported on the mailing list. When using NEST 3.4 (or current master), the following script fails:

import nest

pos = nest.spatial.grid(shape=[3, 3])
input = nest.Create('iaf_psc_alpha', positions=pos)

layer_0 = nest.Create('iaf_psc_alpha', positions=pos)
layer_1 = nest.Create('iaf_psc_alpha', positions=pos)

conn_neur = {'rule': 'pairwise_bernoulli',
             'use_on_source': True, 'mask': {'grid': {'shape': [3, 3]}}}

nest.Connect(input, layer_0, conn_neur)
nest.Connect(input, layer_1, conn_neur)
nest.DumpLayerConnections(input, layer_0, 'static_synapse', 'conn.txt')

The script works fine with NEST 3.3 (and Python 3.9). Hence, it seems like a bug has been introduced at some point, which makes DumpLayerConnections fail when a source layer is connected to more than one target layer.

The error message reads:

Assertion failed: (lid < dims_[ 0 ]), function lid_to_position, file grid_layer.h, line 223.
[machine-id] *** Process received signal ***
[machine-id] Signal: Abort trap: 6 (6)
[machine-id] Signal code:  (0)
[machine-id] [ 0] 0   libsystem_platform.dylib            0x00007ff80b9c2dfd _sigtramp + 29
[machine-id] [ 1] 0   ???                                 0x0000000000000000 0x0 + 0
[machine-id] [ 2] 0   libsystem_c.dylib                   0x00007ff80b8f8d24 abort + 123
[machine-id] [ 3] 0   libsystem_c.dylib                   0x00007ff80b8f80cb err + 0
[machine-id] [ 4] 0   libnestkernel.master.dylib          0x000000010868f873 _ZNK4nest9GridLayerILi2EE12get_positionEm.cold.1 + 35
[machine-id] [ 5] 0   libnestkernel.master.dylib          0x000000010867095c _ZNK4nest9GridLayerILi2EE12get_positionEm + 204
[machine-id] [ 6] 0   libnestkernel.master.dylib          0x0000000108650c52 _ZN4nest5LayerILi2EE16dump_connectionsERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEENS2_10shared_ptrINS_14NodeCollectionEEENS8_INS_13AbstractLayerEEERK5Token + 1394
[machine-id] [ 7] 0   libnestkernel.master.dylib          0x00000001086780c3 _ZN4nest22dump_layer_connectionsERK5TokenNSt3__110shared_ptrINS_14NodeCollectionEEES6_R12lockPTRDatumINS3_13basic_ostreamIcNS3_11char_traitsIcEEEEXadL_ZN14SLIInterpreter11OstreamtypeEEEE + 403
[machine-id] [ 8] 0   libnestkernel.master.dylib          0x00000001085a3b74 _ZNK4nest10NestModule37DumpLayerConnections_os_g_g_lFunction7executeEP14SLIInterpreter + 324
[machine-id] [ 9] 0   libsli.master.dylib                 0x000000010890537f _ZN13FunctionDatum7executeEP14SLIInterpreter + 447
[machine-id] [10] 0   libsli.master.dylib                 0x000000010890d0b2 _ZN14SLIInterpreter8execute_Em + 402
[machine-id] [11] 0   libsli.master.dylib                 0x000000010890dc5f _ZN14SLIInterpreter7executeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 639
[machine-id] [12] 0   pynestkernel.so                     0x00000001082b5d49 _ZL41__pyx_pw_12pynestkernel_10NESTEngine_9runP7_objectS0_ + 329
[machine-id] [13] 0   python3.9                           0x00000001060356f9 method_vectorcall_O + 121
[machine-id] [14] 0   python3.9                           0x000000010613e8dd _PyEval_EvalFrameDefault + 34413
[machine-id] [15] 0   python3.9                           0x00000001060268b4 _PyFunction_Vectorcall + 420
[machine-id] [16] 0   python3.9                           0x000000010613d13e _PyEval_EvalFrameDefault + 28366
[machine-id] [17] 0   python3.9                           0x0000000106026be2 _PyFunction_Vectorcall + 1234
[machine-id] [18] 0   python3.9                           0x000000010613d13e _PyEval_EvalFrameDefault + 28366
[machine-id] [19] 0   python3.9                           0x00000001060268b4 _PyFunction_Vectorcall + 420
[machine-id] [20] 0   python3.9                           0x000000010613fd9e _PyEval_EvalFrameDefault + 39726
[machine-id] [21] 0   python3.9                           0x0000000106134637 _PyEval_EvalCode + 663
[machine-id] [22] 0   python3.9                           0x00000001061b3a84 run_mod + 196
[machine-id] [23] 0   python3.9                           0x00000001061b24d7 pyrun_file + 167
[machine-id] [24] 0   python3.9                           0x00000001061b204c pyrun_simple_file + 460
[machine-id] [25] 0   python3.9                           0x00000001061b1e55 PyRun_SimpleFileExFlags + 53
[machine-id] [26] 0   python3.9                           0x00000001061d62b7 pymain_run_file + 279
[machine-id] [27] 0   python3.9                           0x00000001061d5a81 pymain_run_python + 417
[machine-id] [28] 0   python3.9                           0x00000001061d5895 Py_RunMain + 37
[machine-id] [29] 0   python3.9                           0x0000000105fc7068 main + 56
[machine-id] *** End of error message ***
Abort trap: 6

Metadata

Metadata

Assignees

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