37 string file_prefix =
"poisson";
43 unsigned int seed = 1;
51 po::options_description desc(
"Allowed options");
53 (
"help",
"produce help message")
54 (
"simtime", po::value<double>(),
"simulation time")
55 (
"kappa", po::value<double>(),
"poisson group rate")
56 (
"dir", po::value<string>(),
"output directory")
57 (
"size", po::value<int>(),
"poisson group size")
58 (
"seed", po::value<int>(),
"random seed")
62 po::store(po::parse_command_line(ac, av, desc), vm);
65 if (vm.count(
"help")) {
66 std::cout << desc <<
"\n";
70 if (vm.count(
"kappa")) {
71 std::cout <<
"kappa set to " 72 << vm[
"kappa"].as<
double>() <<
".\n";
73 kappa = vm[
"kappa"].as<
double>();
76 if (vm.count(
"dir")) {
77 std::cout <<
"dir set to " 78 << vm[
"dir"].as<
string>() <<
".\n";
79 dir = vm[
"dir"].as<
string>();
82 if (vm.count(
"simtime")) {
83 std::cout <<
"simtime set to " 84 << vm[
"simtime"].as<
double>() <<
".\n";
85 simtime = vm[
"simtime"].as<
double>();
88 if (vm.count(
"size")) {
89 std::cout <<
"size set to " 90 << vm[
"size"].as<
int>() <<
".\n";
91 size = vm[
"size"].as<
int>();
94 if (vm.count(
"seed")) {
95 std::cout <<
"seed set to " 96 << vm[
"seed"].as<
int>() <<
".\n";
97 seed = vm[
"seed"].as<
int>();
100 catch(std::exception& e) {
101 std::cerr <<
"error: " << e.what() <<
"\n";
105 std::cerr <<
"Exception of unknown type!\n";
113 sprintf(strbuf,
"%s/%s.%d.ras", dir.c_str(), file_prefix.c_str(),
sys->
mpi_rank() );
116 sprintf(strbuf,
"%s/%s.%d.prate", dir.c_str(), file_prefix.c_str(),
sys->
mpi_rank() );
120 if (!
sys->run(simtime,
false))
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
unsigned int mpi_rank()
Returns current rank.
Definition: System.cpp:1009
A Checker class that tracks population firing rate as a moving average and breaks a run if it goes ou...
Definition: RateChecker.h:59
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
The standard Monitor object to record spikes from a SpikingGroup and write them to a text file...
Definition: SpikeMonitor.h:52
void auryn_abort(int errcode)
Terminates Auryn simulation abnormally.
Definition: auryn_global.cpp:113
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
A SpikingGroup that creates poissonian spikes with a given rate.
Definition: PoissonGroup.h:52
void set_master_seed(unsigned int seed=123)
Set master seed.
Definition: System.cpp:1014
void auryn_init(int ac, char *av[], string dir, string simulation_name, string logfile_prefix, LogMessageType filelog_level, LogMessageType consolelog_level)
Initalizes MPI and the Auryn simulation environment.
Definition: auryn_global.cpp:84
void msg(std::string text, LogMessageType type=NOTIFICATION, bool global=false, int line=-1, std::string srcfile="")
Definition: Logger.cpp:74
Monitor class to record population firing rates.
Definition: PopulationRateMonitor.h:46
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151