IO Manager

The IOManager in NEST coordinates input/output operations, managing data paths, file prefixes, and file-overwrite settings. It registers and routes data between recording/stimulation devices and their respective backends (e.g., handling file I/O for spike data or parameter logging). It ensures devices communicate with the correct backend while deferring logging responsibilities to the LoggingManager.

class IOManager : public nest::ManagerInterface

Manager to handle everything related to input and output.

IOManager handles the data path and prefix variables of the NEST kernel and manages the recording and stimulation backends and the routing of data from and to devices to and from the backends.

This manager is not responsible for logging and messaging to the user. See LoggingManager if you are looging for that.

Public Functions

virtual void initialize(const bool) override

Prepare manager for operation.

After this method has completed, the manager should be completely initialized and “ready for action”.

See also

finalize()

Note

Initialization of any given manager may depend on other managers having been initialized before. KernelManager::initialize() is responsible for calling the initialization routines on the specific managers in correct order.

Parameters:

adjust_number_of_threads_or_rng_only – Pass true if calling from kernel_manager::change_number_of_threads() or RandomManager::get_status() to limit operations to those necessary for thread adjustment or switch or re-seeding of RNG.

virtual void finalize(const bool) override

Take down manager after operation.

After this method has completed, all dynamic data structures created by the manager shall be deallocated and containers emptied. Plain variables need not be reset.

See also

initialize()

Note

Finalization of any given manager may depend on other managers not having been finalized yet. KernelManager::finalize() is responsible for calling the initialization routines on the specific managers in correct order, i.e., the opposite order of initialize() calls.

Parameters:

adjust_number_of_threads_or_rng_only – Pass true if calling from kernel_manager::change_number_of_threads() to limit operations to those necessary for thread adjustment.

virtual void set_status(const DictionaryDatum&) override

Set the status of the manager.

See also

get_status()

virtual void get_status(DictionaryDatum&) override

Retrieve the status of the manager.

See also

set_status()

Note

This would ideally be a const function. However, some managers delay the update of internal variables up to the point where they are needed (e.g., before reporting their values to the user, or before simulate is called). An example for this pattern is the call to update_delay_extrema_() right at the beginning of ConnectionManager::get_status().

inline const std::string &get_data_prefix() const

The prefix for files written by devices.

The prefix must not contain any part of a path.

See also

get_data_dir(), overwrite_files()

inline const std::string &get_data_path() const

The path for files written by devices.

It may be the empty string (use current directory).

inline bool overwrite_files() const

Indicate if existing data files should be overwritten.

Returns:

true if existing data files should be overwritten by devices. Default: false.

void post_run_hook()

Clean up in all registered recording backends after a single call to run by calling the backends’ post_run_hook() functions.

void post_step_hook()

Clean up in all registered recording backends after a single simulation step by calling the backends’ post_step_hook() functions.

virtual void cleanup() override

Finalize all registered recording backends after a call to SimulationManager::simulate() or SimulationManager::cleanup() by calling the backends’ finalize() functions.

void write(const Name backend_name, const RecordingDevice &device, const Event &event, const std::vector<double> &double_values, const std::vector<long> &long_values)

Send device data to a given recording backend.

This function is called from a RecordingDevice device when it wants to write data to a given recording backend, identified by its backend_name. The function takes an Event event from which some fundamental data is taken and additionally vectors of double_values and long_values that have to be written. The data vectors may be empty, if no additional data has to be written.

Parameters:
  • backend_name – the name of the RecordingBackend to write to

  • device – a reference to the RecordingDevice that wants to write

  • event – the Event to be written

  • double_values – a vector of doubles to be written

  • long_values – a vector of longs to be written