bsp_mesgqueue.h File Reference

Defines methods on MessageQueue. More...

#include "bsp_exptable.h"
#include <config.h>

Include dependency graph for bsp_mesgqueue.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static void messageQueue_initialize (ExpandableTable *restrict table, const int rows)
 Initializes a MessageQueue.
static void messageQueue_destruct (ExpandableTable *restrict table)
 Destructor of MessageQueue object.
static void messageQueue_reset (ExpandableTable *restrict table)
 Clears a MessageQueue.
static void messageQueue_expand (ExpandableTable *restrict table, const int rows)
 Adds aditional rows to a MessageQueue.
static void messageQueue_push (ExpandableTable *restrict table, char *restrict data, int size)
 Adds a message to the Queue.
static int messageQueue_setTagSize (ExpandableTable *restrict table, const int tag_size)
 sets tag size.
static int messageQueue_getTagSize (const ExpandableTable *restrict table)
 Query tag size.
static int messageQueue_getNumber (const ExpandableTable *restrict table)
static int messageQueue_getAccumSize (const ExpandableTable *restrict table)
 Query the sum of the sizes of all payloads of the messages in queue.
static int messageQueue_getTag (ExpandableTable *restrict table, void *restrict tag)
 Query the tag and payload size of the current message.
static int messageQueue_dequeue (ExpandableTable *restrict table, void *restrict payload, int size)
 Dequeue current message.
static int messageQueue_hpdequeue (ExpandableTable *restrict table, const void **const tag, const void **const payload)
 Dequeues current message.


Detailed Description

Defines methods on MessageQueue.

MessageQueue is queue for holding BSMP messages.

Author:
Wijnand Suijlen

Definition in file bsp_mesgqueue.h.


Function Documentation

static int messageQueue_dequeue ExpandableTable *restrict  table,
void *restrict  payload,
int  size
[inline, static]
 

Dequeue current message.

Copies at least size bytes of payload of current message to supplied memory location.

Parameters:
table Reference to MessageQueue
payload Reference to a memory location of size MIN( size, payload size)
size Maximum number of bytes to copy
Returns:
actual number of bytes copied

Definition at line 184 of file bsp_mesgqueue.h.

References MIN, and no_slots().

Referenced by bsp_move().

Here is the call graph for this function:

static void messageQueue_destruct ExpandableTable *restrict  table  )  [inline, static]
 

Destructor of MessageQueue object.

Parameters:
table Reference to MessageQueue object

Definition at line 60 of file bsp_mesgqueue.h.

References expandableTable_destruct().

Referenced by bsp_end().

Here is the call graph for this function:

static void messageQueue_expand ExpandableTable *restrict  table,
const int  rows
[inline, static]
 

Adds aditional rows to a MessageQueue.

Parameters:
table Reference to MessageQueue
rows Number of rows to be added

Definition at line 84 of file bsp_mesgqueue.h.

References expandableTable_expand().

Referenced by messageQueue_push().

Here is the call graph for this function:

static int messageQueue_getAccumSize const ExpandableTable *restrict  table  )  [inline, static]
 

Query the sum of the sizes of all payloads of the messages in queue.

Parameters:
table Reference to MessageQueue
Returns:
The sum of the sizes of all payload of the messages in queue

Definition at line 153 of file bsp_mesgqueue.h.

Referenced by bsp_qsize().

static int messageQueue_getNumber const ExpandableTable *restrict  table  )  [inline, static]
 

Definition at line 143 of file bsp_mesgqueue.h.

Referenced by bsp_get_tag(), bsp_hpmove(), and bsp_qsize().

static int messageQueue_getTag ExpandableTable *restrict  table,
void *restrict  tag
[inline, static]
 

Query the tag and payload size of the current message.

Parameters:
table Reference to MessageQueue
tag Pointer to memory location which can contain a tag. This memory will be set to the tag
Returns:
Payload size

Definition at line 165 of file bsp_mesgqueue.h.

Referenced by bsp_get_tag().

static int messageQueue_getTagSize const ExpandableTable *restrict  table  )  [inline, static]
 

Query tag size.

Returns:
tag size

Definition at line 133 of file bsp_mesgqueue.h.

Referenced by bsp_send(), and bsp_set_tagsize().

static int messageQueue_hpdequeue ExpandableTable *restrict  table,
const void **const   tag,
const void **const   payload
[inline, static]
 

Dequeues current message.

Sets the supplied pointers to memory location which contain tag and payload.

Parameters:
table Reference to MessageQueue
tag Reference to a pointer which can point to a tag
payload Reference to a pointer which can point to the payload
Returns:
Size of the payload

Definition at line 214 of file bsp_mesgqueue.h.

References no_slots().

Referenced by bsp_hpmove().

Here is the call graph for this function:

static void messageQueue_initialize ExpandableTable *restrict  table,
const int  rows
[inline, static]
 

Initializes a MessageQueue.

A MessageQueue is a VarElSizeTable with only one column / one processor.

Parameters:
table Reference to a MessageQueue object
rows Number of rows

Definition at line 44 of file bsp_mesgqueue.h.

References MesgQInfo::accum_size, MesgQInfo::inslot_offset, SpecInfo::mesgq, MesgQInfo::n_mesg, MesgQInfo::n_mesg_deq, MesgQInfo::slot_offset, MesgQInfo::tag_size, and varElSizeTable_initialize().

Referenced by bsp_begin().

Here is the call graph for this function:

static void messageQueue_push ExpandableTable *restrict  table,
char *restrict  data,
int  size
[inline, static]
 

Adds a message to the Queue.

Because this function is used only in combination with a DeliveryTable the entire combined object is copied to the MessageQueue

Parameters:
table Reference to MessageQueue
data Reference to a send element in a DeliveryTable
size Length of data in bytes

Definition at line 97 of file bsp_mesgqueue.h.

References MAX, messageQueue_expand(), and no_slots().

Referenced by deliveryTable_execute().

Here is the call graph for this function:

static void messageQueue_reset ExpandableTable *restrict  table  )  [inline, static]
 

Clears a MessageQueue.

Parameters:
table Reference to MessageQueue object

Definition at line 69 of file bsp_mesgqueue.h.

References expandableTable_reset().

Referenced by bsp_sync().

Here is the call graph for this function:

static int messageQueue_setTagSize ExpandableTable *restrict  table,
const int  tag_size
[inline, static]
 

sets tag size.

MessageQueue itself doesn't use this value. It just remembers it

Parameters:
table Reference to MessageQueue
tag_size New tag size
Returns:
Old tag size

Definition at line 122 of file bsp_mesgqueue.h.

Referenced by deliveryTable_execute().


Generated on Sat Apr 8 12:58:58 2006 for BSPonMPI by  doxygen 1.4.6