5typedef boost::shared_ptr<Individual> IndividualP;
7typedef boost::shared_ptr<State> StateP;
14const int T_DEFAULT = 0;
15const int T_CONTROL = 99;
16const int T_CONTINUE = 1;
17const int T_TERMINATE = 2;
18const int T_VALUES = 3;
24const int CONTINUE = 1;
25const int TERMINATE = 0;
29{ COMP, IDLE, SEND, RECV, PACK, UNPACK };
34const int ANY_PROCESS = MPI::ANY_SOURCE;
46 uint mpiGlobalSize_, mpiGlobalRank_;
47 uint mpiSize_, mpiRank_;
48 std::string processorName_;
51 MPI::Status controlStatus_;
53 std::vector<uint> demeMasters;
79 double currentTime_, lastTime_;
80 double beginTime_, endTime_;
85 double packTime_, unpackTime_;
88 double time(
enum timing T);
91 bool initialize(StateP,
int,
char**);
94 {
return bInitialized_; }
97 bool sendIndividuals(std::vector<IndividualP>, uint, uint nIndividuals = 0);
98 bool sendIndividualsGlobal(std::vector<IndividualP>, uint, uint nIndividuals = 0);
99 bool sendFitness(std::vector<IndividualP>, uint, uint nIndividuals = 0);
100 bool sendValuesGlobal(std::vector<double>, uint);
101 bool sendLogsGlobal(std::string, uint iProcess = 0,
bool blocking =
false);
102 bool sendDataGlobal(voidP, uint, uint);
105 uint recvDemeIndividuals(std::vector<IndividualP>&, uint);
106 std::vector<IndividualP> recvIndividuals(uint iProcess = MPI::ANY_SOURCE);
107 std::vector<IndividualP> recvIndividualsGlobal(uint iProcess = MPI::ANY_SOURCE);
108 uint recvReplaceIndividuals(std::vector<IndividualP>&, uint);
109 uint recvDemeFitness(std::vector<IndividualP>&, uint);
110 std::vector<uint> recvFitnessVector(std::vector<IndividualP>&, uint);
111 std::vector<double> recvValuesGlobal(uint iProcess = MPI::ANY_SOURCE);
112 std::string recvLogsGlobal();
113 voidP recvDataGlobal(uint iProcess = MPI::ANY_SOURCE);
116 bool messageWaiting(uint iProcess = MPI::ANY_SOURCE, uint tag = MPI::ANY_TAG);
118 bool sendControlMessage(uint,
int);
119 int recvControlMessage(uint);
120 bool sendTerminateMessage(uint,
bool);
121 bool recvTerminateMessage(uint);
122 bool checkTerminationMessage(uint master = 0);
123 uint createDemeCommunicator(uint nDemes);
124 uint getDemeMaster(uint iDeme);
127 uint getLastSource();
132 uint getCommGlobalRank()
133 {
return mpiGlobalRank_; }
134 uint getCommGlobalSize()
135 {
return mpiGlobalSize_; }
138typedef boost::shared_ptr<Communicator> CommunicatorP;
145 bool initialize(StateP state,
int argc,
char** argv)
151 uint getCommGlobalRank()
157typedef boost::shared_ptr<Communicator> CommunicatorP;
162typedef boost::shared_ptr<Comm::Communicator> CommunicatorP;
Communicator class for interprocess communication.
double time(enum timing T)
MPI::Intercomm frameworkComm_
Individual class - inherits a vector of Genotype objects.
State class - backbone of the framework.