Scippy

UG

Ubiquity Generator framework

MessageQueueTableElement Class Reference

Class of MessageQueueTableElement. More...

#include <paraCommCPP11.h>

Public Member Functions

 MessageQueueTableElement ()
 default constructor of MessageQueueTableElement More...
 
 ~MessageQueueTableElement ()
 destructor of MessageQueueTableElement More...
 
MessageQueueElementcheckElement (int source, int datatypeId, int tag)
 check if the specified message exists or nor More...
 
MessageQueueElementcheckElementWithTag (int tag)
 check if the specified message with tag exists or nor More...
 
MessageQueueElementextarctElement (bool *sentMessage, int source, int datatypeId, int tag)
 extracts a message More...
 
MessageQueueElementextarctElement (bool *sentMessage)
 extracts a message (This method is only for desctructor of ParaCommCPP11. No lock is necessary.) More...
 
void enqueue (std::condition_variable &sentMsg, std::mutex &queueLockMutex, bool *sentMessage, MessageQueueElement *newElement)
 enqueue a message More...
 
MessageQueueElementgetHead ()
 getter of head More...
 
int getSize ()
 getter of size More...
 
bool isEmpty ()
 check if the queue is empty or not More...
 
void waitMessage (std::condition_variable &sentMsg, std::mutex &queueLockMutex, bool *sentMessage)
 wait for a message coming to a queue More...
 
void waitMessage (std::condition_variable &sentMsg, std::mutex &queueLockMutex, bool *sentMessage, int source, int tag)
 wait for a specified message coming to a queue More...
 
void waitMessage (std::condition_variable &sentMsg, std::mutex &queueLockMutex, bool *sentMessage, int source, int datatypeId, int tag)
 wait for a specified message coming to a queue More...
 
void waitMessage (std::condition_variable &sentMsg, std::mutex &queueLockMutex, bool *sentMessage, int source, int *tag)
 wait for a specified message coming to a queue More...
 
 MessageQueueTableElement ()
 default constructor of MessageQueueTableElement More...
 
 ~MessageQueueTableElement ()
 destructor of MessageQueueTableElement More...
 
MessageQueueElementcheckElement (int source, int datatypeId, int tag)
 check if the specified message exists or nor More...
 
MessageQueueElementcheckElementWithTag (int tag)
 check if the specified message with tag exists or nor More...
 
MessageQueueElementextarctElement (bool *sentMessage, int source, int datatypeId, int tag)
 extracts a message More...
 
MessageQueueElementextarctElement (bool *sentMessage)
 extracts a message (This method is only for desctructor of ParaCommCPP11. No lock is necessary.) More...
 
void enqueue (ConditionVariable *sentMsg, bool *sentMessage, MessageQueueElement *newElement)
 enqueue a message More...
 
MessageQueueElementgetHead ()
 getter of head More...
 
int getSize ()
 getter of size More...
 
bool isEmpty ()
 check if the queue is empty or not More...
 
void waitMessage (ConditionVariable *sentMsg, bool *sentMessage)
 wait for a message coming to a queue More...
 
void waitMessage (ConditionVariable *sentMsg, bool *sentMessage, int source, int datatypeId, int tag)
 wait for a specified message coming to a queue More...
 
void waitMessage (ConditionVariable *sentMsg, bool *sentMessage, int source, int *tag)
 wait for a specified message coming to a queue More...
 

Private Attributes

MessageQueueElementhead
 head of the message queue More...
 
MessageQueueElementtail
 tail of the message queue More...
 
int size
 number of the messages in queue More...
 

Detailed Description

Class of MessageQueueTableElement.

Definition at line 243 of file paraCommCPP11.h.

Constructor & Destructor Documentation

◆ MessageQueueTableElement() [1/2]

default constructor of MessageQueueTableElement

Definition at line 255 of file paraCommCPP11.h.

◆ ~MessageQueueTableElement() [1/2]

◆ MessageQueueTableElement() [2/2]

default constructor of MessageQueueTableElement

Definition at line 245 of file paraCommPth.h.

◆ ~MessageQueueTableElement() [2/2]

Member Function Documentation

◆ checkElement() [1/2]

MessageQueueElement * checkElement ( int  source,
int  datatypeId,
int  tag 
)

check if the specified message exists or nor

Returns
pointer to MessageQueueElement, 0: no element
Parameters
sourcesource rank
datatypeIddata type id
tagtag of the message

Definition at line 278 of file paraCommCPP11.h.

References MessageQueueElement::getNext(), and MessageQueueTableElement::head.

◆ checkElement() [2/2]

MessageQueueElement * checkElement ( int  source,
int  datatypeId,
int  tag 
)

check if the specified message exists or nor

Returns
pointer to MessageQueueElement, 0: no element
Parameters
sourcesource rank
datatypeIddata type id
tagtag of the message

Definition at line 272 of file paraCommPth.h.

References MessageQueueElement::getNext(), and MessageQueueTableElement::head.

◆ checkElementWithTag() [1/2]

MessageQueueElement * checkElementWithTag ( int  tag)

check if the specified message with tag exists or nor

Returns
pointer to MessageQueueElement, 0: no element
Parameters
tagtag of the message

Definition at line 302 of file paraCommCPP11.h.

References MessageQueueElement::getNext(), and MessageQueueTableElement::head.

Referenced by ParaCommCPP11::iProbe(), and ParaCommPth::iProbe().

◆ checkElementWithTag() [2/2]

MessageQueueElement * checkElementWithTag ( int  tag)

check if the specified message with tag exists or nor

Returns
pointer to MessageQueueElement, 0: no element
Parameters
tagtag of the message

Definition at line 298 of file paraCommPth.h.

References MessageQueueElement::getNext(), and MessageQueueTableElement::head.

◆ enqueue() [1/2]

void enqueue ( ConditionVariable sentMsg,
bool *  sentMessage,
MessageQueueElement newElement 
)

enqueue a message

Parameters
sentMsgcondition variable for synchronization
sentMessagemutex for synchronization
newElementmessage queue element to enter

Definition at line 407 of file paraCommPth.h.

References MessageQueueTableElement::head, MessageQueueElement::link(), MessageQueueTableElement::size, and MessageQueueTableElement::tail.

◆ enqueue() [2/2]

void enqueue ( std::condition_variable &  sentMsg,
std::mutex &  queueLockMutex,
bool *  sentMessage,
MessageQueueElement newElement 
)

enqueue a message

Parameters
sentMsgcondition variable for synchronization
queueLockMutexmutex for synchronization
sentMessageflag for synchronization
newElementmessage queue element to enter

Definition at line 407 of file paraCommCPP11.h.

References MessageQueueTableElement::head, MessageQueueElement::link(), MessageQueueTableElement::size, and MessageQueueTableElement::tail.

Referenced by ParaCommCPP11::send(), ParaCommPth::send(), ParaCommCPP11::uTypeSend(), and ParaCommPth::uTypeSend().

◆ extarctElement() [1/4]

MessageQueueElement * extarctElement ( bool *  sentMessage)

extracts a message (This method is only for desctructor of ParaCommCPP11. No lock is necessary.)

Returns
pointer to the message
Parameters
sentMessagefor synchronization

Definition at line 381 of file paraCommCPP11.h.

References MessageQueueElement::getNext(), MessageQueueTableElement::head, MessageQueueElement::link(), MessageQueueTableElement::size, and MessageQueueTableElement::tail.

◆ extarctElement() [2/4]

MessageQueueElement * extarctElement ( bool *  sentMessage)

extracts a message (This method is only for desctructor of ParaCommCPP11. No lock is necessary.)

Returns
pointer to the message
Parameters
sentMessagefor synchronization

Definition at line 381 of file paraCommPth.h.

References MessageQueueElement::getNext(), MessageQueueTableElement::head, MessageQueueElement::link(), MessageQueueTableElement::size, and MessageQueueTableElement::tail.

◆ extarctElement() [3/4]

MessageQueueElement * extarctElement ( bool *  sentMessage,
int  source,
int  datatypeId,
int  tag 
)

◆ extarctElement() [4/4]

MessageQueueElement * extarctElement ( bool *  sentMessage,
int  source,
int  datatypeId,
int  tag 
)

extracts a message

Returns
pointer to the message
Parameters
sentMessagefor synchronization
sourcesource rank
datatypeIddata type id
tagtag of the message

Definition at line 320 of file paraCommPth.h.

References MessageQueueElement::getDataTypeId(), MessageQueueElement::getNext(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), MessageQueueTableElement::head, MessageQueueElement::link(), MessageQueueTableElement::size, and MessageQueueTableElement::tail.

◆ getHead() [1/2]

MessageQueueElement * getHead ( )

getter of head

Returns
head element pointer

Definition at line 432 of file paraCommCPP11.h.

References MessageQueueTableElement::head.

Referenced by ParaCommCPP11::iProbe(), ParaCommPth::iProbe(), ParaCommCPP11::probe(), and ParaCommPth::probe().

◆ getHead() [2/2]

MessageQueueElement * getHead ( )

getter of head

Returns
head element pointer

Definition at line 433 of file paraCommPth.h.

References MessageQueueTableElement::head.

◆ getSize() [1/2]

int getSize ( )

getter of size

Returns
size of the message queue

Definition at line 442 of file paraCommCPP11.h.

References MessageQueueTableElement::size.

Referenced by ParaCommCPP11::getNumOfMessagesWaitingToSend(), and ParaCommPth::getNumOfMessagesWaitingToSend().

◆ getSize() [2/2]

int getSize ( )

getter of size

Returns
size of the message queue

Definition at line 443 of file paraCommPth.h.

References MessageQueueTableElement::size.

◆ isEmpty() [1/2]

bool isEmpty ( )

check if the queue is empty or not

Returns
true, if it is empty, else false

Definition at line 452 of file paraCommCPP11.h.

References MessageQueueTableElement::head, and MessageQueueTableElement::size.

Referenced by ParaCommCPP11::iProbe(), and ParaCommPth::iProbe().

◆ isEmpty() [2/2]

bool isEmpty ( )

check if the queue is empty or not

Returns
true, if it is empty, else false

Definition at line 453 of file paraCommPth.h.

References MessageQueueTableElement::head, and MessageQueueTableElement::size.

◆ waitMessage() [1/7]

void waitMessage ( ConditionVariable sentMsg,
bool *  sentMessage 
)

wait for a message coming to a queue

Parameters
sentMsgcondition variable for synchronization
sentMessageflag for synchronization

Definition at line 467 of file paraCommPth.h.

References CONDITIONVARIABLE_WAIT.

◆ waitMessage() [2/7]

void waitMessage ( ConditionVariable sentMsg,
bool *  sentMessage,
int  source,
int *  tag 
)

wait for a specified message coming to a queue

Parameters
sentMsgcondition variable for synchronization
sentMessageflag for synchronization
sourcesource rank of the message
tagtag of the message

Definition at line 510 of file paraCommPth.h.

References CONDITIONVARIABLE_WAIT, MessageQueueElement::getNext(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), MessageQueueTableElement::head, and UG::TagAny.

◆ waitMessage() [3/7]

void waitMessage ( ConditionVariable sentMsg,
bool *  sentMessage,
int  source,
int  datatypeId,
int  tag 
)

wait for a specified message coming to a queue

Parameters
sentMsgcondition variable for synchronization
sentMessageflag for synchronization
sourcesource rank of the message
datatypeIddata type id of the message
tagtag of the message

Definition at line 478 of file paraCommPth.h.

References CONDITIONVARIABLE_WAIT, MessageQueueElement::getDataTypeId(), MessageQueueElement::getNext(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), and MessageQueueTableElement::head.

◆ waitMessage() [4/7]

void waitMessage ( std::condition_variable &  sentMsg,
std::mutex &  queueLockMutex,
bool *  sentMessage 
)

wait for a message coming to a queue

Parameters
sentMsgcondition variable for synchronization
queueLockMutexmutex for synchronization
sentMessageflag for synchronization

Definition at line 464 of file paraCommCPP11.h.

Referenced by ParaCommCPP11::probe(), ParaCommPth::probe(), ParaCommCPP11::receive(), ParaCommPth::receive(), ParaCommCPP11::uTypeReceive(), ParaCommPth::uTypeReceive(), ParaCommCPP11::waitSpecTagFromSpecSource(), and ParaCommPth::waitSpecTagFromSpecSource().

◆ waitMessage() [5/7]

void waitMessage ( std::condition_variable &  sentMsg,
std::mutex &  queueLockMutex,
bool *  sentMessage,
int  source,
int *  tag 
)

wait for a specified message coming to a queue

Parameters
sentMsgcondition variable for synchronization
queueLockMutexmutex for synchronization
sentMessageflag for synchronization
sourcesource rank of the message
tagtag of the message

Definition at line 541 of file paraCommCPP11.h.

References MessageQueueElement::getNext(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), MessageQueueTableElement::head, and UG::TagAny.

◆ waitMessage() [6/7]

void waitMessage ( std::condition_variable &  sentMsg,
std::mutex &  queueLockMutex,
bool *  sentMessage,
int  source,
int  datatypeId,
int  tag 
)

wait for a specified message coming to a queue

Parameters
sentMsgcondition variable for synchronization
queueLockMutexmutex for synchronization
sentMessageflag for synchronization
sourcesource rank of the message
datatypeIddata type id of the message
tagtag of the message

Definition at line 508 of file paraCommCPP11.h.

References MessageQueueElement::getDataTypeId(), MessageQueueElement::getNext(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), and MessageQueueTableElement::head.

◆ waitMessage() [7/7]

void waitMessage ( std::condition_variable &  sentMsg,
std::mutex &  queueLockMutex,
bool *  sentMessage,
int  source,
int  tag 
)

wait for a specified message coming to a queue

Parameters
sentMsgcondition variable for synchronization
queueLockMutexmutex for synchronization
sentMessageflag for synchronization
sourcesource rank of the message
tagtag of the message

Definition at line 477 of file paraCommCPP11.h.

References MessageQueueElement::getNext(), MessageQueueElement::getSource(), MessageQueueElement::getTag(), and MessageQueueTableElement::head.

Member Data Documentation

◆ head

◆ size

◆ tail

MessageQueueElement * tail
private

tail of the message queue

Definition at line 247 of file paraCommCPP11.h.

Referenced by MessageQueueTableElement::enqueue(), and MessageQueueTableElement::extarctElement().