Skip to content

nest simulation does not receive events from a non-nest script #66

@cristianoalessandro

Description

@cristianoalessandro

Hi all,

I am running into the following issue with a very simple music example. I have a non-nest script sending spikes to a nest simulation. The latter simply consists of a parrot neuron that should just replicate the received events, and a spike detectors that should write the spikes to a file. Unfortunately, the file remains empty as if no spikes are received.

I debugged it as follows:

  1. use a nest script as a sender while keeping the original nest receiver. This works: the receiver writes appropriate spike events to the file. Meaning that the receiver should be fine.
  2. use the original non-nest sender, and a non-nest receiver (it does the same thing as the original nest receiver). This works as well. Meaning that the sender should be fine.
  3. use a nest sender and a nest receiver (both doing the same thing as the original scripts). This works too: the receiver writes appropriate events to the file.

The only case that does not work is when I have a non-nest sender and a nest-receiver. Do you have a clue why that could be the case? Code is as follows...

Non-nest sender

import music
import sys

timestep = 0.001
stoptime = 1.0     # This is the actual execution time, not the simulated time span

setup = music.Setup()
outp = setup.publishEventOutput("out")

firstId = 0 
size = 1 
buf = 1 
        
outp.map (music.Index.GLOBAL,
          base=firstId,
          size=size,
          maxBuffered=buf)

runtime = setup.runtime(timestep)

tickt = runtime.time()
while tickt <= stoptime:
    # Send an event for each tick, util stoptime
    outp.insertEvent(tickt, firstId, music.Index.GLOBAL)
    runtime.tick()
    tickt = runtime.time()

Nest receiver

import nest

N = 1

nest.SetKernelStatus({"overwrite_files": True})

meip = nest.Create ('music_event_in_proxy', N)
nest.SetStatus (meip, [{'port_name': 'spikes_in', 'music_channel': 0}])

delay=2.0

nest.SetAcceptableLatency('spikes_in', delay)

# Parrot neuron
n_in = nest.Create ("parrot_neuron", N)
nest.Connect(meip, n_in, 'one_to_one', {"weight":1.0, "delay": delay})

# Create a spike detecor
sdetector = nest.Create("spike_detector")
nest.SetStatus(sdetector, {"withgid": True, "withtime": True, "to_file": True,
    "label": "receive", "file_extension": "spikes"})
nest.Connect(n_in, sdetector)

nest.Simulate (1000.0)

Music config file

[from]
  binary=./sender.py
  np=1

[to]
  binary=./receiver_nest.py
  np=1

from.out -> to.spikes_in [1]

Metadata

Metadata

Assignees

No one assigned

    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