#include <AlpsKnowledgeBrokerMPI.h>


Public Member Functions | |
| AlpsKnowledgeBrokerMPI () | |
| Default construtor. More... | |
| AlpsKnowledgeBrokerMPI (int argc, char *argv[], AlpsModel &model) | |
| Useful construtor. More... | |
| ~AlpsKnowledgeBrokerMPI () | |
| Destructor. More... | |
| virtual int | getProcRank () const |
| Query the global rank of the process. More... | |
| virtual int | getMasterRank () const |
| Query the global rank of the Master. More... | |
| virtual AlpsProcessType | getProcType () const |
| Query the type (master, hub, or worker) of the process. More... | |
| void | initializeSearch (int argc, char *argv[], AlpsModel &model) |
| This function. More... | |
| void | search (AlpsModel *model) |
| Search best solution for a given model. More... | |
| void | rootSearch (AlpsTreeNode *root) |
| This function. More... | |
Report search results. | |
| virtual double | getIncumbentValue () const |
| The process queries the quality of the incumbent this process stores. More... | |
| virtual double | getBestQuality () const |
| The master queries the quality of the best solution it knowns. More... | |
| virtual double | getBestEstimateQuality () |
| Get best estimalted quality in system. More... | |
| virtual void | printBestSolution (char *outputFile=0) const |
| Master prints out the best solution that it knows. More... | |
| virtual void | searchLog () |
| Log search statistics. More... | |
Knowledge sharing functions | |
| void | sendKnowledge (AlpsKnowledgeType type, int sender, int receiver, char *&msgBuffer, int msgSize, int msgTag, MPI_Comm comm, bool blocking) |
| Set knowlege. More... | |
| void | receiveKnowledge (AlpsKnowledgeType type, int sender, int receiver, char *&msgBuffer, int msgSize, int msgTag, MPI_Comm comm, MPI_Status *status, bool blocking) |
| Receive knowlege. More... | |
| void | requestKnowledge (AlpsKnowledgeType type, int sender, int receiver, char *&msgBuffer, int msgSize, int msgTag, MPI_Comm comm, bool blocking) |
| Request knowlege. More... | |
Public Member Functions inherited from AlpsKnowledgeBroker | |
| AlpsKnowledgeBroker () | |
| Default constructor. More... | |
| virtual | ~AlpsKnowledgeBroker () |
| Destructor. More... | |
| int | getTreeDepth () |
| Get tree depth. More... | |
| void | setPeakMemory (double size) |
| Set peak memory usage. More... | |
| double | getPeakMemory () |
| Get peak memory usage. More... | |
| int | getLargeSize () const |
| void | registerClass (int name, AlpsKnowledge *userKnowledge) |
| Every user derived knowledge class must register. More... | |
| const AlpsKnowledge * | decoderObject (int name) |
This method returns the pointer to an empty object of the registered class name. More... | |
| AlpsPhase | getPhase () |
| void | setPhase (AlpsPhase ph) |
| AlpsModel * | getModel () |
| void | setModel (AlpsModel *m) |
| void | setupKnowledgePools () |
| Set up knowledge pools for this broker. More... | |
| void | addKnowledgePool (AlpsKnowledgeType kt, AlpsKnowledgePool *kp) |
| Add a knowledge pool into the Knowledge pools. More... | |
| AlpsKnowledgePool * | getKnowledgePool (AlpsKnowledgeType kt) const |
| Retrieve a knowledge pool in the Knowledge base. More... | |
| virtual int | getNumKnowledges (AlpsKnowledgeType kt) const |
| Query the number of knowledge in the given type of a knowledge pool. More... | |
| virtual int | getMaxNumKnowledges (AlpsKnowledgeType kt) const |
| Query the max number of knowledge can be stored in a given type of knowledge pools. More... | |
| virtual void | setMaxNumKnowledges (AlpsKnowledgeType kt, int num) |
| Set the max number of knowledge can be stored in a given type o fknowledge pools. More... | |
| virtual bool | hasKnowledge (AlpsKnowledgeType kt) const |
| Query whether there are knowledges in the given type of knowledge pools. More... | |
| virtual std::pair < AlpsKnowledge *, double > | getKnowledge (AlpsKnowledgeType kt) const |
| Get a knowledge, but doesn't remove it from the pool. More... | |
| virtual void | popKnowledge (AlpsKnowledgeType kt) |
| Remove the a knowledge from the given type of knowledge pools. More... | |
| virtual std::pair < AlpsKnowledge *, double > | getBestKnowledge (AlpsKnowledgeType kt) const |
| Get the best knowledge in the given type of knowledge pools. More... | |
| virtual void | getAllKnowledges (AlpsKnowledgeType kt, std::vector< std::pair< AlpsKnowledge *, double > > &kls) const |
| Get all knowledges in the given type of knowledge pools. More... | |
| virtual void | addKnowledge (AlpsKnowledgeType kt, AlpsKnowledge *kl, double value) |
| Add a knowledge in the given type of knowledge pools. More... | |
| int | getNumNodesProcessed () const |
| Query the number of node processed by this process. More... | |
| int | getNumNodesBranched () const |
| Query the number of node processed by this process. More... | |
| int | getNumNodesDiscarded () const |
| Query the number of node processed by this process. More... | |
| int | getNumNodesPartial () const |
| Query the number of node in the queue that are pregnant. More... | |
| int | getNumNodesProcessedSystem () const |
| Query the number of node processed by the system. More... | |
| virtual int | updateNumNodesLeft () |
| Update the number of left nodes on this process. More... | |
| virtual AlpsTreeNode * | getBestNode () const |
| Query the best node in the subtree pool. More... | |
| AlpsExitStatus | getSolStatus () const |
| Query search termination status. More... | |
| void | setExitStatus (AlpsExitStatus status) |
| Set terminate status. More... | |
| AlpsTimer & | timer () |
| Query timer. More... | |
| AlpsTimer & | subTreeTimer () |
| Query subtree timer. More... | |
| AlpsTimer & | tempTimer () |
| Query secondary timer. More... | |
| int | getNodeMemSize () |
| void | setNodeMemSize (int ms) |
| double | getNodeProcessingTime () |
| void | setNodeProcessingTime (double npTime) |
| AlpsNodeIndex_t | nextNodeIndex () |
| Query the next index assigned to a newly created node, and then increment the nextIndex_ by 1. More... | |
| AlpsNodeIndex_t | getNextNodeIndex () const |
| Query the next index assigned to a newly created node. More... | |
| void | setNextNodeIndex (AlpsNodeIndex_t s) |
| Set nextIndex_. More... | |
| AlpsNodeIndex_t | getMaxNodeIndex () const |
| Queriy the upper bound of node indices. More... | |
| void | setMaxNodeIndex (AlpsNodeIndex_t s) |
| Set the upper bound of node indices. More... | |
| AlpsSearchStrategy < AlpsSubTree * > * | getSubTreeSelection () const |
| void | setSubTreeSelection (AlpsSearchStrategy< AlpsSubTree * > *tc) |
| AlpsSearchStrategy < AlpsTreeNode * > * | getNodeSelection () const |
| void | setNodeSelection (AlpsSearchStrategy< AlpsTreeNode * > *nc) |
| AlpsSearchStrategy < AlpsTreeNode * > * | getRampUpNodeSelection () const |
| void | setRampUpNodeSelection (AlpsSearchStrategy< AlpsTreeNode * > *nc) |
| void | passInMessageHandler (CoinMessageHandler *handler) |
| Pass in Message handler (not deleted at end). More... | |
| void | newLanguage (CoinMessages::Language language) |
| Set language. More... | |
| void | setLanguage (CoinMessages::Language language) |
| Pass in Message handler (not deleted at end). More... | |
| CoinMessageHandler * | messageHandler () const |
| Return handler. More... | |
| CoinMessages | messages () |
| Return messages. More... | |
| CoinMessages * | messagesPointer () |
| Return pointer to messages. More... | |
| int | getMsgLevel () |
| Return msg level. More... | |
| int | getHubMsgLevel () |
| Return msg level. More... | |
| int | getMasterMsgLevel () |
| Return msg level. More... | |
| int | getlogFileLevel () |
| Return log file level. More... | |
| int | getNumNodeLog () const |
| Get times that node log has been printed. More... | |
| void | setNumNodeLog (int num) |
| Get times that node log has been printed. More... | |
Protected Member Functions | |
| void | init () |
| Initialize member data. More... | |
| AlpsReturnStatus | doOneUnitWork (int unitWork, double unitTime, AlpsExitStatus &exitStatus, int &numNodesProcessed, int &numNodesBranched, int &numNodesDiscarded, int &numNodesPartial, int &depth, bool &betterSolution) |
| Explore a subtree from subtree pool for certain units of work/time. More... | |
| void | processMessages (char *&buffer, MPI_Status &status, MPI_Request &request) |
| Processing messages. More... | |
| void | rootInitMaster (AlpsTreeNode *root) |
| Static load balancing: Root Initialization. More... | |
| void | rootInitHub () |
| void | rootInitWorker () |
| void | spiralMaster (AlpsTreeNode *root) |
| Static load balancing: spiral. More... | |
| void | spiralHub () |
| void | spiralWorker () |
| void | deleteSubTrees () |
| Delete subTrees in pools and the active subtree. More... | |
| void | forwardModelKnowledge () |
| void | sendModelKnowledge (MPI_Comm comm, int receiver=-1) |
| Set generated knowlege (related to model) to receiver. More... | |
| void | receiveModelKnowledge (MPI_Comm comm) |
| Receive generated knowlege (related to model) from sender. More... | |
| void | masterForceHubTerm () |
| Master tell hubs to terminate due to reaching limits or other reason. More... | |
| void | hubForceWorkerTerm () |
| Hub tell workers to terminate due to reaching limits or other reason. More... | |
| void | changeWorkingSubTree (double &changeWorkThreshold) |
| Change subtree to be explored if it is too worse. More... | |
| void | sendErrorCodeToMaster (int errorCode) |
| Send error code to master. More... | |
| void | recvErrorCode (char *&bufLarge) |
| Receive error code and set solution status. More... | |
| void | spiralRecvProcessNode () |
| Unpack the node, explore it and send load info to master. More... | |
| void | spiralDonateNode () |
| Unpack msg and donate a node. More... | |
Core member functions for master, hubs and workers. | |
| void | masterMain (AlpsTreeNode *root) |
| Master generates subtrees and sends them to hubs in Round-Robin way. More... | |
| void | hubMain () |
| Hub generates subtrees and sends them to workers in Round-Robin way. More... | |
| void | workerMain () |
| Worker first receive subtrees, then start to explore them. More... | |
Load balancing member functions | |
| void | masterAskHubDonate (int donorID, int receiverID, double receiverWorkload) |
| Master asks a hub to donate its workload to another hub. More... | |
| void | hubAskWorkerDonate (int donorID, int receiverID, double receiverWorkload) |
| Hub asks a worker to donate its workload to another worker. More... | |
| void | updateWorkloadInfo () |
| Calculate the work quality and quantity on this process. More... | |
| virtual int | getNumNodeLeftSystem () |
| Master asks a hub to donate its workload to another hub. More... | |
| void | donateWork (char *&buf, int tag, MPI_Status *status, int recvID=-1, double recvWL=0.0) |
| A worker donate its workload to the specified worker. More... | |
| void | hubAllocateDonation (char *&buf, MPI_Status *status) |
| Hub allocates the donated workload to its workers. More... | |
| void | hubBalanceWorkers () |
| Hub balances the workloads of its workers. More... | |
| void | hubSatisfyWorkerRequest (char *&buf, MPI_Status *status) |
| Hub satisfies the workload rquest from a worker. More... | |
| void | hubReportStatus (int tag, MPI_Comm comm) |
| A hub reports its status (workload and msg counts) to the master. More... | |
| void | hubUpdateCluStatus (char *&buf, MPI_Status *status, MPI_Comm comm) |
| A hub unpacks the status of a worker from buffer. More... | |
| void | hubsShareWork (char *&buf, MPI_Status *status) |
| Two hubs share their workload. More... | |
| void | masterBalanceHubs () |
| Master balance the workload of hubs. More... | |
| void | masterUpdateSysStatus (char *&buf, MPI_Status *status, MPI_Comm comm) |
| Master unpack the status of a hub from buf and update system status. More... | |
| void | refreshSysStatus () |
| The master re-calculate the system status. More... | |
| void | refreshClusterStatus () |
| A hub adds its status to the cluster's status. More... | |
| void | workerReportStatus (int tag, MPI_Comm comm) |
| A worker report its status (workload and msg counts) to its hub. More... | |
Node index functions // msg counts is modified inside | |
| void | workerAskIndices () |
| A worker ask for node index from master. More... | |
| void | workerRecvIndices (char *&bufLarge) |
| A worker receive node index from master. More... | |
| void | masterSendIndices (char *&bufLarge) |
| Master send a batch of node indices to the receiving worker. More... | |
Other message passing member functions | |
| void | broadcastModel (const int id, const int source) |
| Broadcast the model from source to other processes. More... | |
| void | sendIncumbent () |
| Sent the incumbent value and rank to its two child if eixt. More... | |
| bool | unpackSetIncumbent (char *&buf, MPI_Status *status) |
| unpack the incumbent value, then store it and the id of the process having the incumbent in AlpsDataPool. More... | |
| void | collectBestSolution (int destination) |
| Send the best solution from the process having it to destination. More... | |
| void | tellMasterRecv () |
| Inform master that a proc has received workload during a load balance initialized by master. More... | |
| void | tellHubRecv () |
| Inform hub that a proc has received workload during a load balance initialized by a hub. More... | |
| void | packEncoded (AlpsEncoded *enc, char *&buf, int &size, int &position, MPI_Comm comm) |
| Pack an AlpsEncoded instance into buf. More... | |
| AlpsEncoded * | unpackEncoded (char *&buf, int &position, MPI_Comm comm, int size=-1) |
| Unpack the given buffer into an AlpsEncoded instance. More... | |
| void | receiveSizeBuf (char *&buf, int sender, int tag, MPI_Comm comm, MPI_Status *status) |
| Receive the size of buffer, allocate memory for buffer, then receive the message and put it in buffer. More... | |
| void | receiveRampUpNode (int sender, MPI_Comm comm, MPI_Status *status) |
| First receive the size and the contend of a node, then construct a subtree with this received node. More... | |
| void | receiveSubTree (char *&buf, int sender, MPI_Status *status) |
| Receive a subtree from the sender process and add it into the subtree pool. More... | |
| void | sendSizeBuf (char *&buf, int size, int position, const int target, const int tag, MPI_Comm comm) |
| Send the size and content of a buffer to the target process. More... | |
| void | sendRampUpNode (const int target, MPI_Comm comm) |
| Send the size and the content of the best node of a given subtree to the target process. More... | |
| void | sendNodeModelGen (int receiver, int doUnitWork) |
| Send a node from rampUpSubTree's node pool and generated model knowledge. More... | |
| bool | sendSubTree (const int target, AlpsSubTree *&st, int tag) |
| Send a given subtree to the target process. More... | |
| void | sendFinishInit (const int target, MPI_Comm comm) |
| Send finish initialization signal to the target process. More... | |
Change message counts functions | |
| void | incSendCount (const char *how, int s=1) |
| Increment the number of sent message. More... | |
| void | decSendCount (const char *how, int s=1) |
| Decrement the number of sent message. More... | |
| void | incRecvCount (const char *how, int s=1) |
| Increment the number of received message. More... | |
| void | decRecvCount (const char *how, int s=1) |
| Decrement the number of sent message. More... | |
Protected Attributes | |
| bool | forceTerminate_ |
| Terminate due to reaching limits (time and node) or other reason. More... | |
| bool | blockTermCheck_ |
| Indicate whether do termination check. More... | |
| bool | blockHubReport_ |
| Indicate whether a hub need to report state to master. More... | |
| bool | blockWorkerReport_ |
| Indicate whether a worker need to report state to its hub. More... | |
| bool | blockAskForWork_ |
| Indicate whether a worker need to as for work from its hub. More... | |
| char * | attachBuffer_ |
| Buffer attached to MPI when sharing generated knowledge. More... | |
| char * | largeBuffer_ |
| Large message buffer. More... | |
| char * | largeBuffer2_ |
| Large message buffer. More... | |
| char * | smallBuffer_ |
| Small message buffer. More... | |
| double | masterBalancePeriod_ |
| The period that master do load balancing. More... | |
| double | hubReportPeriod_ |
| The period that a hub load balancing and report cluster status. More... | |
| int | modelGenID_ |
| The global rank of the process that share generated model knowledge. More... | |
| int | modelGenPos_ |
| Size of the shared knowledge. More... | |
| AlpsSubTree * | rampUpSubTree_ |
| A subtree used in during up. More... | |
| int | unitWorkNodes_ |
| Number of nodes in one unit of work. More... | |
| int | haltSearch_ |
| Temporily halt search. More... | |
Process information | |
| int | processNum_ |
| The Number of processes launched. More... | |
| int | hubNum_ |
| The Number of hubs. More... | |
| int | globalRank_ |
| The rank of the process in MPI_COMM_WORLD. More... | |
| MPI_Comm | clusterComm_ |
| Communicator of the cluster to which the process belongs. More... | |
| MPI_Comm | hubComm_ |
| Communicator consists of all hubs. More... | |
| MPI_Group | hubGroup_ |
| MPI_Group consists of all hubs. More... | |
| int | clusterSize_ |
| The actual size of the cluster to which the process belongs. More... | |
| int | userClusterSize_ |
| The user reqested size of a cluster. More... | |
| int | clusterRank_ |
| The local rank of the process in clusterComm_. More... | |
| int * | hubRanks_ |
| The global ranks of the hubs. More... | |
| int | myHubRank_ |
| The global rank of its hub for a worker. More... | |
| int | masterRank_ |
| The global rank of the master. More... | |
| AlpsProcessType | processType_ |
| The AlpsProcessType of this process. More... | |
| AlpsProcessType * | processTypeList_ |
| The AlpsProcessType of all process. More... | |
| bool | hubWork_ |
| Whether hub should also work as a worker. More... | |
| MPI_Request | subTreeRequest_ |
| Send subtree request. More... | |
| MPI_Request | solRequestL_ |
| Send model knoledge request. More... | |
| MPI_Request | solRequestR_ |
| The Number of processes launched. More... | |
| MPI_Request | modelKnowRequestL_ |
| Send model knoledge request. More... | |
| MPI_Request | modelKnowRequestR_ |
| The Number of processes launched. More... | |
| MPI_Request | forwardRequestL_ |
| Forward model knoledge request. More... | |
| MPI_Request | forwardRequestR_ |
| The Number of processes launched. More... | |
Incumbent data | |
| double | incumbentValue_ |
| Incumbent value. More... | |
| int | incumbentID_ |
| The process id that store the incumbent. More... | |
| bool | updateIncumbent_ |
| Indicate whether the incumbent value is updated between two checking point. More... | |
Workload balancing | |
| double | workQuality_ |
| The workload quality of the process. More... | |
| double | clusterWorkQuality_ |
| The workload quality of the cluster to which the process belong. More... | |
| double | systemWorkQuality_ |
| The workload quality of the whole system. More... | |
| double * | hubWorkQualities_ |
| The workload qualities of hubs. More... | |
| double * | workerWorkQualities_ |
| The workload qualities of workers in the cluster to which this proces belongs. More... | |
| double | workQuantity_ |
| The workload quantity of the workload on the process. More... | |
| double | clusterWorkQuantity_ |
| The workload quantity of the cluster to which the process belongs. More... | |
| double | systemWorkQuantity_ |
| The workload quantity of the whole system. More... | |
| double | systemWorkQuantityForce_ |
| The workload quantity of the whole system before forcing termination. More... | |
| double * | hubWorkQuantities_ |
| The workload quantities of all clusters/hubs. More... | |
| double * | workerWorkQuantities_ |
| The workload quantities of workers in the cluster to which this proces belongs. More... | |
| bool * | workerReported_ |
| Indicate which worker has been reported its work. More... | |
| bool * | hubReported_ |
| Indicate which hub has been reported its work. More... | |
| bool | allHubReported_ |
| Indicate whether all hubs have reported status to master at least once. More... | |
| int | masterDoBalance_ |
| Whether master do load balance. More... | |
| int | hubDoBalance_ |
| Whether a hub do load balance. More... | |
| int * | workerNodeProcesseds_ |
| To record how many nodes processed for each worker in a cluster. More... | |
| int | clusterNodeProcessed_ |
| To record how many nodes by a cluster. More... | |
| int * | hubNodeProcesseds_ |
| To record how many nodes processed for each hub. More... | |
Message counts | |
| int | sendCount_ |
| The number of new messages sent by the process after last survey. More... | |
| int | recvCount_ |
| The number of new messages received by the process after last survey. More... | |
| int | clusterSendCount_ |
| The number of new messages sent by the processes in clusterComm_ after last survey. More... | |
| int | clusterRecvCount_ |
| The number of new messages received by the processes in clusterComm_ after last survey. More... | |
| int | systemSendCount_ |
| The total number of messages sent by the all processes. More... | |
| int | systemRecvCount_ |
| The total number of messages sent by the all processes. More... | |
Node index | |
| int | masterIndexBatch_ |
Parallel statistics | |
| AlpsTimer | masterTimer_ |
| Master timer. More... | |
| AlpsTimer | hubTimer_ |
| Hub timer. More... | |
| AlpsTimer | workerTimer_ |
| Worker timer. More... | |
| double | rampUpTime_ |
| The time spent in ramp up. More... | |
| double | rampDownTime_ |
| The time spent in ramp down. More... | |
| double | idleTime_ |
| The time spent waiting for work. More... | |
| double | msgTime_ |
| The time spent processing messages (include idle). More... | |
| AlpsPsStats | psStats_ |
| More statistics. More... | |
Protected Attributes inherited from AlpsKnowledgeBroker | |
| std::string | instanceName_ |
| The instance name. More... | |
| AlpsModel * | model_ |
| Pointer to model. More... | |
| AlpsPhase | phase_ |
| Alps phase. More... | |
| int | nodeMemSize_ |
| The approximate memory size (bytes) of a node with full description. More... | |
| double | nodeProcessingTime_ |
| The approximately CPU time to process a node. More... | |
| int | largeSize_ |
| The size of largest message buffer can be sent or received. More... | |
| bool | userBalancePeriod_ |
| Has user input balance period. More... | |
| int | numNodeLog_ |
| Times that node log is printed. More... | |
| AlpsSubTreePool * | subTreePool_ |
| A subtree pool holding a collection of subtrees. More... | |
| AlpsSolutionPool * | solPool_ |
| A solution pool containing the solutions found. More... | |
| std::map< AlpsKnowledgeType, AlpsKnowledgePool * > * | pools_ |
| The collection of pools managed by the knowledge broker. More... | |
| AlpsSubTree * | workingSubTree_ |
| Point to the subtree that being explored. More... | |
| bool | needWorkingSubTree_ |
| Indicate whether need a new subtree. More... | |
| AlpsNodeIndex_t | nextIndex_ |
| The index to be assigned to a new search tree node. More... | |
| AlpsNodeIndex_t | maxIndex_ |
| The maximum index can been assigned on this process. More... | |
| AlpsTimer | timer_ |
| Main timer. More... | |
| AlpsTimer | subTreeTimer_ |
| Subtree timer. More... | |
| AlpsTimer | tempTimer_ |
| Secondary timer. More... | |
| int | solNum_ |
| The number of solutions found. More... | |
| int | nodeProcessedNum_ |
| The number of nodes that have been processed. More... | |
| int | nodeBranchedNum_ |
| The number of nodes that have been branched. More... | |
| int | nodeDiscardedNum_ |
| The number of nodes that have been discarded before processing. More... | |
| int | nodePartialNum_ |
| The number of nodes that are pregnant. More... | |
| int | systemNodeProcessed_ |
| To record how many nodes processed by the system (used in parallel code). More... | |
| int | nodeLeftNum_ |
| The number of nodes left. More... | |
| int | treeDepth_ |
| The depth of the tree. More... | |
| int | bestSolNode_ |
| The number of nodes pocessed to find the solution. More... | |
| double | peakMemory_ |
| Peak memory usage. More... | |
| AlpsExitStatus | exitStatus_ |
| The status of search when terminated. More... | |
| AlpsSearchStrategy < AlpsSubTree * > * | treeSelection_ |
| Tree selection criterion. More... | |
| AlpsSearchStrategy < AlpsTreeNode * > * | nodeSelection_ |
| Node selection criterion. More... | |
| AlpsSearchStrategy < AlpsTreeNode * > * | rampUpNodeSelection_ |
| Node selection criterion. More... | |
| CoinMessageHandler * | handler_ |
| Message handler. More... | |
| CoinMessages | messages_ |
| Alps messages. More... | |
| int | msgLevel_ |
| The leve of printing message to screen of the master and general message. More... | |
| int | hubMsgLevel_ |
| The leve of printing message to screen of hubs. More... | |
| int | workerMsgLevel_ |
| The leve of printing message to screen of workers. More... | |
| int | logFileLevel_ |
| The degree of log file. More... | |
| std::string | logfile_ |
| The log file. More... | |
Private Member Functions | |
| AlpsKnowledgeBrokerMPI (const AlpsKnowledgeBrokerMPI &) | |
| Disable copy construct and assignment operator. More... | |
| AlpsKnowledgeBrokerMPI & | operator= (const AlpsKnowledgeBrokerMPI &) |
Definition at line 41 of file AlpsKnowledgeBrokerMPI.h.
|
private |
Disable copy construct and assignment operator.
|
inline |
Default construtor.
NOTE: must call initializeSearch() later.
Definition at line 579 of file AlpsKnowledgeBrokerMPI.h.
|
inline |
Useful construtor.
Definition at line 587 of file AlpsKnowledgeBrokerMPI.h.
| AlpsKnowledgeBrokerMPI::~AlpsKnowledgeBrokerMPI | ( | ) |
Destructor.
|
private |
|
protected |
Initialize member data.
|
protected |
Master generates subtrees and sends them to hubs in Round-Robin way.
Master periodically do inter-cluster load balancing, and termination check.
|
protected |
Hub generates subtrees and sends them to workers in Round-Robin way.
Hub do intra-cluster load balancing.
|
protected |
Worker first receive subtrees, then start to explore them.
Worker also peroidically check message and process message.
|
protected |
Explore a subtree from subtree pool for certain units of work/time.
|
protected |
Processing messages.
|
protected |
Static load balancing: Root Initialization.
|
protected |
|
protected |
|
protected |
Static load balancing: spiral.
|
protected |
|
protected |
|
protected |
Master asks a hub to donate its workload to another hub.
|
protected |
Hub asks a worker to donate its workload to another worker.
|
protected |
Calculate the work quality and quantity on this process.
|
inlineprotectedvirtual |
Master asks a hub to donate its workload to another hub.
Reimplemented from AlpsKnowledgeBroker.
Definition at line 373 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
A worker donate its workload to the specified worker.
|
protected |
Hub allocates the donated workload to its workers.
|
protected |
Hub balances the workloads of its workers.
|
protected |
Hub satisfies the workload rquest from a worker.
|
protected |
A hub reports its status (workload and msg counts) to the master.
|
protected |
A hub unpacks the status of a worker from buffer.
|
protected |
Two hubs share their workload.
|
protected |
Master balance the workload of hubs.
|
protected |
Master unpack the status of a hub from buf and update system status.
|
protected |
The master re-calculate the system status.
|
protected |
A hub adds its status to the cluster's status.
|
protected |
A worker report its status (workload and msg counts) to its hub.
|
protected |
A worker ask for node index from master.
|
protected |
A worker receive node index from master.
|
protected |
Master send a batch of node indices to the receiving worker.
|
protected |
Broadcast the model from source to other processes.
|
protected |
Sent the incumbent value and rank to its two child if eixt.
|
protected |
unpack the incumbent value, then store it and the id of the process having the incumbent in AlpsDataPool.
|
protected |
Send the best solution from the process having it to destination.
|
protected |
Inform master that a proc has received workload during a load balance initialized by master.
|
protected |
Inform hub that a proc has received workload during a load balance initialized by a hub.
|
protected |
Pack an AlpsEncoded instance into buf.
Return filled buf and size of packed message. position: where to start if buf is allocated.
|
protected |
Unpack the given buffer into an AlpsEncoded instance.
|
protected |
Receive the size of buffer, allocate memory for buffer, then receive the message and put it in buffer.
|
protected |
First receive the size and the contend of a node, then construct a subtree with this received node.
|
protected |
Receive a subtree from the sender process and add it into the subtree pool.
|
protected |
Send the size and content of a buffer to the target process.
|
protected |
Send the size and the content of the best node of a given subtree to the target process.
|
protected |
Send a node from rampUpSubTree's node pool and generated model knowledge.
|
protected |
Send a given subtree to the target process.
|
protected |
Send finish initialization signal to the target process.
|
protected |
Delete subTrees in pools and the active subtree.
|
protected |
|
protected |
Set generated knowlege (related to model) to receiver.
|
protected |
Receive generated knowlege (related to model) from sender.
|
protected |
Increment the number of sent message.
|
protected |
Decrement the number of sent message.
|
protected |
Increment the number of received message.
|
protected |
Decrement the number of sent message.
|
protected |
Master tell hubs to terminate due to reaching limits or other reason.
|
protected |
Hub tell workers to terminate due to reaching limits or other reason.
|
protected |
Change subtree to be explored if it is too worse.
|
protected |
Send error code to master.
|
protected |
Receive error code and set solution status.
|
protected |
Unpack the node, explore it and send load info to master.
|
protected |
Unpack msg and donate a node.
|
inlinevirtual |
Query the global rank of the process.
Reimplemented from AlpsKnowledgeBroker.
Definition at line 601 of file AlpsKnowledgeBrokerMPI.h.
|
inlinevirtual |
Query the global rank of the Master.
Reimplemented from AlpsKnowledgeBroker.
Definition at line 604 of file AlpsKnowledgeBrokerMPI.h.
|
inlinevirtual |
Query the type (master, hub, or worker) of the process.
Reimplemented from AlpsKnowledgeBroker.
Definition at line 607 of file AlpsKnowledgeBrokerMPI.h.
|
virtual |
This function.
Implements AlpsKnowledgeBroker.
Search best solution for a given model.
Reimplemented from AlpsKnowledgeBroker.
|
virtual |
This function.
Implements AlpsKnowledgeBroker.
|
inlinevirtual |
The process queries the quality of the incumbent this process stores.
Implements AlpsKnowledgeBroker.
Definition at line 638 of file AlpsKnowledgeBrokerMPI.h.
|
inlinevirtual |
The master queries the quality of the best solution it knowns.
Implements AlpsKnowledgeBroker.
Definition at line 650 of file AlpsKnowledgeBrokerMPI.h.
|
inlinevirtual |
Get best estimalted quality in system.
Reimplemented from AlpsKnowledgeBroker.
Definition at line 665 of file AlpsKnowledgeBrokerMPI.h.
|
virtual |
Master prints out the best solution that it knows.
Implements AlpsKnowledgeBroker.
|
virtual |
Log search statistics.
Implements AlpsKnowledgeBroker.
| void AlpsKnowledgeBrokerMPI::sendKnowledge | ( | AlpsKnowledgeType | type, |
| int | sender, | ||
| int | receiver, | ||
| char *& | msgBuffer, | ||
| int | msgSize, | ||
| int | msgTag, | ||
| MPI_Comm | comm, | ||
| bool | blocking | ||
| ) |
Set knowlege.
| void AlpsKnowledgeBrokerMPI::receiveKnowledge | ( | AlpsKnowledgeType | type, |
| int | sender, | ||
| int | receiver, | ||
| char *& | msgBuffer, | ||
| int | msgSize, | ||
| int | msgTag, | ||
| MPI_Comm | comm, | ||
| MPI_Status * | status, | ||
| bool | blocking | ||
| ) |
Receive knowlege.
| void AlpsKnowledgeBrokerMPI::requestKnowledge | ( | AlpsKnowledgeType | type, |
| int | sender, | ||
| int | receiver, | ||
| char *& | msgBuffer, | ||
| int | msgSize, | ||
| int | msgTag, | ||
| MPI_Comm | comm, | ||
| bool | blocking | ||
| ) |
Request knowlege.
|
protected |
The Number of processes launched.
Definition at line 55 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The Number of hubs.
Definition at line 58 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The rank of the process in MPI_COMM_WORLD.
Definition at line 61 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Communicator of the cluster to which the process belongs.
Definition at line 64 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Communicator consists of all hubs.
Definition at line 67 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
MPI_Group consists of all hubs.
Definition at line 70 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The actual size of the cluster to which the process belongs.
Definition at line 73 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The user reqested size of a cluster.
Definition at line 76 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The local rank of the process in clusterComm_.
Definition at line 79 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The global ranks of the hubs.
Definition at line 82 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The global rank of its hub for a worker.
Definition at line 85 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The global rank of the master.
Definition at line 88 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The AlpsProcessType of this process.
Definition at line 91 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The AlpsProcessType of all process.
Definition at line 94 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Whether hub should also work as a worker.
Definition at line 97 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Send subtree request.
Definition at line 100 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Send model knoledge request.
Definition at line 103 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The Number of processes launched.
Definition at line 104 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Send model knoledge request.
Definition at line 107 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The Number of processes launched.
Definition at line 108 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Forward model knoledge request.
Definition at line 111 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The Number of processes launched.
Definition at line 112 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Incumbent value.
Definition at line 120 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The process id that store the incumbent.
Definition at line 123 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate whether the incumbent value is updated between two checking point.
Definition at line 127 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quality of the process.
Definition at line 135 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quality of the cluster to which the process belong.
Definition at line 138 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quality of the whole system.
Definition at line 141 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload qualities of hubs.
Definition at line 144 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload qualities of workers in the cluster to which this proces belongs.
Number of nodes is used as the quantities criteria.
Definition at line 148 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quantity of the workload on the process.
Definition at line 151 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quantity of the cluster to which the process belongs.
Definition at line 154 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quantity of the whole system.
Definition at line 157 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quantity of the whole system before forcing termination.
Definition at line 160 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quantities of all clusters/hubs.
Definition at line 163 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The workload quantities of workers in the cluster to which this proces belongs.
Definition at line 167 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate which worker has been reported its work.
Definition at line 170 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate which hub has been reported its work.
Definition at line 173 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate whether all hubs have reported status to master at least once.
Definition at line 176 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Whether master do load balance.
0: do; >0: blocked.
Definition at line 179 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Whether a hub do load balance.
0: do; >0: blocked.
Definition at line 182 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
To record how many nodes processed for each worker in a cluster.
Definition at line 185 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
To record how many nodes by a cluster.
Definition at line 188 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
To record how many nodes processed for each hub.
Definition at line 191 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The number of new messages sent by the process after last survey.
Definition at line 199 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The number of new messages received by the process after last survey.
Definition at line 202 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The number of new messages sent by the processes in clusterComm_ after last survey.
Definition at line 206 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The number of new messages received by the processes in clusterComm_ after last survey.
Definition at line 210 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The total number of messages sent by the all processes.
Definition at line 213 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The total number of messages sent by the all processes.
Definition at line 216 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Definition at line 223 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Master timer.
Definition at line 231 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Hub timer.
Definition at line 234 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Worker timer.
Definition at line 237 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The time spent in ramp up.
Definition at line 240 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The time spent in ramp down.
Definition at line 243 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The time spent waiting for work.
Definition at line 246 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The time spent processing messages (include idle).
Definition at line 249 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
More statistics.
Definition at line 252 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Terminate due to reaching limits (time and node) or other reason.
Definition at line 256 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate whether do termination check.
Definition at line 259 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate whether a hub need to report state to master.
Definition at line 262 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate whether a worker need to report state to its hub.
Definition at line 265 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Indicate whether a worker need to as for work from its hub.
Definition at line 268 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Buffer attached to MPI when sharing generated knowledge.
Definition at line 271 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Large message buffer.
Definition at line 274 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Large message buffer.
Used for sharing model knowledge
Definition at line 277 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Small message buffer.
Definition at line 280 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The period that master do load balancing.
It changes as search progresses.
Definition at line 284 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The period that a hub load balancing and report cluster status.
It changes as search progresses.
Definition at line 288 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
The global rank of the process that share generated model knowledge.
Definition at line 291 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Size of the shared knowledge.
Definition at line 294 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
A subtree used in during up.
Definition at line 297 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Number of nodes in one unit of work.
Definition at line 300 of file AlpsKnowledgeBrokerMPI.h.
|
protected |
Temporily halt search.
Definition at line 303 of file AlpsKnowledgeBrokerMPI.h.
1.8.5