delay from_step_
update clock_+from_step<=T
Definition: scheduler.h:418
int int_t
Integer number with at least 16 bit.
Definition: nest.h:95
void increment_n_gsd()
Increment total number of global spike detectors by 1.
Definition: scheduler.h:641
static const delay comm_marker_
Marker Value to be put between the data fields from different time steps during communication.
Definition: scheduler.h:552
std::vector< uint_t > local_grid_spikes_
Buffer containing the gids of local neurons that spiked in the last min_delay_ interval.
Definition: scheduler.h:517
static vector< delay > slice_moduli_
Table of pre-computed slice-based modulos.
Definition: scheduler.h:480
volatile index exit_counter_
Counter for exit barrier.
Definition: scheduler.h:409
long_t grng_seed_
The seed of the global RNG, not neccessarily describing the state of the GRNG.
Definition: scheduler.h:431
void prepare_node_(Node *)
Initialized buffers, register in list of nodes to update/finalize.
Definition: scheduler.h:753
void reset()
Bring scheduler back to its initial state.
Definition: scheduler.cpp:109
delay to_do_
number of pending cycles.
Definition: scheduler.h:416
index get_n_gsd()
Get total number of global spike detectors.
Definition: scheduler.h:647
index get_gid() const
Return global Network ID.
Definition: node.h:753
thread get_num_processes() const
Return the number of processes used during simulation.
Definition: scheduler.h:623
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
void set_num_rec_processes(int nrp, bool called_by_reset=false)
Set number of recording processes, switches NEST to global spike detection mode.
thread vp_to_thread(thread vp) const
Definition: scheduler.h:690
std::vector< OffGridSpike > global_offgrid_spikes_
Buffer containing the gids and offsets for all neurons that fired off-grid spikes in the last min_del...
Definition: scheduler.h:538
Time const get_time() const
Precise time of simulation.
Definition: scheduler.h:610
void send_offgrid_remote(thread p, SpikeEvent &, const long_t lag=0)
Add global id of event sender to the spike_register.
Definition: scheduler.h:776
void set_num_threads(thread n_threads)
Set the number of threads by setting the internal variable n_threads_, the corresponding value in the...
thread get_num_threads() const
Return the number of threads used during simulation.
Definition: scheduler.h:617
std::vector< std::vector< std::vector< uint_t > > > spike_register_
Register for gids of neurons that spiked.
Definition: scheduler.h:500
void init_()
Initialize the scheduler by initializing the buffers.
Definition: scheduler.cpp:129
size_t get_slice() const
Get slice number.
Definition: scheduler.h:817
index n_gsd_
Total number of global spike detectors, used for distributing them over recording processes...
Definition: scheduler.h:406
void prepare_nodes()
Prepare nodes for simulation and register nodes in node_list.
Definition: scheduler.cpp:586
void terminate()
Definition: scheduler.h:823
void deliver_events_(thread t)
Read all event buffers for thread t and send the corresponding Events to the Nodes that are targeted...
static delay get_slice_modulo(delay d)
Index to slice-based buffer.
Definition: scheduler.h:795
void clear_pending_spikes()
Clear all pending spikes, but do not otherwise manipulate scheduler.
Definition: scheduler.cpp:124
index n_threads_
Number of threads per process.
Definition: scheduler.h:401
void update()
Update all non-frozen nodes.
Definition: scheduler.cpp:485
Scheduler(Network &)
Definition: scheduler.cpp:79
static void update_delay_extrema_()
Update delay extrema to current values.
Definition: scheduler.cpp:230
virtual void calibrate()=0
Re-calculate dependent parameters of the node.
static Network * net_
Pointer to network object.
Definition: scheduler.h:440
Node & get_sender() const
Return reference to sending Node.
Definition: event.h:732
static delay get_min_delay()
Return minimal connection delay.
Definition: scheduler.h:805
Time clock_
Network clock, updated once per slice.
Definition: scheduler.h:414
void finalize_nodes()
Invoke finalize() on nodes registered for finalization.
bool is_local_node(Node *) const
Return true if the node on the local machine, false if not.
Definition: scheduler.h:666
long t_real_
Accumunated wall-clock time spent simulating (in us)
Definition: scheduler.h:423
std::vector< OffGridSpike > local_offgrid_spikes_
Buffer containing the gids and offsets for local neurons that fired off-grid spikes in the last min_d...
Definition: scheduler.h:531
void create_rngs_(const bool ctor_call=false)
Time const & get_slice_origin() const
Time at beginning of current slice.
Definition: scheduler.h:598
double_t get_offset() const
Return the creation time offset of the Event.
Definition: event.h:787
index nodes_vec_network_size_
Network size when nodes_vec_ was last updated.
Definition: scheduler.h:412
void calibrate()
Definition: nest_time.h:369
std::vector< int > displacements_
Buffer containing the starting positions for the spikes from each process within the global_(off)grid...
Definition: scheduler.h:544
thread get_num_rec_processes() const
Definition: scheduler.h:629
bool print_time_
Indicates whether time should be printed during simulations (or not)
Definition: scheduler.h:428
bool force_singlethreading_
Definition: scheduler.h:399
int_t get_multiplicity() const
Definition: event.h:352
bool simulating_
true if simulation in progress
Definition: scheduler.h:398
virtual ~Scheduler()
Definition: scheduler.cpp:104
Definition: nest_time.h:130
bool get_off_grid_communication() const
return current communication style.
Definition: scheduler.h:728
unsigned short targetindex
Unsigned short type for compact target representation.
Definition: nest.h:123
void set_network_(Network *)
thread get_process_id(thread vp) const
Return the process id for a given virtual process.
Definition: scheduler.h:653
void init_buffers()
Initialize buffers of a node.
Definition: node.cpp:73
void simulate(Time const &)
Simulate for the given time .
Definition: scheduler.cpp:292
static delay max_delay_
Value of the largest delay in the network.
Definition: scheduler.h:456
thread suggest_vp(index gid) const
Return a thread number for a given global node id.
Definition: scheduler.h:678
vector< vector< Node * > > nodes_vec_
Nodelists for nodes for each thread.
Definition: scheduler.h:411
void init_moduli_()
Definition: scheduler.cpp:173
static vector< delay > moduli_
Table of pre-computed modulos.
Definition: scheduler.h:467
void ensure_valid_thread_local_ids()
Ensure that all nodes in the network have valid thread-local IDs.
Definition: scheduler.h:342
librandom::RngPtr get_grng() const
Return pointer to global random number generator.
Definition: scheduler.h:741
librandom::RngPtr grng_
Global random number generator.
Definition: scheduler.h:491
const Name vp("vp")
Node parameter.
Definition: nest_names.h:341
Main administrative interface to the network.
Definition: network.h:135
thread thread_to_vp(thread t) const
Definition: scheduler.h:703
void set_off_grid_communication(bool off_grid_spiking)
set communication style to off_grid (true) or on_grid
Definition: scheduler.h:722
bool is_local_vp(thread) const
Return true if the thread is on the local machine, false if not.
Definition: scheduler.h:672
const Name thread_local_id("thread_local_id")
Thead-local ID of node, see Kunkel et al 2014, Sec 3.3.2.
Definition: nest_names.h:310
volatile index entry_counter_
Counter for entry barrier.
Definition: scheduler.h:408
void configure_spike_buffers_()
Resize spike_register and comm_buffer to correct dimensions.
Definition: scheduler.cpp:252
thread get_global_thread_id(thread lt) const
Return the global thread id of a local thread.
static int get_num_processes()
Definition: communicator.h:421
thread get_vp() const
Retrieve the number of the virtual process to which the node is assigned.
Definition: node.h:837
friend struct step
Definition: nest_time.h:171
delay slice_
current update slice
Definition: scheduler.h:415
bool terminate_
Terminate on signal or error.
Definition: scheduler.h:425
librandom::RngPtr get_rng(const thread) const
Return pointer to random number generator of the specified thread.
Definition: scheduler.h:734
void update_nodes_vec_()
Create up-to-date vector of local nodes, nodes_vec_.
index n_sim_procs_
MPI processes used for simulation.
Definition: scheduler.h:404
Combined storage of GID and offset information for off-grid spikes.
Definition: communicator.h:75
Time get_previous_slice_origin() const
Time at beginning of previous slice.
Definition: scheduler.h:604
timeval t_slice_begin_
Wall-clock time at the begin of a time slice.
Definition: scheduler.h:421
ad push_back(new StringDatum("("+modulepath+"/pynest-init.sli) run"))
void create_grng_(const bool ctor_call=false)
static delay get_max_delay()
Return maximal connection delay.
Definition: scheduler.h:811
void collocate_buffers_()
Rearrange the spike_register into a 2-dim structure.
index n_rec_procs_
MPI processes dedicated for recording devices.
Definition: scheduler.h:403
void calibrate_clock()
Calibrate clock after resolution change.
Definition: scheduler.h:747
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
long_t delay
Delay of a connection.
Definition: nest.h:178
Default types used by the NEST kernel.
static delay get_modulo(delay d)
Return (T+d) mod max_delay.
Definition: scheduler.h:785
Event for spike information.
Definition: event.h:320
std::vector< long_t > rng_seeds_
The seeds of the local RNGs. These do not neccessarily describe the state of the RNGs.
Definition: scheduler.h:430
static delay min_delay_
Value of the smallest delay in the network.
Definition: scheduler.h:448
bool simulated_
indicates whether the network has already been simulated for some time
Definition: scheduler.h:426
void gather_events_()
Collocate buffers and exchange events with other MPI processes.
Base class for all NEST network objects.
Definition: node.h:96
void send_remote(thread p, SpikeEvent &, const long_t lag=0)
Add global id of event sender to the spike_register.
Definition: scheduler.h:768
Communicator::OffGridSpike OffGridSpike
Definition: scheduler.h:47
bool off_grid_spiking_
indicates whether spikes are not constrained to the grid
Definition: scheduler.h:427
bool get_simulated() const
Return true, if the network has already been simulated for some time.
Definition: scheduler.h:716
timeval t_slice_end_
Wall-clock time at the end of time slice.
Definition: scheduler.h:422
std::vector< uint_t > global_grid_spikes_
Buffer containing the gids of all neurons that spiked in the last min_delay_ interval.
Definition: scheduler.h:524
Schedule update of Nodes and Events during simulation.
Definition: scheduler.h:66
static int get_rank()
Definition: communicator.h:416
void get_status(DictionaryDatum &) const
void finalize_()
Finalize the scheduler by freeing the buffers and destoying the mutexes.
Definition: scheduler.cpp:162
const Name p("p")
current release probability (Tsodyks2_connection)
Definition: nest_names.h:218
delay to_step_
update clock_+from_step<=T
Definition: scheduler.h:419
bool initialized_
Definition: scheduler.h:397
void finalize_simulation()
Cleanup after the simulation.
Definition: scheduler.cpp:411
int_t thread
Thread index type.
Definition: nest.h:133
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
vector< librandom::RngPtr > rng_
Vector of random number generators for threads.
Definition: scheduler.h:486
const double e
Definition: numerics.cpp:62
void resume()
Resume simulation after an interrupt.
Definition: scheduler.cpp:430
void compute_moduli_()
Re-compute table of fixed modulos, including slice-based.
Definition: scheduler.cpp:208
thread get_num_sim_processes() const
Definition: scheduler.h:635
Node * thread_lid_to_node(thread t, targetindex thread_local_id) const
Definition: scheduler.h:762
delay to_do_total_
number of requested cycles in current simulation.
Definition: scheduler.h:417
void prepare_simulation()
All steps that must be done before a simulation.
Definition: scheduler.cpp:365
std::vector< std::vector< std::vector< OffGridSpike > > > offgrid_spike_register_
Register for off-grid spikes.
Definition: scheduler.h:510
void set_status(const DictionaryDatum &)
thread suggest_rec_vp(index gid) const
Return a thread number for a given global recording node id.
Definition: scheduler.h:684