23 #ifndef COMMUNICATOR_H
24 #define COMMUNICATOR_H
99 assert(std::numeric_limits<double_t >::digits >
100 std::numeric_limits<gid_external_type>::digits);
159 static void communicate(std::vector<uint_t>& send_buffer,
160 std::vector<uint_t>& recv_buffer,
161 std::vector<int>& displacements);
162 static void communicate(std::vector<OffGridSpike>& send_buffer,
163 std::vector<OffGridSpike>& recv_buffer,
164 std::vector<int>& displacements);
165 static void communicate(std::vector<double_t>& send_buffer,
166 std::vector<double_t>& recv_buffer,
167 std::vector<int>& displacements);
176 template <
typename NodeListType>
177 static void communicate(
const NodeListType& local_nodes,
178 std::vector<NodeAddressingData>& all_nodes,
179 bool remote =
false);
180 template <
typename NodeListType>
181 static void communicate(
const NodeListType& local_nodes,
182 std::vector<NodeAddressingData>& all_nodes,
185 bool remote =
false);
233 std::vector<uint_t>& recv_buffer,
234 std::vector<int>& displacements);
236 std::vector<OffGridSpike>& recv_buffer,
237 std::vector<int>& displacements);
241 template <
typename T>
243 std::vector<T>& recv_buffer,
244 std::vector<int>& displacements,
245 std::vector<int>& recv_counts);
247 template <
typename T>
249 std::vector<T>& recv_buffer,
250 std::vector<int>& displacements);
253 std::vector<uint_t>& recv_buffer,
254 std::vector<int>& displacements);
256 std::vector<OffGridSpike>& recv_buffer,
257 std::vector<int>& displacements);
304 class NodeAddressingData {
323 static void communicate(std::vector<uint_t>& send_buffer, std::vector<uint_t>& recv_buffer,
324 std::vector<int>& displacements);
325 static void communicate(std::vector<OffGridSpike>& send_buffer,
326 std::vector<OffGridSpike>& recv_buffer,
327 std::vector<int>& displacements);
328 static void communicate(std::vector<double_t>& send_buffer,
329 std::vector<double_t>& recv_buffer,
330 std::vector<int>& displacements);
343 template <
typename NodeListType>
344 static void communicate(
const NodeListType& local_nodes,
345 std::vector<NodeAddressingData>& all_nodes,
346 bool remote =
false);
347 template <
typename NodeListType>
348 static void communicate(
const NodeListType& local_nodes,
349 std::vector<NodeAddressingData>& all_nodes,
351 bool remote =
false);
406 gethostname(name, 1023);
static double_t time_communicate(int, int)
Definition: communicator.h:362
static double_t time_communicate_alltoall(int, int)
Definition: communicator.h:365
bool operator<(const NodeAddressingData &other) const
Definition: communicator.h:120
uint_t get_gid() const
Definition: communicator.h:85
static bool grng_synchrony(unsigned long)
Definition: communicator.h:361
static void communicate_connector_properties(DictionaryDatum &)
Definition: communicator.h:353
void set_gid(gid_external_type gid)
Definition: communicator.h:86
Communicator()
Definition: communicator.h:58
double_t offset_
offset of spike from grid
Definition: communicator.h:94
static int num_processes_
the number of mpi-processes
Definition: communicator.h:220
static void set_buffer_sizes(int send_buffer_size, int recv_buffer_size)
Definition: communicator.h:461
Definition: communicator.h:110
static int get_recv_buffer_size()
Definition: communicator.h:441
NodeAddressingData(uint_t gid, uint_t parent_gid, uint_t vp)
Definition: communicator.h:114
static void test_link(int, int)
Definition: communicator.cpp:775
static double_t time_communicate_offgrid(int, int)
Definition: communicator.h:364
static int rank_
the rank of the machine
Definition: communicator.h:219
static void enter_runtime(double_t h_min_delay)
Enter the runtime mode.
Definition: communicator.cpp:1028
static bool get_initialized()
Definition: communicator.h:451
static void mpi_abort(int exitcode)
Definition: communicator.cpp:191
static bool grng_synchrony(unsigned long)
Definition: communicator.cpp:804
static bool initialized_
whether MPI is initialized
Definition: communicator.h:224
static bool use_Allgather_
using Allgather communication
Definition: communicator.h:225
uint_t get_gid() const
Definition: communicator.h:117
static MUSIC::Runtime * get_music_runtime()
Definition: communicator.cpp:1023
static std::string get_processor_name()
Definition: communicator.cpp:197
static void communicate_Allgather(std::vector< uint_t > &send_buffer, std::vector< uint_t > &recv_buffer, std::vector< int > &displacements)
Definition: communicator.cpp:259
static MUSIC::Runtime * music_runtime
pointer to a MUSIC runtime object
Definition: communicator.h:63
static void communicate_Allgatherv(std::vector< T > &send_buffer, std::vector< T > &recv_buffer, std::vector< int > &displacements, std::vector< int > &recv_counts)
Definition: communicator_impl.h:59
uint_t get_parent_gid() const
Definition: communicator.h:118
uint_t gid_
GID of neuron.
Definition: communicator.h:124
static double_t time_communicate(int num_bytes, int samples=1000)
Definition: communicator.cpp:823
static int get_send_buffer_size()
Definition: communicator.h:436
static void test_links()
Definition: communicator.cpp:794
static void set_use_Allgather(bool use_Allgather)
Definition: communicator.h:262
static bool get_use_Allgather()
Definition: communicator.h:446
static void communicate(std::vector< int_t > &)
Definition: communicator.h:332
static void communicate(std::vector< uint_t > &send_buffer, std::vector< uint_t > &recv_buffer, std::vector< int > &displacements)
communicate (on-grid) if compiled without MPI
Definition: communicator.cpp:239
static int get_num_virtual_processes()
Definition: communicator.h:431
static void finalize()
Finish off MPI routines.
Definition: communicator.cpp:154
static void set_num_processes(int)
Definition: communicator.h:426
uint_t parent_gid_
GID of neuron's parent.
Definition: communicator.h:125
double_t get_offset() const
Definition: communicator.h:87
const Name other("other")
Node type.
Definition: nest_names.h:216
static MUSIC::Setup * get_music_setup()
Definition: communicator.cpp:1018
static double_t time_communicate_alltoall(int num_bytes, int samples=1000)
Definition: communicator.cpp:892
static Network * net_
Pointer to the Network class.
Definition: communicator.h:217
uint_t get_vp() const
Definition: communicator.h:119
OffGridSpike(uint_t gidv, double_t offsetv)
Definition: communicator.h:289
OffGridSpike()
Definition: communicator.h:80
static uint_t COMM_OVERFLOW_ERROR
Definition: communicator.h:228
uint_t gid_external_type
We defined this type explicitly, so that the assert function below always tests the correct type...
Definition: communicator.h:78
static void communicate_connector_properties(DictionaryDatum &dict)
Definition: communicator.cpp:946
static std::vector< int > comm_step_
array containing communication partner for each step.
Definition: communicator.h:227
static void init_communication()
Perform the CPEX algorithm to determine the communication partner of the process for each communicati...
Definition: communicator.cpp:214
static double_t time_communicate_alltoallv(int num_bytes, int samples=1000)
Definition: communicator.cpp:916
static double_t time_communicate_offgrid(int num_bytes, int samples=1000)
Definition: communicator.cpp:871
NodeAddressingData()
Definition: communicator.h:112
const Name vp("vp")
Node parameter.
Definition: nest_names.h:341
Main administrative interface to the network.
Definition: network.h:135
OffGridSpike(gid_external_type gidv, double_t offsetv)
Definition: communicator.h:82
static int send_buffer_size_
expected size of send buffer
Definition: communicator.h:222
static void synchronize()
Ensure all processes have reached the same stage by waiting until all processes have sent a dummy mes...
Definition: communicator.cpp:770
friend class Network
Definition: communicator.h:55
static int get_num_processes()
Definition: communicator.h:421
static void set_num_threads(thread num_threads)
Definition: communicator.h:456
static void synchronize()
Definition: communicator.h:355
int char ** argv
Definition: neststartup.cpp:61
static void register_music_event_in_proxy(std::string portname, int channel, nest::Node *mp)
Register a music_event_in_proxy for a given port and a given channel.
static MUSIC::Setup * music_setup
pointer to a MUSIC setup object
Definition: communicator.h:62
static double_t time_communicatev(int, int)
Definition: communicator.h:363
static int recv_buffer_size_
size of receive buffer
Definition: communicator.h:223
double double_t
Double precision floating point numbers.
Definition: nest.h:93
Combined storage of GID and offset information for off-grid spikes.
Definition: communicator.h:75
static double_t time_communicatev(int num_bytes, int samples=1000)
Definition: communicator.cpp:844
uint_t vp_
virtual process of neuron
Definition: communicator.h:126
static void communicate(std::vector< long_t > &)
Definition: communicator.h:333
int char SLIInterpreter nest::Network std::string modulepath nest::Communicator::init & argc
Definition: neststartup.cpp:66
unsigned int uint_t
Unsigned int_t.
Definition: nest.h:97
const Name max("max")
Definition: topology_names.h:75
static int n_vps_
the number of virtual processes
Definition: communicator.h:221
Definition: communicator.h:53
Default types used by the NEST kernel.
bool operator==(const NodeAddressingData &other) const
Definition: communicator.h:121
Base class for all NEST network objects.
Definition: node.h:96
~Communicator()
Definition: communicator.h:59
void set_gid(uint_t gid)
Definition: communicator.h:293
static double_t time_communicate_alltoallv(int, int)
Definition: communicator.h:366
static void init(int *argc, char **argv[])
Set up MPI and establish number of processes and rank.
Definition: communicator.cpp:81
static int get_rank()
Definition: communicator.h:416
static void assert_datatype_compatibility()
This function asserts that doubles can hold GIDs without loss.
Definition: communicator.h:97
int_t thread
Thread index type.
Definition: nest.h:133
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
static void advance_music_time(long_t num_steps)
Advance the time of music by num_steps simulation steps.
Definition: communicator.cpp:1038
double_t gid_
GID of neuron that spiked.
Definition: communicator.h:93
static void communicate_CPEX(std::vector< uint_t > &send_buffer, std::vector< uint_t > &recv_buffer, std::vector< int > &displacements)
Definition: communicator.cpp:307