Scippy

UG

Ubiquity Generator framework

BbParaNodeTh Class Reference

class BbParaNodeTh More...

#include <bbParaNodeTh.h>

+ Inheritance diagram for BbParaNodeTh:

Public Member Functions

 BbParaNodeTh ()
 default constructor More...
 
 BbParaNodeTh (TaskId inNodeId, TaskId inGeneratorNodeId, int inDepth, double inDualBoundValue, double inOriginalDualBoundValue, double inEstimatedValue, ParaDiffSubproblem *inDiffSubproblem)
 constructor More...
 
 ~BbParaNodeTh ()
 destructor More...
 
BbParaNodeThclone (ParaComm *comm)
 clone this BbParaNodeTh More...
 
int bcast (ParaComm *comm, int root)
 broadcast this object More...
 
int send (ParaComm *comm, int destination)
 send this object More...
 
int receive (ParaComm *comm, int source)
 receive this object More...
 
int sendNewSubtreeRoot (ParaComm *comm, int destination)
 send new subtree root node More...
 
int sendSubtreeRootNodeId (ParaComm *comm, int destination, int tag)
 send subtree root to be removed More...
 
int receiveNewSubtreeRoot (ParaComm *comm, int source)
 receive this object More...
 
int receiveSubtreeRootNodeId (ParaComm *comm, int source, int tag)
 receive this object node Id More...
 
- Public Member Functions inherited from BbParaNode
 BbParaNode ()
 default constructor More...
 
 BbParaNode (TaskId inNodeId, TaskId inGeneratorNodeId, int inDepth, double inDualBoundValue, double inOriginalDualBoundValue, double inEstimatedValue, ParaDiffSubproblem *inDiffSubproblem)
 constructor More...
 
virtual ~BbParaNode ()
 destructor More...
 
int getDepth ()
 getter of depth More...
 
void setDepth (int inDepth)
 setter of depth More...
 
double getDualBoundValue ()
 getter of dual bound value More...
 
double getInitialDualBoundValue ()
 getter of initial dual bound value More...
 
void setDualBoundValue (double inDualBoundValue)
 setter of dual bound value More...
 
void setInitialDualBoundValue (double inTrueDualBoundValue)
 setter of initial dual bound value More...
 
void resetDualBoundValue ()
 reset dual bound value More...
 
BbParaDiffSubproblemgetDiffSubproblem ()
 getter of diffSubproblem More...
 
void setDiffSubproblem (BbParaDiffSubproblem *inDiffSubproblem)
 setter of diffSubproblem */ More...
 
ParaTaskGenealogicalPtrgetAncestor ()
 getter of ancestor More...
 
void setAncestor (ParaTaskGenealogicalPtr *inAncestor)
 setter of ancestor More...
 
void removeDescendant (TaskId removeNodeId)
 remove a descendant More...
 
bool hasDescendant ()
 check if this node has descendant or not More...
 
void addDescendant (ParaTaskGenealogicalPtr *inDescendant)
 add a descendant More...
 
void updateInitialDualBoundToSubtreeDualBound ()
 update initial dual bound value by checking descendant dual bound values More...
 
double getMinimumDualBoundInDesendants (double value)
 get minimum dual bound value in descendants More...
 
const std::string toString ()
 stringfy BbParaNode More...
 
const std::string toSimpleString ()
 stringfy BbParaNode as simple string More...
 
void setMergeNodeInfo (BbParaMergeNodeInfo *mNode)
 set merge node information to this BbParaNode object More...
 
BbParaMergeNodeInfogetMergeNodeInfo ()
 get merge node information struct More...
 
void setMergingStatus (int status)
 set merging status More...
 
int getMergingStatus ()
 get merging status More...
 
bool areNodesCollected ()
 check if nodes are collected or not More...
 
void collectsNodes ()
 set all nodes are collected TODO: this function has to be investigated More...
 
bool isSameNodeIdAs (const BbParaNode &inNode)
 check if this node's id is the same as that of argument ParaNode's task id More...
 
- Public Member Functions inherited from ParaTask
 ParaTask ()
 default constructor More...
 
 ParaTask (const ParaTask &paraTask)
 copy constructor More...
 
 ParaTask (TaskId inTaskId, TaskId inGeneratorTaskId, double inEstimatedValue, ParaDiffSubproblem *inDiffSubproblem)
 constructor More...
 
virtual ~ParaTask ()
 destructor More...
 
bool isRootTask ()
 check if root task or not More...
 
bool isSameTaskIdAs (const ParaTask &inTask)
 check if this task id is the same as argument ParaTask's task id More...
 
bool isSameParetntTaskIdAs (const ParaTask &inTask)
 check if this task's parent id is the same as that of argument ParaTask's task id More...
 
bool isSameParetntTaskSubtaskIdAs (const TaskId &inTaskId)
 check if this task's parent subtree id is the same as that of argument ParaTask's task id More...
 
bool isSameSubtaskIdAs (const ParaTask &inTask)
 check if this task's subtask id is the same as that of argument ParaTask's task id More...
 
bool isSameLcIdAs (const ParaTask &inTask)
 check if this task's global subtask id in LC is the same as that of argument ParaTask's task id More...
 
bool isSameLcIdAs (const int lcId)
 check if this task's global subtask LC id is the same as LC id of argument More...
 
bool isSameGlobalSubtaskIdInLcAs (const ParaTask &inTask)
 check if this task's global subtask id in LC is the same as that of argument ParaTask's task id More...
 
bool isSameGlobalSubtaskIdInLcAs (const int globalSubtaskIdInLc)
 check if this task's global subtask id in LC is the same as that of argument More...
 
int getLcId ()
 getter of LoadCoordinator id More...
 
int getGlobalSubtaskIdInLc ()
 getter of global subtask id in Solvers managed by LoadCoordinator More...
 
void setGlobalSubtaskId (int lcId, int subtaskId)
 setter of global subtask id More...
 
int getSolverId ()
 getter of Solver id More...
 
void setSolverId (int id)
 setter of Solver id More...
 
TaskId getTaskId ()
 getter of task id More...
 
void setTaskId (TaskId inTaskId)
 setter of task id More...
 
TaskId getGeneratorTaskId ()
 getter of generator task id More...
 
void setGeneratorTaskId (TaskId inGeneratorTaskId)
 setter of generator task id More...
 
double getEstimatedValue ()
 getter of estimated value More...
 
void setEstimatedValue (double inEstimatedValue)
 setter of estimated value More...
 
ParaDiffSubproblemgetDiffSubproblem ()
 getter of diffSubproblem More...
 
void setDiffSubproblem (ParaDiffSubproblem *inDiffSubproblem)
 setter of diffSubproblem */ More...
 
ParaTaskGenealogicalPtrgetAncestor ()
 getter of ancestor More...
 
void setAncestor (ParaTaskGenealogicalPtr *inAncestor)
 setter of ancestor More...
 
void removeDescendant (TaskId removeTaskId)
 remove a descendant More...
 
bool hasDescendant ()
 check if this task has descendant or not More...
 
void addDescendant (ParaTaskGenealogicalPtr *inDescendant)
 add a descendant More...
 

Private Member Functions

BbParaNodeThcreateDatatype (ParaComm *comm)
 create BbParaNode datatype More...
 

Additional Inherited Members

- Public Attributes inherited from BbParaNode
BbParaNodenext
 this pointer is used in case of self-split ramp-up in LC this field is not transferred More...
 
- Public Attributes inherited from ParaTask
TaskId taskId
 solving task information More...
 
TaskId generatorTaskId
 subtree root task id of generator More...
 
ParaTaskGenealogicalPtrancestor
 pointer to ancestor ParaTask : This field is not transferred More...
 
std::map< TaskId, ParaTaskGenealogicalPtrPtrdescendants
 collection of pointers to descendants : This filed is not transferred More...
 
- Protected Attributes inherited from BbParaNode
int depth
 depth from the root node of original tree More...
 
double dualBoundValue
 dual bound value More...
 
double initialDualBoundValue
 dual bound value when this node is created This value is updated to precise one when there is guarantee More...
 
int basisInfo
 indicate if basis information is including or not More...
 
int mergingStatus
 merging status: -1 - no merging node, 0 - checking, 1 - merged (representative) 2 - merged to the other node 3 - cannot be merged 4 - merging representative was deleted More...
 
BbParaMergeNodeInfomergeNodeInfo
 pointer to mergeNodeInfo. Not zero means merging More...
 
bool nodesAreCollected
 subproblems generated from this nodes are collected at interruption. this field is not transferred More...
 
- Protected Attributes inherited from ParaTask
double estimatedValue
 estimate value More...
 
int diffSubproblemInfo
 1: with diffSubproblem, 0: no diffSubproblem More...
 
ParaDiffSubproblemdiffSubproblem
 difference between solving instance data and subproblem data More...
 

Detailed Description

class BbParaNodeTh

Definition at line 51 of file bbParaNodeTh.h.

Constructor & Destructor Documentation

◆ BbParaNodeTh() [1/2]

default constructor

Definition at line 66 of file bbParaNodeTh.h.

Referenced by BbParaNodeTh::clone().

◆ BbParaNodeTh() [2/2]

BbParaNodeTh ( TaskId  inNodeId,
TaskId  inGeneratorNodeId,
int  inDepth,
double  inDualBoundValue,
double  inOriginalDualBoundValue,
double  inEstimatedValue,
ParaDiffSubproblem inDiffSubproblem 
)

constructor

Parameters
inNodeIdnode id
inGeneratorNodeIdgenerator node id
inDepthdepth in global search tree
inDualBoundValuedual bound value
inOriginalDualBoundValueoriginal dual bound value when the node is generated
inEstimatedValueestimated value
inDiffSubproblempointer to ParaDiffSubproblem object

Definition at line 74 of file bbParaNodeTh.h.

◆ ~BbParaNodeTh()

destructor

Definition at line 90 of file bbParaNodeTh.h.

Member Function Documentation

◆ bcast()

◆ clone()

◆ createDatatype()

BbParaNodeTh * createDatatype ( ParaComm comm)
private

create BbParaNode datatype

Returns
pointer to BbParaNodeTh object
Parameters
commcommunicator used

Definition at line 42 of file bbParaNodeTh.cpp.

References BbParaNodeTh::clone().

Referenced by BbParaNodeTh::bcast(), BbParaNodeTh::send(), BbParaNodeTh::sendNewSubtreeRoot(), and BbParaNodeTh::sendSubtreeRootNodeId().

◆ receive()

int receive ( ParaComm comm,
int  source 
)
virtual

◆ receiveNewSubtreeRoot()

int receiveNewSubtreeRoot ( ParaComm comm,
int  source 
)
virtual

◆ receiveSubtreeRootNodeId()

int receiveSubtreeRootNodeId ( ParaComm comm,
int  source,
int  tag 
)
virtual

receive this object node Id

Returns
always 0 (for future extensions)
Parameters
commcommunicator used
sourcesource rank
tagtag of message

Implements BbParaNode.

Definition at line 238 of file bbParaNodeTh.cpp.

References DEF_PARA_COMM, ParaTask::generatorTaskId, PARA_COMM_CALL, UG::ParaTaskType, and ParaTask::taskId.

Referenced by BbParaNodeTh::clone().

◆ send()

int send ( ParaComm comm,
int  destination 
)
virtual

send this object

Returns
always 0 (for future extensions)
Parameters
commcommunicator used
destinationdestination rank

Implements BbParaNode.

Definition at line 98 of file bbParaNodeTh.cpp.

References BbParaNodeTh::createDatatype(), DEF_PARA_COMM, BbParaNode::mergeNodeInfo, PARA_COMM_CALL, UG::ParaTaskType, and UG::TagTask.

Referenced by BbParaNodeTh::clone().

◆ sendNewSubtreeRoot()

int sendNewSubtreeRoot ( ParaComm comm,
int  destination 
)
virtual

send new subtree root node

Returns
always 0 (for future extensions)
Parameters
commcommunicator used
destinationdestination rank

Implements BbParaNode.

Definition at line 117 of file bbParaNodeTh.cpp.

References BbParaNodeTh::createDatatype(), DEF_PARA_COMM, ParaTask::isRootTask(), BbParaNode::mergeNodeInfo, PARA_COMM_CALL, UG::ParaTaskType, and UG::TagNewSubtreeRootNode.

Referenced by BbParaNodeTh::clone().

◆ sendSubtreeRootNodeId()

int sendSubtreeRootNodeId ( ParaComm comm,
int  destination,
int  tag 
)
virtual

send subtree root to be removed

Returns
always 0 (for future extensions)
Parameters
commcommunicator used
destinationdestination rank
tagtag of message

Implements BbParaNode.

Definition at line 138 of file bbParaNodeTh.cpp.

References BbParaNodeTh::createDatatype(), DEF_PARA_COMM, BbParaNode::mergeNodeInfo, PARA_COMM_CALL, and UG::ParaTaskType.

Referenced by BbParaNodeTh::clone().