38 #ifdef AURYN_CODE_USE_MPI 39 #include <boost/mpi.hpp> 41 #endif //AURYN_CODE_USE_MPI 46 #include <boost/progress.hpp> 47 #include <boost/random/mersenne_twister.hpp> 48 #include <boost/random/variate_generator.hpp> 49 #include <boost/random/uniform_int.hpp> 50 #include <boost/random/uniform_int_distribution.hpp> 52 #define PROGRESSBAR_DEFAULT_UPDATE_INTERVAL 1000 53 #define LOGGER_MARK_INTERVAL (10000*1000) // 1000s 75 #ifdef AURYN_CODE_USE_MPI 76 mpi::communicator * mpicom;
78 #endif // AURYN_CODE_USE_MPI 80 unsigned int mpi_size_;
81 unsigned int mpi_rank_;
85 std::vector<SpikingGroup *> spiking_groups;
86 std::vector<Connection *> connections;
87 std::vector<Device *> devices;
88 std::vector<Checker *> checkers;
92 boost::mt19937 seed_gen;
93 boost::random::uniform_int_distribution<> * seed_dist;
94 boost::variate_generator<boost::mt19937&, boost::random::uniform_int_distribution<> > * seed_die;
96 double simulation_time_realtime_ratio;
99 double last_elapsed_time;
104 int online_rate_monitor_id;
106 double online_rate_monitor_tau;
107 double online_rate_monitor_mul;
108 double online_rate_monitor_state;
111 void evolve_online_rate_monitor();
117 void progressbar (
double fraction,
AurynTime clk );
139 void evolve_connections();
142 void execute_devices();
145 bool execute_checkers();
166 #ifdef AURYN_CODE_USE_MPI 168 System(mpi::communicator * communicator);
172 #endif // AURYN_CODE_USE_MPI 279 bool run(
AurynFloat simulation_time,
bool checking=
true);
337 #ifdef AURYN_CODE_USE_MPI 339 #endif // AURYN_CODE_USE_MPI 372 #ifdef CODE_COLLECT_SYNC_TIMING_STATS 378 void reset_sync_time();
AurynDouble get_total_effective_load()
Get total effective load.
void set_output_dir(std::string path)
Set output dir for fn function.
Definition: System.cpp:664
bool run_chunk(AurynFloat chunk_time, AurynFloat interval_start, AurynFloat interval_end, bool checking=true)
Runs simulation for a given amount of time.
Definition: System.cpp:634
unsigned int get_seed()
Returns a random seed which is different on each rank.
Definition: System.cpp:1030
unsigned int progressbar_update_interval
The progressbar update interval in timesteps of auryn_timestep.
Definition: System.h:164
The abstract base class for all Connection objects in Auryn.
Definition: Connection.h:53
double get_total_elapsed_time()
Returns total elapsed time in seconds.
Definition: System.cpp:961
mpi::communicator * get_com()
Returns global mpi communicator.
Definition: System.cpp:648
std::string get_simulation_name()
Returns the simulation name.
Definition: System.cpp:659
Class that implements system wide variables and methods to manage and run simulations.
Definition: System.h:70
unsigned int mpi_rank()
Returns current rank.
Definition: System.cpp:1009
unsigned int mpi_size()
Returns number of ranks.
Definition: System.cpp:1004
Container class providing Auryn version number.
Definition: AurynVersion.h:37
void load_network_state(std::string basename)
Loads network state from a netstate file.
Definition: System.cpp:812
void set_online_rate_monitor_target(SpikingGroup *group=NULL)
Sets the target group for online rate estimate.
Definition: System.cpp:950
double get_last_elapsed_time()
Returns last elapsed time in seconds.
Definition: System.cpp:956
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynLong get_total_synapses()
Get total number of registered synapses.
Definition: System.cpp:251
AurynTime * get_clock_ptr()
Gets a pointer to the current clock.
Definition: System.cpp:236
void register_checker(Checker *checker)
Registers an instance of Checker to the checkers vector.
Definition: System.cpp:277
void set_simulation_name(std::string name)
Sets the simulation name.
Definition: System.cpp:654
AurynVersion build
Version info.
Definition: System.h:161
Definition: ABSConnection.h:38
bool quiet
Switch to turn output to quiet mode (no progress bar).
Definition: System.h:158
void flush_devices()
Flush devices.
Definition: System.cpp:969
unsigned long AurynLong
An unsigned long type used to count synapses or similar.
Definition: auryn_definitions.h:154
void set_online_rate_monitor_tau(AurynDouble tau=100e-3)
Sets the timeconstant to compute the online rate average for the status bar.
Definition: System.cpp:925
void register_device(Device *device)
Registers an instance of Device to the devices vector.
Definition: System.cpp:272
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
The abstract base class for all checkers.
Definition: Checker.h:47
void save_network_state_text(std::string basename)
Saves the network state to human readable text files.
Definition: System.cpp:784
void set_master_seed(unsigned int seed=123)
Set master seed.
Definition: System.cpp:1014
virtual ~System()
Definition: System.cpp:171
AurynDouble get_time()
Gets the current system time in [s].
Definition: System.cpp:226
void set_online_rate_monitor_id(unsigned int id=0)
Sets the SpikingGroup used to display the rate estimate in the progressbar.
Definition: System.cpp:939
Buffer object to capsulate native MPI_Allgather for SpikingGroups.
Definition: SyncBuffer.h:57
void register_spiking_group(SpikingGroup *spiking_group)
Registers an instance of SpikingGroup to the spiking_groups vector.
Definition: System.cpp:261
unsigned int get_synced_seed()
Returns a random seed which is the same on each rank.
Definition: System.cpp:1035
System(mpi::communicator *communicator)
Default constructor for MPI enabled.
Definition: System.cpp:139
void register_connection(Connection *connection)
Registers an instance of Connection to the connections vector.
Definition: System.cpp:267
AurynTime get_clock()
Gets the current clock value in AurynTime.
Definition: System.cpp:231
AurynLong get_total_neurons()
Get total number of registered neurons.
Definition: System.cpp:241
string fn(std::string extension)
Format output file name.
Definition: System.cpp:689
void save_network_state(std::string basename)
Saves network state to a netstate file.
Definition: System.cpp:694
NeuronID AurynTime
Defines Auryns discrete time unit of the System clock. Change to AurynLong if 120h of simtime are not...
Definition: auryn_definitions.h:155
Abstract base class for all Device, Stimulator, etc objects.
Definition: Device.h:47
std::string string
Standard library string type which is imported into Auryn namespace.
Definition: auryn_definitions.h:156
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151