GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
Public Member Functions | List of all members
galib::internal::Communicator< GeneType > Class Template Referenceabstract

Interface for network communication between islands. More...

#include <Communicator.h>

Inheritance diagram for galib::internal::Communicator< GeneType >:
[legend]

Public Member Functions

virtual ~Communicator ()=default
 
virtual void startReceiving (MigrationBuffer< GeneType > &target_buffer)=0
 Begins asynchronous background receiving of migrants.
 
virtual void update ()=0
 Processes any pending network events (e.g. polls for incoming messages).
 
virtual void stopReceiving ()=0
 Stops background communication activities.
 
virtual void send (const std::vector< Individual< GeneType > > &deme, std::size_t destination_rank)=0
 Sends a deme to a specific destination island.
 
virtual void broadcast (const std::vector< Individual< GeneType > > &deme, const std::vector< std::size_t > &destination_ranks)=0
 Sends a deme to multiple destination islands.
 
virtual Individual< GeneType > allReduceBest (Individual< GeneType > individual) const =0
 Global reduction to find the best individual across all islands.
 
virtual std::size_t getRank () const =0
 Gets the network rank of the local node.
 
virtual std::size_t getSize () const =0
 Gets the total number of islands in the network.
 

Detailed Description

template<typename GeneType>
class galib::internal::Communicator< GeneType >

Interface for network communication between islands.

Handles the low-level details of moving individuals between distributed nodes and synchronizing global state.

Template Parameters
GeneTypeThe gene type of the individuals.

Definition at line 22 of file Communicator.h.

Constructor & Destructor Documentation

◆ ~Communicator()

template<typename GeneType >
virtual galib::internal::Communicator< GeneType >::~Communicator ( )
virtualdefault

Member Function Documentation

◆ allReduceBest()

template<typename GeneType >
virtual Individual< GeneType > galib::internal::Communicator< GeneType >::allReduceBest ( Individual< GeneType >  individual) const
pure virtual

Global reduction to find the best individual across all islands.

Parameters
individualThe local best individual.
Returns
A copy of the absolute best individual found in the entire archipelago.

Implemented in galib::internal::MpiCommunicator< GeneType >.

◆ broadcast()

template<typename GeneType >
virtual void galib::internal::Communicator< GeneType >::broadcast ( const std::vector< Individual< GeneType > > &  deme,
const std::vector< std::size_t > &  destination_ranks 
)
pure virtual

Sends a deme to multiple destination islands.

Parameters
demeThe individuals to migrate.
destination_ranksList of target island IDs.

Implemented in galib::internal::MpiCommunicator< GeneType >.

◆ getRank()

template<typename GeneType >
virtual std::size_t galib::internal::Communicator< GeneType >::getRank ( ) const
pure virtual

Gets the network rank of the local node.

Returns
The ID of the local island.

Implemented in galib::internal::MpiCommunicator< GeneType >.

◆ getSize()

template<typename GeneType >
virtual std::size_t galib::internal::Communicator< GeneType >::getSize ( ) const
pure virtual

Gets the total number of islands in the network.

Returns
The size of the archipelago.

Implemented in galib::internal::MpiCommunicator< GeneType >.

◆ send()

template<typename GeneType >
virtual void galib::internal::Communicator< GeneType >::send ( const std::vector< Individual< GeneType > > &  deme,
std::size_t  destination_rank 
)
pure virtual

Sends a deme to a specific destination island.

Parameters
demeThe individuals to migrate.
destination_rankThe network ID/rank of the target island.

Implemented in galib::internal::MpiCommunicator< GeneType >.

◆ startReceiving()

template<typename GeneType >
virtual void galib::internal::Communicator< GeneType >::startReceiving ( MigrationBuffer< GeneType > &  target_buffer)
pure virtual

Begins asynchronous background receiving of migrants.

Parameters
target_bufferThe buffer where arrived individuals will be stored.

Implemented in galib::internal::MpiCommunicator< GeneType >.

◆ stopReceiving()

template<typename GeneType >
virtual void galib::internal::Communicator< GeneType >::stopReceiving ( )
pure virtual

Stops background communication activities.

Implemented in galib::internal::MpiCommunicator< GeneType >.

◆ update()

template<typename GeneType >
virtual void galib::internal::Communicator< GeneType >::update ( )
pure virtual

Processes any pending network events (e.g. polls for incoming messages).

Implemented in galib::internal::MpiCommunicator< GeneType >.


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