Base class of communicator object. More...
#include <paraComm.h>
Public Member Functions | |
ParaComm () | |
default constructor of ParaComm More... | |
virtual | ~ParaComm () |
destructor of ParaComm More... | |
virtual void | init (int argc, char **argv)=0 |
initializer of this object More... | |
virtual int | getRank ()=0 |
get rank of this process or this thread depending on run-time environment More... | |
virtual int | getSize ()=0 |
get number of UG processes or UG threads depending on run-time environment More... | |
virtual int | getNumOfMessagesWaitingToSend (int dest)=0 |
get size of the messageQueueTable More... | |
virtual void | lcInit (ParaParamSet *paraParamSet)=0 |
special initializer when this object is used in LoadCoordinator More... | |
virtual void | solverInit (ParaParamSet *paraParamSet)=0 |
special initializer when this object is used in Solver More... | |
virtual void | setLocalRank (int inRank) |
virtual void | abort ()=0 |
abort function for this communicator (how to abort depends on which library used for communication) More... | |
virtual bool | waitTerminatedMessage ()=0 |
function to wait Terminated message (This function is not used currently) More... | |
virtual bool | waitToken (int rank) |
wait token when UG runs with deterministic mode More... | |
virtual void | passToken (int rank) |
pass token to from the rank to the next More... | |
virtual bool | passTermToken (int rank) |
pass termination token from the rank to the next More... | |
virtual void | setToken (int rank, int *token) |
set received token to this communicator More... | |
virtual void | lockApp ()=0 |
lock UG application to synchronize with other threads More... | |
virtual void | lockApp (char const *f, int l) |
lock UG application to synchronize with other threads (for debug) More... | |
virtual void | unlockApp ()=0 |
unlock UG application to synchronize with other threads More... | |
virtual void | unlockApp (char const *f, int l) |
unlock UG application to synchronize with other threads (for debug) More... | |
virtual ParaCalculationState * | createParaCalculationState ()=0 |
transfer object factory More... | |
virtual ParaRacingRampUpParamSet * | createParaRacingRampUpParamSet ()=0 |
create ParaRacingRampUpParamSet object More... | |
virtual ParaTask * | createParaTask ()=0 |
create ParaTask object by default constructor More... | |
virtual ParaParamSet * | createParaParamSet ()=0 |
create ParaParamSet object More... | |
virtual ParaSolverState * | createParaSolverState ()=0 |
create ParaSolverState object by default constructor More... | |
virtual ParaSolverTerminationState * | createParaSolverTerminationState ()=0 |
create ParaSolverTerminationState object by default constructor More... | |
virtual ParaTimer * | createParaTimer ()=0 |
create ParaTimer object More... | |
virtual ParaInstance * | createParaInstance ()=0 |
create ParaInstance object by default constructor More... | |
virtual ParaSolution * | createParaSolution ()=0 |
create ParaSolution object by default constructor More... | |
virtual ParaDiffSubproblem * | createParaDiffSubproblem () |
create ParaDiffSubproblem object by default constructor More... | |
virtual int | bcast (void *buffer, int count, const int datatypeId, int root)=0 |
Some action need to be taken for fault tolerant, when the functions return. So, they rerun status value. More... | |
virtual int | send (void *bufer, int count, const int datatypeId, int dest, const int tag)=0 |
send function for standard ParaData types More... | |
virtual int | receive (void *bufer, int count, const int datatypeId, int source, const int tag)=0 |
receive function for standard ParaData types More... | |
virtual void | waitSpecTagFromSpecSource (const int source, const int tag, int *receivedTag)=0 |
wait function for a specific tag from a specific source coming from More... | |
virtual bool | probe (int *source, int *tag)=0 |
No need to take action for fault tolerant, when the functions return. So, they do not rerun status value. More... | |
virtual bool | iProbe (int *source, int *tag)=0 |
iProbe function which checks if a new message is arrived or not More... | |
virtual const char * | getTagString (int tag)=0 |
get Tag string for debugging More... | |
Base class of communicator object.
Definition at line 101 of file paraComm.h.
ParaComm | ( | ) |
default constructor of ParaComm
Definition at line 108 of file paraComm.h.
|
virtual |
destructor of ParaComm
Definition at line 116 of file paraComm.h.
References ParaComm::getNumOfMessagesWaitingToSend(), ParaComm::getRank(), ParaComm::getSize(), ParaComm::init(), ParaComm::lcInit(), paraParamSet, and ParaComm::solverInit().
|
pure virtual |
abort function for this communicator (how to abort depends on which library used for communication)
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::setLocalRank().
|
pure virtual |
Some action need to be taken for fault tolerant, when the functions return. So, they rerun status value.
broadcast function for standard ParaData types
buffer | point to the head of sending message |
count | the number of data in the message |
datatypeId | data type in the message |
root | root rank for broadcasting |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::createParaDiffSubproblem(), and ScipParaSolver::ScipParaSolver().
|
pure virtual |
transfer object factory
create ParaCalculationState object by default constructor
Implemented in BbParaCommMpi, BbParaCommCPP11, and BbParaCommPth.
Referenced by BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState(), and ParaComm::unlockApp().
|
virtual |
create ParaDiffSubproblem object by default constructor
Reimplemented in ScipParaCommMpi.
Definition at line 332 of file paraComm.h.
References ParaComm::bcast(), ParaComm::getTagString(), ParaComm::iProbe(), ParaComm::probe(), ParaComm::receive(), ParaComm::send(), THROW_LOGICAL_ERROR1, and ParaComm::waitSpecTagFromSpecSource().
Referenced by ScipParaDiffSubproblem::createDiffSubproblem().
|
pure virtual |
create ParaInstance object by default constructor
Implemented in ScipParaCommMpi.
Referenced by ScipParaSolver::reinitialize(), and ParaComm::unlockApp().
|
pure virtual |
create ParaParamSet object
Implemented in ScipParaCommMpi.
Referenced by ParaComm::unlockApp().
|
pure virtual |
create ParaRacingRampUpParamSet object
Implemented in BbParaCommMpi, BbParaCommCPP11, BbParaCommPth, and ScipParaCommMpi.
Referenced by BbParaSolver::processTagWinnerRacingRampUpParamSet(), BbParaLoadCoordinator::sendParaTasksToIdleSolvers(), and ParaComm::unlockApp().
|
pure virtual |
create ParaSolution object by default constructor
Implemented in ScipParaCommMpi.
Referenced by BbParaSolver::processTagSolution(), BbParaLoadCoordinator::processTagSolution(), ScipParaSolver::ScipParaSolver(), and ParaComm::unlockApp().
|
pure virtual |
create ParaSolverState object by default constructor
Implemented in BbParaCommMpi, BbParaCommCPP11, and BbParaCommPth.
Referenced by BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagSolverState(), and ParaComm::unlockApp().
|
pure virtual |
create ParaSolverTerminationState object by default constructor
Implemented in BbParaCommMpi, BbParaCommCPP11, and BbParaCommPth.
Referenced by BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSelfSplitTermStateForInterruption(), ParaLoadCoordinator::processTagTerminated(), BbParaLoadCoordinator::processTagTermStateForInterruption(), BbParaLoadCoordinator::sendParaTasksToIdleSolvers(), and ParaComm::unlockApp().
|
pure virtual |
create ParaTask object by default constructor
Implemented in BbParaCommMpi, BbParaCommCPP11, and BbParaCommPth.
Referenced by BbParaLoadCoordinator::processTagNewSubtreeRootNode(), BbParaLoadCoordinator::processTagReassignSelfSplitSubtreeRootNode(), BbParaLoadCoordinator::processTagSubtreeRootNodeStartComputation(), BbParaLoadCoordinator::processTagSubtreeRootNodeToBeRemoved(), BbParaLoadCoordinator::processTagTask(), BbParaSolver::restartRacing(), BbParaSolver::run(), ParaComm::unlockApp(), and BbParaInitiator::~BbParaInitiator().
|
pure virtual |
create ParaTimer object
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaSolver::ParaSolver(), and ParaComm::unlockApp().
|
pure virtual |
get size of the messageQueueTable
dest | destination of message |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::~ParaComm().
|
pure virtual |
get rank of this process or this thread depending on run-time environment
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by BbParaLoadCoordinator::BbParaLoadCoordinator(), ScipDiffParamSetMpi::bcast(), ScipParaSolutionMpi::bcast(), ScipParaDiffSubproblemMpi::bcast(), BbParaLoadCoordinator::changeSearchStrategyOfAllSolversToOriginalSearch(), ScipParaSolver::createSubproblem(), ScipParaSolver::dropSettingsForVariableBoundsExchnage(), ParaSolver::getRank(), BbParaSolver::getRank(), BbParaSolver::iReceiveMessages(), BbParaSolver::keepParaNode(), ParaLoadCoordinator::ParaLoadCoordinator(), ParaSolver::ParaSolver(), BbParaSolver::processTagRampUp(), BbParaLoadCoordinator::processTagSolution(), BbParaLoadCoordinator::processTagTask(), BbParaSolver::processTagToken(), BbParaSolver::processTagWinnerRacingRampUpParamSet(), BbParaSolver::receiveNewTaskAndReactivate(), ScipParaSolver::recoverOriginalSettings(), BbParaSolver::run(), ScipParaSolver::saveOriginalSettings(), ScipParaObjCommPointHdlr::scip_exec(), ScipParaInterruptMsgMonitor::ScipParaInterruptMsgMonitor(), ScipParaSolver::ScipParaSolver(), BbParaSolver::sendCompletionOfCalculation(), BbParaSolver::sendCompletionOfCalculationWithoutSolving(), ScipParaObjCommPointHdlr::sendNode(), BbParaSolver::sendParaNode(), BbParaLoadCoordinator::sendParaTasksToIdleSolvers(), BbParaSolver::sendSolverTerminationState(), ScipParaSolver::setBakSettings(), ScipParaSolver::solve(), ScipParaSolver::writeSubproblem(), ParaComm::~ParaComm(), and ScipParaSolver::~ScipParaSolver().
|
pure virtual |
get number of UG processes or UG threads depending on run-time environment
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by BbParaLoadCoordinator::BbParaLoadCoordinator(), BbParaLoadCoordinator::changeSearchStrategyOfAllSolversToOriginalSearch(), BbParaLoadCoordinator::newRacing(), ScipParaDeterministicTimer::normalize(), ParaRacingSolverPool::ParaRacingSolverPool(), ParaSolver::ParaSolver(), ParaSolverPool::ParaSolverPool(), ParaLoadCoordinator::processTagToken(), BbParaLoadCoordinator::run(), ScipParaSolver::ScipParaSolver(), BbParaLoadCoordinator::sendCutOffValue(), BbParaLoadCoordinator::sendIncumbentValue(), BbParaLoadCoordinator::sendInterruptRequest(), BbParaLoadCoordinator::sendParaTasksToIdleSolvers(), ParaLoadCoordinator::sendRampUpToAllSolvers(), BbParaLoadCoordinator::sendRetryRampUpToAllSolvers(), ParaLoadCoordinator::sendTagToAllSolvers(), BbParaLoadCoordinator::terminateAllSolvers(), ParaLoadCoordinator::terminateAllSolvers(), and ParaComm::~ParaComm().
|
pure virtual |
get Tag string for debugging
tag | tag to be converted to string |
Implemented in ParaCommPth, ParaCommCPP11, ParaCommMpi, BbParaCommMpi, BbParaCommCPP11, BbParaCommPth, and ScipParaCommMpi.
Referenced by ParaComm::createParaDiffSubproblem().
|
pure virtual |
initializer of this object
argc | number of arguments |
argv | pointers to the arguments |
Implemented in ParaCommPth, ParaCommCPP11, ParaCommMpi, and ScipParaCommMpi.
Referenced by ParaComm::~ParaComm().
|
pure virtual |
iProbe function which checks if a new message is arrived or not
source | source rank of the message arrived |
tag | tag of the message arrived |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::createParaDiffSubproblem(), and BbParaSolver::iReceiveMessages().
|
pure virtual |
special initializer when this object is used in LoadCoordinator
paraParamSet | UG parameter set |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::~ParaComm().
|
pure virtual |
lock UG application to synchronize with other threads
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::lockApp(), ScipParaSolver::ScipParaSolver(), ParaComm::setToken(), and ParaCommMpi::setToken().
|
virtual |
lock UG application to synchronize with other threads (for debug)
f | string to indicate what is locked |
l | a number to show something |
Reimplemented in ParaCommPth, and ParaCommCPP11.
Definition at line 238 of file paraComm.h.
References ParaComm::lockApp(), and ParaComm::unlockApp().
|
virtual |
pass termination token from the rank to the next
rank | from this rank, the termination token is passed |
Reimplemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Definition at line 211 of file paraComm.h.
Referenced by ScipParaSolver::~ScipParaSolver().
|
virtual |
pass token to from the rank to the next
rank | from this rank, the token is passed |
Reimplemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Definition at line 201 of file paraComm.h.
Referenced by BbParaSolver::passToken().
|
pure virtual |
No need to take action for fault tolerant, when the functions return. So, they do not rerun status value.
probe function which waits a new message
source | source rank of the message arrived |
tag | tag of the message arrived |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::createParaDiffSubproblem(), BbParaSolver::receiveNewTaskAndReactivate(), BbParaLoadCoordinator::run(), BbParaSolver::sendCompletionOfCalculation(), and BbParaLoadCoordinator::~BbParaLoadCoordinator().
|
pure virtual |
receive function for standard ParaData types
bufer | point to the head of receiving message |
count | the number of data in the message |
datatypeId | data type in the message |
source | source of the message coming from |
tag | tag of the message |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::createParaDiffSubproblem(), BbParaSolver::iReceiveMessages(), ScipParaSolver::lbBoundTightened(), BbParaLoadCoordinator::processTagAllowToBeInCollectingMode(), BbParaLoadCoordinator::processTagAnotherNodeRequest(), BbParaSolver::processTagBreaking(), BbParaSolver::processTagCollectAllNodes(), BbParaSolver::processTagCutOffValue(), BbParaSolver::processTagGivenGapIsReached(), BbParaSolver::processTagGlobalBestDualBoundValueAtWarmStart(), ParaLoadCoordinator::processTagHardTimeLimit(), BbParaSolver::processTagInCollectingMode(), BbParaSolver::processTagIncumbentValue(), BbParaSolver::processTagInterruptRequest(), BbParaSolver::processTagKeepRacing(), BbParaLoadCoordinator::processTagLbBoundTightened(), BbParaSolver::processTagLCBestBoundValue(), BbParaSolver::processTagLightWeightRootNodeProcess(), BbParaSolver::processTagNoNodes(), BbParaSolver::processTagNoTestDualBoundGain(), BbParaSolver::processTagNotificationId(), BbParaSolver::processTagNoWaitModeSend(), BbParaSolver::processTagOutCollectingMode(), BbParaSolver::processTagRampUp(), BbParaSolver::processTagRestart(), BbParaSolver::processTagRetryRampUp(), BbParaLoadCoordinator::processTagSelfSplitFinished(), BbParaSolver::processTagTaskReceived(), BbParaSolver::processTagTerminateRequest(), BbParaSolver::processTagTerminateSolvingToRestart(), BbParaSolver::processTagTestDualBoundGain(), BbParaSolver::processTagToken(), ParaLoadCoordinator::processTagToken(), BbParaLoadCoordinator::processTagUbBoundTightened(), BbParaSolver::processTagWinner(), ScipParaSolver::ubBoundTightened(), and BbParaSolver::waitAckCompletion().
|
pure virtual |
send function for standard ParaData types
bufer | point to the head of sending message |
count | the number of data in the message |
datatypeId | data type in the message |
dest | destination to send the message |
tag | tag of this message |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by BbParaLoadCoordinator::changeSearchStrategyOfAllSolversToOriginalSearch(), ParaComm::createParaDiffSubproblem(), BbParaLoadCoordinator::newRacing(), BbParaSolver::notifySelfSplitFinished(), BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation(), BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagAnotherNodeRequest(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagLbBoundTightened(), BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState(), BbParaLoadCoordinator::processTagSelfSplitTermStateForInterruption(), BbParaLoadCoordinator::processTagSolverState(), BbParaLoadCoordinator::processTagTask(), ParaLoadCoordinator::processTagTerminated(), BbParaLoadCoordinator::processTagTermStateForInterruption(), ParaLoadCoordinator::processTagToken(), BbParaLoadCoordinator::processTagUbBoundTightened(), BbParaLoadCoordinator::run(), ScipParaObjCommPointHdlr::scip_exec(), BbParaSolver::sendAnotherNodeRequest(), BbParaLoadCoordinator::sendCutOffValue(), BbParaLoadCoordinator::sendIncumbentValue(), BbParaLoadCoordinator::sendInterruptRequest(), BbParaLoadCoordinator::sendParaTasksToIdleSolvers(), ParaLoadCoordinator::sendRampUpToAllSolvers(), BbParaLoadCoordinator::sendRetryRampUpToAllSolvers(), ParaLoadCoordinator::sendTagToAllSolvers(), BbParaLoadCoordinator::terminateAllSolvers(), and ParaLoadCoordinator::terminateAllSolvers().
|
virtual |
Reimplemented in ParaCommCPP11.
Definition at line 166 of file paraComm.h.
References ParaComm::abort(), and ParaComm::waitTerminatedMessage().
Referenced by ScipParaInterruptMsgMonitor::run().
|
virtual |
set received token to this communicator
rank | rank to set the token |
token | token to be set |
Reimplemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Definition at line 221 of file paraComm.h.
References ParaComm::lockApp().
Referenced by BbParaSolver::processTagToken(), and ParaLoadCoordinator::processTagToken().
|
pure virtual |
special initializer when this object is used in Solver
paraParamSet | UG parameter set |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::~ParaComm().
|
pure virtual |
unlock UG application to synchronize with other threads
Implemented in ParaCommCPP11, ParaCommPth, and ParaCommMpi.
Referenced by ParaComm::lockApp(), ParaCommMpi::lockApp(), ScipParaSolver::ScipParaSolver(), and ParaComm::unlockApp().
|
virtual |
unlock UG application to synchronize with other threads (for debug)
f | string to indicate what is locked |
l | a number to show something |
Reimplemented in ParaCommCPP11.
Definition at line 253 of file paraComm.h.
References ParaComm::createParaCalculationState(), ParaComm::createParaInstance(), ParaComm::createParaParamSet(), ParaComm::createParaRacingRampUpParamSet(), ParaComm::createParaSolution(), ParaComm::createParaSolverState(), ParaComm::createParaSolverTerminationState(), ParaComm::createParaTask(), ParaComm::createParaTimer(), and ParaComm::unlockApp().
|
pure virtual |
wait function for a specific tag from a specific source coming from
source | source rank which the message should come from |
tag | tag which the message should wait |
receivedTag | tag of the message which is arrived |
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::createParaDiffSubproblem(), BbParaSolver::sendParaNode(), BbParaSolver::waitAckCompletion(), and BbParaSolver::waitNotificationIdMessage().
|
pure virtual |
function to wait Terminated message (This function is not used currently)
Implemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Referenced by ParaComm::setLocalRank().
|
virtual |
wait token when UG runs with deterministic mode
rank | rank to check if token is arrived |
Reimplemented in ParaCommPth, ParaCommCPP11, and ParaCommMpi.
Definition at line 191 of file paraComm.h.
Referenced by BbParaSolver::waitToken().