NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::MPIManager Class Reference

#include <mpi_manager.h>

Inheritance diagram for nest::MPIManager:
[legend]
Collaboration diagram for nest::MPIManager:
[legend]

Classes

class  OffGridSpike
 Combined storage of node ID and offset information for off-grid spikes. More...
 

Public Member Functions

 MPIManager ()
 
 ~MPIManager () override
 
void initialize (const bool) override
 Prepare manager for operation.
 
void finalize (const bool) override
 Take down manager after operation.
 
void set_status (const Dictionary &) override
 Set the status of the manager.
 
void get_status (Dictionary &) override
 Retrieve the status of the manager.
 
void init_mpi (int *argc, char **argv[])
 
size_t get_num_processes () const
 Return the number of processes used during simulation.
 
size_t get_rank () const
 Get rank of MPI process.
 
size_t get_process_id_of_vp (const size_t vp) const
 Return the process id for a given virtual process.
 
size_t get_process_id_of_node_id (const size_t node_id) const
 
void mpi_finalize (int exitcode)
 Finalize MPI communication (needs to be separate from MPIManager::finalize when compiled with MUSIC since spikes can arrive and handlers called here)
 
void mpi_abort (int exitcode)
 If MPI is available, this method calls MPI_Abort with the exitcode.
 
void communicate (std::vector< size_t > &send_buffer, std::vector< size_t > &recv_buffer)
 
void communicate (std::vector< unsigned int > &send_buffer, std::vector< unsigned int > &recv_buffer, std::vector< int > &displacements)
 communicate (on-grid) if compiled without MPI
 
void communicate (std::vector< OffGridSpike > &send_buffer, std::vector< OffGridSpike > &recv_buffer, std::vector< int > &displacements)
 communicate (off-grid) if compiled without MPI
 
void communicate (std::vector< double > &send_buffer, std::vector< double > &recv_buffer, std::vector< int > &displacements)
 
void communicate (std::vector< unsigned long > &send_buffer, std::vector< unsigned long > &recv_buffer, std::vector< int > &displacements)
 
void communicate (std::vector< int > &send_buffer, std::vector< int > &recv_buffer, std::vector< int > &displacements)
 
void communicate (double, std::vector< double > &)
 
void communicate (std::vector< int > &)
 
void communicate (std::vector< long > &)
 
void communicate_Allreduce_sum_in_place (double buffer)
 Sum across all ranks.
 
void communicate_Allreduce_sum_in_place (std::vector< double > &buffer)
 
void communicate_Allreduce_sum_in_place (std::vector< int > &buffer)
 
void communicate_Allreduce_sum (std::vector< double > &send_buffer, std::vector< double > &recv_buffer)
 
bool equal_cross_ranks (const double value)
 Equal across all ranks.
 
std::string get_processor_name ()
 
bool is_mpi_used ()
 
size_t get_buffer_size_target_data () const
 Returns total size of MPI buffer for communication of connections.
 
unsigned int get_send_recv_count_target_data_per_rank () const
 Returns size of MPI buffer for connections divided by number of processes.
 
size_t get_buffer_size_spike_data () const
 Returns total size of MPI buffer for communication of spikes.
 
unsigned int get_send_recv_count_spike_data_per_rank () const
 Returns size of MPI buffer for spikes divided by number of processes.
 
size_t get_send_buffer_size_secondary_events_in_int () const
 Returns total size of MPI send buffer for communication of secondary events.
 
size_t get_recv_buffer_size_secondary_events_in_int () const
 Returns total size of MPI recv buffer for communication of secondary events.
 
template<class D >
void communicate_Alltoall (std::vector< D > &send_buffer, std::vector< D > &recv_buffer, const unsigned int send_recv_count)
 
template<class D >
void communicate_target_data_Alltoall (std::vector< D > &send_buffer, std::vector< D > &recv_buffer)
 
template<class D >
void communicate_spike_data_Alltoall (std::vector< D > &send_buffer, std::vector< D > &recv_buffer)
 
template<class D >
void communicate_off_grid_spike_data_Alltoall (std::vector< D > &send_buffer, std::vector< D > &recv_buffer)
 
template<class D >
void communicate_secondary_events_Alltoallv (std::vector< D > &send_buffer, std::vector< D > &recv_buffer)
 
void synchronize ()
 Ensure all processes have reached the same stage by waiting until all processes have sent a dummy message to process 0.
 
bool any_true (const bool)
 
double time_communicate (int num_bytes, int samples=1000)
 Benchmark communication time of different MPI methods.
 
double time_communicatev (int num_bytes, int samples=1000)
 
double time_communicate_offgrid (int num_bytes, int samples=1000)
 
double time_communicate_alltoall (int num_bytes, int samples=1000)
 
double time_communicate_alltoallv (int num_bytes, int samples=1000)
 
void set_buffer_size_target_data (size_t buffer_size)
 
void set_buffer_size_spike_data (size_t buffer_size)
 
bool increase_buffer_size_target_data ()
 Increases the size of the MPI buffer for communication of connections if it needs to be increased.
 
bool adaptive_target_buffers () const
 Returns whether MPI buffers for communication of connections are adaptive.
 
void set_recv_counts_secondary_events_in_int_per_rank (const std::vector< int > &recv_counts_in_int_per_rank)
 Sets the recvcounts parameter of Alltoallv for communication of secondary events, i.e., the number of elements (in ints) to recv from the corresponding rank.
 
size_t get_recv_count_secondary_events_in_int (const size_t source_rank) const
 Returns the recvcounts parameter of Alltoallv for communication of secondary events, i.e., the number of elements (in ints) to recv from source_rank.
 
size_t get_recv_displacement_secondary_events_in_int (const size_t source_rank) const
 Returns the rdispls parameter of Alltoallv for communication of secondary events, i.e., the offset in the MPI buffer where elements from source_rank are written.
 
size_t get_send_count_secondary_events_in_int (const size_t target_rank) const
 Returns the number of elements (in ints) to be sent to target_rank.
 
size_t get_send_displacement_secondary_events_in_int (const size_t target_rank) const
 Returns the send displacement of elements (in ints) to be sent to rank target_rank.
 
size_t get_done_marker_position_in_secondary_events_send_buffer (const size_t target_rank) const
 Returns where the done marker is located in the MPI send buffer for target_rank.
 
size_t get_done_marker_position_in_secondary_events_recv_buffer (const size_t source_rank) const
 Returns where the done marker is located in the MPI recv buffer for source_rank.
 
void communicate_recv_counts_secondary_events ()
 
- Public Member Functions inherited from nest::ManagerInterface
 ManagerInterface (ManagerInterface const &)=delete
 
void operator= (ManagerInterface const &)=delete
 
 ManagerInterface ()
 
virtual ~ManagerInterface ()
 
virtual void prepare ()
 
virtual void cleanup ()
 

Private Attributes

int num_processes_
 number of MPI processes
 
int rank_
 rank of the MPI process
 
int send_buffer_size_
 expected size of send buffer
 
int recv_buffer_size_
 size of receive buffer
 
bool use_mpi_
 whether MPI is used
 
size_t buffer_size_target_data_
 total size of MPI buffer for
 
size_t buffer_size_spike_data_
 total size of MPI buffer for
 
size_t max_buffer_size_target_data_
 maximal size of MPI buffer for
 
bool adaptive_target_buffers_
 whether MPI buffers for communication of
 
double growth_factor_buffer_spike_data_
 
double growth_factor_buffer_target_data_
 
double shrink_factor_buffer_spike_data_
 
unsigned int send_recv_count_spike_data_per_rank_
 
unsigned int send_recv_count_target_data_per_rank_
 
std::vector< int > recv_counts_secondary_events_in_int_per_rank_
 How many secondary elements (in ints) will be received from each rank.
 
std::vector< int > send_counts_secondary_events_in_int_per_rank_
 how many secondary elements (in ints) will be sent to each rank
 
std::vector< int > recv_displacements_secondary_events_in_int_per_rank_
 Offset in the MPI receive buffer (in ints) at which elements received from each rank will be written.
 
std::vector< int > send_displacements_secondary_events_in_int_per_rank_
 Offset in the MPI send buffer (in ints) from which elements send to each rank will be read.
 

Constructor & Destructor Documentation

◆ MPIManager()

nest::MPIManager::MPIManager ( )

◆ ~MPIManager()

nest::MPIManager::~MPIManager ( )
inlineoverride

Member Function Documentation

◆ adaptive_target_buffers()

bool nest::MPIManager::adaptive_target_buffers ( ) const
inline

Returns whether MPI buffers for communication of connections are adaptive.

References adaptive_target_buffers_.

◆ any_true()

bool nest::MPIManager::any_true ( const bool  my_bool)
inline

Referenced by nest::ConnectionManager::check_secondary_connections_exist(), nest::NodeManager::check_wfr_use(), and nest::ConnectionManager::sync_has_primary_connections().

Here is the caller graph for this function:

◆ communicate() [1/9]

void nest::MPIManager::communicate ( double  send_val,
std::vector< double > &  recv_buffer 
)

◆ communicate() [2/9]

void nest::MPIManager::communicate ( std::vector< double > &  send_buffer,
std::vector< double > &  recv_buffer,
std::vector< int > &  displacements 
)

References num_processes_.

◆ communicate() [3/9]

void nest::MPIManager::communicate ( std::vector< int > &  )
inline

◆ communicate() [4/9]

void nest::MPIManager::communicate ( std::vector< int > &  send_buffer,
std::vector< int > &  recv_buffer,
std::vector< int > &  displacements 
)

References num_processes_.

◆ communicate() [5/9]

void nest::MPIManager::communicate ( std::vector< long > &  )
inline

◆ communicate() [6/9]

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

communicate (off-grid) if compiled without MPI

References num_processes_, recv_buffer_size_, and send_buffer_size_.

◆ communicate() [7/9]

void nest::MPIManager::communicate ( std::vector< size_t > &  send_buffer,
std::vector< size_t > &  recv_buffer 
)

◆ communicate() [8/9]

void nest::MPIManager::communicate ( std::vector< unsigned int > &  send_buffer,
std::vector< unsigned int > &  recv_buffer,
std::vector< int > &  displacements 
)

communicate (on-grid) if compiled without MPI

References num_processes_, recv_buffer_size_, and send_buffer_size_.

◆ communicate() [9/9]

void nest::MPIManager::communicate ( std::vector< unsigned long > &  send_buffer,
std::vector< unsigned long > &  recv_buffer,
std::vector< int > &  displacements 
)

References num_processes_.

◆ communicate_Allreduce_sum()

void nest::MPIManager::communicate_Allreduce_sum ( std::vector< double > &  send_buffer,
std::vector< double > &  recv_buffer 
)

◆ communicate_Allreduce_sum_in_place() [1/3]

void nest::MPIManager::communicate_Allreduce_sum_in_place ( double  buffer)

Sum across all ranks.

◆ communicate_Allreduce_sum_in_place() [2/3]

void nest::MPIManager::communicate_Allreduce_sum_in_place ( std::vector< double > &  buffer)

◆ communicate_Allreduce_sum_in_place() [3/3]

void nest::MPIManager::communicate_Allreduce_sum_in_place ( std::vector< int > &  buffer)

◆ communicate_Alltoall()

template<class D >
void nest::MPIManager::communicate_Alltoall ( std::vector< D > &  send_buffer,
std::vector< D > &  recv_buffer,
const unsigned int  send_recv_count 
)

Referenced by communicate_off_grid_spike_data_Alltoall(), communicate_spike_data_Alltoall(), communicate_target_data_Alltoall(), and nest::ThirdInBuilder::connect_().

Here is the caller graph for this function:

◆ communicate_off_grid_spike_data_Alltoall()

template<class D >
void nest::MPIManager::communicate_off_grid_spike_data_Alltoall ( std::vector< D > &  send_buffer,
std::vector< D > &  recv_buffer 
)

References communicate_Alltoall(), and send_recv_count_spike_data_per_rank_.

Referenced by nest::EventDeliveryManager::gather_spike_data_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ communicate_recv_counts_secondary_events()

void nest::MPIManager::communicate_recv_counts_secondary_events ( )

References recv_counts_secondary_events_in_int_per_rank_, send_counts_secondary_events_in_int_per_rank_, and send_displacements_secondary_events_in_int_per_rank_.

Referenced by nest::SimulationManager::update_connection_infrastructure().

Here is the caller graph for this function:

◆ communicate_secondary_events_Alltoallv()

template<class D >
void nest::MPIManager::communicate_secondary_events_Alltoallv ( std::vector< D > &  send_buffer,
std::vector< D > &  recv_buffer 
)

Referenced by nest::EventDeliveryManager::gather_secondary_events().

Here is the caller graph for this function:

◆ communicate_spike_data_Alltoall()

template<class D >
void nest::MPIManager::communicate_spike_data_Alltoall ( std::vector< D > &  send_buffer,
std::vector< D > &  recv_buffer 
)

References communicate_Alltoall(), and send_recv_count_spike_data_per_rank_.

Referenced by nest::EventDeliveryManager::gather_spike_data_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ communicate_target_data_Alltoall()

template<class D >
void nest::MPIManager::communicate_target_data_Alltoall ( std::vector< D > &  send_buffer,
std::vector< D > &  recv_buffer 
)

References communicate_Alltoall(), and send_recv_count_target_data_per_rank_.

Referenced by nest::EventDeliveryManager::gather_target_data(), and nest::EventDeliveryManager::gather_target_data_compressed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ equal_cross_ranks()

bool nest::MPIManager::equal_cross_ranks ( const double  value)

Equal across all ranks.

Parameters
valuevalue on calling rank
Returns
true if values across all ranks are equal, false otherwise or if any rank passes -inf as value

◆ finalize()

void nest::MPIManager::finalize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

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.

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_onlyPass true if calling from kernel_manager::change_number_of_threads() to limit operations to those necessary for thread adjustment.
See also
initialize()

Implements nest::ManagerInterface.

◆ get_buffer_size_spike_data()

size_t nest::MPIManager::get_buffer_size_spike_data ( ) const
inline

Returns total size of MPI buffer for communication of spikes.

References buffer_size_spike_data_.

Referenced by set_buffer_size_spike_data().

Here is the caller graph for this function:

◆ get_buffer_size_target_data()

size_t nest::MPIManager::get_buffer_size_target_data ( ) const
inline

Returns total size of MPI buffer for communication of connections.

References buffer_size_target_data_.

Referenced by set_buffer_size_target_data().

Here is the caller graph for this function:

◆ get_done_marker_position_in_secondary_events_recv_buffer()

size_t nest::MPIManager::get_done_marker_position_in_secondary_events_recv_buffer ( const size_t  source_rank) const
inline

Returns where the done marker is located in the MPI recv buffer for source_rank.

References get_recv_count_secondary_events_in_int(), and get_recv_displacement_secondary_events_in_int().

Referenced by nest::ConnectionManager::deliver_secondary_events().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_done_marker_position_in_secondary_events_send_buffer()

size_t nest::MPIManager::get_done_marker_position_in_secondary_events_send_buffer ( const size_t  target_rank) const
inline

Returns where the done marker is located in the MPI send buffer for target_rank.

References get_send_count_secondary_events_in_int(), and get_send_displacement_secondary_events_in_int().

Referenced by nest::EventDeliveryManager::write_done_marker_secondary_events_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_num_processes()

size_t nest::MPIManager::get_num_processes ( ) const
inline

Return the number of processes used during simulation.

This functions returns the number of processes. Since each process has the same number of threads, the total number of threads is given by get_num_threads()*get_num_processes().

References num_processes_.

Referenced by nest::nc_const_iterator::advance_local_iter_to_new_part_(), nest::SimulationManager::call_update_(), nest::ConnectionManager::compute_target_data_buffer_size(), nest::ThirdInBuilder::connect_(), nest::EventDeliveryManager::deliver_events_(), nest::ConnectionManager::deliver_secondary_events(), nest::EventDeliveryManager::distribute_target_data_buffers_(), nest::EventDeliveryManager::get_global_max_spikes_per_rank_(), nest::VPManager::get_num_virtual_processes(), nest::FreeLayer< D >::get_status(), nest::VPManager::get_vp(), nest::KernelManager::initialize(), nest::FreeLayer< D >::lid_to_position_id_(), nest::NodeCollectionPrimitive::rank_local_begin(), nest::NodeCollectionComposite::rank_local_begin(), nest::EventDeliveryManager::reset_complete_marker_spike_data_(), nest::SendBufferPosition::SendBufferPosition(), set_buffer_size_spike_data(), set_buffer_size_target_data(), nest::EventDeliveryManager::set_end_marker_(), nest::VPManager::set_status(), nest::VPManager::thread_to_vp(), nest::VPManager::vp_to_thread(), and nest::EventDeliveryManager::write_done_marker_secondary_events_().

Here is the caller graph for this function:

◆ get_process_id_of_node_id()

size_t nest::MPIManager::get_process_id_of_node_id ( const size_t  node_id) const
inline

◆ get_process_id_of_vp()

size_t nest::MPIManager::get_process_id_of_vp ( const size_t  vp) const
inline

Return the process id for a given virtual process.

The real process' id of a virtual process is defined by the relation: p = (vp mod P), where P is the total number of processes.

References num_processes_.

Referenced by nest::NodeCollectionComposite::gid_to_rank_(), nest::VPManager::is_local_vp(), nest::NodeCollectionPrimitive::rank_local_begin(), and nest::ThirdInBuilder::register_connection().

Here is the caller graph for this function:

◆ get_processor_name()

std::string nest::MPIManager::get_processor_name ( )
inline

◆ get_rank()

◆ get_recv_buffer_size_secondary_events_in_int()

size_t nest::MPIManager::get_recv_buffer_size_secondary_events_in_int ( ) const
inline

Returns total size of MPI recv buffer for communication of secondary events.

References recv_counts_secondary_events_in_int_per_rank_, and recv_displacements_secondary_events_in_int_per_rank_.

Referenced by get_status().

Here is the caller graph for this function:

◆ get_recv_count_secondary_events_in_int()

size_t nest::MPIManager::get_recv_count_secondary_events_in_int ( const size_t  source_rank) const
inline

Returns the recvcounts parameter of Alltoallv for communication of secondary events, i.e., the number of elements (in ints) to recv from source_rank.

References recv_counts_secondary_events_in_int_per_rank_.

Referenced by get_done_marker_position_in_secondary_events_recv_buffer().

Here is the caller graph for this function:

◆ get_recv_displacement_secondary_events_in_int()

size_t nest::MPIManager::get_recv_displacement_secondary_events_in_int ( const size_t  source_rank) const
inline

Returns the rdispls parameter of Alltoallv for communication of secondary events, i.e., the offset in the MPI buffer where elements from source_rank are written.

References recv_displacements_secondary_events_in_int_per_rank_.

Referenced by nest::ConnectionManager::compute_compressed_secondary_recv_buffer_positions(), nest::ConnectionManager::fill_target_buffer(), get_done_marker_position_in_secondary_events_recv_buffer(), and nest::SourceTable::populate_target_data_fields_().

Here is the caller graph for this function:

◆ get_send_buffer_size_secondary_events_in_int()

size_t nest::MPIManager::get_send_buffer_size_secondary_events_in_int ( ) const
inline

Returns total size of MPI send buffer for communication of secondary events.

References send_counts_secondary_events_in_int_per_rank_, and send_displacements_secondary_events_in_int_per_rank_.

Referenced by get_status().

Here is the caller graph for this function:

◆ get_send_count_secondary_events_in_int()

size_t nest::MPIManager::get_send_count_secondary_events_in_int ( const size_t  target_rank) const
inline

Returns the number of elements (in ints) to be sent to target_rank.

References send_counts_secondary_events_in_int_per_rank_.

Referenced by get_done_marker_position_in_secondary_events_send_buffer().

Here is the caller graph for this function:

◆ get_send_displacement_secondary_events_in_int()

size_t nest::MPIManager::get_send_displacement_secondary_events_in_int ( const size_t  target_rank) const
inline

Returns the send displacement of elements (in ints) to be sent to rank target_rank.

References send_displacements_secondary_events_in_int_per_rank_.

Referenced by nest::TargetTable::add_target(), and get_done_marker_position_in_secondary_events_send_buffer().

Here is the caller graph for this function:

◆ get_send_recv_count_spike_data_per_rank()

unsigned int nest::MPIManager::get_send_recv_count_spike_data_per_rank ( ) const
inline

Returns size of MPI buffer for spikes divided by number of processes.

References send_recv_count_spike_data_per_rank_.

Referenced by nest::EventDeliveryManager::deliver_events_(), nest::EventDeliveryManager::gather_spike_data_(), nest::EventDeliveryManager::get_global_max_spikes_per_rank_(), nest::SendBufferPosition::SendBufferPosition(), and nest::EventDeliveryManager::set_end_marker_().

Here is the caller graph for this function:

◆ get_send_recv_count_target_data_per_rank()

unsigned int nest::MPIManager::get_send_recv_count_target_data_per_rank ( ) const
inline

Returns size of MPI buffer for connections divided by number of processes.

References send_recv_count_target_data_per_rank_.

Referenced by nest::EventDeliveryManager::distribute_target_data_buffers_().

Here is the caller graph for this function:

◆ get_status()

void nest::MPIManager::get_status ( Dictionary &  )
overridevirtual

Retrieve the status of the manager.

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().
See also
set_status()

Implements nest::ManagerInterface.

References nest::names::adaptive_target_buffers(), adaptive_target_buffers_, nest::names::buffer_size_spike_data(), buffer_size_spike_data_, nest::names::buffer_size_target_data(), buffer_size_target_data_, get_recv_buffer_size_secondary_events_in_int(), get_send_buffer_size_secondary_events_in_int(), nest::names::growth_factor_buffer_spike_data(), growth_factor_buffer_spike_data_, nest::names::growth_factor_buffer_target_data(), growth_factor_buffer_target_data_, nest::names::max_buffer_size_target_data(), max_buffer_size_target_data_, nest::names::mpi_rank(), nest::names::num_processes(), num_processes_, rank_, nest::names::recv_buffer_size_secondary_events(), and nest::names::send_buffer_size_secondary_events().

Here is the call graph for this function:

◆ increase_buffer_size_target_data()

bool nest::MPIManager::increase_buffer_size_target_data ( )
inline

Increases the size of the MPI buffer for communication of connections if it needs to be increased.

Returns whether the size was changed.

References adaptive_target_buffers_, buffer_size_target_data_, growth_factor_buffer_target_data_, max_buffer_size_target_data_, and set_buffer_size_target_data().

Referenced by nest::EventDeliveryManager::gather_target_data(), and nest::EventDeliveryManager::gather_target_data_compressed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_mpi()

void nest::MPIManager::init_mpi ( int *  argc,
char **  argv[] 
)

References nest::kernel(), nest::KernelManager::mpi_manager, recv_counts_secondary_events_in_int_per_rank_, recv_displacements_secondary_events_in_int_per_rank_, send_counts_secondary_events_in_int_per_rank_, send_displacements_secondary_events_in_int_per_rank_, set_buffer_size_spike_data(), and set_buffer_size_target_data().

Referenced by nest::init_nest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void nest::MPIManager::initialize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Prepare manager for operation.

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

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_onlyPass 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.
See also
finalize()

Implements nest::ManagerInterface.

References nest::FATAL, and LOG.

◆ is_mpi_used()

bool nest::MPIManager::is_mpi_used ( )
inline

References use_mpi_.

◆ mpi_abort()

void nest::MPIManager::mpi_abort ( int  exitcode)
inline

If MPI is available, this method calls MPI_Abort with the exitcode.

◆ mpi_finalize()

void nest::MPIManager::mpi_finalize ( int  exitcode)

Finalize MPI communication (needs to be separate from MPIManager::finalize when compiled with MUSIC since spikes can arrive and handlers called here)

Referenced by nest::shutdown_nest().

Here is the caller graph for this function:

◆ set_buffer_size_spike_data()

void nest::MPIManager::set_buffer_size_spike_data ( size_t  buffer_size)
inline

References buffer_size_spike_data_, get_buffer_size_spike_data(), get_num_processes(), and send_recv_count_spike_data_per_rank_.

Referenced by nest::EventDeliveryManager::gather_spike_data_(), init_mpi(), and set_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_buffer_size_target_data()

void nest::MPIManager::set_buffer_size_target_data ( size_t  buffer_size)
inline

References buffer_size_target_data_, get_buffer_size_target_data(), get_num_processes(), max_buffer_size_target_data_, and send_recv_count_target_data_per_rank_.

Referenced by nest::ConnectionManager::compute_target_data_buffer_size(), increase_buffer_size_target_data(), init_mpi(), and set_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_recv_counts_secondary_events_in_int_per_rank()

void nest::MPIManager::set_recv_counts_secondary_events_in_int_per_rank ( const std::vector< int > &  recv_counts_in_int_per_rank)
inline

Sets the recvcounts parameter of Alltoallv for communication of secondary events, i.e., the number of elements (in ints) to recv from the corresponding rank.

References recv_counts_secondary_events_in_int_per_rank_, and recv_displacements_secondary_events_in_int_per_rank_.

Referenced by nest::SourceTable::compute_buffer_pos_for_unique_secondary_sources().

Here is the caller graph for this function:

◆ set_status()

◆ synchronize()

void nest::MPIManager::synchronize ( )
inline

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

Referenced by nest::SimulationManager::call_update_(), nest::EventDeliveryManager::gather_spike_data_(), and nest::synchronize().

Here is the caller graph for this function:

◆ time_communicate()

double nest::MPIManager::time_communicate ( int  num_bytes,
int  samples = 1000 
)
inline

Benchmark communication time of different MPI methods.

The methods time_communicate* can be used to benchmark the timing of different MPI communication methods.

◆ time_communicate_alltoall()

double nest::MPIManager::time_communicate_alltoall ( int  num_bytes,
int  samples = 1000 
)
inline

◆ time_communicate_alltoallv()

double nest::MPIManager::time_communicate_alltoallv ( int  num_bytes,
int  samples = 1000 
)
inline

◆ time_communicate_offgrid()

double nest::MPIManager::time_communicate_offgrid ( int  num_bytes,
int  samples = 1000 
)
inline

◆ time_communicatev()

double nest::MPIManager::time_communicatev ( int  num_bytes,
int  samples = 1000 
)
inline

Member Data Documentation

◆ adaptive_target_buffers_

bool nest::MPIManager::adaptive_target_buffers_
private

whether MPI buffers for communication of

Referenced by adaptive_target_buffers(), get_status(), increase_buffer_size_target_data(), and set_status().

◆ buffer_size_spike_data_

size_t nest::MPIManager::buffer_size_spike_data_
private

total size of MPI buffer for

Referenced by get_buffer_size_spike_data(), get_status(), set_buffer_size_spike_data(), and set_status().

◆ buffer_size_target_data_

size_t nest::MPIManager::buffer_size_target_data_
private

◆ growth_factor_buffer_spike_data_

double nest::MPIManager::growth_factor_buffer_spike_data_
private

Referenced by get_status(), and set_status().

◆ growth_factor_buffer_target_data_

double nest::MPIManager::growth_factor_buffer_target_data_
private

◆ max_buffer_size_target_data_

size_t nest::MPIManager::max_buffer_size_target_data_
private

maximal size of MPI buffer for

Referenced by get_status(), increase_buffer_size_target_data(), set_buffer_size_target_data(), and set_status().

◆ num_processes_

int nest::MPIManager::num_processes_
private

◆ rank_

int nest::MPIManager::rank_
private

rank of the MPI process

Referenced by get_rank(), and get_status().

◆ recv_buffer_size_

int nest::MPIManager::recv_buffer_size_
private

size of receive buffer

Referenced by communicate(), and communicate().

◆ recv_counts_secondary_events_in_int_per_rank_

std::vector< int > nest::MPIManager::recv_counts_secondary_events_in_int_per_rank_
private

◆ recv_displacements_secondary_events_in_int_per_rank_

std::vector< int > nest::MPIManager::recv_displacements_secondary_events_in_int_per_rank_
private

Offset in the MPI receive buffer (in ints) at which elements received from each rank will be written.

Referenced by get_recv_buffer_size_secondary_events_in_int(), get_recv_displacement_secondary_events_in_int(), init_mpi(), and set_recv_counts_secondary_events_in_int_per_rank().

◆ send_buffer_size_

int nest::MPIManager::send_buffer_size_
private

expected size of send buffer

Referenced by communicate(), and communicate().

◆ send_counts_secondary_events_in_int_per_rank_

std::vector< int > nest::MPIManager::send_counts_secondary_events_in_int_per_rank_
private

◆ send_displacements_secondary_events_in_int_per_rank_

std::vector< int > nest::MPIManager::send_displacements_secondary_events_in_int_per_rank_
private

Offset in the MPI send buffer (in ints) from which elements send to each rank will be read.

Referenced by communicate_recv_counts_secondary_events(), get_send_buffer_size_secondary_events_in_int(), get_send_displacement_secondary_events_in_int(), and init_mpi().

◆ send_recv_count_spike_data_per_rank_

unsigned int nest::MPIManager::send_recv_count_spike_data_per_rank_
private

◆ send_recv_count_target_data_per_rank_

unsigned int nest::MPIManager::send_recv_count_target_data_per_rank_
private

◆ shrink_factor_buffer_spike_data_

double nest::MPIManager::shrink_factor_buffer_spike_data_
private

Referenced by set_status().

◆ use_mpi_

bool nest::MPIManager::use_mpi_
private

whether MPI is used

Referenced by is_mpi_used().


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