23#ifndef RECORDING_BACKEND_MPI_H
24#define RECORDING_BACKEND_MPI_H
29#include <netinet/in.h>
31#include <sys/socket.h>
119 const std::vector< std::string >& double_value_names,
120 const std::vector< std::string >& long_value_names )
override;
154 std::vector< std::vector< std::vector< std::array< double, 3 > > > >
buffer_;
164 typedef std::vector< std::map< size_t, std::tuple< int, MPI_Comm*, const RecordingDevice* > > >
device_map;
175 typedef std::map< std::string, std::tuple< int, MPI_Comm*, int > >
comm_map;
181 void get_port(
size_t index_node,
const std::string& label, std::string* port_name );
182 void send_data(
const MPI_Comm* comm,
const double data[],
int size );
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Encapsulate information sent between nodes.
Definition event.h:103
A recording backend for sending information with MPI.
Definition recording_backend_mpi.h:106
device_map devices_
Definition recording_backend_mpi.h:165
bool prepared_
Definition recording_backend_mpi.h:144
void set_status(const Dictionary &) override
Set the status of the recording backend using the key-value pairs contained in the params dictionary.
Definition recording_backend_mpi.cpp:359
void initialize() override
Definition recording_backend_mpi.cpp:47
void set_value_names(const RecordingDevice &device, const std::vector< std::string > &double_value_names, const std::vector< std::string > &long_value_names) override
To make the names of recorded quantities known to the RecordingBackend, the vectors double_value_name...
Definition recording_backend_mpi.cpp:114
void prepare() override
Prepare the backend at begin of the NEST Simulate function.
Definition recording_backend_mpi.cpp:122
void get_port(const RecordingDevice *device, std::string *port_name)
Definition recording_backend_mpi.cpp:365
RecordingBackendMPI()
Definition recording_backend_mpi.cpp:35
void get_device_status(const RecordingDevice &device, Dictionary ¶ms_dictionary) const override
Return the per-device status of the given recording device by writing it to the given params dictiona...
Definition recording_backend_mpi.cpp:319
std::vector< std::vector< std::vector< std::array< double, 3 > > > > buffer_
Buffer for saving events before they are sent.
Definition recording_backend_mpi.h:154
void check_device_status(const Dictionary &) const override
Check if the given per-device properties are valid and usable by the backend.
Definition recording_backend_mpi.cpp:307
std::map< std::string, std::tuple< int, MPI_Comm *, int > > comm_map
A map of MPI communicators used by the master thread for the MPI communication.
Definition recording_backend_mpi.h:175
void write(const RecordingDevice &, const Event &, const std::vector< double > &, const std::vector< long > &) override
Write the data from the event to the backend specific channel together with the values given.
Definition recording_backend_mpi.cpp:326
bool enrolled_
Definition recording_backend_mpi.h:143
void pre_run_hook() override
Initialize global backend-specific data structures.
Definition recording_backend_mpi.cpp:210
~RecordingBackendMPI()
Definition recording_backend_mpi.cpp:41
void get_status(Dictionary &) const override
Return the status of the recording backend by writing it to the given params dictionary.
Definition recording_backend_mpi.cpp:353
void send_data(const MPI_Comm *comm, const double data[], int size)
Definition recording_backend_mpi.cpp:421
void disenroll(const RecordingDevice &device) override
Disenroll a RecordingDevice from the RecordingBackend.
Definition recording_backend_mpi.cpp:101
void post_run_hook() override
Clean up the backend at the end of a Run.
Definition recording_backend_mpi.cpp:231
std::vector< std::map< size_t, std::tuple< int, MPI_Comm *, const RecordingDevice * > > > device_map
A map for the enrolled devices.
Definition recording_backend_mpi.h:164
void finalize() override
Definition recording_backend_mpi.cpp:57
void post_step_hook() override
Do work required at the end of each simulation step.
Definition recording_backend_mpi.cpp:225
void cleanup() override
Clean up the backend at the end of a user level call to the NEST Simulate function.
Definition recording_backend_mpi.cpp:275
comm_map commMap_
Definition recording_backend_mpi.h:176
std::string mpi_address_
Definition recording_backend_mpi.h:178
void get_device_defaults(Dictionary &) const override
Return the per-device defaults by writing it to the given params dictionary.
Definition recording_backend_mpi.cpp:313
void enroll(const RecordingDevice &device, const Dictionary ¶ms) override
Enroll a RecordingDevice with the RecordingBackend.
Definition recording_backend_mpi.cpp:75
Abstract base class for all NESTio recording backends.
Definition recording_backend.h:67
Base class for all recording devices.
Definition recording_device.h:157
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33