Alps  2.0.2
Private Member Functions | List of all members
AlpsKnowledgeBrokerMPI Class Reference

MPI implementation of AlpsKnowledgeBroker interface. More...

#include <AlpsKnowledgeBrokerMPI.h>

+ Inheritance diagram for AlpsKnowledgeBrokerMPI:
+ Collaboration diagram for AlpsKnowledgeBrokerMPI:

Public Member Functions

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...
 
 AlpsKnowledgeBroker (AlpsModel &model)
 Constructor that sets the model. More...
 
virtual ~AlpsKnowledgeBroker ()
 Destructor. More...
 
void registerClass (int name, AlpsKnowledge *userKnowledge)
 Every user derived knowledge class must register. More...
 
const AlpsKnowledgedecoderObject (int name) const
 This method returns the pointer to an empty object of the registered class name. More...
 
AlpsPhase getPhase ()
 
void setPhase (AlpsPhase ph)
 
AlpsModelgetModel ()
 
void setModel (AlpsModel *m)
 
int getTreeDepth ()
 Get tree depth. More...
 
void setPeakMemory (double size)
 Set peak memory usage. More...
 
double getPeakMemory ()
 Get peak memory usage. More...
 
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...
 
AlpsKnowledgePoolgetKnowledgePool (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 AlpsTreeNodegetBestNode () 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...
 
AlpsTimertimer ()
 Query timer. More...
 
AlpsTimersubTreeTimer ()
 Query subtree timer. More...
 
AlpsTimertempTimer ()
 Query secondary timer. More...
 
int getNodeMemSize ()
 
void setNodeMemSize (int ms)
 
double getNodeProcessingTime ()
 
void setNodeProcessingTime (double npTime)
 
int getLargeSize () const
 
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)
 
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...
 
AlpsSubTreegetWorkingSubTree ()
 

Protected Member Functions

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...
 
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 ()
 
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 ()
 
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...
 
AlpsEncodedunpackEncoded (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...
 
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...
 

Protected Attributes

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...
 
AlpsProcessTypeprocessTypeList_
 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_
 
MPI_Request modelKnowRequestL_
 Send model knoledge request. More...
 
MPI_Request modelKnowRequestR_
 
MPI_Request forwardRequestL_
 Forward model knoledge request. More...
 
MPI_Request forwardRequestR_
 
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_
 
- Protected Attributes inherited from AlpsKnowledgeBroker
std::string instanceName_
 The instance name. More...
 
AlpsModelmodel_
 Pointer to model. More...
 
AlpsPhase phase_
 Alps phase. More...
 
AlpsSubTreePoolsubTreePool_
 A subtree pool holding a collection of subtrees. More...
 
AlpsSolutionPoolsolPool_
 A solution pool containing the solutions found. More...
 
std::map< AlpsKnowledgeType, AlpsKnowledgePool * > * pools_
 The collection of pools managed by the knowledge broker. More...
 
AlpsSubTreeworkingSubTree_
 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...
 
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...
 

Private Member Functions

 AlpsKnowledgeBrokerMPI (const AlpsKnowledgeBrokerMPI &)
 Disable copy construct and assignment operator. More...
 
AlpsKnowledgeBrokerMPIoperator= (const AlpsKnowledgeBrokerMPI &)
 

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...
 
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...
 
AlpsSubTreerampUpSubTree_
 A subtree used in during up. More...
 
int unitWorkNodes_
 Number of nodes in one unit of work. More...
 
int haltSearch_
 Temporily halt search. More...
 
void init ()
 Initialize member data. 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...
 
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...
 
 AlpsKnowledgeBrokerMPI ()
 Default construtor. More...
 
 AlpsKnowledgeBrokerMPI (int argc, char *argv[], AlpsModel &model, bool showBanner=true)
 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, bool showBanner=true)
 This function. More...
 
void search (AlpsModel *model)
 Search best solution for a given model. More...
 
void rootSearch (AlpsTreeNode *root)
 This function. More...
 

Detailed Description

MPI implementation of AlpsKnowledgeBroker interface.

Each hub will have an instance of this class to manage the knowledges sent and received with its workers and with the master.

There are 3 functions that controls the workflow workerMain(), hubMain() and masterMain().

Definition at line 56 of file AlpsKnowledgeBrokerMPI.h.

Constructor & Destructor Documentation

◆ AlpsKnowledgeBrokerMPI() [1/3]

AlpsKnowledgeBrokerMPI::AlpsKnowledgeBrokerMPI ( const AlpsKnowledgeBrokerMPI )
private

Disable copy construct and assignment operator.

◆ AlpsKnowledgeBrokerMPI() [2/3]

AlpsKnowledgeBrokerMPI::AlpsKnowledgeBrokerMPI ( )
inline

Default construtor.

NOTE: must call initializeSearch() later.

Definition at line 594 of file AlpsKnowledgeBrokerMPI.h.

◆ AlpsKnowledgeBrokerMPI() [3/3]

AlpsKnowledgeBrokerMPI::AlpsKnowledgeBrokerMPI ( int  argc,
char *  argv[],
AlpsModel model,
bool  showBanner = true 
)
inline

Useful construtor.

Definition at line 602 of file AlpsKnowledgeBrokerMPI.h.

◆ ~AlpsKnowledgeBrokerMPI()

AlpsKnowledgeBrokerMPI::~AlpsKnowledgeBrokerMPI ( )

Destructor.

Member Function Documentation

◆ operator=()

AlpsKnowledgeBrokerMPI& AlpsKnowledgeBrokerMPI::operator= ( const AlpsKnowledgeBrokerMPI )
private

◆ init()

void AlpsKnowledgeBrokerMPI::init ( )
protected

Initialize member data.

◆ masterMain()

void AlpsKnowledgeBrokerMPI::masterMain ( AlpsTreeNode root)
protected

Master generates subtrees and sends them to hubs in Round-Robin way.

Master periodically do inter-cluster load balancing, and termination check.

◆ hubMain()

void AlpsKnowledgeBrokerMPI::hubMain ( )
protected

Hub generates subtrees and sends them to workers in Round-Robin way.

Hub do intra-cluster load balancing.

◆ workerMain()

void AlpsKnowledgeBrokerMPI::workerMain ( )
protected

Worker first receive subtrees, then start to explore them.

Worker also peroidically check message and process message.

◆ doOneUnitWork()

AlpsReturnStatus AlpsKnowledgeBrokerMPI::doOneUnitWork ( int  unitWork,
double  unitTime,
AlpsExitStatus exitStatus,
int &  numNodesProcessed,
int &  numNodesBranched,
int &  numNodesDiscarded,
int &  numNodesPartial,
int &  depth,
bool &  betterSolution 
)
protected

Explore a subtree from subtree pool for certain units of work/time.

◆ processMessages()

void AlpsKnowledgeBrokerMPI::processMessages ( char *&  buffer,
MPI_Status &  status,
MPI_Request &  request 
)
protected

Processing messages.

◆ rootInitMaster()

void AlpsKnowledgeBrokerMPI::rootInitMaster ( AlpsTreeNode root)
protected

Static load balancing: Root Initialization.

◆ rootInitHub()

void AlpsKnowledgeBrokerMPI::rootInitHub ( )
protected

◆ rootInitWorker()

void AlpsKnowledgeBrokerMPI::rootInitWorker ( )
protected

◆ spiralMaster()

void AlpsKnowledgeBrokerMPI::spiralMaster ( AlpsTreeNode root)
protected

Static load balancing: spiral.

◆ spiralHub()

void AlpsKnowledgeBrokerMPI::spiralHub ( )
protected

◆ spiralWorker()

void AlpsKnowledgeBrokerMPI::spiralWorker ( )
protected

◆ masterAskHubDonate()

void AlpsKnowledgeBrokerMPI::masterAskHubDonate ( int  donorID,
int  receiverID,
double  receiverWorkload 
)
protected

Master asks a hub to donate its workload to another hub.

◆ hubAskWorkerDonate()

void AlpsKnowledgeBrokerMPI::hubAskWorkerDonate ( int  donorID,
int  receiverID,
double  receiverWorkload 
)
protected

Hub asks a worker to donate its workload to another worker.

◆ updateWorkloadInfo()

void AlpsKnowledgeBrokerMPI::updateWorkloadInfo ( )
protected

Calculate the work quality and quantity on this process.

◆ getNumNodeLeftSystem()

virtual int AlpsKnowledgeBrokerMPI::getNumNodeLeftSystem ( )
inlineprotectedvirtual

Reimplemented from AlpsKnowledgeBroker.

Definition at line 388 of file AlpsKnowledgeBrokerMPI.h.

◆ donateWork()

void AlpsKnowledgeBrokerMPI::donateWork ( char *&  buf,
int  tag,
MPI_Status *  status,
int  recvID = -1,
double  recvWL = 0.0 
)
protected

A worker donate its workload to the specified worker.

◆ hubAllocateDonation()

void AlpsKnowledgeBrokerMPI::hubAllocateDonation ( char *&  buf,
MPI_Status *  status 
)
protected

Hub allocates the donated workload to its workers.

◆ hubBalanceWorkers()

void AlpsKnowledgeBrokerMPI::hubBalanceWorkers ( )
protected

Hub balances the workloads of its workers.

◆ hubSatisfyWorkerRequest()

void AlpsKnowledgeBrokerMPI::hubSatisfyWorkerRequest ( char *&  buf,
MPI_Status *  status 
)
protected

Hub satisfies the workload rquest from a worker.

◆ hubReportStatus()

void AlpsKnowledgeBrokerMPI::hubReportStatus ( int  tag,
MPI_Comm  comm 
)
protected

A hub reports its status (workload and msg counts) to the master.

◆ hubUpdateCluStatus()

void AlpsKnowledgeBrokerMPI::hubUpdateCluStatus ( char *&  buf,
MPI_Status *  status,
MPI_Comm  comm 
)
protected

A hub unpacks the status of a worker from buffer.

◆ hubsShareWork()

void AlpsKnowledgeBrokerMPI::hubsShareWork ( char *&  buf,
MPI_Status *  status 
)
protected

Two hubs share their workload.

◆ masterBalanceHubs()

void AlpsKnowledgeBrokerMPI::masterBalanceHubs ( )
protected

Master balance the workload of hubs.

◆ masterUpdateSysStatus()

void AlpsKnowledgeBrokerMPI::masterUpdateSysStatus ( char *&  buf,
MPI_Status *  status,
MPI_Comm  comm 
)
protected

Master unpack the status of a hub from buf and update system status.

◆ refreshSysStatus()

void AlpsKnowledgeBrokerMPI::refreshSysStatus ( )
protected

The master re-calculate the system status.

◆ refreshClusterStatus()

void AlpsKnowledgeBrokerMPI::refreshClusterStatus ( )
protected

A hub adds its status to the cluster's status.

◆ workerReportStatus()

void AlpsKnowledgeBrokerMPI::workerReportStatus ( int  tag,
MPI_Comm  comm 
)
protected

A worker report its status (workload and msg counts) to its hub.

◆ workerAskIndices()

void AlpsKnowledgeBrokerMPI::workerAskIndices ( )
protected

A worker ask for node index from master.

◆ workerRecvIndices()

void AlpsKnowledgeBrokerMPI::workerRecvIndices ( char *&  bufLarge)
protected

A worker receive node index from master.

◆ masterSendIndices()

void AlpsKnowledgeBrokerMPI::masterSendIndices ( char *&  bufLarge)
protected

Master send a batch of node indices to the receiving worker.

◆ broadcastModel()

void AlpsKnowledgeBrokerMPI::broadcastModel ( const int  id,
const int  source 
)
protected

Broadcast the model from source to other processes.

◆ sendIncumbent()

void AlpsKnowledgeBrokerMPI::sendIncumbent ( )
protected

Sent the incumbent value and rank to its two child if eixt.

◆ unpackSetIncumbent()

bool AlpsKnowledgeBrokerMPI::unpackSetIncumbent ( char *&  buf,
MPI_Status *  status 
)
protected

unpack the incumbent value, then store it and the id of the process having the incumbent in AlpsDataPool.

◆ collectBestSolution()

void AlpsKnowledgeBrokerMPI::collectBestSolution ( int  destination)
protected

Send the best solution from the process having it to destination.

◆ tellMasterRecv()

void AlpsKnowledgeBrokerMPI::tellMasterRecv ( )
protected

Inform master that a proc has received workload during a load balance initialized by master.

◆ tellHubRecv()

void AlpsKnowledgeBrokerMPI::tellHubRecv ( )
protected

Inform hub that a proc has received workload during a load balance initialized by a hub.

◆ packEncoded()

void AlpsKnowledgeBrokerMPI::packEncoded ( AlpsEncoded enc,
char *&  buf,
int &  size,
int &  position,
MPI_Comm  comm 
)
protected

Pack an AlpsEncoded instance into buf.

Return filled buf and size of packed message. position: where to start if buf is allocated.

◆ unpackEncoded()

AlpsEncoded* AlpsKnowledgeBrokerMPI::unpackEncoded ( char *&  buf,
int &  position,
MPI_Comm  comm,
int  size = -1 
)
protected

Unpack the given buffer into an AlpsEncoded instance.

◆ receiveSizeBuf()

void AlpsKnowledgeBrokerMPI::receiveSizeBuf ( char *&  buf,
int  sender,
int  tag,
MPI_Comm  comm,
MPI_Status *  status 
)
protected

Receive the size of buffer, allocate memory for buffer, then receive the message and put it in buffer.

◆ receiveRampUpNode()

void AlpsKnowledgeBrokerMPI::receiveRampUpNode ( int  sender,
MPI_Comm  comm,
MPI_Status *  status 
)
protected

First receive the size and the contend of a node, then construct a subtree with this received node.

◆ receiveSubTree()

void AlpsKnowledgeBrokerMPI::receiveSubTree ( char *&  buf,
int  sender,
MPI_Status *  status 
)
protected

Receive a subtree from the sender process and add it into the subtree pool.

◆ sendSizeBuf()

void AlpsKnowledgeBrokerMPI::sendSizeBuf ( char *&  buf,
int  size,
int  position,
const int  target,
const int  tag,
MPI_Comm  comm 
)
protected

Send the size and content of a buffer to the target process.

◆ sendRampUpNode()

void AlpsKnowledgeBrokerMPI::sendRampUpNode ( const int  target,
MPI_Comm  comm 
)
protected

Send the size and the content of the best node of a given subtree to the target process.

◆ sendNodeModelGen()

void AlpsKnowledgeBrokerMPI::sendNodeModelGen ( int  receiver,
int  doUnitWork 
)
protected

Send a node from rampUpSubTree's node pool and generated model knowledge.

◆ sendSubTree()

bool AlpsKnowledgeBrokerMPI::sendSubTree ( const int  target,
AlpsSubTree *&  st,
int  tag 
)
protected

Send a given subtree to the target process.

◆ sendFinishInit()

void AlpsKnowledgeBrokerMPI::sendFinishInit ( const int  target,
MPI_Comm  comm 
)
protected

Send finish initialization signal to the target process.

◆ deleteSubTrees()

void AlpsKnowledgeBrokerMPI::deleteSubTrees ( )
protected

Delete subTrees in pools and the active subtree.

◆ forwardModelKnowledge()

void AlpsKnowledgeBrokerMPI::forwardModelKnowledge ( )
protected

◆ sendModelKnowledge()

void AlpsKnowledgeBrokerMPI::sendModelKnowledge ( MPI_Comm  comm,
int  receiver = -1 
)
protected

Set generated knowlege (related to model) to receiver.

◆ receiveModelKnowledge()

void AlpsKnowledgeBrokerMPI::receiveModelKnowledge ( MPI_Comm  comm)
protected

Receive generated knowlege (related to model) from sender.

◆ incSendCount()

void AlpsKnowledgeBrokerMPI::incSendCount ( const char *  how,
int  s = 1 
)
protected

Increment the number of sent message.

◆ decSendCount()

void AlpsKnowledgeBrokerMPI::decSendCount ( const char *  how,
int  s = 1 
)
protected

Decrement the number of sent message.

◆ incRecvCount()

void AlpsKnowledgeBrokerMPI::incRecvCount ( const char *  how,
int  s = 1 
)
protected

Increment the number of received message.

◆ decRecvCount()

void AlpsKnowledgeBrokerMPI::decRecvCount ( const char *  how,
int  s = 1 
)
protected

Decrement the number of sent message.

◆ masterForceHubTerm()

void AlpsKnowledgeBrokerMPI::masterForceHubTerm ( )
protected

Master tell hubs to terminate due to reaching limits or other reason.

◆ hubForceWorkerTerm()

void AlpsKnowledgeBrokerMPI::hubForceWorkerTerm ( )
protected

Hub tell workers to terminate due to reaching limits or other reason.

◆ changeWorkingSubTree()

void AlpsKnowledgeBrokerMPI::changeWorkingSubTree ( double &  changeWorkThreshold)
protected

Change subtree to be explored if it is too worse.

◆ sendErrorCodeToMaster()

void AlpsKnowledgeBrokerMPI::sendErrorCodeToMaster ( int  errorCode)
protected

Send error code to master.

◆ recvErrorCode()

void AlpsKnowledgeBrokerMPI::recvErrorCode ( char *&  bufLarge)
protected

Receive error code and set solution status.

◆ spiralRecvProcessNode()

void AlpsKnowledgeBrokerMPI::spiralRecvProcessNode ( )
protected

Unpack the node, explore it and send load info to master.

◆ spiralDonateNode()

void AlpsKnowledgeBrokerMPI::spiralDonateNode ( )
protected

Unpack msg and donate a node.

◆ getProcRank()

virtual int AlpsKnowledgeBrokerMPI::getProcRank ( ) const
inlinevirtual

Query the global rank of the process.

Reimplemented from AlpsKnowledgeBroker.

Definition at line 617 of file AlpsKnowledgeBrokerMPI.h.

◆ getMasterRank()

virtual int AlpsKnowledgeBrokerMPI::getMasterRank ( ) const
inlinevirtual

Query the global rank of the Master.

Reimplemented from AlpsKnowledgeBroker.

Definition at line 620 of file AlpsKnowledgeBrokerMPI.h.

◆ getProcType()

virtual AlpsProcessType AlpsKnowledgeBrokerMPI::getProcType ( ) const
inlinevirtual

Query the type (master, hub, or worker) of the process.

Reimplemented from AlpsKnowledgeBroker.

Definition at line 623 of file AlpsKnowledgeBrokerMPI.h.

◆ initializeSearch()

void AlpsKnowledgeBrokerMPI::initializeSearch ( int  argc,
char *  argv[],
AlpsModel model,
bool  showBanner = true 
)
virtual

This function.

  • initializes the message environment;
  • the master reads in ALPS and user's parameter sets. If the model data is input from file, then it reads in the model data.
  • sets up user params and model;
  • broadcast parameters from the master to all other processes;
  • creates MPI communicators and groups;
  • classifies process types, sets up subtree and pools
  • determines their hub's global rank for workers

Implements AlpsKnowledgeBroker.

◆ search()

void AlpsKnowledgeBrokerMPI::search ( AlpsModel model)
virtual

Search best solution for a given model.

Reimplemented from AlpsKnowledgeBroker.

◆ rootSearch()

void AlpsKnowledgeBrokerMPI::rootSearch ( AlpsTreeNode root)
virtual

This function.

  • broadcasts model data from the master to all other processes;
  • calls its associated main function to explore the sub tree;
  • collects the best solution found.

Implements AlpsKnowledgeBroker.

◆ getIncumbentValue()

virtual double AlpsKnowledgeBrokerMPI::getIncumbentValue ( ) const
inlinevirtual

The process queries the quality of the incumbent this process stores.

Implements AlpsKnowledgeBroker.

Definition at line 657 of file AlpsKnowledgeBrokerMPI.h.

◆ getBestQuality()

virtual double AlpsKnowledgeBrokerMPI::getBestQuality ( ) const
inlinevirtual

The master queries the quality of the best solution it knowns.

Implements AlpsKnowledgeBroker.

Definition at line 670 of file AlpsKnowledgeBrokerMPI.h.

◆ getBestEstimateQuality()

virtual double AlpsKnowledgeBrokerMPI::getBestEstimateQuality ( )
inlinevirtual

Get best estimalted quality in system.

Reimplemented from AlpsKnowledgeBroker.

Definition at line 685 of file AlpsKnowledgeBrokerMPI.h.

◆ printBestSolution()

virtual void AlpsKnowledgeBrokerMPI::printBestSolution ( char *  outputFile = 0) const
virtual

Master prints out the best solution that it knows.

Implements AlpsKnowledgeBroker.

◆ searchLog()

virtual void AlpsKnowledgeBrokerMPI::searchLog ( )
virtual

Log search statistics.

Implements AlpsKnowledgeBroker.

◆ sendKnowledge()

void AlpsKnowledgeBrokerMPI::sendKnowledge ( AlpsKnowledgeType  type,
int  sender,
int  receiver,
char *&  msgBuffer,
int  msgSize,
int  msgTag,
MPI_Comm  comm,
bool  blocking 
)

Set knowlege.

◆ receiveKnowledge()

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.

◆ requestKnowledge()

void AlpsKnowledgeBrokerMPI::requestKnowledge ( AlpsKnowledgeType  type,
int  sender,
int  receiver,
char *&  msgBuffer,
int  msgSize,
int  msgTag,
MPI_Comm  comm,
bool  blocking 
)

Request knowlege.

Member Data Documentation

◆ processNum_

int AlpsKnowledgeBrokerMPI::processNum_
protected

The Number of processes launched.

Definition at line 70 of file AlpsKnowledgeBrokerMPI.h.

◆ hubNum_

int AlpsKnowledgeBrokerMPI::hubNum_
protected

The Number of hubs.

Definition at line 73 of file AlpsKnowledgeBrokerMPI.h.

◆ globalRank_

int AlpsKnowledgeBrokerMPI::globalRank_
protected

The rank of the process in MPI_COMM_WORLD.

Definition at line 76 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterComm_

MPI_Comm AlpsKnowledgeBrokerMPI::clusterComm_
protected

Communicator of the cluster to which the process belongs.

Definition at line 79 of file AlpsKnowledgeBrokerMPI.h.

◆ hubComm_

MPI_Comm AlpsKnowledgeBrokerMPI::hubComm_
protected

Communicator consists of all hubs.

Definition at line 82 of file AlpsKnowledgeBrokerMPI.h.

◆ hubGroup_

MPI_Group AlpsKnowledgeBrokerMPI::hubGroup_
protected

MPI_Group consists of all hubs.

Definition at line 85 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterSize_

int AlpsKnowledgeBrokerMPI::clusterSize_
protected

The actual size of the cluster to which the process belongs.

Definition at line 88 of file AlpsKnowledgeBrokerMPI.h.

◆ userClusterSize_

int AlpsKnowledgeBrokerMPI::userClusterSize_
protected

The user reqested size of a cluster.

Definition at line 91 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterRank_

int AlpsKnowledgeBrokerMPI::clusterRank_
protected

The local rank of the process in clusterComm_.

Definition at line 94 of file AlpsKnowledgeBrokerMPI.h.

◆ hubRanks_

int* AlpsKnowledgeBrokerMPI::hubRanks_
protected

The global ranks of the hubs.

Definition at line 97 of file AlpsKnowledgeBrokerMPI.h.

◆ myHubRank_

int AlpsKnowledgeBrokerMPI::myHubRank_
protected

The global rank of its hub for a worker.

Definition at line 100 of file AlpsKnowledgeBrokerMPI.h.

◆ masterRank_

int AlpsKnowledgeBrokerMPI::masterRank_
protected

The global rank of the master.

Definition at line 103 of file AlpsKnowledgeBrokerMPI.h.

◆ processType_

AlpsProcessType AlpsKnowledgeBrokerMPI::processType_
protected

The AlpsProcessType of this process.

Definition at line 106 of file AlpsKnowledgeBrokerMPI.h.

◆ processTypeList_

AlpsProcessType* AlpsKnowledgeBrokerMPI::processTypeList_
protected

The AlpsProcessType of all process.

Definition at line 109 of file AlpsKnowledgeBrokerMPI.h.

◆ hubWork_

bool AlpsKnowledgeBrokerMPI::hubWork_
protected

Whether hub should also work as a worker.

Definition at line 112 of file AlpsKnowledgeBrokerMPI.h.

◆ subTreeRequest_

MPI_Request AlpsKnowledgeBrokerMPI::subTreeRequest_
protected

Send subtree request.

Definition at line 115 of file AlpsKnowledgeBrokerMPI.h.

◆ solRequestL_

MPI_Request AlpsKnowledgeBrokerMPI::solRequestL_
protected

Send model knoledge request.

Definition at line 118 of file AlpsKnowledgeBrokerMPI.h.

◆ solRequestR_

MPI_Request AlpsKnowledgeBrokerMPI::solRequestR_
protected

Definition at line 119 of file AlpsKnowledgeBrokerMPI.h.

◆ modelKnowRequestL_

MPI_Request AlpsKnowledgeBrokerMPI::modelKnowRequestL_
protected

Send model knoledge request.

Definition at line 122 of file AlpsKnowledgeBrokerMPI.h.

◆ modelKnowRequestR_

MPI_Request AlpsKnowledgeBrokerMPI::modelKnowRequestR_
protected

Definition at line 123 of file AlpsKnowledgeBrokerMPI.h.

◆ forwardRequestL_

MPI_Request AlpsKnowledgeBrokerMPI::forwardRequestL_
protected

Forward model knoledge request.

Definition at line 126 of file AlpsKnowledgeBrokerMPI.h.

◆ forwardRequestR_

MPI_Request AlpsKnowledgeBrokerMPI::forwardRequestR_
protected

Definition at line 127 of file AlpsKnowledgeBrokerMPI.h.

◆ incumbentValue_

double AlpsKnowledgeBrokerMPI::incumbentValue_
protected

Incumbent value.

Definition at line 135 of file AlpsKnowledgeBrokerMPI.h.

◆ incumbentID_

int AlpsKnowledgeBrokerMPI::incumbentID_
protected

The process id that store the incumbent.

Definition at line 138 of file AlpsKnowledgeBrokerMPI.h.

◆ updateIncumbent_

bool AlpsKnowledgeBrokerMPI::updateIncumbent_
protected

Indicate whether the incumbent value is updated between two checking point.

Definition at line 142 of file AlpsKnowledgeBrokerMPI.h.

◆ workQuality_

double AlpsKnowledgeBrokerMPI::workQuality_
protected

The workload quality of the process.

Definition at line 150 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterWorkQuality_

double AlpsKnowledgeBrokerMPI::clusterWorkQuality_
protected

The workload quality of the cluster to which the process belong.

Definition at line 153 of file AlpsKnowledgeBrokerMPI.h.

◆ systemWorkQuality_

double AlpsKnowledgeBrokerMPI::systemWorkQuality_
protected

The workload quality of the whole system.

Definition at line 156 of file AlpsKnowledgeBrokerMPI.h.

◆ hubWorkQualities_

double* AlpsKnowledgeBrokerMPI::hubWorkQualities_
protected

The workload qualities of hubs.

Definition at line 159 of file AlpsKnowledgeBrokerMPI.h.

◆ workerWorkQualities_

double* AlpsKnowledgeBrokerMPI::workerWorkQualities_
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 163 of file AlpsKnowledgeBrokerMPI.h.

◆ workQuantity_

double AlpsKnowledgeBrokerMPI::workQuantity_
protected

The workload quantity of the workload on the process.

Definition at line 166 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterWorkQuantity_

double AlpsKnowledgeBrokerMPI::clusterWorkQuantity_
protected

The workload quantity of the cluster to which the process belongs.

Definition at line 169 of file AlpsKnowledgeBrokerMPI.h.

◆ systemWorkQuantity_

double AlpsKnowledgeBrokerMPI::systemWorkQuantity_
protected

The workload quantity of the whole system.

Definition at line 172 of file AlpsKnowledgeBrokerMPI.h.

◆ systemWorkQuantityForce_

double AlpsKnowledgeBrokerMPI::systemWorkQuantityForce_
protected

The workload quantity of the whole system before forcing termination.

Definition at line 175 of file AlpsKnowledgeBrokerMPI.h.

◆ hubWorkQuantities_

double* AlpsKnowledgeBrokerMPI::hubWorkQuantities_
protected

The workload quantities of all clusters/hubs.

Definition at line 178 of file AlpsKnowledgeBrokerMPI.h.

◆ workerWorkQuantities_

double* AlpsKnowledgeBrokerMPI::workerWorkQuantities_
protected

The workload quantities of workers in the cluster to which this proces belongs.

Definition at line 182 of file AlpsKnowledgeBrokerMPI.h.

◆ workerReported_

bool* AlpsKnowledgeBrokerMPI::workerReported_
protected

Indicate which worker has been reported its work.

Definition at line 185 of file AlpsKnowledgeBrokerMPI.h.

◆ hubReported_

bool* AlpsKnowledgeBrokerMPI::hubReported_
protected

Indicate which hub has been reported its work.

Definition at line 188 of file AlpsKnowledgeBrokerMPI.h.

◆ allHubReported_

bool AlpsKnowledgeBrokerMPI::allHubReported_
protected

Indicate whether all hubs have reported status to master at least once.

Definition at line 191 of file AlpsKnowledgeBrokerMPI.h.

◆ masterDoBalance_

int AlpsKnowledgeBrokerMPI::masterDoBalance_
protected

Whether master do load balance.

0: do; >0: blocked.

Definition at line 194 of file AlpsKnowledgeBrokerMPI.h.

◆ hubDoBalance_

int AlpsKnowledgeBrokerMPI::hubDoBalance_
protected

Whether a hub do load balance.

0: do; >0: blocked.

Definition at line 197 of file AlpsKnowledgeBrokerMPI.h.

◆ workerNodeProcesseds_

int* AlpsKnowledgeBrokerMPI::workerNodeProcesseds_
protected

To record how many nodes processed for each worker in a cluster.

Definition at line 200 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterNodeProcessed_

int AlpsKnowledgeBrokerMPI::clusterNodeProcessed_
protected

To record how many nodes by a cluster.

Definition at line 203 of file AlpsKnowledgeBrokerMPI.h.

◆ hubNodeProcesseds_

int* AlpsKnowledgeBrokerMPI::hubNodeProcesseds_
protected

To record how many nodes processed for each hub.

Definition at line 206 of file AlpsKnowledgeBrokerMPI.h.

◆ sendCount_

int AlpsKnowledgeBrokerMPI::sendCount_
protected

The number of new messages sent by the process after last survey.

Definition at line 214 of file AlpsKnowledgeBrokerMPI.h.

◆ recvCount_

int AlpsKnowledgeBrokerMPI::recvCount_
protected

The number of new messages received by the process after last survey.

Definition at line 217 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterSendCount_

int AlpsKnowledgeBrokerMPI::clusterSendCount_
protected

The number of new messages sent by the processes in clusterComm_ after last survey.

Definition at line 221 of file AlpsKnowledgeBrokerMPI.h.

◆ clusterRecvCount_

int AlpsKnowledgeBrokerMPI::clusterRecvCount_
protected

The number of new messages received by the processes in clusterComm_ after last survey.

Definition at line 225 of file AlpsKnowledgeBrokerMPI.h.

◆ systemSendCount_

int AlpsKnowledgeBrokerMPI::systemSendCount_
protected

The total number of messages sent by the all processes.

Definition at line 228 of file AlpsKnowledgeBrokerMPI.h.

◆ systemRecvCount_

int AlpsKnowledgeBrokerMPI::systemRecvCount_
protected

The total number of messages sent by the all processes.

Definition at line 231 of file AlpsKnowledgeBrokerMPI.h.

◆ masterIndexBatch_

int AlpsKnowledgeBrokerMPI::masterIndexBatch_
protected

Definition at line 238 of file AlpsKnowledgeBrokerMPI.h.

◆ masterTimer_

AlpsTimer AlpsKnowledgeBrokerMPI::masterTimer_
protected

Master timer.

Definition at line 246 of file AlpsKnowledgeBrokerMPI.h.

◆ hubTimer_

AlpsTimer AlpsKnowledgeBrokerMPI::hubTimer_
protected

Hub timer.

Definition at line 249 of file AlpsKnowledgeBrokerMPI.h.

◆ workerTimer_

AlpsTimer AlpsKnowledgeBrokerMPI::workerTimer_
protected

Worker timer.

Definition at line 252 of file AlpsKnowledgeBrokerMPI.h.

◆ rampUpTime_

double AlpsKnowledgeBrokerMPI::rampUpTime_
protected

The time spent in ramp up.

Definition at line 255 of file AlpsKnowledgeBrokerMPI.h.

◆ rampDownTime_

double AlpsKnowledgeBrokerMPI::rampDownTime_
protected

The time spent in ramp down.

Definition at line 258 of file AlpsKnowledgeBrokerMPI.h.

◆ idleTime_

double AlpsKnowledgeBrokerMPI::idleTime_
protected

The time spent waiting for work.

Definition at line 261 of file AlpsKnowledgeBrokerMPI.h.

◆ msgTime_

double AlpsKnowledgeBrokerMPI::msgTime_
protected

The time spent processing messages (include idle).

Definition at line 264 of file AlpsKnowledgeBrokerMPI.h.

◆ psStats_

AlpsPsStats AlpsKnowledgeBrokerMPI::psStats_
protected

More statistics.

Definition at line 267 of file AlpsKnowledgeBrokerMPI.h.

◆ forceTerminate_

bool AlpsKnowledgeBrokerMPI::forceTerminate_
protected

Terminate due to reaching limits (time and node) or other reason.

Definition at line 271 of file AlpsKnowledgeBrokerMPI.h.

◆ blockTermCheck_

bool AlpsKnowledgeBrokerMPI::blockTermCheck_
protected

Indicate whether do termination check.

Definition at line 274 of file AlpsKnowledgeBrokerMPI.h.

◆ blockHubReport_

bool AlpsKnowledgeBrokerMPI::blockHubReport_
protected

Indicate whether a hub need to report state to master.

Definition at line 277 of file AlpsKnowledgeBrokerMPI.h.

◆ blockWorkerReport_

bool AlpsKnowledgeBrokerMPI::blockWorkerReport_
protected

Indicate whether a worker need to report state to its hub.

Definition at line 280 of file AlpsKnowledgeBrokerMPI.h.

◆ blockAskForWork_

bool AlpsKnowledgeBrokerMPI::blockAskForWork_
protected

Indicate whether a worker need to as for work from its hub.

Definition at line 283 of file AlpsKnowledgeBrokerMPI.h.

◆ attachBuffer_

char* AlpsKnowledgeBrokerMPI::attachBuffer_
protected

Buffer attached to MPI when sharing generated knowledge.

Definition at line 286 of file AlpsKnowledgeBrokerMPI.h.

◆ largeBuffer_

char* AlpsKnowledgeBrokerMPI::largeBuffer_
protected

Large message buffer.

Definition at line 289 of file AlpsKnowledgeBrokerMPI.h.

◆ largeBuffer2_

char* AlpsKnowledgeBrokerMPI::largeBuffer2_
protected

Large message buffer.

Used for sharing model knowledge

Definition at line 292 of file AlpsKnowledgeBrokerMPI.h.

◆ smallBuffer_

char* AlpsKnowledgeBrokerMPI::smallBuffer_
protected

Small message buffer.

Definition at line 295 of file AlpsKnowledgeBrokerMPI.h.

◆ masterBalancePeriod_

double AlpsKnowledgeBrokerMPI::masterBalancePeriod_
protected

The period that master do load balancing.

It changes as search progresses.

Definition at line 299 of file AlpsKnowledgeBrokerMPI.h.

◆ hubReportPeriod_

double AlpsKnowledgeBrokerMPI::hubReportPeriod_
protected

The period that a hub load balancing and report cluster status.

It changes as search progresses.

Definition at line 303 of file AlpsKnowledgeBrokerMPI.h.

◆ modelGenID_

int AlpsKnowledgeBrokerMPI::modelGenID_
protected

The global rank of the process that share generated model knowledge.

Definition at line 306 of file AlpsKnowledgeBrokerMPI.h.

◆ modelGenPos_

int AlpsKnowledgeBrokerMPI::modelGenPos_
protected

Size of the shared knowledge.

Definition at line 309 of file AlpsKnowledgeBrokerMPI.h.

◆ rampUpSubTree_

AlpsSubTree* AlpsKnowledgeBrokerMPI::rampUpSubTree_
protected

A subtree used in during up.

Definition at line 312 of file AlpsKnowledgeBrokerMPI.h.

◆ unitWorkNodes_

int AlpsKnowledgeBrokerMPI::unitWorkNodes_
protected

Number of nodes in one unit of work.

Definition at line 315 of file AlpsKnowledgeBrokerMPI.h.

◆ haltSearch_

int AlpsKnowledgeBrokerMPI::haltSearch_
protected

Temporily halt search.

Definition at line 318 of file AlpsKnowledgeBrokerMPI.h.


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