Communicator class for interprocess communication.
More...
#include <Communicator.h>
|
bool | initialize (StateP, int, char **) |
|
bool | finalize () |
|
bool | isInitialized () |
|
bool | sendIndividuals (std::vector< IndividualP >, uint, uint nIndividuals=0) |
|
bool | sendIndividualsGlobal (std::vector< IndividualP >, uint, uint nIndividuals=0) |
|
bool | sendFitness (std::vector< IndividualP >, uint, uint nIndividuals=0) |
|
bool | sendValuesGlobal (std::vector< double >, uint) |
|
bool | sendLogsGlobal (std::string, uint iProcess=0, bool blocking=false) |
|
bool | sendDataGlobal (voidP, uint, uint) |
|
uint | recvDemeIndividuals (std::vector< IndividualP > &, uint) |
|
std::vector< IndividualP > | recvIndividuals (uint iProcess=MPI::ANY_SOURCE) |
|
std::vector< IndividualP > | recvIndividualsGlobal (uint iProcess=MPI::ANY_SOURCE) |
|
uint | recvReplaceIndividuals (std::vector< IndividualP > &, uint) |
|
uint | recvDemeFitness (std::vector< IndividualP > &, uint) |
|
std::vector< uint > | recvFitnessVector (std::vector< IndividualP > &, uint) |
|
std::vector< double > | recvValuesGlobal (uint iProcess=MPI::ANY_SOURCE) |
|
std::string | recvLogsGlobal () |
|
voidP | recvDataGlobal (uint iProcess=MPI::ANY_SOURCE) |
|
bool | messageWaiting (uint iProcess=MPI::ANY_SOURCE, uint tag=MPI::ANY_TAG) |
|
void | synchronize () |
|
bool | sendControlMessage (uint, int) |
|
int | recvControlMessage (uint) |
|
bool | sendTerminateMessage (uint, bool) |
|
bool | recvTerminateMessage (uint) |
|
bool | checkTerminationMessage (uint master=0) |
|
uint | createDemeCommunicator (uint nDemes) |
|
uint | getDemeMaster (uint iDeme) |
|
uint | getLastSource () |
|
uint | getCommRank () |
|
uint | getCommSize () |
|
uint | getCommGlobalRank () |
|
uint | getCommGlobalSize () |
|
bool | initialize (StateP state, int argc, char **argv) |
|
bool | finalize () |
|
uint | getCommRank () |
|
uint | getCommGlobalRank () |
|
uint | getCommSize () |
|
|
double | time (enum timing T) |
|
Communicator class for interprocess communication.
Wraps MPI calls for message passing between processes. Note: will be reimplemented as an abstract class with MPI specialization.
Definition at line 42 of file Communicator.h.
◆ Communicator()
Comm::Communicator::Communicator |
( |
| ) |
|
◆ checkTerminationMessage()
bool Comm::Communicator::checkTerminationMessage |
( |
uint |
master = 0 | ) |
|
◆ createDemeCommunicator()
uint Comm::Communicator::createDemeCommunicator |
( |
uint |
nDemes | ) |
|
◆ finalize() [1/2]
bool Comm::Communicator::finalize |
( |
| ) |
|
◆ finalize() [2/2]
bool Comm::Communicator::finalize |
( |
| ) |
|
|
inline |
◆ getCommGlobalRank() [1/2]
uint Comm::Communicator::getCommGlobalRank |
( |
| ) |
|
|
inline |
◆ getCommGlobalRank() [2/2]
uint Comm::Communicator::getCommGlobalRank |
( |
| ) |
|
|
inline |
◆ getCommGlobalSize()
uint Comm::Communicator::getCommGlobalSize |
( |
| ) |
|
|
inline |
◆ getCommRank() [1/2]
uint Comm::Communicator::getCommRank |
( |
| ) |
|
|
inline |
◆ getCommRank() [2/2]
uint Comm::Communicator::getCommRank |
( |
| ) |
|
|
inline |
◆ getCommSize() [1/2]
uint Comm::Communicator::getCommSize |
( |
| ) |
|
|
inline |
◆ getCommSize() [2/2]
uint Comm::Communicator::getCommSize |
( |
| ) |
|
|
inline |
◆ getDemeMaster()
uint Comm::Communicator::getDemeMaster |
( |
uint |
iDeme | ) |
|
◆ getLastSource()
uint Comm::Communicator::getLastSource |
( |
| ) |
|
◆ initialize() [1/2]
bool Comm::Communicator::initialize |
( |
StateP |
state, |
|
|
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
inline |
◆ initialize() [2/2]
bool Comm::Communicator::initialize |
( |
StateP |
state, |
|
|
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ isInitialized()
bool Comm::Communicator::isInitialized |
( |
| ) |
|
|
inline |
◆ messageWaiting()
bool Comm::Communicator::messageWaiting |
( |
uint |
iProcess = MPI::ANY_SOURCE , |
|
|
uint |
tag = MPI::ANY_TAG |
|
) |
| |
◆ recvControlMessage()
int Comm::Communicator::recvControlMessage |
( |
uint |
iProcess | ) |
|
◆ recvDataGlobal()
voidP Comm::Communicator::recvDataGlobal |
( |
uint |
iProcess = MPI::ANY_SOURCE | ) |
|
◆ recvDemeFitness()
uint Comm::Communicator::recvDemeFitness |
( |
std::vector< IndividualP > & |
deme, |
|
|
uint |
iProcess |
|
) |
| |
◆ recvDemeIndividuals()
uint Comm::Communicator::recvDemeIndividuals |
( |
std::vector< IndividualP > & |
deme, |
|
|
uint |
iProcess |
|
) |
| |
◆ recvFitnessVector()
std::vector< uint > Comm::Communicator::recvFitnessVector |
( |
std::vector< IndividualP > & |
deme, |
|
|
uint |
iProcess |
|
) |
| |
◆ recvIndividuals()
std::vector< IndividualP > Comm::Communicator::recvIndividuals |
( |
uint |
iProcess = MPI::ANY_SOURCE | ) |
|
◆ recvIndividualsGlobal()
std::vector< IndividualP > Comm::Communicator::recvIndividualsGlobal |
( |
uint |
iProcess = MPI::ANY_SOURCE | ) |
|
◆ recvLogsGlobal()
std::string Comm::Communicator::recvLogsGlobal |
( |
| ) |
|
◆ recvReplaceIndividuals()
uint Comm::Communicator::recvReplaceIndividuals |
( |
std::vector< IndividualP > & |
pool, |
|
|
uint |
iProcess |
|
) |
| |
◆ recvTerminateMessage()
bool Comm::Communicator::recvTerminateMessage |
( |
uint |
iProcess | ) |
|
◆ recvValuesGlobal()
std::vector< double > Comm::Communicator::recvValuesGlobal |
( |
uint |
iProcess = MPI::ANY_SOURCE | ) |
|
◆ sendControlMessage()
bool Comm::Communicator::sendControlMessage |
( |
uint |
iProcess, |
|
|
int |
control |
|
) |
| |
◆ sendDataGlobal()
bool Comm::Communicator::sendDataGlobal |
( |
voidP |
data, |
|
|
uint |
size, |
|
|
uint |
iProcess |
|
) |
| |
◆ sendFitness()
bool Comm::Communicator::sendFitness |
( |
std::vector< IndividualP > |
pool, |
|
|
uint |
iProcess, |
|
|
uint |
nIndividuals = 0 |
|
) |
| |
◆ sendIndividuals()
bool Comm::Communicator::sendIndividuals |
( |
std::vector< IndividualP > |
pool, |
|
|
uint |
iProcess, |
|
|
uint |
nIndividuals = 0 |
|
) |
| |
◆ sendIndividualsGlobal()
bool Comm::Communicator::sendIndividualsGlobal |
( |
std::vector< IndividualP > |
pool, |
|
|
uint |
iProcess, |
|
|
uint |
nIndividuals = 0 |
|
) |
| |
◆ sendLogsGlobal()
bool Comm::Communicator::sendLogsGlobal |
( |
std::string |
logs, |
|
|
uint |
iProcess = 0 , |
|
|
bool |
blocking = false |
|
) |
| |
◆ sendTerminateMessage()
bool Comm::Communicator::sendTerminateMessage |
( |
uint |
iProcess, |
|
|
bool |
termination |
|
) |
| |
◆ sendValuesGlobal()
bool Comm::Communicator::sendValuesGlobal |
( |
std::vector< double > |
values, |
|
|
uint |
iProcess |
|
) |
| |
◆ synchronize()
void Comm::Communicator::synchronize |
( |
| ) |
|
◆ time()
double Comm::Communicator::time |
( |
enum timing |
T | ) |
|
|
protected |
Gets current time and adds elapsed time to a category
- Returns
- : elapsed time (since last function call)
Definition at line 130 of file Communicator.cpp.
◆ beginTime_
double Comm::Communicator::beginTime_ |
|
protected |
◆ bInitialized_
bool Comm::Communicator::bInitialized_ |
|
protected |
◆ compTime_
double Comm::Communicator::compTime_ |
|
protected |
◆ controlStatus_
MPI::Status Comm::Communicator::controlStatus_ |
|
protected |
◆ currentTime_
double Comm::Communicator::currentTime_ |
|
protected |
◆ demeComm_
MPI::Intercomm Comm::Communicator::demeComm_ |
|
protected |
deme communicator - initially includes all processes (MPI_COMM_WORLD) but may be split into subcomms if multiple deme population is used Used by:
- the active algorithm, for algorithm implementation and broadcast of termination signal
Definition at line 76 of file Communicator.h.
◆ demeMasters
std::vector<uint> Comm::Communicator::demeMasters |
|
protected |
◆ endTime_
double Comm::Communicator::endTime_ |
|
protected |
◆ frameworkComm_
MPI::Intercomm Comm::Communicator::frameworkComm_ |
|
protected |
framework communicator - equivalent to MPI_COMM_WORLD Used by:
- State
- for termination condition messages
- Migration
- for individual exchange between demes
- Population
- for statistics and hall-of-fame updates
- Logger
- for accumulation of logs to process 0
Definition at line 69 of file Communicator.h.
◆ idleTime_
double Comm::Communicator::idleTime_ |
|
protected |
◆ lastTime_
double Comm::Communicator::lastTime_ |
|
protected |
◆ logLevel_
int Comm::Communicator::logLevel_ |
|
protected |
◆ mpiGlobalRank_
uint Comm::Communicator::mpiGlobalRank_ |
|
protected |
◆ mpiGlobalSize_
uint Comm::Communicator::mpiGlobalSize_ |
|
protected |
◆ mpiRank_
uint Comm::Communicator::mpiRank_ |
|
protected |
◆ mpiSize_
uint Comm::Communicator::mpiSize_ |
|
protected |
◆ packTime_
double Comm::Communicator::packTime_ |
|
protected |
◆ processorName_
std::string Comm::Communicator::processorName_ |
|
protected |
◆ recvCnt_
uint Comm::Communicator::recvCnt_ |
|
protected |
◆ recvTime_
double Comm::Communicator::recvTime_ |
|
protected |
◆ sendCnt_
uint Comm::Communicator::sendCnt_ |
|
protected |
◆ sendTime_
double Comm::Communicator::sendTime_ |
|
protected |
◆ state_
StateP Comm::Communicator::state_ |
|
protected |
◆ status_
MPI::Status Comm::Communicator::status_ |
|
protected |
◆ unpackTime_
double Comm::Communicator::unpackTime_ |
|
protected |
The documentation for this class was generated from the following files: