Communicator object for MPI communications. More...
#include <bbParaCommMpi.h>
Public Member Functions | |
BbParaCommMpi () | |
default constructor of ParaCommMpi More... | |
BbParaCommMpi (MPI_Comm comm) | |
constructor of ParaCommMpi with MPI communicator More... | |
virtual | ~BbParaCommMpi () |
destructor of this communicator More... | |
virtual ParaCalculationState * | createParaCalculationState () |
create ParaCalculationState object by default constructor More... | |
virtual ParaCalculationState * | createParaCalculationState (double compTime, double rootTime, int nSolved, int nSent, int nImprovedIncumbent, int terminationState, int nSolvedWithNoPreprocesses, int nSimplexIterRoot, double averageSimplexIter, int nTransferredLocalCuts, int minTransferredLocalCuts, int maxTransferredLocalCuts, int nTransferredBendersCuts, int minTransferredBendersCuts, int maxTransferredBendersCuts, int nRestarts, double minIisum, double maxIisum, int minNii, int maxNii, double dualBound, int nSelfSplitNodesLeft) |
create ParaCalculationState object More... | |
virtual ParaTask * | createParaTask () |
create ParaNode object by default constructor More... | |
virtual ParaTask * | createParaNode (TaskId inNodeId, TaskId inGeneratorNodeId, int inDepth, double inDualBoundValue, double inOriginalDualBoundValue, double inEstimatedValue, ParaDiffSubproblem *inDiffSubproblem) |
create ParaNode object More... | |
virtual ParaSolverState * | createParaSolverState () |
create ParaSolverState object by default constructor More... | |
virtual ParaSolverState * | createParaSolverState (int racingStage, unsigned int notificationId, int lcId, int globalSubtreeId, long long nodesSolved, int nodesLeft, double bestDualBoundValue, double globalBestPrimalBoundValue, double detTime, double averageDualBoundGain) |
create ParaSolverState object More... | |
virtual ParaSolverTerminationState * | createParaSolverTerminationState () |
create ParaSolverTerminationState object by default constructor More... | |
virtual ParaSolverTerminationState * | createParaSolverTerminationState (int interrupted, int rank, int totalNSolved, int minNSolved, int maxNSolved, int totalNSent, int totalNImprovedIncumbent, int nParaNodesReceived, int nParaNodesSolved, int nParaNodesSolvedAtRoot, int nParaNodesSolvedAtPreCheck, int nTransferredLocalCutsFromSolver, int minTransferredLocalCutsFromSolver, int maxTransferredLocalCutsFromSolver, int nTransferredBendersCutsFromSolver, int minTransferredBendersCutsFromSolver, int maxTransferredBendersCutsFromSolver, int nTotalRestarts, int minRestarts, int maxRestarts, int nTightened, int nTightenedInt, int calcTerminationState, double runningTime, double idleTimeToFirstParaNode, double idleTimeBetweenParaNodes, double iddleTimeAfterLastParaNode, double idleTimeToWaitNotificationId, double idleTimeToWaitAckCompletion, double idleTimeToWaitToken, double totalRootNodeTime, double minRootNodeTime, double maxRootNodeTime, double detTime) |
create ParaSolverTerminationState object More... | |
virtual ParaRacingRampUpParamSet * | createParaRacingRampUpParamSet () |
create ParaRacingRampUpParamSet object by default constructor More... | |
Public Member Functions inherited from ParaCommMpi | |
ParaCommMpi () | |
default constructor of ParaCommMpi More... | |
ParaCommMpi (MPI_Comm comm) | |
constructor of ParaCommMpi with MPI communicator More... | |
virtual | ~ParaCommMpi () |
destructor of this communicator More... | |
MPI_Comm & | getMpiComm () |
getter of MPI_Comm More... | |
virtual void | init (int argc, char **argv) |
initializer of this communicator More... | |
double | getStartTime () |
get start time of this communicator More... | |
int | getRank () |
get rank of caller's thread More... | |
int | getSize () |
get size of this communicator, which indicates how many threads in a UG process More... | |
int | getNumOfMessagesWaitingToSend (int dest=-1) |
get size of the messageQueueTable More... | |
void | lcInit (ParaParamSet *paraParamSet) |
initializer for LoadCoordinator More... | |
void | solverInit (ParaParamSet *paraParamSet) |
initializer for Solvers More... | |
void | abort () |
abort. How it works sometimes depends on communicator used More... | |
virtual bool | waitTerminatedMessage () |
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 *inToken) |
set received token to this communicator More... | |
virtual void | lockApp () |
lock UG application to synchronize with other threads More... | |
virtual void | unlockApp () |
unlock UG application to synchronize with other threads More... | |
ParaTimer * | createParaTimer () |
create ParaTimer object More... | |
int | bcast (void *buffer, int count, const int datatypeId, int root) |
broadcast function for standard ParaData types More... | |
virtual int | send (void *bufer, int count, const int datatypeId, int dest, const int tag) |
send function for standard ParaData types More... | |
int | iSend (void *bufer, int count, const int datatypeId, int dest, const int tag, MPI_Request *req) |
send function for standard ParaData types More... | |
int | receive (void *bufer, int count, const int datatypeId, int source, const int tag) |
receive function for standard ParaData types More... | |
void | waitSpecTagFromSpecSource (const int source, const int tag, int *receivedTag) |
wait function for a specific tag from a specific source coming from More... | |
bool | probe (int *source, int *tag) |
probe function which waits a new message More... | |
bool | iProbe (int *source, int *tag) |
iProbe function which checks if a new message is arrived or not More... | |
int | ubcast (void *buffer, int count, MPI_Datatype datatype, int root) |
User type bcast for created data type. More... | |
int | usend (void *bufer, int count, MPI_Datatype datatype, int dest, int tag) |
User type send for created data type. More... | |
int | iUsend (void *bufer, int count, MPI_Datatype datatype, int dest, int tag, MPI_Request *req) |
User type send for created data type. More... | |
int | ureceive (void *bufer, int count, MPI_Datatype datatype, int source, int tag) |
User type receive for created data type. More... | |
int | testAllIsends () |
void | waitAllIsends () |
virtual const char * | getTagString (int tag) |
get Tag string for debugging 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... | |
Public Member Functions inherited from ParaComm | |
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... | |
Protected Member Functions | |
virtual bool | tagStringTableIsSetUpCoorectly () |
check if tag string table (for debugging) set up correctly More... | |
virtual const char * | getTagString (int tag) |
get Tag string for debugging More... | |
virtual bool | tagStringTableIsSetUpCoorectly () |
check if tag string table (for debugging) set up correctly More... | |
Protected Attributes | |
pthread_mutex_t | tokenAccessLock |
mutex for pthread thread More... | |
Protected Attributes inherited from ParaCommMpi | |
MPI_Comm | myComm |
MPI communicator. More... | |
int | myCommSize |
communicator size : number of processes joined in this system More... | |
int | myRank |
rank of this process More... | |
int | namelen |
length of this process name More... | |
char | procName [MPI_MAX_PROCESSOR_NAME] |
process name More... | |
bool | tagTraceFlag |
indicate if tags are traced or not More... | |
std::ofstream | ofs |
output file stream for tag trace More... | |
std::ostream * | tos |
output file stream for tag trace to change file name More... | |
double | startTime |
start time of this communicator More... | |
int | token [2] |
index 0: token index 1: token color -1: green > 0: yellow ( termination origin solver number ) -2: red ( means the solver can terminate ) More... | |
pthread_mutex_t | tokenAccessLock |
mutex for pthread thread More... | |
std::mutex | applicationLockMutex |
mutex for applications More... | |
Static Protected Attributes | |
static MPI_Datatype | datatypes [TYPE_LIST_SIZE] |
data type mapping table to MPI data type More... | |
static const char * | tagStringTable [] |
table for tag name string More... | |
Static Protected Attributes inherited from ParaCommMpi | |
static MPI_Datatype | datatypes [TYPE_LIST_SIZE] |
data type mapping table to MPI data type More... | |
static const char * | tagStringTable [] |
table for tag name string More... | |
Additional Inherited Members | |
Public Attributes inherited from ParaCommMpi | |
std::deque< ParaIsendRequest * > | iSendRequestDeque |
Communicator object for MPI communications.
Definition at line 76 of file bbParaCommMpi.h.
BbParaCommMpi | ( | ) |
default constructor of ParaCommMpi
Definition at line 112 of file bbParaCommMpi.h.
References ParaCommMpi::token, and BbParaCommMpi::tokenAccessLock.
BbParaCommMpi | ( | MPI_Comm | comm | ) |
constructor of ParaCommMpi with MPI communicator
comm | my communicator |
Definition at line 129 of file bbParaCommMpi.h.
|
virtual |
destructor of this communicator
Definition at line 142 of file bbParaCommMpi.h.
|
virtual |
create ParaCalculationState object by default constructor
Implements ParaComm.
Definition at line 106 of file bbParaCommMpi.cpp.
|
virtual |
create ParaCalculationState object
compTime | computation time of this ParaNode |
rootTime | computation time of the root node |
nSolved | the number of nodes solved |
nSent | the number of ParaNodes sent |
nImprovedIncumbent | the number of improved solution generated in this ParaSolver |
terminationState | indicate whether if this computation is terminationState or not. 0: no, 1: terminationState |
nSolvedWithNoPreprocesses | number of nodes solved when it is solved with no preprocesses |
nSimplexIterRoot | number of simplex iteration at root node |
averageSimplexIter | average number of simplex iteration except root node |
nTransferredLocalCuts | number of local cuts transferred from a ParaNode |
minTransferredLocalCuts | minimum number of local cuts transferred from a ParaNode |
maxTransferredLocalCuts | maximum number of local cuts transferred from a ParaNode |
nTransferredBendersCuts | number of benders cuts transferred from a ParaNode |
minTransferredBendersCuts | minimum number of benders cuts transferred from a ParaNode |
maxTransferredBendersCuts | maximum number of benders cuts transferred from a ParaNode |
nRestarts | number of restarts |
minIisum | minimum sum of integer infeasibility |
maxIisum | maximum sum of integer infeasibility |
minNii | minimum number of integer infeasibility |
maxNii | maximum number of integer infeasibility |
dualBound | final dual bound value |
nSelfSplitNodesLeft | number of self-split nodes left |
Definition at line 113 of file bbParaCommMpi.cpp.
|
virtual |
create ParaNode object
inNodeId | node id |
inGeneratorNodeId | generator node id |
inDepth | node depth in global search tree |
inDualBoundValue | dual bound value |
inOriginalDualBoundValue | original dual bound value |
inEstimatedValue | estimated value |
inDiffSubproblem | diff subproblem info. from the original problem |
Definition at line 172 of file bbParaCommMpi.cpp.
|
virtual |
create ParaRacingRampUpParamSet object by default constructor
Implements ParaComm.
Reimplemented in ScipParaCommMpi.
Definition at line 281 of file bbParaCommMpi.h.
References THROW_LOGICAL_ERROR1.
|
virtual |
create ParaSolverState object by default constructor
Implements ParaComm.
Definition at line 194 of file bbParaCommMpi.cpp.
|
virtual |
create ParaSolverState object
racingStage | if this value is 1, solver is in racing stage |
notificationId | id for this notification |
lcId | lc id of current ParaNode |
globalSubtreeId | global subtree id of current ParaNode |
nodesSolved | number of nodes solved |
nodesLeft | number of remaining nodes |
bestDualBoundValue | best dual bound value in that of remaining nodes |
globalBestPrimalBoundValue | global best primal bound value |
detTime | deterministic time, -1: should be non-deterministic |
averageDualBoundGain | average dual bound gain received |
Definition at line 201 of file bbParaCommMpi.cpp.
|
virtual |
create ParaSolverTerminationState object by default constructor
Implements ParaComm.
Definition at line 230 of file bbParaCommMpi.cpp.
|
virtual |
create ParaSolverTerminationState object
interrupted | indicate that this solver is interrupted or not. 0: not interrupted, 1: interrupted 2: checkpoint, 3: racing-ramp up |
rank | rank of this solver |
totalNSolved | accumulated number of nodes solved in this ParaSolver |
minNSolved | minimum number of subtree nodes rooted from ParaNode |
maxNSolved | maximum number of subtree nodes rooted from ParaNode |
totalNSent | accumulated number of nodes sent from this ParaSolver |
totalNImprovedIncumbent | accumulated number of improvements of incumbent value in this ParaSolver |
nParaNodesReceived | number of ParaNodes received in this ParaSolver |
nParaNodesSolved | number of ParaNodes solved ( received ) in this ParaSolver |
nParaNodesSolvedAtRoot | number of ParaNodes solved at root node before sending |
nParaNodesSolvedAtPreCheck | number of ParaNodes solved at pre-checking of root node solvability |
nTransferredLocalCutsFromSolver | number of local cuts transferred from this Solver |
minTransferredLocalCutsFromSolver | minimum number of local cuts transferred from this Solver |
maxTransferredLocalCutsFromSolver | maximum number of local cuts transferred from this Solver |
nTransferredBendersCutsFromSolver | number of benders cuts transferred from this Solver |
minTransferredBendersCutsFromSolver | minimum number of benders cuts transferred from this Solver |
maxTransferredBendersCutsFromSolver | maximum number of benders cuts transferred from this Solver |
nTotalRestarts | number of total restarts |
minRestarts | minimum number of restarts |
maxRestarts | maximum number of restarts |
nTightened | number of tightened variable bounds during racing stage |
nTightenedInt | number of tightened integral variable bounds during racing stage |
calcTerminationState | termination sate of a calculation in a Solver |
runningTime | this solver running time |
idleTimeToFirstParaNode | idle time to start solving the first ParaNode |
idleTimeBetweenParaNodes | idle time between ParaNodes processing |
iddleTimeAfterLastParaNode | idle time after the last ParaNode was solved |
idleTimeToWaitNotificationId | idle time to wait notification Id messages |
idleTimeToWaitAckCompletion | idle time to wait ack completion message |
idleTimeToWaitToken | idle time to wait token |
totalRootNodeTime | total time consumed by root node processes |
minRootNodeTime | minimum time consumed by root node processes |
maxRootNodeTime | maximum time consumed by root node processes |
detTime | deterministic time, -1: should be non-deterministic |
Definition at line 237 of file bbParaCommMpi.cpp.
References interrupted.
|
virtual |
create ParaNode object by default constructor
Implements ParaComm.
Definition at line 165 of file bbParaCommMpi.cpp.
|
protectedvirtual |
get Tag string for debugging
tag | tag to be converted to string |
Reimplemented from ParaCommMpi.
Reimplemented in ScipParaCommMpi.
Definition at line 90 of file bbParaCommMpi.cpp.
References ParaCommMpi::getTagString(), UG::N_BB_MPI_TAGS, UG::TAG_BB_FIRST, and BbParaCommMpi::tagStringTable.
|
protectedvirtual |
check if tag string table (for debugging) set up correctly
Reimplemented from ParaCommMpi.
Reimplemented in ScipParaCommMpi.
Definition at line 83 of file bbParaCommMpi.cpp.
References UG::N_BB_MPI_TAGS, UG::N_MPI_TAGS, and BbParaCommMpi::tagStringTable.
|
staticprotected |
data type mapping table to MPI data type
Definition at line 79 of file bbParaCommMpi.h.
|
staticprotected |
table for tag name string
Definition at line 80 of file bbParaCommMpi.h.
Referenced by BbParaCommMpi::getTagString(), and BbParaCommMpi::tagStringTableIsSetUpCoorectly().
|
protected |
mutex for pthread thread
Definition at line 85 of file bbParaCommMpi.h.
Referenced by BbParaCommMpi::BbParaCommMpi().