Communicator object for C++11 thread communications. More...
#include <paraCommCPP11.h>
Public Member Functions | |
| ParaCommCPP11 () | |
| constructor of ParaComCPP11 More... | |
| virtual | ~ParaCommCPP11 () |
| destructor of this communicator More... | |
| virtual void | init (int argc, char **argv) |
| initializer of this communicator More... | |
| virtual void | setLocalRank (int inRank) |
| double | getStartTime () |
| get start time of this communicator (should not be used) 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... | |
| virtual void | lcInit (ParaParamSet *paraParamSet) |
| initializer for LoadCoordinator More... | |
| virtual void | solverInit (ParaParamSet *paraParamSet) |
| initializer for Solvers More... | |
| virtual void | solverInit (int rank, ParaParamSet *paraParamSet) |
| initializer for a specific Solver More... | |
| virtual void | solverReInit (int rank, ParaParamSet *paraParamSet) |
| reinitializer of a specific Solver More... | |
| virtual void | solverDel (int rank) |
| delete Solver from this communicator 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... | |
| std::ostream * | getOstream () |
| get ostream pointer More... | |
| void | lockRank () |
| lock rank More... | |
| void | unlockRank () |
| unlock rank More... | |
| virtual void | lockApp () |
| 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 () |
| 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... | |
| void | unlockRank (char const *f, int l) |
| unlock rank (for debugging) 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... | |
| int | send (void *bufer, int count, const int datatypeId, int dest, const int tag) |
| 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 | uTypeSend (void *bufer, const int datatypeId, int dest, int tag) |
| User type send for created data type. More... | |
| int | uTypeReceive (void **bufer, const int datatypeId, int source, int tag) |
| User type receive for created data type. More... | |
| virtual const char * | getTagString (int tag) |
| get Tag string for debugging 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 | |
| void * | allocateMemAndCopy (const void *buffer, int count, const int datatypeId) |
| allocate memory and copy message More... | |
| void | copy (void *dest, const void *src, int count, int datatypeId) |
| copy message More... | |
| void | freeMem (void *buffer, int count, const int datatypeId) |
| free memory More... | |
| bool | freeStandardTypes (MessageQueueElement *elem) |
| free memory More... | |
| virtual bool | tagStringTableIsSetUpCoorectly () |
| check if tag string table (for debugging) set up correctly More... | |
Protected Attributes | |
| int | comSize |
| communicator size : number of threads joined in this system More... | |
| bool | tagTraceFlag |
| indicate if tags are traced or not More... | |
| int ** | token |
| index 0: token index 1: token color -1: green > 0: yellow ( termination origin solver number ) -2: red ( means the solver can terminate ) More... | |
| ParaSysTimer | timer |
| system timer More... | |
| MessageQueueTableElement ** | messageQueueTable |
| message queue table More... | |
| bool * | sentMessage |
| sent message flag for synchronization More... | |
| std::mutex * | queueLockMutex |
| mutex for synchronization More... | |
| std::condition_variable * | sentMsg |
| condition variable for synchronization More... | |
| std::mutex * | tokenAccessLockMutex |
| mutex to access token More... | |
| std::mutex | rankLockMutex |
| mutex to access rank More... | |
| std::mutex | applicationLockMutex |
| mutex for applications More... | |
Static Protected Attributes | |
| static const char * | tagStringTable [] |
| tag name string table More... | |
| static ThreadsTableElement * | threadsTable [ThreadTableSize] |
| threads table: index is thread rank More... | |
| static thread_local int | localRank = -1 |
| local thread rank More... | |
Communicator object for C++11 thread communications.
Definition at line 694 of file paraCommCPP11.h.
| ParaCommCPP11 | ( | ) |
constructor of ParaComCPP11
Definition at line 768 of file paraCommCPP11.h.
|
virtual |
destructor of this communicator
Definition at line 298 of file paraCommCPP11.cpp.
References ABORT_LOGICAL_ERROR2, ParaCommCPP11::comSize, MessageQueueTableElement::extarctElement(), ParaCommCPP11::freeStandardTypes(), MessageQueueElement::getData(), MessageQueueElement::getDataTypeId(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::rankLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, ParaCommCPP11::threadsTable, UG::ThreadTableSize, ParaCommCPP11::token, and ParaCommCPP11::tokenAccessLockMutex.
|
virtual |
abort. How it works sometimes depends on communicator used
Implements ParaComm.
Definition at line 899 of file paraCommCPP11.h.
Referenced by main().
|
protected |
allocate memory and copy message
| buffer | pointer to buffer of the message |
| count | the number of data element in the message |
| datatypeId | data type of each element in the message |
Definition at line 361 of file paraCommCPP11.cpp.
References UG::ParaBOOL, UG::ParaBYTE, UG::ParaCHAR, UG::ParaDOUBLE, UG::ParaFLOAT, UG::ParaINT, UG::ParaLONG, UG::ParaLONG_DOUBLE, UG::ParaLONG_LONG, UG::ParaSHORT, UG::ParaSIGNED_CHAR, UG::ParaUNSIGNED, UG::ParaUNSIGNED_CHAR, UG::ParaUNSIGNED_LONG, UG::ParaUNSIGNED_LONG_LONG, UG::ParaUNSIGNED_SHORT, and THROW_LOGICAL_ERROR2.
Referenced by ParaCommCPP11::send().
|
virtual |
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 |
Implements ParaComm.
Definition at line 750 of file paraCommCPP11.cpp.
References ParaCommCPP11::comSize, ParaCommCPP11::getRank(), ParaCommCPP11::receive(), and ParaCommCPP11::send().
Referenced by main(), and ScipParaSolver::ScipParaSolver().
|
protected |
copy message
| dest | destination to copy the data |
| src | source of the data |
| count | the number of data element |
| datatypeId | data type of each element |
Definition at line 476 of file paraCommCPP11.cpp.
References UG::ParaBOOL, UG::ParaBYTE, UG::ParaCHAR, UG::ParaDOUBLE, UG::ParaFLOAT, UG::ParaINT, UG::ParaLONG, UG::ParaLONG_DOUBLE, UG::ParaLONG_LONG, UG::ParaSHORT, UG::ParaSIGNED_CHAR, UG::ParaUNSIGNED, UG::ParaUNSIGNED_CHAR, UG::ParaUNSIGNED_LONG, UG::ParaUNSIGNED_LONG_LONG, UG::ParaUNSIGNED_SHORT, and THROW_LOGICAL_ERROR2.
Referenced by ParaCommCPP11::receive().
|
virtual |
|
protected |
free memory
| buffer | pointer to buffer of the message |
| count | the number of data element |
| datatypeId | data type of each element |
Definition at line 572 of file paraCommCPP11.cpp.
References UG::ParaBOOL, UG::ParaBYTE, UG::ParaCHAR, UG::ParaDOUBLE, UG::ParaFLOAT, UG::ParaINT, UG::ParaLONG, UG::ParaLONG_DOUBLE, UG::ParaLONG_LONG, UG::ParaSHORT, UG::ParaSIGNED_CHAR, UG::ParaUNSIGNED, UG::ParaUNSIGNED_CHAR, UG::ParaUNSIGNED_LONG, UG::ParaUNSIGNED_LONG_LONG, UG::ParaUNSIGNED_SHORT, and THROW_LOGICAL_ERROR2.
Referenced by ParaCommCPP11::freeStandardTypes(), and ParaCommCPP11::receive().
|
protected |
free memory
| elem | pointer to a message queue element |
Definition at line 670 of file paraCommCPP11.cpp.
References ParaCommCPP11::freeMem(), MessageQueueElement::getCount(), MessageQueueElement::getData(), MessageQueueElement::getDataTypeId(), UG::ParaCalculationStateType, UG::ParaInstanceType, UG::ParaParamSetType, UG::ParaRacingRampUpParamType, UG::ParaSolutionType, UG::ParaSolverStateType, UG::ParaSolverTerminationStateType, UG::ParaTaskType, and UG::UG_USER_TYPE_FIRST.
Referenced by ParaCommCPP11::~ParaCommCPP11(), and ScipParaCommTh::~ScipParaCommTh().
|
virtual |
get size of the messageQueueTable
Implements ParaComm.
Definition at line 838 of file paraCommCPP11.h.
References ParaCommCPP11::comSize, MessageQueueTableElement::getSize(), and ParaCommCPP11::messageQueueTable.
| std::ostream * getOstream | ( | ) |
get ostream pointer
Definition at line 351 of file paraCommCPP11.cpp.
References ThreadsTableElement::getOstream(), ParaCommCPP11::localRank, ParaCommCPP11::rankLockMutex, and ParaCommCPP11::threadsTable.
|
virtual |
get rank of caller's thread
Implements ParaComm.
Definition at line 342 of file paraCommCPP11.cpp.
References ParaCommCPP11::localRank, and ParaCommCPP11::rankLockMutex.
Referenced by ScipDiffParamSetMpi::bcast(), ScipParaDiffSubproblemMpi::bcast(), ScipParaSolutionMpi::bcast(), ParaCommCPP11::bcast(), ParaCommCPP11::iProbe(), ParaCommCPP11::lockApp(), main(), ParaCommCPP11::passTermToken(), ParaCommCPP11::probe(), ParaCommCPP11::receive(), runSolverThread(), ScipParaSolver::ScipParaSolver(), ParaCommCPP11::send(), ParaCommCPP11::unlockApp(), ParaCommCPP11::uTypeReceive(), ParaCommCPP11::uTypeSend(), and ParaCommCPP11::waitSpecTagFromSpecSource().
|
virtual |
get size of this communicator, which indicates how many threads in a UG process
Implements ParaComm.
Definition at line 827 of file paraCommCPP11.h.
References ParaCommCPP11::comSize.
Referenced by main(), and runSolverThread().
| double getStartTime | ( | ) |
get start time of this communicator (should not be used)
Definition at line 810 of file paraCommCPP11.h.
References ParaSysTimer::getStartTime(), and ParaCommCPP11::timer.
|
virtual |
get Tag string for debugging
| tag | tag to be converted to string |
Implements ParaComm.
Reimplemented in BbParaCommCPP11, and ScipParaCommTh.
Definition at line 740 of file paraCommCPP11.cpp.
References UG::N_TH_TAGS, and ParaCommCPP11::tagStringTable.
Referenced by BbParaCommCPP11::getTagString().
|
virtual |
initializer of this communicator
if you add tag, you should add tagStringTale too
initialize hashtable
| argc | the number of arguments |
| argv | pointers to the arguments |
Implements ParaComm.
Definition at line 84 of file paraCommCPP11.cpp.
References ParaCommCPP11::comSize, ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, ParaSysTimer::start(), ParaCommCPP11::tagStringTableIsSetUpCoorectly(), ParaCommCPP11::threadsTable, UG::ThreadTableSize, ParaCommCPP11::timer, ParaCommCPP11::token, and ParaCommCPP11::tokenAccessLockMutex.
Referenced by main().
|
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 |
Implements ParaComm.
Definition at line 860 of file paraCommCPP11.cpp.
References MessageQueueTableElement::checkElementWithTag(), MessageQueueTableElement::getHead(), ParaCommCPP11::getRank(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), MessageQueueTableElement::isEmpty(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, TAG_TRACE, and UG::TagAny.
|
virtual |
initializer for LoadCoordinator
| paraParamSet | UG parameter set |
Implements ParaComm.
Definition at line 154 of file paraCommCPP11.cpp.
References ParaCommCPP11::localRank, paraParamSet, ParaCommCPP11::rankLockMutex, UG::TagTrace, ParaCommCPP11::tagTraceFlag, and ParaCommCPP11::threadsTable.
Referenced by main().
|
virtual |
lock UG application to synchronize with other threads
Implements ParaComm.
Definition at line 973 of file paraCommCPP11.h.
References ParaCommCPP11::applicationLockMutex.
Referenced by runSolverThread().
|
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 from ParaComm.
Definition at line 984 of file paraCommCPP11.h.
References ParaCommCPP11::applicationLockMutex, and ParaCommCPP11::getRank().
| void lockRank | ( | ) |
|
virtual |
pass termination token from the rank to the next
| rank | from this rank, the termination token is passed |
Reimplemented from ParaComm.
Definition at line 256 of file paraCommCPP11.cpp.
References ParaCommCPP11::comSize, ParaCommCPP11::getRank(), UG::ParaINT, ParaCommCPP11::send(), UG::TagToken, THROW_LOGICAL_ERROR4, ParaCommCPP11::token, and ParaCommCPP11::tokenAccessLockMutex.
|
virtual |
pass token to from the rank to the next
| rank | from this rank, the token is passed |
Reimplemented from ParaComm.
Definition at line 243 of file paraCommCPP11.cpp.
References ParaCommCPP11::comSize, UG::ParaINT, ParaCommCPP11::send(), UG::TagToken, ParaCommCPP11::token, and ParaCommCPP11::tokenAccessLockMutex.
|
virtual |
probe function which waits a new message
| source | source rank of the message arrived |
| tag | tag of the message arrived |
Implements ParaComm.
Definition at line 845 of file paraCommCPP11.cpp.
References MessageQueueTableElement::getHead(), ParaCommCPP11::getRank(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, TAG_TRACE, and MessageQueueTableElement::waitMessage().
Referenced by main(), runSolverThread(), and ParaCommCPP11::waitToken().
|
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 |
Implements ParaComm.
Definition at line 794 of file paraCommCPP11.cpp.
References ParaCommCPP11::copy(), MessageQueueTableElement::extarctElement(), ParaCommCPP11::freeMem(), MessageQueueElement::getData(), ParaCommCPP11::getRank(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, TAG_TRACE, and MessageQueueTableElement::waitMessage().
Referenced by ParaCommCPP11::bcast(), main(), runSolverThread(), and ParaCommCPP11::waitToken().
|
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 |
Implements ParaComm.
Definition at line 775 of file paraCommCPP11.cpp.
References ParaCommCPP11::allocateMemAndCopy(), MessageQueueTableElement::enqueue(), ParaCommCPP11::getRank(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, and TAG_TRACE.
Referenced by ParaCommCPP11::bcast(), main(), ParaCommCPP11::passTermToken(), ParaCommCPP11::passToken(), and ParaTimeLimitMonitorTh::run().
|
virtual |
Reimplemented from ParaComm.
Definition at line 798 of file paraCommCPP11.h.
References ParaCommCPP11::localRank.
|
virtual |
set received token to this communicator
| rank | rank to set the token |
| inToken | token to be set |
Reimplemented from ParaComm.
Definition at line 284 of file paraCommCPP11.cpp.
References ParaCommCPP11::token, and ParaCommCPP11::tokenAccessLockMutex.
|
virtual |
delete Solver from this communicator
| rank | rank of the Solver |
Definition at line 193 of file paraCommCPP11.cpp.
References ParaCommCPP11::localRank, ParaCommCPP11::rankLockMutex, ParaCommCPP11::threadsTable, and THROW_LOGICAL_ERROR2.
|
virtual |
initializer for a specific Solver
| rank | rank of the Solver |
| paraParamSet | UG parameter set |
Definition at line 167 of file paraCommCPP11.cpp.
References ParaCommCPP11::localRank, paraParamSet, ParaCommCPP11::rankLockMutex, and ParaCommCPP11::threadsTable.
|
virtual |
initializer for Solvers
| paraParamSet | UG parameter set |
Implements ParaComm.
Definition at line 867 of file paraCommCPP11.h.
Referenced by main(), and runSolverThread().
|
virtual |
reinitializer of a specific Solver
| rank | rank of the Solver |
| paraParamSet | UG parameter set |
Definition at line 180 of file paraCommCPP11.cpp.
References ParaCommCPP11::localRank, ParaCommCPP11::rankLockMutex, and ParaCommCPP11::threadsTable.
|
protectedvirtual |
check if tag string table (for debugging) set up correctly
Reimplemented in BbParaCommCPP11, and ScipParaCommTh.
Definition at line 732 of file paraCommCPP11.cpp.
References UG::N_TH_TAGS, and ParaCommCPP11::tagStringTable.
Referenced by ParaCommCPP11::init(), and BbParaCommCPP11::tagStringTableIsSetUpCoorectly().
|
virtual |
unlock UG application to synchronize with other threads
Implements ParaComm.
Definition at line 996 of file paraCommCPP11.h.
References ParaCommCPP11::applicationLockMutex.
Referenced by runSolverThread().
|
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 from ParaComm.
Definition at line 1007 of file paraCommCPP11.h.
References ParaCommCPP11::applicationLockMutex, and ParaCommCPP11::getRank().
| void unlockRank | ( | ) |
unlock rank
Definition at line 965 of file paraCommCPP11.h.
References ParaCommCPP11::rankLockMutex.
| void unlockRank | ( | char const * | f, |
| int | l | ||
| ) |
unlock rank (for debugging)
| f | string to indicate what is locked |
| l | a number to show something |
Definition at line 1020 of file paraCommCPP11.h.
References ParaCommCPP11::rankLockMutex.
| int uTypeReceive | ( | void ** | bufer, |
| const int | datatypeId, | ||
| int | source, | ||
| int | tag | ||
| ) |
User type receive for created data type.
| bufer | point to the head of receiving message |
| datatypeId | created data type |
| source | source rank |
| tag | tag of the message |
Definition at line 917 of file paraCommCPP11.cpp.
References MessageQueueTableElement::extarctElement(), MessageQueueElement::getData(), ParaCommCPP11::getRank(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, TAG_TRACE, and MessageQueueTableElement::waitMessage().
| int uTypeSend | ( | void * | bufer, |
| const int | datatypeId, | ||
| int | dest, | ||
| int | tag | ||
| ) |
User type send for created data type.
| bufer | point to the head of sending message |
| datatypeId | created data type |
| dest | destination rank |
| tag | tag of the message |
Definition at line 900 of file paraCommCPP11.cpp.
References MessageQueueTableElement::enqueue(), ParaCommCPP11::getRank(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, and TAG_TRACE.
|
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 |
Implements ParaComm.
Definition at line 821 of file paraCommCPP11.cpp.
References ParaCommCPP11::getRank(), ParaCommCPP11::messageQueueTable, ParaCommCPP11::queueLockMutex, ParaCommCPP11::sentMessage, ParaCommCPP11::sentMsg, TAG_TRACE, and MessageQueueTableElement::waitMessage().
|
virtual |
function to wait Terminated message (This function is not used currently)
Implements ParaComm.
Definition at line 910 of file paraCommCPP11.h.
|
virtual |
wait token when UG runs with deterministic mode
| rank | rank to check if token is arrived |
Reimplemented from ParaComm.
Definition at line 213 of file paraCommCPP11.cpp.
References UG::ParaINT, ParaCommCPP11::probe(), ParaCommCPP11::receive(), TAG_TRACE, UG::TagToken, ParaCommCPP11::token, and ParaCommCPP11::tokenAccessLockMutex.
|
protected |
mutex for applications
Definition at line 715 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::lockApp(), and ParaCommCPP11::unlockApp().
|
protected |
communicator size : number of threads joined in this system
Definition at line 697 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::bcast(), ParaCommCPP11::getNumOfMessagesWaitingToSend(), ParaCommCPP11::getSize(), ParaCommCPP11::init(), ParaCommCPP11::passTermToken(), ParaCommCPP11::passToken(), ParaCommCPP11::~ParaCommCPP11(), and ScipParaCommTh::~ScipParaCommTh().
|
staticprotected |
local thread rank
Definition at line 707 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::getOstream(), ParaCommCPP11::getRank(), ParaCommCPP11::lcInit(), ParaCommCPP11::setLocalRank(), ParaCommCPP11::solverDel(), ParaCommCPP11::solverInit(), and ParaCommCPP11::solverReInit().
|
protected |
message queue table
Definition at line 708 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::getNumOfMessagesWaitingToSend(), ParaCommCPP11::init(), ParaCommCPP11::iProbe(), ParaCommCPP11::probe(), ParaCommCPP11::receive(), ParaCommCPP11::send(), ParaCommCPP11::uTypeReceive(), ParaCommCPP11::uTypeSend(), ParaCommCPP11::waitSpecTagFromSpecSource(), ParaCommCPP11::~ParaCommCPP11(), and ScipParaCommTh::~ScipParaCommTh().
|
protected |
mutex for synchronization
Definition at line 710 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::init(), ParaCommCPP11::iProbe(), ParaCommCPP11::probe(), ParaCommCPP11::receive(), ParaCommCPP11::send(), ParaCommCPP11::uTypeReceive(), ParaCommCPP11::uTypeSend(), ParaCommCPP11::waitSpecTagFromSpecSource(), and ParaCommCPP11::~ParaCommCPP11().
|
protected |
mutex to access rank
Definition at line 714 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::getOstream(), ParaCommCPP11::getRank(), ParaCommCPP11::lcInit(), ParaCommCPP11::lockRank(), ParaCommCPP11::solverDel(), ParaCommCPP11::solverInit(), ParaCommCPP11::solverReInit(), ParaCommCPP11::unlockRank(), ParaCommCPP11::~ParaCommCPP11(), and ScipParaCommTh::~ScipParaCommTh().
|
protected |
sent message flag for synchronization
Definition at line 709 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::init(), ParaCommCPP11::probe(), ParaCommCPP11::receive(), ParaCommCPP11::send(), ParaCommCPP11::uTypeReceive(), ParaCommCPP11::uTypeSend(), ParaCommCPP11::waitSpecTagFromSpecSource(), ParaCommCPP11::~ParaCommCPP11(), and ScipParaCommTh::~ScipParaCommTh().
|
protected |
condition variable for synchronization
Definition at line 711 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::init(), ParaCommCPP11::probe(), ParaCommCPP11::receive(), ParaCommCPP11::send(), ParaCommCPP11::uTypeReceive(), ParaCommCPP11::uTypeSend(), ParaCommCPP11::waitSpecTagFromSpecSource(), and ParaCommCPP11::~ParaCommCPP11().
|
staticprotected |
tag name string table
Definition at line 705 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::getTagString(), and ParaCommCPP11::tagStringTableIsSetUpCoorectly().
|
protected |
indicate if tags are traced or not
Definition at line 698 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::lcInit().
|
staticprotected |
threads table: index is thread rank
Definition at line 706 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::getOstream(), ParaCommCPP11::init(), ParaCommCPP11::lcInit(), ParaCommCPP11::solverDel(), ParaCommCPP11::solverInit(), ParaCommCPP11::solverReInit(), and ParaCommCPP11::~ParaCommCPP11().
|
protected |
system timer
Definition at line 704 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::getStartTime(), and ParaCommCPP11::init().
|
protected |
index 0: token index 1: token color -1: green > 0: yellow ( termination origin solver number ) -2: red ( means the solver can terminate )
Definition at line 699 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::init(), ParaCommCPP11::passTermToken(), ParaCommCPP11::passToken(), ParaCommCPP11::setToken(), ParaCommCPP11::waitToken(), and ParaCommCPP11::~ParaCommCPP11().
|
protected |
mutex to access token
Definition at line 713 of file paraCommCPP11.h.
Referenced by ParaCommCPP11::init(), ParaCommCPP11::passTermToken(), ParaCommCPP11::passToken(), ParaCommCPP11::setToken(), ParaCommCPP11::waitToken(), and ParaCommCPP11::~ParaCommCPP11().