Scippy

UG

Ubiquity Generator framework

BbParaNodeMpi Class Reference

class BbParaNodeMpi More...

#include <bbParaNodeMpi.h>

Inheritance diagram for BbParaNodeMpi:
BbParaNode ParaTask

Public Member Functions

 BbParaNodeMpi ()
 default constructor More...
 
 BbParaNodeMpi (TaskId inNodeId, TaskId inGeneratorNodeId, int inDepth, double inDualBoundValue, double inOriginalDualBoundValue, double inEstimatedValue, ParaDiffSubproblem *inDiffSubproblem)
 constructor More...
 
 ~BbParaNodeMpi ()
 destructor More...
 
BbParaNodeMpiclone (ParaComm *comm)
 clone this BbParaNodeMpi 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 sendReassignSelfSplitSubtreeRoot (ParaComm *comm, int destination)
 send subtree root to be reassigned More...
 
int receiveNewSubtreeRoot (ParaComm *comm, int source)
 receive this object More...
 
int receiveSubtreeRootNodeId (ParaComm *comm, int source, int tag)
 receive this object More...
 
int receiveReassignSelfSplitSubtreeRoot (ParaComm *comm, int source)
 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...
 
virtual BbParaNodeclone (ParaComm *comm)=0
 clone this BbParaNode More...
 
virtual int bcast (ParaComm *comm, int root)=0
 broadcast this object More...
 
virtual int send (ParaComm *comm, int destination)=0
 send this object More...
 
virtual int receive (ParaComm *comm, int source)=0
 receive this object More...
 
virtual int sendNewSubtreeRoot (ParaComm *comm, int destination)=0
 send new subtree root node More...
 
virtual int sendSubtreeRootNodeId (ParaComm *comm, int destination, int tag)=0
 send subtree root to be removed More...
 
virtual int receiveNewSubtreeRoot (ParaComm *comm, int source)=0
 receive this object More...
 
virtual int receiveSubtreeRootNodeId (ParaComm *comm, int source, int tag)=0
 receive this object node Id More...
 
void write (gzstream::ogzstream &out)
 write to checkpoint file More...
 
bool read (ParaComm *comm, gzstream::igzstream &in, bool onlyBoundChanges)
 read from checkpoint file 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...
 
virtual ParaTaskclone (ParaComm *comm)=0
 clone this ParaTask More...
 
virtual int bcast (ParaComm *comm, int root)=0
 broadcast this object More...
 
virtual int send (ParaComm *comm, int destination)=0
 send this object More...
 
virtual int receive (ParaComm *comm, int source)=0
 receive this object More...
 
virtual void write (gzstream::ogzstream &out)=0
 write to checkpoint file More...
 
virtual const std::string toString ()
 stringfy ParaTask More...
 
virtual const std::string toSimpleString ()
 stringfy ParaTask as simple string More...
 

Private Member Functions

MPI_Datatype createDatatype ()
 create BbParaNode datatype More...
 
MPI_Datatype createDatatypeForNodeId ()
 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 BbParaNodeMpi

Definition at line 52 of file bbParaNodeMpi.h.

Constructor & Destructor Documentation

◆ BbParaNodeMpi() [1/2]

default constructor

Definition at line 71 of file bbParaNodeMpi.h.

Referenced by BbParaNodeMpi::clone().

◆ BbParaNodeMpi() [2/2]

BbParaNodeMpi ( 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 79 of file bbParaNodeMpi.h.

◆ ~BbParaNodeMpi()

destructor

Definition at line 95 of file bbParaNodeMpi.h.

Member Function Documentation

◆ bcast()

int bcast ( ParaComm comm,
int  root 
)
virtual

broadcast this object

Returns
always 0 (for future extensions)
Parameters
commcommunicator used
rootroot rank of broadcast

Implements BbParaNode.

Definition at line 236 of file bbParaNodeMpi.cpp.

References ParaDiffSubproblem::bcast(), comm, BbParaNodeMpi::createDatatype(), DEF_PARA_COMM, ParaTask::diffSubproblem, ParaTask::diffSubproblemInfo, SubtaskId::lcId, MPI_CALL, PARA_COMM_CALL, TaskId::subtaskId, and ParaTask::taskId.

◆ clone()

BbParaNodeMpi * clone ( ParaComm comm)
virtual

◆ createDatatype()

◆ createDatatypeForNodeId()

◆ receive()

int receive ( ParaComm comm,
int  source 
)
virtual

receive this object

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

Implements BbParaNode.

Definition at line 361 of file bbParaNodeMpi.cpp.

References comm, BbParaNodeMpi::createDatatype(), DEF_PARA_COMM, ParaTask::diffSubproblem, ParaTask::diffSubproblemInfo, SubtaskId::lcId, MPI_CALL, PARA_COMM_CALL, ParaDiffSubproblem::receive(), TaskId::subtaskId, UG::TagTask, and ParaTask::taskId.

◆ receiveNewSubtreeRoot()

int receiveNewSubtreeRoot ( ParaComm comm,
int  source 
)
virtual

receive this object

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

Implements BbParaNode.

Definition at line 386 of file bbParaNodeMpi.cpp.

References comm, BbParaNodeMpi::createDatatype(), DEF_PARA_COMM, ParaTask::diffSubproblem, ParaTask::diffSubproblemInfo, SubtaskId::lcId, MPI_CALL, PARA_COMM_CALL, ParaDiffSubproblem::receive(), TaskId::subtaskId, UG::TagNewSubtreeRootNode, and ParaTask::taskId.

◆ receiveReassignSelfSplitSubtreeRoot()

int receiveReassignSelfSplitSubtreeRoot ( ParaComm comm,
int  source 
)

receive this object node Id

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

◆ receiveSubtreeRootNodeId()

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

receive this object

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

Implements BbParaNode.

Definition at line 415 of file bbParaNodeMpi.cpp.

References comm, BbParaNodeMpi::createDatatypeForNodeId(), DEF_PARA_COMM, SubtaskId::lcId, MPI_CALL, PARA_COMM_CALL, TaskId::subtaskId, and ParaTask::taskId.

◆ 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 268 of file bbParaNodeMpi.cpp.

References comm, BbParaNodeMpi::createDatatype(), DEF_PARA_COMM, ParaTask::diffSubproblem, ParaTask::diffSubproblemInfo, SubtaskId::lcId, MPI_CALL, PARA_COMM_CALL, ParaDiffSubproblem::send(), TaskId::subtaskId, UG::TagTask, and ParaTask::taskId.

◆ 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 292 of file bbParaNodeMpi.cpp.

References comm, BbParaNodeMpi::createDatatype(), DEF_PARA_COMM, ParaTask::diffSubproblem, ParaTask::diffSubproblemInfo, SubtaskId::lcId, MPI_CALL, PARA_COMM_CALL, ParaDiffSubproblem::send(), TaskId::subtaskId, UG::TagNewSubtreeRootNode, and ParaTask::taskId.

◆ sendReassignSelfSplitSubtreeRoot()

int sendReassignSelfSplitSubtreeRoot ( ParaComm comm,
int  destination 
)

send subtree root to be reassigned

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

◆ 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 316 of file bbParaNodeMpi.cpp.

References comm, BbParaNodeMpi::createDatatypeForNodeId(), DEF_PARA_COMM, SubtaskId::lcId, MPI_CALL, PARA_COMM_CALL, TaskId::subtaskId, and ParaTask::taskId.