#include <bbParaNodesMerger.h>
Public Member Functions | |
BbParaNodesMerger (int inVarIndexRange, int inNBoundChangesOfBestNode, ParaTimer *inParaTimer, BbParaInstance *inParaInstance, ParaParamSet *inParaParamSet) | |
~BbParaNodesMerger () | |
void | addNodeToMergeNodeStructs (BbParaNode *node) |
add a node to nodes merger More... | |
void | generateMergeNodesCandidates (ParaComm *paraComm, ParaInitiator *paraInitiator) |
generate merge nodes candidates More... | |
void | regenerateMergeNodesCandidates (BbParaNode *node, ParaComm *paraComm, ParaInitiator *paraInitiator) |
regenerate merge nodes candidates More... | |
void | deleteMergeNodeInfo (BbParaMergeNodeInfo *mNode) |
delete merge node info More... | |
int | mergeNodes (BbParaNode *node, BbParaNodePool *paraNodePool) |
make a merge node More... | |
double | getAddingNodeToMergeStructTime () |
getter of addingNodeToMergeStructTime More... | |
double | getGenerateMergeNodesCandidatesTime () |
getter of generateMergeNodesCandidatesTime More... | |
double | getRegenerateMergeNodesCandidatesTime () |
getter of regenerateMergeNodesCandidatesTime More... | |
double | getMergeNodeTime () |
getter of mergeNodeTime More... | |
Private Attributes | |
int | varIndexRange |
variable index range More... | |
int | nBoundChangesOfBestNode |
bound changes of the best node More... | |
ParaTimer * | paraTimer |
normal timer used More... | |
BbParaInstance * | instance |
pointer to ParaInstance object More... | |
ParaParamSet * | paraParamSet |
pointer to ParaParamSet object More... | |
BbParaFixedValue ** | varIndexTable |
variable indices table. More... | |
BbParaMergeNodeInfo * | mergeInfoHead |
head of BbParaMergeNodeInfo list More... | |
BbParaMergeNodeInfo * | mergeInfoTail |
tail of BbParaMergeNodeInfo list times More... | |
double | addingNodeToMergeStructTime |
accumulate time to add Node to merge struct More... | |
double | generateMergeNodesCandidatesTime |
accumulate time to generate merge nodes candidates More... | |
double | regenerateMergeNodesCandidatesTime |
accumulate time to regenerate merge nodes candidates More... | |
double | mergeNodeTime |
accumulate time to make a merged node More... | |
Definition at line 125 of file bbParaNodesMerger.h.
BbParaNodesMerger | ( | int | inVarIndexRange, |
int | inNBoundChangesOfBestNode, | ||
ParaTimer * | inParaTimer, | ||
BbParaInstance * | inParaInstance, | ||
ParaParamSet * | inParaParamSet | ||
) |
Definition at line 143 of file bbParaNodesMerger.h.
References BbParaNodesMerger::mergeInfoHead, BbParaNodesMerger::mergeInfoTail, BbParaNodesMerger::varIndexRange, and BbParaNodesMerger::varIndexTable.
~BbParaNodesMerger | ( | ) |
Definition at line 174 of file bbParaNodesMerger.h.
void addNodeToMergeNodeStructs | ( | BbParaNode * | node | ) |
add a node to nodes merger
node | pointer to BbParaNode object to be merged |
Definition at line 45 of file bbParaNodesMerger.cpp.
References BbParaNodesMerger::addingNodeToMergeStructTime, DEFAULT_NUM_EPSILON, EPSEQ, BbParaMergeNodeInfo_::fixedVariables, BbParaNode::getDiffSubproblem(), ParaTimer::getElapsedTime(), BbParaFixedValue_::head, BbParaFixedVariable_::index, BbParaNodesMerger::instance, BbParaMergeNodeInfo_::keyIndex, BbParaMergeNodeInfo_::mergedDiffSubproblem, BbParaMergeNodeInfo_::mergedTo, BbParaNodesMerger::mergeInfoHead, BbParaNodesMerger::mergeInfoTail, BbParaFixedVariable_::mnode, BbParaNodesMerger::nBoundChangesOfBestNode, BbParaFixedValue_::next, BbParaMergeNodeInfo_::next, BbParaFixedVariable_::next, BbParaMergeNodeInfo_::nFixedVariables, BbParaMergeNodeInfo_::nMergedNodes, BbParaMergeNodeInfo_::nSameValueVariables, BbParaMergeNodeInfo_::origDiffSubproblem, BbParaMergeNodeInfo_::PARA_MERGING, BbParaMergeNodeInfo_::paraNode, BbParaNodesMerger::paraTimer, BbParaFixedVariable_::prev, BbParaNode::setMergeNodeInfo(), BbParaNode::setMergingStatus(), BbParaMergeNodeInfo_::status, BbParaFixedValue_::tail, BbParaFixedValue_::value, BbParaFixedVariable_::value, and BbParaNodesMerger::varIndexTable.
Referenced by BbParaLoadCoordinator::processTagTask(), and BbParaLoadCoordinator::warmStart().
void deleteMergeNodeInfo | ( | BbParaMergeNodeInfo * | mNode | ) |
delete merge node info
mNode | pointer to BbParaMergeNodeInfo object to be removed |
Definition at line 453 of file bbParaNodesMerger.cpp.
References BbParaNodesMerger::deleteMergeNodeInfo(), BbParaMergeNodeInfo_::fixedVariables, BbParaNode::getDualBoundValue(), BbParaNode::getMergeNodeInfo(), BbParaNode::getMergingStatus(), BbParaMergeNodeInfo_::keyIndex, BbParaMergeNodeInfo_::mergedDiffSubproblem, BbParaMergeNodeInfo_::mergedTo, BbParaFixedVariable_::next, BbParaMergeNodeInfo_::nFixedVariables, BbParaMergeNodeInfo_::nMergedNodes, BbParaMergeNodeInfo_::origDiffSubproblem, BbParaMergeNodeInfo_::PARA_DELETED, BbParaMergeNodeInfo_::PARA_MERGE_CHECKING_TO_OTHER_NODE, BbParaMergeNodeInfo_::PARA_MERGED_RPRESENTATIVE, BbParaMergeNodeInfo_::PARA_MERGING, BbParaMergeNodeInfo_::paraNode, BbParaFixedVariable_::prev, BbParaNode::setDiffSubproblem(), BbParaNode::setMergeNodeInfo(), BbParaNode::setMergingStatus(), and BbParaMergeNodeInfo_::status.
Referenced by BbParaNodesMerger::deleteMergeNodeInfo(), BbParaNodesMerger::generateMergeNodesCandidates(), BbParaNodesMerger::mergeNodes(), BbParaNodesMerger::regenerateMergeNodesCandidates(), and BbParaLoadCoordinator::sendParaTasksToIdleSolvers().
void generateMergeNodesCandidates | ( | ParaComm * | paraComm, |
ParaInitiator * | paraInitiator | ||
) |
generate merge nodes candidates
paraComm | pointer to paraComm object |
paraInitiator | pointer to ParaInitiatior object, this can be 0, if it is not |
Definition at line 191 of file bbParaNodesMerger.cpp.
References BbParaDiffSubproblem::createDiffSubproblem(), BbParaNodesMerger::deleteMergeNodeInfo(), BbParaSortedVariable_::fixedVariable, BbParaMergeNodeInfo_::fixedVariables, UG::FixedVariablesRatioInMerging, BbParaNodesMerger::generateMergeNodesCandidatesTime, BbParaNode::getDiffSubproblem(), ParaTimer::getElapsedTime(), BbParaNode::getMergeNodeInfo(), ParaParamSet::getRealParamValue(), BbParaInstance::getVarIndexRange(), BbParaSortedVariable_::idxInFixedVariabes, BbParaNodesMerger::instance, BbParaMergeNodeInfo_::keyIndex, BbParaMergeNodeInfo_::mergedDiffSubproblem, BbParaMergeNodeInfo_::mergedTo, BbParaNodesMerger::mergeInfoHead, BbParaNodesMerger::mergeInfoTail, BbParaFixedVariable_::mnode, BbParaNodesMerger::nBoundChangesOfBestNode, BbParaFixedValue_::next, BbParaMergeNodeInfo_::next, BbParaFixedVariable_::next, BbParaMergeNodeInfo_::nFixedVariables, BbParaMergeNodeInfo_::nMergedNodes, BbParaFixedVariable_::nSameValue, BbParaMergeNodeInfo_::nSameValueVariables, BbParaMergeNodeInfo_::origDiffSubproblem, BbParaMergeNodeInfo_::PARA_MERGE_CHECKING_TO_OTHER_NODE, BbParaMergeNodeInfo_::PARA_MERGED_RPRESENTATIVE, BbParaMergeNodeInfo_::PARA_MERGING, paraInitiator, BbParaMergeNodeInfo_::paraNode, BbParaNodesMerger::paraParamSet, BbParaNodesMerger::paraTimer, BbParaNode::setDiffSubproblem(), BbParaNode::setMergeNodeInfo(), BbParaNode::setMergingStatus(), BbParaMergeNodeInfo_::status, and BbParaNodesMerger::varIndexTable.
Referenced by BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaNodesMerger::regenerateMergeNodesCandidates(), and BbParaLoadCoordinator::warmStart().
double getAddingNodeToMergeStructTime | ( | ) |
getter of addingNodeToMergeStructTime
Definition at line 223 of file bbParaNodesMerger.h.
References BbParaNodesMerger::addingNodeToMergeStructTime.
Referenced by BbParaLoadCoordinator::writeLoadCoordinatorStatisticsToCheckpointFile().
double getGenerateMergeNodesCandidatesTime | ( | ) |
getter of generateMergeNodesCandidatesTime
Definition at line 233 of file bbParaNodesMerger.h.
References BbParaNodesMerger::generateMergeNodesCandidatesTime.
Referenced by BbParaLoadCoordinator::writeLoadCoordinatorStatisticsToCheckpointFile().
double getMergeNodeTime | ( | ) |
getter of mergeNodeTime
Definition at line 253 of file bbParaNodesMerger.h.
References BbParaNodesMerger::mergeNodeTime.
Referenced by BbParaLoadCoordinator::writeLoadCoordinatorStatisticsToCheckpointFile().
double getRegenerateMergeNodesCandidatesTime | ( | ) |
getter of regenerateMergeNodesCandidatesTime
Definition at line 243 of file bbParaNodesMerger.h.
References BbParaNodesMerger::regenerateMergeNodesCandidatesTime.
Referenced by BbParaLoadCoordinator::writeLoadCoordinatorStatisticsToCheckpointFile().
int mergeNodes | ( | BbParaNode * | node, |
BbParaNodePool * | paraNodePool | ||
) |
make a merge node
node | pointer to BbParaNode object which is the representative |
paraNodePool | pointer to BbParaNodePool object |
Definition at line 593 of file bbParaNodesMerger.cpp.
References BbParaNodesMerger::deleteMergeNodeInfo(), BbParaMergeNodeInfo_::fixedVariables, BbParaNode::getDiffSubproblem(), ParaTimer::getElapsedTime(), BbParaMergeNodeInfo_::keyIndex, BbParaMergeNodeInfo_::mergedDiffSubproblem, BbParaMergeNodeInfo_::mergedTo, BbParaNodesMerger::mergeNodeTime, BbParaFixedVariable_::next, BbParaMergedNodeListElement_::next, BbParaMergeNodeInfo_::nMergedNodes, BbParaMergedNodeListElement_::node, BbParaMergeNodeInfo_::origDiffSubproblem, BbParaMergeNodeInfo_::PARA_MERGED_RPRESENTATIVE, BbParaNodesMerger::paraTimer, BbParaNodePool::removeMergedNodes(), BbParaNode::setDiffSubproblem(), BbParaMergeNodeInfo_::status, and THROW_LOGICAL_ERROR4.
Referenced by BbParaLoadCoordinator::processTagAnotherNodeRequest(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), and BbParaLoadCoordinator::processTagSolverState().
void regenerateMergeNodesCandidates | ( | BbParaNode * | node, |
ParaComm * | paraComm, | ||
ParaInitiator * | paraInitiator | ||
) |
regenerate merge nodes candidates
node | pointer to BbParaNode object to be removed from this merger |
paraComm | pointer to paraComm object |
paraInitiator | pointer to ParaInitiatior object, this can be 0, if it is not |
Definition at line 391 of file bbParaNodesMerger.cpp.
References BbParaNodesMerger::deleteMergeNodeInfo(), BbParaMergeNodeInfo_::fixedVariables, BbParaNodesMerger::generateMergeNodesCandidates(), ParaTimer::getElapsedTime(), BbParaMergeNodeInfo_::keyIndex, BbParaMergeNodeInfo_::mergedDiffSubproblem, BbParaMergeNodeInfo_::mergedTo, BbParaNodesMerger::mergeInfoHead, BbParaNodesMerger::mergeInfoTail, BbParaMergeNodeInfo_::next, BbParaFixedVariable_::next, BbParaMergeNodeInfo_::origDiffSubproblem, BbParaMergeNodeInfo_::PARA_MERGE_CHECKING_TO_OTHER_NODE, BbParaMergeNodeInfo_::PARA_MERGED_RPRESENTATIVE, BbParaMergeNodeInfo_::PARA_MERGING, paraInitiator, BbParaMergeNodeInfo_::paraNode, BbParaNodesMerger::paraTimer, BbParaNodesMerger::regenerateMergeNodesCandidatesTime, BbParaNode::setDiffSubproblem(), BbParaNode::setMergingStatus(), and BbParaMergeNodeInfo_::status.
Referenced by BbParaLoadCoordinator::processTagCompletionOfCalculation().
|
private |
accumulate time to add Node to merge struct
Definition at line 136 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::addNodeToMergeNodeStructs(), and BbParaNodesMerger::getAddingNodeToMergeStructTime().
|
private |
accumulate time to generate merge nodes candidates
Definition at line 137 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::generateMergeNodesCandidates(), and BbParaNodesMerger::getGenerateMergeNodesCandidatesTime().
|
private |
pointer to ParaInstance object
Definition at line 130 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::addNodeToMergeNodeStructs(), and BbParaNodesMerger::generateMergeNodesCandidates().
|
private |
head of BbParaMergeNodeInfo list
Definition at line 133 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::addNodeToMergeNodeStructs(), BbParaNodesMerger::BbParaNodesMerger(), BbParaNodesMerger::generateMergeNodesCandidates(), and BbParaNodesMerger::regenerateMergeNodesCandidates().
|
private |
tail of BbParaMergeNodeInfo list times
Definition at line 134 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::addNodeToMergeNodeStructs(), BbParaNodesMerger::BbParaNodesMerger(), BbParaNodesMerger::generateMergeNodesCandidates(), and BbParaNodesMerger::regenerateMergeNodesCandidates().
|
private |
accumulate time to make a merged node
Definition at line 139 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::getMergeNodeTime(), and BbParaNodesMerger::mergeNodes().
|
private |
bound changes of the best node
Definition at line 128 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::addNodeToMergeNodeStructs(), and BbParaNodesMerger::generateMergeNodesCandidates().
|
private |
pointer to ParaParamSet object
Definition at line 131 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::generateMergeNodesCandidates().
|
private |
normal timer used
Definition at line 129 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::addNodeToMergeNodeStructs(), BbParaNodesMerger::generateMergeNodesCandidates(), BbParaNodesMerger::mergeNodes(), and BbParaNodesMerger::regenerateMergeNodesCandidates().
|
private |
accumulate time to regenerate merge nodes candidates
Definition at line 138 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::getRegenerateMergeNodesCandidatesTime(), and BbParaNodesMerger::regenerateMergeNodesCandidates().
|
private |
variable index range
Definition at line 127 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::BbParaNodesMerger().
|
private |
variable indices table.
Definition at line 132 of file bbParaNodesMerger.h.
Referenced by BbParaNodesMerger::addNodeToMergeNodeStructs(), BbParaNodesMerger::BbParaNodesMerger(), and BbParaNodesMerger::generateMergeNodesCandidates().