|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
#include <MpiCommunicator.h>
Public Member Functions | |
| MpiCommunicator (Serializer< GeneType > &serializer, const std::size_t max_payload_size, const MPI_Comm comm=MPI_COMM_WORLD) | |
| ~MpiCommunicator () final | |
| void | startReceiving (MigrationBuffer< GeneType > &target_buffer) override |
| Begins asynchronous background receiving of migrants. | |
| void | update () override |
| Processes any pending network events (e.g. polls for incoming messages). | |
| void | stopReceiving () override |
| Stops background communication activities. | |
| void | send (const std::vector< Individual< GeneType > > &deme, const std::size_t destination_rank) override |
| Sends a deme to a specific destination island. | |
| void | broadcast (const std::vector< Individual< GeneType > > &deme, const std::vector< std::size_t > &destination_ranks) override |
| Sends a deme to multiple destination islands. | |
| Individual< GeneType > | allReduceBest (Individual< GeneType > individual) const override |
| Global reduction to find the best individual across all islands. | |
| std::size_t | getRank () const override |
| Gets the network rank of the local node. | |
| std::size_t | getSize () const override |
| Gets the total number of islands in the network. | |
Public Member Functions inherited from galib::internal::Communicator< GeneType > | |
| virtual | ~Communicator ()=default |
Definition at line 14 of file MpiCommunicator.h.
|
inlineexplicit |
Definition at line 32 of file MpiCommunicator.h.
|
inlinefinal |
Definition at line 53 of file MpiCommunicator.h.
References galib::internal::MpiCommunicator< GeneType >::stopReceiving().
|
inlineoverridevirtual |
Global reduction to find the best individual across all islands.
| individual | The local best individual. |
Implements galib::internal::Communicator< GeneType >.
Definition at line 164 of file MpiCommunicator.h.
References galib::internal::Serializer< GeneType >::deserialize(), galib::Individual< GeneType >::getFitness(), and galib::internal::Serializer< GeneType >::serialize().
|
inlineoverridevirtual |
Sends a deme to multiple destination islands.
| deme | The individuals to migrate. |
| destination_ranks | List of target island IDs. |
Implements galib::internal::Communicator< GeneType >.
Definition at line 146 of file MpiCommunicator.h.
References galib::internal::Serializer< GeneType >::serialize().
|
inlineoverridevirtual |
Gets the network rank of the local node.
Implements galib::internal::Communicator< GeneType >.
Definition at line 223 of file MpiCommunicator.h.
|
inlineoverridevirtual |
Gets the total number of islands in the network.
Implements galib::internal::Communicator< GeneType >.
Definition at line 227 of file MpiCommunicator.h.
|
inlineoverridevirtual |
Sends a deme to a specific destination island.
| deme | The individuals to migrate. |
| destination_rank | The network ID/rank of the target island. |
Implements galib::internal::Communicator< GeneType >.
Definition at line 133 of file MpiCommunicator.h.
References galib::internal::Serializer< GeneType >::serialize().
|
inlineoverridevirtual |
Begins asynchronous background receiving of migrants.
| target_buffer | The buffer where arrived individuals will be stored. |
Implements galib::internal::Communicator< GeneType >.
Definition at line 57 of file MpiCommunicator.h.
References galib::internal::MpiCommunicator< GeneType >::stopReceiving().
|
inlineoverridevirtual |
Stops background communication activities.
Implements galib::internal::Communicator< GeneType >.
Definition at line 118 of file MpiCommunicator.h.
Referenced by galib::internal::MpiCommunicator< GeneType >::startReceiving(), and galib::internal::MpiCommunicator< GeneType >::~MpiCommunicator().
|
inlineoverridevirtual |
Processes any pending network events (e.g. polls for incoming messages).
Implements galib::internal::Communicator< GeneType >.
Definition at line 75 of file MpiCommunicator.h.
References galib::internal::Serializer< GeneType >::deserialize(), and galib::internal::MigrationBuffer< GeneType >::push().