#include <SpikeStreamArchiver.h>
Public Member Functions | |
| SpikeStreamArchiver (int argc, char **argv) | |
| ~SpikeStreamArchiver () | |
Static Public Member Functions | |
| static void | systemError (const string &message) |
| static void | systemError (const char *message, int messageData1) |
| static void | systemError (const char *message) |
Private Member Functions | |
| SpikeStreamArchiver (const SpikeStreamArchiver &) | |
| SpikeStreamArchiver | operator= (const SpikeStreamArchiver &) |
| bool | archiveNeuralNetwork () |
| void | cleanUpArchiver () |
| string | getString (unsigned int) |
| bool | loadTaskIDs () |
| void | processFiringNeuronList (int senderTID) |
| void | processSpikeList (int senderTID) |
| void | run () |
| void | startArchiving () |
| void | stopArchiving () |
| bool | storeNetworkData (unsigned int unixTime, string networkDataString) |
Static Private Member Functions | |
| static bool | sendMessage (int taskID, int msgtag) |
| static bool | sendMessage (int taskId, int msgtag, unsigned int msgInteger) |
| static bool | sendMessage (int taskID, int msgtag, const char *charArray) |
Private Attributes | |
| int | myTaskID |
| DBInterface * | archiveDBInterface |
| DBInterface * | neuralNetworkDBInterface |
| bool | stop |
| bool | networkDataStored |
| unsigned int | archiveType |
| unsigned int | spikeMessageTotal |
| map< int, unsigned int > | taskToNeuronGrpMap |
| map< unsigned int, TimeStepHolder > | timeStepMap |
| map< unsigned int, bool > | firingNeuronMap |
| unsigned int | numberOfSpikes |
| unsigned int * | unpackArray |
| unsigned int | unpkFromNeurID |
| unsigned int | messageTimeStep |
| unsigned int | simulationStartTime |
| char | archiveName [MAX_DATABASE_NAME_LENGTH] |
| map< int, unsigned int > | startNeurIDTaskMap |
Static Private Attributes | |
| static int | parentTaskID = 0 |
| static bool | errorState = false |
Definition at line 52 of file SpikeStreamArchiver.h.
|
||||||||||||
|
Constructor Definition at line 45 of file SpikeStreamArchiver.cpp. References archiveDBInterface, archiveName, archiveNeuralNetwork(), archiveType, loadTaskIDs(), myTaskID, networkDataStored, neuralNetworkDBInterface, parentTaskID, run(), sendMessage(), simulationStartTime, stop, systemError(), and unpackArray. |
|
|
Destructor Definition at line 155 of file SpikeStreamArchiver.cpp. References archiveDBInterface, myTaskID, neuralNetworkDBInterface, and unpackArray. |
|
|
Declare copy constructor private so that it cannot be used inadvertently. |
|
|
Store an XML file recording the essential details of the neural network. This is to enable the archive to be played back even after the network has changed For the moment just store the neuron groups Definition at line 283 of file SpikeStreamArchiver.cpp. References archiveDBInterface, archiveName, archiveType, neuralNetworkDBInterface, simulationStartTime, and systemError(). Referenced by SpikeStreamArchiver(). |
|
|
Called just before exiting run method to do any final tasks, such as storing spike lists or deleting network model if no spike lists have been stored. Definition at line 380 of file SpikeStreamArchiver.cpp. References archiveDBInterface, networkDataStored, parentTaskID, sendMessage(), simulationStartTime, storeNetworkData(), systemError(), and timeStepMap. Referenced by run(). |
|
|
Converts an unsigned integer to a string. Definition at line 426 of file SpikeStreamArchiver.cpp. Referenced by processFiringNeuronList(), and processSpikeList(). |
|
|
Fills the map connecting NeuronGrpIDs and TaskIDs. Definition at line 434 of file SpikeStreamArchiver.cpp. References neuralNetworkDBInterface, spikeMessageTotal, startNeurIDTaskMap, systemError(), and taskToNeuronGrpMap. Referenced by SpikeStreamArchiver(). |
|
|
Declare assignment private so that it cannot be used inadvertently. |
|
|
Processes a list of firing neurons from the task simulating a neuron group. Need to receive all the neuron groups, which is checked using task ids. For each neuron group add the firing neurons to the archive. Definition at line 490 of file SpikeStreamArchiver.cpp. References getString(), messageTimeStep, numberOfSpikes, spikeMessageTotal, storeNetworkData(), taskToNeuronGrpMap, timeStepMap, and unpackArray. Referenced by run(). |
|
|
Processes a list of spikes from the task simulating the neuron group that is being monitored. Need to receive all the neuron groups. This is checked using task ids. For each neuron group add the firing neurons to the archive. Definition at line 578 of file SpikeStreamArchiver.cpp. References firingNeuronMap, getString(), messageTimeStep, numberOfSpikes, spikeMessageTotal, startNeurIDTaskMap, storeNetworkData(), systemError(), taskToNeuronGrpMap, timeStepMap, unpackArray, and unpkFromNeurID. Referenced by run(). |
|
|
Main run method Definition at line 170 of file SpikeStreamArchiver.cpp. References cleanUpArchiver(), errorState, myTaskID, processFiringNeuronList(), processSpikeList(), startArchiving(), stop, stopArchiving(), and systemError(). Referenced by SpikeStreamArchiver(). |
|
||||||||||||||||
|
Sends a message containing a char string. Definition at line 732 of file SpikeStreamArchiver.cpp. |
|
||||||||||||||||
|
Sends a message with a single integer. Definition at line 700 of file SpikeStreamArchiver.cpp. |
|
||||||||||||
|
Sends a message without any contents. Definition at line 677 of file SpikeStreamArchiver.cpp. Referenced by cleanUpArchiver(), SpikeStreamArchiver(), startArchiving(), stopArchiving(), and systemError(). |
|
|
Sends a message to all simulation tasks requesting them to start sending spike messages. Definition at line 776 of file SpikeStreamArchiver.cpp. References archiveType, sendMessage(), and taskToNeuronGrpMap. Referenced by run(). |
|
|
Sends a message to all simulation taks requesting them to stop sending spike messages. Definition at line 788 of file SpikeStreamArchiver.cpp. References archiveType, sendMessage(), and taskToNeuronGrpMap. Referenced by run(). |
|
||||||||||||
|
Stores the network data in the database. Definition at line 799 of file SpikeStreamArchiver.cpp. References archiveDBInterface, networkDataStored, simulationStartTime, and systemError(). Referenced by cleanUpArchiver(), processFiringNeuronList(), and processSpikeList(). |
|
|
Writes an error message to the standard output and sends a message to the parent task with the error message. Also puts archiver into error state, in which it only responds to exit message so that SimulationManager can shut simulation down cleanly. Definition at line 247 of file SpikeStreamArchiver.cpp. References errorState, parentTaskID, and sendMessage(). |
|
||||||||||||
|
Writes an error message to the standard output and sends a message to the parent task with the error message. Also puts archiver into error state, in which it only responds to exit message so that SimulationManager can shut simulation down cleanly. Definition at line 257 of file SpikeStreamArchiver.cpp. References errorState, parentTaskID, and sendMessage(). |
|
|
Writes an error message to the standard output and sends a message to the parent task with the error message. Also puts archiver into error state, in which it only responds to exit message so that SimulationManager can shut simulation down cleanly. Definition at line 269 of file SpikeStreamArchiver.cpp. References errorState, parentTaskID, and sendMessage(). Referenced by archiveNeuralNetwork(), cleanUpArchiver(), loadTaskIDs(), processSpikeList(), run(), SpikeStreamArchiver(), and storeNetworkData(). |
|
|
Reference to archive database handling class. Definition at line 72 of file SpikeStreamArchiver.h. Referenced by archiveNeuralNetwork(), cleanUpArchiver(), SpikeStreamArchiver(), storeNetworkData(), and ~SpikeStreamArchiver(). |
|
|
Name of the archive. Definition at line 127 of file SpikeStreamArchiver.h. Referenced by archiveNeuralNetwork(), and SpikeStreamArchiver(). |
|
|
Controls whether the archive records firing neurons or spikes. Definition at line 87 of file SpikeStreamArchiver.h. Referenced by archiveNeuralNetwork(), SpikeStreamArchiver(), startArchiving(), and stopArchiving(). |
|
|
When the archiver has an error it enters error state, waits for an exit message and then exits. This is to enable the Simulation Manager to clean up properly. Definition at line 137 of file SpikeStreamArchiver.h. Referenced by run(), and systemError(). |
|
|
Holds all the currently firing neurons. Use a map for this to eliminate duplicates Definition at line 105 of file SpikeStreamArchiver.h. Referenced by processSpikeList(). |
|
|
Keeps track of the time step in the current and previous messages. Definition at line 119 of file SpikeStreamArchiver.h. Referenced by processFiringNeuronList(), and processSpikeList(). |
|
|
PVM task id of this process Definition at line 65 of file SpikeStreamArchiver.h. Referenced by run(), SpikeStreamArchiver(), and ~SpikeStreamArchiver(). |
|
|
A network model is stored at the beginning of each simulation run. This variable keeps track of whether any network data has been stored for this archive. If not, then the network model is deleted when this task exits to avoid the build up of empty archives. Definition at line 84 of file SpikeStreamArchiver.h. Referenced by cleanUpArchiver(), SpikeStreamArchiver(), and storeNetworkData(). |
|
|
Reference to network database handling class. Definition at line 75 of file SpikeStreamArchiver.h. Referenced by archiveNeuralNetwork(), loadTaskIDs(), SpikeStreamArchiver(), and ~SpikeStreamArchiver(). |
|
|
Used to unpack the number of spikes from a message. Declare it here to save declaring it each time a message is received. Definition at line 110 of file SpikeStreamArchiver.h. Referenced by processFiringNeuronList(), and processSpikeList(). |
|
|
PVM task id of the process that spawned this process. Static so that it can be used in the static systemError methods. Definition at line 69 of file SpikeStreamArchiver.h. Referenced by cleanUpArchiver(), SpikeStreamArchiver(), and systemError(). |
|
|
Records when the simulation is started. This is used to link the model and data files for a simulation run. Definition at line 123 of file SpikeStreamArchiver.h. Referenced by archiveNeuralNetwork(), cleanUpArchiver(), SpikeStreamArchiver(), and storeNetworkData(). |
|
|
The sum of the task ids from the neuron groups that send data to this class. Used to keeps track of whether all messages have been received. Definition at line 92 of file SpikeStreamArchiver.h. Referenced by loadTaskIDs(), processFiringNeuronList(), and processSpikeList(). |
|
|
Holds the start neuron ID for each task processing neurons The key is the task id, the data is the start neuron id of that neuron group. Definition at line 132 of file SpikeStreamArchiver.h. Referenced by loadTaskIDs(), and processSpikeList(). |
|
|
Controls whether the main run method is running. Definition at line 78 of file SpikeStreamArchiver.h. Referenced by run(), and SpikeStreamArchiver(). |
|
|
Records the link between taskIDs and neuron groups IDs The key is the taskID, the data is the neuronGrpID. Definition at line 96 of file SpikeStreamArchiver.h. Referenced by loadTaskIDs(), processFiringNeuronList(), processSpikeList(), startArchiving(), and stopArchiving(). |
|
|
Holds the time step holders for each time step. These are removed when all messages have been received for the time step. Definition at line 101 of file SpikeStreamArchiver.h. Referenced by cleanUpArchiver(), processFiringNeuronList(), and processSpikeList(). |
|
|
Array to unpack the spikes or neuron ids into. Definition at line 113 of file SpikeStreamArchiver.h. Referenced by processFiringNeuronList(), processSpikeList(), SpikeStreamArchiver(), and ~SpikeStreamArchiver(). |
|
|
Define integer here to extract from neuron id. Definition at line 116 of file SpikeStreamArchiver.h. Referenced by processSpikeList(). |
1.4.4