nest / nestml

A domain specific language for neuron and synapse models in spiking neural network simulation
GNU General Public License v2.0
46 stars 45 forks source link

Error with `random_normal()` function #1016

Open pnbabu opened 6 months ago

pnbabu commented 6 months ago

When the random_normal() function is called from the parameters or state block of the NESTML model, the simulation script with the model throws an error:

Assertion failed: (tid < static_cast< size_t >( vp_specific_rngs_.size() )), function get_vp_specific_rng, file random_manager.h, line 166.

In the generated code, the parameter with the random_normal() function is initialized in the constructor

P_.internal_val = ((0) + (0.2) * normal_dev_( nest::get_vp_specific_rng( get_thread() ) )); // as real

At this point in the code, the thread ID via the get_thread() function is not yet available with the node which results in the error.

clinssen commented 6 months ago

Based on discussion at the 2024 Q1 NEST hackathon, we concluded that implementing this in NEST Simulator would be difficult. In this case, we should forbid users from using RNGs in the parameters (or internals, or state) initialisation when generating code for the NEST target. (This should be a target platform-specific coco.)