NEST  2.6.0,not_revisioned_source_dir@0
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Member Functions | Static Private Attributes | Friends | List of all members
nest::Communicator Class Reference

#include <communicator.h>

Classes

class  NodeAddressingData
 
class  OffGridSpike
 Combined storage of GID and offset information for off-grid spikes. More...
 

Public Member Functions

 Communicator ()
 
 ~Communicator ()
 
 Communicator ()
 
 ~Communicator ()
 

Static Public Member Functions

static void enter_runtime (double_t h_min_delay)
 Enter the runtime mode. More...
 
static MUSIC::Setup * get_music_setup ()
 
static MUSIC::Runtime * get_music_runtime ()
 
static void advance_music_time (long_t num_steps)
 Advance the time of music by num_steps simulation steps. More...
 
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. More...
 
static void init (int *argc, char **argv[])
 Set up MPI and establish number of processes and rank. More...
 
static void finalize ()
 Finish off MPI routines. More...
 
static void mpi_abort (int exitcode)
 
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 More...
 
static void communicate (std::vector< OffGridSpike > &send_buffer, std::vector< OffGridSpike > &recv_buffer, std::vector< int > &displacements)
 communicate (off-grid) if compiled without MPI More...
 
static void communicate (std::vector< double_t > &send_buffer, std::vector< double_t > &recv_buffer, std::vector< int > &displacements)
 
static void communicate (double_t, std::vector< double_t > &)
 
static void communicate (std::vector< int_t > &)
 communicate function for sending set-up information More...
 
static void communicate (std::vector< long_t > &)
 
template<typename NodeListType >
static void communicate (const NodeListType &local_nodes, std::vector< NodeAddressingData > &all_nodes, bool remote=false)
 Collect GIDs for all nodes in a given node list across processes. More...
 
template<typename NodeListType >
static void communicate (const NodeListType &local_nodes, std::vector< NodeAddressingData > &all_nodes, Network &net, DictionaryDatum params, bool remote=false)
 
static void communicate_connector_properties (DictionaryDatum &dict)
 
static void synchronize ()
 Ensure all processes have reached the same stage by waiting until all processes have sent a dummy message to process 0. More...
 
static void test_link (int, int)
 
static void test_links ()
 
static bool grng_synchrony (unsigned long)
 
static double_t time_communicate (int num_bytes, int samples=1000)
 
static double_t time_communicatev (int num_bytes, int samples=1000)
 
static double_t time_communicate_offgrid (int num_bytes, int samples=1000)
 
static double_t time_communicate_alltoall (int num_bytes, int samples=1000)
 
static double_t time_communicate_alltoallv (int num_bytes, int samples=1000)
 
static std::string get_processor_name ()
 
static int get_rank ()
 
static int get_num_processes ()
 
static void set_num_processes (int)
 
static int get_num_virtual_processes ()
 
static int get_send_buffer_size ()
 
static int get_recv_buffer_size ()
 
static bool get_use_Allgather ()
 
static bool get_initialized ()
 
static void set_num_threads (thread num_threads)
 
static void set_buffer_sizes (int send_buffer_size, int recv_buffer_size)
 
static void set_use_Allgather (bool use_Allgather)
 
static void communicate (std::vector< uint_t > &send_buffer, std::vector< uint_t > &recv_buffer, std::vector< int > &displacements)
 
static void communicate (std::vector< OffGridSpike > &send_buffer, std::vector< OffGridSpike > &recv_buffer, std::vector< int > &displacements)
 
static void communicate (std::vector< double_t > &send_buffer, std::vector< double_t > &recv_buffer, std::vector< int > &displacements)
 
static void communicate (double_t, std::vector< double_t > &)
 
static void communicate (std::vector< int_t > &)
 
static void communicate (std::vector< long_t > &)
 
template<typename NodeListType >
static void communicate (const NodeListType &local_nodes, std::vector< NodeAddressingData > &all_nodes, bool remote=false)
 Collect GIDs for all nodes in a given node list across processes. More...
 
template<typename NodeListType >
static void communicate (const NodeListType &local_nodes, std::vector< NodeAddressingData > &all_nodes, Network &net, DictionaryDatum params, bool remote=false)
 
static void communicate_connector_properties (DictionaryDatum &)
 
static void synchronize ()
 
static bool grng_synchrony (unsigned long)
 
static double_t time_communicate (int, int)
 
static double_t time_communicatev (int, int)
 
static double_t time_communicate_offgrid (int, int)
 
static double_t time_communicate_alltoall (int, int)
 
static double_t time_communicate_alltoallv (int, int)
 
static std::string get_processor_name ()
 
static int get_rank ()
 
static int get_num_processes ()
 
static void set_num_processes (int)
 
static int get_num_virtual_processes ()
 
static int get_send_buffer_size ()
 
static int get_recv_buffer_size ()
 
static bool get_use_Allgather ()
 
static bool get_initialized ()
 
static void set_num_threads (thread num_threads)
 
static void set_buffer_sizes (int send_buffer_size, int recv_buffer_size)
 
static void set_use_Allgather (bool use_Allgather)
 

Static Public Attributes

static MUSIC::Setup * music_setup =0
 pointer to a MUSIC setup object More...
 
static MUSIC::Runtime * music_runtime =0
 pointer to a MUSIC runtime object More...
 

Static Private Member Functions

static void init_communication ()
 Perform the CPEX algorithm to determine the communication partner of the process for each communication step. More...
 
static void communicate_Allgather (std::vector< uint_t > &send_buffer, std::vector< uint_t > &recv_buffer, std::vector< int > &displacements)
 
static void communicate_Allgather (std::vector< OffGridSpike > &send_buffer, std::vector< OffGridSpike > &recv_buffer, std::vector< int > &displacements)
 
static void communicate_Allgather (std::vector< int_t > &)
 
static void communicate_Allgather (std::vector< long_t > &)
 
template<typename T >
static void communicate_Allgatherv (std::vector< T > &send_buffer, std::vector< T > &recv_buffer, std::vector< int > &displacements, std::vector< int > &recv_counts)
 
template<typename T >
static void communicate_Allgather (std::vector< T > &send_buffer, std::vector< T > &recv_buffer, std::vector< int > &displacements)
 
static void communicate_CPEX (std::vector< uint_t > &send_buffer, std::vector< uint_t > &recv_buffer, std::vector< int > &displacements)
 
static void communicate_CPEX (std::vector< OffGridSpike > &send_buffer, std::vector< OffGridSpike > &recv_buffer, std::vector< int > &displacements)
 
static void communicate_CPEX (std::vector< int_t > &)
 
static void communicate_CPEX (std::vector< long_t > &)
 

Static Private Attributes

static Networknet_ = 0
 Pointer to the Network class. More...
 
static int rank_ = 0
 the rank of the machine More...
 
static int num_processes_ = 1
 the number of mpi-processes More...
 
static int n_vps_ = 1
 the number of virtual processes More...
 
static int send_buffer_size_ = 1
 expected size of send buffer More...
 
static int recv_buffer_size_ = 1
 size of receive buffer More...
 
static bool initialized_ = false
 whether MPI is initialized More...
 
static bool use_Allgather_ = true
 using Allgather communication More...
 
static std::vector< int > comm_step_ = std::vector<int>()
 array containing communication partner for each step. More...
 
static uint_t COMM_OVERFLOW_ERROR = std::numeric_limits<unsigned int>::max()
 

Friends

class Network
 

Constructor & Destructor Documentation

nest::Communicator::Communicator ( )
inline
nest::Communicator::~Communicator ( )
inline
nest::Communicator::Communicator ( )
inline
nest::Communicator::~Communicator ( )
inline

Member Function Documentation

void nest::Communicator::advance_music_time ( long_t  num_steps)
static

Advance the time of music by num_steps simulation steps.

Parameters
num_stepsnumber of simulation steps, the time to propagate. /TODO: put this into scheduler.

Referenced by nest::Scheduler::update().

void nest::Communicator::communicate ( std::vector< uint_t > &  send_buffer,
std::vector< uint_t > &  recv_buffer,
std::vector< int > &  displacements 
)
static
void nest::Communicator::communicate ( std::vector< OffGridSpike > &  send_buffer,
std::vector< OffGridSpike > &  recv_buffer,
std::vector< int > &  displacements 
)
static

communicate (off-grid) if compiled without MPI

void nest::Communicator::communicate ( std::vector< double_t > &  send_buffer,
std::vector< double_t > &  recv_buffer,
std::vector< int > &  displacements 
)
static
void nest::Communicator::communicate ( double_t  send_val,
std::vector< double_t > &  recv_buffer 
)
static

References comm.

void nest::Communicator::communicate ( std::vector< int_t > &  buffer)
static

communicate function for sending set-up information

void nest::Communicator::communicate ( std::vector< long_t > &  buffer)
static
template<typename NodeListType >
void nest::Communicator::communicate ( const NodeListType &  local_nodes,
std::vector< NodeAddressingData > &  all_nodes,
bool  remote = false 
)
static

Collect GIDs for all nodes in a given node list across processes.

The NodeListType should be one of LocalNodeList, LocalLeafList, LocalChildList.

References assert(), nest::names::n, num_processes_, and rank_.

template<typename NodeListType >
void nest::Communicator::communicate ( const NodeListType &  local_nodes,
std::vector< NodeAddressingData > &  all_nodes,
Network net,
DictionaryDatum  params,
bool  remote = false 
)
static
static void nest::Communicator::communicate ( std::vector< uint_t > &  send_buffer,
std::vector< uint_t > &  recv_buffer,
std::vector< int > &  displacements 
)
static
static void nest::Communicator::communicate ( std::vector< OffGridSpike > &  send_buffer,
std::vector< OffGridSpike > &  recv_buffer,
std::vector< int > &  displacements 
)
static
static void nest::Communicator::communicate ( std::vector< double_t > &  send_buffer,
std::vector< double_t > &  recv_buffer,
std::vector< int > &  displacements 
)
static
static void nest::Communicator::communicate ( double_t  ,
std::vector< double_t > &   
)
static
static void nest::Communicator::communicate ( std::vector< int_t > &  )
inlinestatic
static void nest::Communicator::communicate ( std::vector< long_t > &  )
inlinestatic
template<typename NodeListType >
static void nest::Communicator::communicate ( const NodeListType &  local_nodes,
std::vector< NodeAddressingData > &  all_nodes,
bool  remote = false 
)
static

Collect GIDs for all nodes in a given node list across processes.

The NodeListType should be one of LocalNodeList, LocalLeafList, LocalChildList. Collect GIDs for all nodes in a given node list across processes. The NodeListType should be one of LocalNodeList, LocalLeafList, LocalChildList.

template<typename NodeListType >
static void nest::Communicator::communicate ( const NodeListType &  local_nodes,
std::vector< NodeAddressingData > &  all_nodes,
Network net,
DictionaryDatum  params,
bool  remote = false 
)
static
void nest::Communicator::communicate_Allgather ( std::vector< uint_t > &  send_buffer,
std::vector< uint_t > &  recv_buffer,
std::vector< int > &  displacements 
)
staticprivate

References comm.

void nest::Communicator::communicate_Allgather ( std::vector< OffGridSpike > &  send_buffer,
std::vector< OffGridSpike > &  recv_buffer,
std::vector< int > &  displacements 
)
staticprivate

References comm, and MPI_OFFGRID_SPIKE.

void nest::Communicator::communicate_Allgather ( std::vector< int_t > &  buffer)
staticprivate

References comm.

void nest::Communicator::communicate_Allgather ( std::vector< long_t > &  buffer)
staticprivate

References comm.

template<typename T >
void nest::Communicator::communicate_Allgather ( std::vector< T > &  send_buffer,
std::vector< T > &  recv_buffer,
std::vector< int > &  displacements 
)
staticprivate

References comm.

template<typename T >
void nest::Communicator::communicate_Allgatherv ( std::vector< T > &  send_buffer,
std::vector< T > &  recv_buffer,
std::vector< int > &  displacements,
std::vector< int > &  recv_counts 
)
staticprivate

References comm.

void nest::Communicator::communicate_connector_properties ( DictionaryDatum dict)
static
static void nest::Communicator::communicate_connector_properties ( DictionaryDatum )
inlinestatic
void nest::Communicator::communicate_CPEX ( std::vector< uint_t > &  send_buffer,
std::vector< uint_t > &  recv_buffer,
std::vector< int > &  displacements 
)
staticprivate

References comm.

void nest::Communicator::communicate_CPEX ( std::vector< OffGridSpike > &  send_buffer,
std::vector< OffGridSpike > &  recv_buffer,
std::vector< int > &  displacements 
)
staticprivate

References comm, and MPI_OFFGRID_SPIKE.

void nest::Communicator::communicate_CPEX ( std::vector< int_t > &  buffer)
staticprivate

References comm.

void nest::Communicator::communicate_CPEX ( std::vector< long_t > &  buffer)
staticprivate

References comm.

void nest::Communicator::enter_runtime ( double_t  h_min_delay)
static

Enter the runtime mode.

This must be done before simulating. After having entered runtime mode ports cannot be published anymore.

Parameters
h_min_delayis the length of a time slice, after which commmunication should take place.

References numerics::e.

Referenced by nest::Scheduler::prepare_simulation().

void nest::Communicator::finalize ( )
static

Finish off MPI routines.

References numerics::e, SLIInterpreter::M_INFO, and MPI_OFFGRID_SPIKE.

Referenced by nestshutdown().

bool nest::Communicator::get_initialized ( )
inlinestatic

References initialized_.

Referenced by nest::NestModule::init().

static bool nest::Communicator::get_initialized ( )
static
MUSIC::Runtime * nest::Communicator::get_music_runtime ( )
static
MUSIC::Setup * nest::Communicator::get_music_setup ( )
static
int nest::Communicator::get_num_processes ( )
inlinestatic
static int nest::Communicator::get_num_processes ( )
static
int nest::Communicator::get_num_virtual_processes ( )
inlinestatic
static int nest::Communicator::get_num_virtual_processes ( )
static
std::string nest::Communicator::get_processor_name ( )
inlinestatic
static std::string nest::Communicator::get_processor_name ( )
static
int nest::Communicator::get_rank ( )
inlinestatic
static int nest::Communicator::get_rank ( )
static
int nest::Communicator::get_recv_buffer_size ( )
inlinestatic
static int nest::Communicator::get_recv_buffer_size ( )
static
int nest::Communicator::get_send_buffer_size ( )
inlinestatic
static int nest::Communicator::get_send_buffer_size ( )
static
bool nest::Communicator::get_use_Allgather ( )
inlinestatic
static bool nest::Communicator::get_use_Allgather ( )
static
bool nest::Communicator::grng_synchrony ( unsigned long  process_rnd_number)
static
static bool nest::Communicator::grng_synchrony ( unsigned  long)
inlinestatic
void nest::Communicator::init ( int *  argc,
char **  argv[] 
)
static
void nest::Communicator::init_communication ( )
staticprivate

Perform the CPEX algorithm to determine the communication partner of the process for each communication step.

See: A. Tam and C. Wang: Efficient scheduling of complete exchange on clusters. In 13th International Conference on Parallel and Distributed Computing Systems (PDCS 2000), Las Vegas, 2000

Referenced by init(), and set_use_Allgather().

void nest::Communicator::mpi_abort ( int  exitcode)
static
static void nest::Communicator::register_music_event_in_proxy ( std::string  portname,
int  channel,
nest::Node mp 
)
static

Register a music_event_in_proxy for a given port and a given channel.

As a consequence, the proxy will be informed, whenever an event over this port and channel comes in.

void nest::Communicator::set_buffer_sizes ( int  send_buffer_size,
int  recv_buffer_size 
)
inlinestatic
static void nest::Communicator::set_buffer_sizes ( int  send_buffer_size,
int  recv_buffer_size 
)
static
void nest::Communicator::set_num_processes ( int  np)
inlinestatic
static void nest::Communicator::set_num_processes ( int  )
static
void nest::Communicator::set_num_threads ( thread  num_threads)
inlinestatic

References n_vps_, and num_processes_.

Referenced by nest::Scheduler::prepare_nodes().

static void nest::Communicator::set_num_threads ( thread  num_threads)
static
void nest::Communicator::set_use_Allgather ( bool  use_Allgather)
inlinestatic
static void nest::Communicator::set_use_Allgather ( bool  use_Allgather)
static
void nest::Communicator::synchronize ( )
static

Ensure all processes have reached the same stage by waiting until all processes have sent a dummy message to process 0.

References comm.

Referenced by nest::NestModule::SyncProcessesFunction::execute(), and nest::Scheduler::resume().

static void nest::Communicator::synchronize ( )
inlinestatic
void nest::Communicator::test_link ( int  sender,
int  receiver 
)
static

References assert(), and comm.

void nest::Communicator::test_links ( )
static
nest::double_t nest::Communicator::time_communicate ( int  num_bytes,
int  samples = 1000 
)
static
static double_t nest::Communicator::time_communicate ( int  ,
int   
)
inlinestatic
nest::double_t nest::Communicator::time_communicate_alltoall ( int  num_bytes,
int  samples = 1000 
)
static
static double_t nest::Communicator::time_communicate_alltoall ( int  ,
int   
)
inlinestatic
nest::double_t nest::Communicator::time_communicate_alltoallv ( int  num_bytes,
int  samples = 1000 
)
static
static double_t nest::Communicator::time_communicate_alltoallv ( int  ,
int   
)
inlinestatic
nest::double_t nest::Communicator::time_communicate_offgrid ( int  num_bytes,
int  samples = 1000 
)
static
static double_t nest::Communicator::time_communicate_offgrid ( int  ,
int   
)
inlinestatic
nest::double_t nest::Communicator::time_communicatev ( int  num_bytes,
int  samples = 1000 
)
static
static double_t nest::Communicator::time_communicatev ( int  ,
int   
)
inlinestatic

Friends And Related Function Documentation

Network
friend

Member Data Documentation

unsigned int nest::Communicator::COMM_OVERFLOW_ERROR = std::numeric_limits<unsigned int>::max()
staticprivate
std::vector< int > nest::Communicator::comm_step_ = std::vector<int>()
staticprivate

array containing communication partner for each step.

static bool nest::Communicator::initialized_ = false
staticprivate

whether MPI is initialized

Referenced by get_initialized(), and init().

MUSIC::Runtime * nest::Communicator::music_runtime =0
static

pointer to a MUSIC runtime object

MUSIC::Setup * nest::Communicator::music_setup =0
static

pointer to a MUSIC setup object

Referenced by init().

static int nest::Communicator::n_vps_ = 1
staticprivate

the number of virtual processes

Referenced by get_num_virtual_processes(), and set_num_threads().

static Network * nest::Communicator::net_ = 0
staticprivate

Pointer to the Network class.

Referenced by nest::Network::Network().

static int nest::Communicator::num_processes_ = 1
staticprivate

the number of mpi-processes

Referenced by communicate(), get_num_processes(), init(), set_num_processes(), and set_num_threads().

static int nest::Communicator::rank_ = 0
staticprivate

the rank of the machine

Referenced by communicate(), get_rank(), and init().

static int nest::Communicator::recv_buffer_size_ = 1
staticprivate

size of receive buffer

Referenced by get_recv_buffer_size(), init(), and set_buffer_sizes().

static int nest::Communicator::send_buffer_size_ = 1
staticprivate

expected size of send buffer

Referenced by get_send_buffer_size(), init(), and set_buffer_sizes().

static bool nest::Communicator::use_Allgather_ = true
staticprivate

using Allgather communication

Referenced by get_use_Allgather(), init(), and set_use_Allgather().


The documentation for this class was generated from the following files: