Scippy

UG

Ubiquity Generator framework

ScipParaLoadCoordinator Class Reference

Class for LoadCoordinator. More...

#include <scipParaLoadCoordinator.h>

Inheritance diagram for ScipParaLoadCoordinator:
BbParaLoadCoordinator ParaLoadCoordinator

Public Member Functions

 ScipParaLoadCoordinator (UG::ParaComm *inComm, UG::ParaParamSet *inParaParamSet, UG::ParaInitiator *inParaInitiator, bool *inRacingSolversExist, UG::ParaTimer *inParaTimer, UG::ParaDeterministicTimer *inDetTimer)
 constructor More...
 
 ScipParaLoadCoordinator (int inNhanders, UG::ParaComm *inComm, UG::ParaParamSet *inParaParamSet, UG::ParaInitiator *paraInitiator, bool *racingSolversExist, UG::ParaTimer *paraTimer, UG::ParaDeterministicTimer *detTimer)
 constructor More...
 
virtual ~ScipParaLoadCoordinator ()
 destructor More...
 
- Public Member Functions inherited from BbParaLoadCoordinator
 BbParaLoadCoordinator (int inNhanders, ParaComm *inComm, ParaParamSet *inParaParamSet, ParaInitiator *paraInitiator, bool *racingSolversExist, ParaTimer *paraTimer, ParaDeterministicTimer *detTimer)
 constructor More...
 
virtual ~BbParaLoadCoordinator ()
 destructor More...
 
virtual void warmStart ()
 warm start (restart) More...
 
virtual void run (ParaTask *paraNode)
 run for normal ramp-up More...
 
virtual void run (ParaTask *paraNode, int nRacingSolvers, ParaRacingRampUpParamSet **racingRampUpParams)
 run for racing ramp-up More...
 
void setGlobalBestIncumbentSolution (ParaSolution *sol)
 set global best incumbent solution More...
 
- Public Member Functions inherited from ParaLoadCoordinator
 ParaLoadCoordinator (int nHandlers, ParaComm *inComm, ParaParamSet *inParaParamSet, ParaInitiator *paraInitiator, bool *racingSolversExist, ParaTimer *paraTimer, ParaDeterministicTimer *detTimer)
 constructor More...
 
virtual ~ParaLoadCoordinator ()
 destructor More...
 
virtual void interrupt ()
 interrupt from out side More...
 
virtual void warmStart ()
 warm start (restart) More...
 
virtual void run (ParaTask *paraTask)
 run for normal ramp-up More...
 
virtual void run (ParaTask *paraTask, int nRacingSolvers, ParaRacingRampUpParamSet **racingRampUpParams)
 run for racing ramp-up More...
 
virtual void parallelDispatch ()
 execute UG parallel solver totally solver dependent way More...
 

Private Types

typedef int(ScipParaLoadCoordinator::* ScipMessageHandlerFunctionPointer) (int, int)
 

Private Member Functions

int processTagInitialStat (int source, int tag)
 Message handlers. More...
 

Additional Inherited Members

- Protected Types inherited from BbParaLoadCoordinator
typedef int(UG::BbParaLoadCoordinator::* BbMessageHandlerFunctionPointer) (int, int)
 
- Protected Types inherited from ParaLoadCoordinator
typedef int(UG::ParaLoadCoordinator::* MessageHandlerFunctionPointer) (int, int)
 
- Protected Member Functions inherited from BbParaLoadCoordinator
void terminateAllSolvers ()
 terminate all solvers More...
 
virtual void sendRetryRampUpToAllSolvers ()
 notify retry ramp-up to all solvers More...
 
virtual void sendInterruptRequest ()
 send interrupt request to all solvers More...
 
virtual bool updateSolution (BbParaSolution *)
 update incumbent solution More...
 
virtual void sendIncumbentValue (int receivedRank)
 send incumbent value More...
 
virtual void sendCutOffValue (int receivedRank)
 send cut off value More...
 
virtual int processTagTask (int source, int tag)
 Message handlers. More...
 
virtual int processTagSolution (int source, int tag)
 function to process TagSolution message More...
 
virtual int processTagSolverState (int source, int tag)
 function to process TagSolverState message More...
 
virtual int processTagCompletionOfCalculation (int source, int tag)
 function to process TagCompletionOfCalculation message More...
 
virtual int processTagTermStateForInterruption (int source, int tag)
 function to process TagTermStateForInterruption message More...
 
virtual int processTagAnotherNodeRequest (int source, int tag)
 function to process TagAnotherNodeRequest message More...
 
virtual int processTagAllowToBeInCollectingMode (int source, int tag)
 function to process TagAllowToBeInCollectingMode message More...
 
virtual int processTagLbBoundTightened (int source, int tag)
 function to process TagLbBoundTightened message More...
 
virtual int processTagUbBoundTightened (int source, int tag)
 function to process TagUbBoundTightened message More...
 
virtual int processTagSelfSplitFinished (int source, int tag)
 function to process TagSelfSplitFinished message More...
 
virtual int processTagNewSubtreeRootNode (int source, int tag)
 function to process TagNewSubtreeRootNode message More...
 
virtual int processTagSubtreeRootNodeStartComputation (int source, int tag)
 function to process TagSubtreeRootNodeStartComputation message More...
 
virtual int processTagSubtreeRootNodeToBeRemoved (int source, int tag)
 function to process TagSubtreeRootNodeToBeRemoved message More...
 
virtual int processTagReassignSelfSplitSubtreeRootNode (int source, int tag)
 function to process TagReassignSelfSplitSubtreeRootNode message More...
 
virtual int processTagSelfSlpitNodeCalcuationState (int source, int tag)
 function to process TagSelfSlpitNodeCalcuationState message More...
 
virtual int processTagSelfSplitTermStateForInterruption (int source, int tag)
 function to process TagSelfSplitTermStateForInterruption message More...
 
virtual int processRacingRampUpTagSolverState (int source, int tag)
 message handlers specialized for racing ramp-up More...
 
virtual int processRacingRampUpTagCompletionOfCalculation (int source, int tag)
 function to process TagCompletionOfCalculation message in racing ramp-up stage More...
 
virtual void run ()
 run function to start main process More...
 
virtual void updateCheckpointFiles ()
 function to update checkpoint files More...
 
virtual void writeLoadCoordinatorStatisticsToCheckpointFile (gzstream::ogzstream &loadCoordinatorStatisticsStream, int nSolverInfo, double globalBestDualBoundValue, double externalGlobalBestDualBoundValue)
 write LoadCorrdinator statistics to checkpoint file More...
 
virtual void writePreviousStatisticsInformation ()
 write previous run's statistics information More...
 
virtual bool sendParaTasksToIdleSolvers ()
 send ParaNodes to idle solvers More...
 
virtual void inactivateRacingSolverPool (int rank)
 inactivate racing solver pool More...
 
virtual void outputTabularSolvingStatusHeader ()
 output tabular solving status header More...
 
virtual void outputTabularSolvingStatus (char incumbent)
 output solving status in tabular form More...
 
virtual void writeSubtreeInfo (int source, ParaCalculationState *calcState)
 write subtree info. More...
 
virtual void restartInRampDownPhase ()
 restart in ramp-down phase More...
 
virtual int restartRacing ()
 restart racing More...
 
virtual void newRacing ()
 start a new racing More...
 
virtual void changeSearchStrategyOfAllSolversToBestBoundSearch ()
 change search strategy of all solvers to best bound bound search strategy More...
 
virtual void changeSearchStrategyOfAllSolversToOriginalSearch ()
 change search strategy of all solvers to original search strategy More...
 
virtual bool isRacingStage ()
 check if current stage is in racing or not More...
 
virtual bool isGapReached ()
 check if Gap reached or not More...
 
- Protected Member Functions inherited from ParaLoadCoordinator
virtual void writeTransferLog (int rank, ParaCalculationState *state)
 write transfer log More...
 
virtual void writeTransferLog (int rank)
 write transfer log More...
 
virtual void writeTransferLogInRacing (int rank, ParaCalculationState *state)
 write transfer log in racing More...
 
virtual void writeTransferLogInRacing (int rank)
 write transfer log in racing More...
 
virtual void sendRampUpToAllSolvers ()
 notify ramp-up to all solvers More...
 
virtual void sendRetryRampUpToAllSolvers ()
 notify retry ramp-up to all solvers (Maybe, this remove from this base class) More...
 
virtual void sendInterruptRequest ()=0
 send interrupt request to all solvers More...
 
virtual void terminateAllSolvers ()
 terminate all solvers More...
 
int createNewGlobalSubtreeId ()
 create a new global subtree Id More...
 
virtual int processTagTask (int source, int tag)=0
 Message handlers. More...
 
virtual int processTagSolution (int source, int tag)=0
 function to process TagSolution message More...
 
virtual int processTagSolverState (int source, int tag)=0
 function to process TagSolverState message More...
 
virtual int processTagCompletionOfCalculation (int source, int tag)=0
 function to process TagCompletionOfCalculation message More...
 
virtual int processTagTerminated (int source, int tag)
 function to process TagTerminated message More...
 
virtual int processTagHardTimeLimit (int source, int tag)
 function to process TagHardTimeLimit message More...
 
virtual int processTagToken (int source, int tag)
 function to process TagToken message More...
 
virtual int processRacingRampUpTagSolverState (int source, int tag)=0
 message handlers specialized for racing ramp-up More...
 
virtual int processRacingRampUpTagCompletionOfCalculation (int source, int tag)=0
 function to process TagCompletionOfCalculation message in racing ramp-up stage More...
 
void sendTagToAllSolvers (const int tag)
 send specified tag to all solvers More...
 
virtual void run ()=0
 run function to start main process More...
 
virtual bool sendParaTasksToIdleSolvers ()=0
 send ParaTasks to idle solvers More...
 
virtual void updateCheckpointFiles ()=0
 function to update checkpoint files More...
 
- Protected Attributes inherited from BbParaLoadCoordinator
bool initialNodesGenerated
 indicates that initial nodes have been generated More...
 
int firstCollectingModeState
 status of first collecting mode -1 : have not been in collecting mode 0 : once in collecting mode 1 : collecting mode is terminated once More...
 
bool isCollectingModeRestarted
 this flag indicate if a collecting mode is restarted or not More...
 
bool isBreakingFinised
 indicate that breaking is finished or not if bootstrap ramp-up is not specified, this flag should be always true More...
 
int breakingSolverId
 all nodes collecting solver Id: -1: no collecting More...
 
int nReplaceToBetterNode
 the number of replacing to a better nodes More...
 
int nNormalSelection
 number of normal node selection to a random node selection More...
 
bool winnerSolverNodesCollected
 indicate that all winner solver nodes has been collected More...
 
bool primalUpdated
 indicate that primal solution was updated or not More...
 
bool restartingRacing
 indicate that racing ramp-up is restarting More...
 
int nRestartedRacing
 number of racing stages restarted More...
 
BbParaNodePoolparaNodePool
 Pools in LoadCorrdinator. More...
 
BbParaLoadCoordinatorTerminationState lcts
 LoadCoordinatorTerminationState: counters and times. More...
 
double statEmptyNodePoolTime
 To measure how long does node pool stay in empty situation. More...
 
int minDepthInWinnerSolverNodes
 racing winner information More...
 
int maxDepthInWinnerSolverNodes
 maximum depth of open nodes in the winner solver tree More...
 
bool merging
 for merging nodes More...
 
int nBoundChangesOfBestNode
 the number of fixed variables of the best node The followings are used temporary to generate merge nodes info More...
 
BbParaNodesMergernodesMerger
 pointer to nodes merger object, which merges nodes More...
 
size_t nCollectedSolvers
 counter to check if all solvers are terminated or not More...
 
double previousTabularOutputTime
 to keep tabular solving status output time More...
 
double averageDualBoundGain
 average dual bound gain: could be negative value at restart More...
 
int nAverageDualBoundGain
 number of nodes whose dual bound gain are counted More...
 
std::deque< double > lastSeveralDualBoundGains
 keep last several dual bound gains More...
 
double averageLastSeveralDualBoundGains
 average dual bound gains of last several ones More...
 
double starvingTime
 start time of starving active solvers More...
 
double hugeImbalanceTime
 start time of huge imbalance situation More...
 
BbParaNodePoolparaNodePoolToRestart
 ParaNode pool to restart in ramp-down phase. More...
 
BbParaNodePoolparaNodePoolBufferToRestart
 ParaNode pool for buffering ParaNodes in huge imbalance situation. More...
 
BbParaNodePoolparaNodePoolBufferToGenerateCPF
 This is used for GenerateReducedCheckpointFiles. More...
 
BbParaNodePoolparaNodeToKeepCheckpointFileNodes
 The first n nodes may always keep in checkpoint file, that is, the n nodes are not processed in this run. More...
 
BbParaNodePoolunprocessedParaNodes
 The last n nodes may always keep in checkpoint file, that is, the n nodes are not processed in this run. More...
 
std::set< int > * selfSplitFinisedSolvers
 indicate selfSplit finished solvers More...
 
bool outputTabularSolvingStatusFlag
 output streams and flags which indicate the output is specified or not More...
 
std::ofstream ofsTabularSolvingStatus
 ofstream for solving status in tabular form More...
 
std::ostream * osTabularSolvingStatus
 ostream for solving status in tabular form to switch output location More...
 
bool logSubtreeInfoFlag
 indicate if subtree info. is logged or not More...
 
std::ofstream ofsLogSubtreeInfo
 ofstream for subtree info. More...
 
std::ostream * osLogSubtreeInfo
 ostram for subtree info. to switch output location More...
 
bool allCompInfeasibleAfterSolution
 indicate that all computations are infeasible after a feasible solution More...
 
double minmalDualBoundNormalTermSolvers
 minimal dual bound for normal termination solvers More...
 
bool warmStartNodeTransferring
 indicate that the first node transferring at warm start (restart) More...
 
bool hugeImbalance
 indicate that a huge imbalance in solvers is detected More...
 
bool isHeaderPrinted
 indicate if heeader is printed or not More...
 
bool givenGapIsReached
 shows if specified gap is reached or not More...
 
bool aSolverTerminatedWithOptimality
 indicate if a solver terminated with proving optimality of the problem More...
 
BbParaSolutionpendingSolution
 pending solution during merging More...
 
- Protected Attributes inherited from ParaLoadCoordinator
int nHandlers
 number of valid handlers More...
 
MessageHandlerFunctionPointermessageHandler
 message handlers table for primary phase More...
 
MessageHandlerFunctionPointerracingRampUpMessageHandler
 message handlers table for racing stage More...
 
int globalSubtreeIdGen
 global subtree id generator More...
 
ParaCommparaComm
 communicator used More...
 
ParaParamSetparaParams
 UG parameter set. More...
 
ParaInitiatorparaInitiator
 initiator More...
 
bool * racingSolversExist
 indicate if racing solver exits or not, true: exists More...
 
bool restarted
 indicates that this run is restarted from checkpoint files More...
 
RunningPhase runningPhase
 status of LoadCoordinator More...
 
bool computationIsInterrupted
 indicate that current computation is interrupted or not More...
 
bool interruptedFromControlTerminal
 interrupted from control terminal More...
 
bool hardTimeLimitIsReached
 indicate that hard time limit is reached or not More...
 
bool memoryLimitIsReached
 indicate if memory limit is reached or not in a solver, when base solver has memory management feature More...
 
bool interruptIsRequested
 indicate that all solver interrupt message is requested or not More...
 
ParaSolverPoolparaSolverPool
 Pools in LoadCorrdinator. More...
 
ParaRacingSolverPoolparaRacingSolverPool
 racing solver pool More...
 
long long nSolvedInInterruptedRacingSolvers
 number of tasks solved of the winner solver in the racing solvers More...
 
long long nTasksLeftInInterruptedRacingSolvers
 number of of tasks remains of the the winner solver in the racing solvers More...
 
double previousCheckpointTime
 For checkpoint. More...
 
char lastCheckpointTimeStr [26]
 lastCheckpointTimeStr[0] == ' ' means no checkpoint More...
 
double eps
 epsilon More...
 
int racingWinner
 racing winner information More...
 
ParaRacingRampUpParamSetracingWinnerParams
 racing winner parameter set More...
 
bool racingTermination
 racing termination information More...
 
int nSolvedRacingTermination
 number of tasks solved at the racing termination solver More...
 
size_t nTerminated
 counter to check if all solvers are terminated or not More...
 
ParaTimerparaTimer
 Timers for LoadCoordinator. More...
 
ParaDeterministicTimerparaDetTimer
 deterministic timer used in case of deterministic mode this timer need to be created in case of deterministic mode More...
 
bool logSolvingStatusFlag
 output streams and flags which indicate the output is specified or not More...
 
std::ofstream ofsLogSolvingStatus
 ofstream for solving status More...
 
std::ostream * osLogSolvingStatus
 ostram for solving status to switch output location More...
 
bool logTasksTransferFlag
 indicate if task transfer info. is logged or not More...
 
std::ofstream ofsLogTasksTransfer
 ofstream for task transfer info. More...
 
std::ostream * osLogTasksTransfer
 ostream for task transfer info. to switch output location More...
 
std::ofstream ofsStatisticsFinalRun
 ofstream for statistics of the final run More...
 
std::ostream * osStatisticsFinalRun
 ostream for statistics of the final run More...
 
std::ofstream ofsStatisticsRacingRampUp
 ofstream for statistics for racing solvers More...
 
std::ostream * osStatisticsRacingRampUp
 ostream for statistics for racing solvers to switch output location More...
 
ParaSolutionpendingSolution
 pending solution during merging More...
 
bool terminationIssued
 indicate termination request is issued More...
 
std::mutex routineMutex
 used to exclusive control of routines More...
 

Detailed Description

Class for LoadCoordinator.

Definition at line 73 of file scipParaLoadCoordinator.h.

Member Typedef Documentation

◆ ScipMessageHandlerFunctionPointer

typedef int(ScipParaLoadCoordinator::* ScipMessageHandlerFunctionPointer) (int, int)
private

Definition at line 76 of file scipParaLoadCoordinator.h.

Constructor & Destructor Documentation

◆ ScipParaLoadCoordinator() [1/2]

ScipParaLoadCoordinator ( UG::ParaComm inComm,
UG::ParaParamSet inParaParamSet,
UG::ParaInitiator inParaInitiator,
bool *  inRacingSolversExist,
UG::ParaTimer inParaTimer,
UG::ParaDeterministicTimer inDetTimer 
)

constructor

Parameters
inCommcommunicator used
inParaParamSetUG parameter set used
inParaInitiatorParaInitiator for initialization of solving algorithm
inRacingSolversExistindicate racing solver exits or not
inParaTimerParaTimer used
inDetTimerDeterministicTimer used

Definition at line 98 of file scipParaLoadCoordinator.h.

◆ ScipParaLoadCoordinator() [2/2]

ScipParaLoadCoordinator ( int  inNhanders,
UG::ParaComm inComm,
UG::ParaParamSet inParaParamSet,
UG::ParaInitiator paraInitiator,
bool *  racingSolversExist,
UG::ParaTimer paraTimer,
UG::ParaDeterministicTimer detTimer 
)

constructor

register message handlers

Parameters
inNhandersnumber of valid message handlers
inCommcommunicator used
inParaParamSetUG parameter set used
paraInitiatorParaInitiator for initialization of solving algorithm
racingSolversExistindicate racing solver exits or not
paraTimerParaTimer used
detTimerDeterministicTimer used

Definition at line 60 of file scipParaLoadCoordinator.cpp.

References ParaParamSet::getIntParamValue(), ParaLoadCoordinator::messageHandler, ParaLoadCoordinator::paraParams, ScipParaLoadCoordinator::processTagInitialStat(), UG::RampUpPhaseProcess, and ParaSCIP::TagInitialStat.

◆ ~ScipParaLoadCoordinator()

virtual ~ScipParaLoadCoordinator ( )
virtual

destructor

Definition at line 137 of file scipParaLoadCoordinator.h.

Member Function Documentation

◆ processTagInitialStat()

int processTagInitialStat ( int  source,
int  tag 
)
private

Message handlers.

function to process TagInitialStat message

Returns
always 0 (for extension)
Parameters
sourcesource solver rank
tagTagInitialStat

Definition at line 104 of file scipParaLoadCoordinator.cpp.

References DEF_SCIP_PARA_COMM, ScipParaInitialStat::getMaxDepth(), BbParaLoadCoordinator::maxDepthInWinnerSolverNodes, ParaLoadCoordinator::paraComm, ParaLoadCoordinator::paraInitiator, and ParaInitialStat::receive().

Referenced by ScipParaLoadCoordinator::ScipParaLoadCoordinator().