bsp_delivtable.h File Reference

Defines the prototypes of the methods on a DeliveryTable object. More...

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

Include dependency graph for bsp_delivtable.h:

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

Go to the source code of this file.

Functions

void deliveryTable_execute (ExpandableTable *restrict, ExpandableTable *restrict, MessageQueue *restrict, const int)
static void deliveryTable_initialize (ExpandableTable *restrict table, const int nprocs, const int rows)
 initializes a DeliveryTable object
static void deliveryTable_reset (ExpandableTable *restrict table)
 clears a DeliveryTable object
static void deliveryTable_destruct (ExpandableTable *restrict table)
 Frees memory allocated by a DeliveryTable.
static void deliveryTable_expand (ExpandableTable *restrict table, const int rows)
 Expands a DeliveryTable.
static void * deliveryTable_push (ExpandableTable *restrict table, const int proc, const DelivElement element, const ItemType type)
 Adds an element to the table and expands the table when necessary.


Detailed Description

Defines the prototypes of the methods on a DeliveryTable object.

DeliveryTable provides two functionalities:

  1. It is a queue for actions which have to be performed during the next bsp_sync(), e.g. a bsp_set_tagsize() or a bsp_pop_reg()
  2. It is a communication buffer for data which has to be sent during the next bsp_sync(), e.g. a bsp_put()

These are the same if you consider sends and puts to be actions as well: A put or send is a memory copy action on the remote processor. Actions like bsp_set_tagsize() which do not need communication are placed in the column of the local processor (the column number is equal to the rank of the local processor).

Each action consists of a tag and a payload. The tag is a DelivElement, the payload data can be anything as long it is not bigger as described in the tag. The tag stores information about the size, action specific information and where to find the next action of the same type. The tag does not store what type of action it represents, because DeliveryTable knows where to find the first action of a certain type (DelivInfo ) . Subsequent actions are referenced by the next value in the tag. In other words: Each column stores 6 linked lists of actions (pushreg, popreg, put, get, send, settag). Information about these linked lists (the arrays referenced in DelivInfo) are stored at the top of the columns. This way, the information is automatically communicated to the receiving processors.

You may wonder why these linked lists are necessary. It also works without these lists if you store the type of action in the tag. However, when executing a column, it has to be determined what type each actions. This results in a switch-case statement in a tight loop. Branches are expensive and using these linked lists they have become unnecessary.

Author:
Wijnand Suijlen

Definition in file bsp_delivtable.h.


Function Documentation

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

Frees memory allocated by a DeliveryTable.

Parameters:
table Reference to a DeliveryTable

Definition at line 135 of file bsp_delivtable.h.

References bsp_free(), and expandableTable_destruct().

Referenced by bsp_end().

Here is the call graph for this function:

void deliveryTable_execute ExpandableTable restrict,
ExpandableTable restrict,
MessageQueue restrict,
const   int
 

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

Expands a DeliveryTable.

Parameters:
table Reference to a DeliveryTable object
rows Number of rows which should be added to this table

Definition at line 149 of file bsp_delivtable.h.

References ALIGNED_TYPE, and expandableTable_expand().

Referenced by deliveryTable_push().

Here is the call graph for this function:

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

initializes a DeliveryTable object

Parameters:
table Reference to a DeliveryTable
nprocs Number of processors to allocate memory for
rows Number of rows to allocate

Definition at line 83 of file bsp_delivtable.h.

References ALIGNED_TYPE, bsp_malloc, DelivInfo::count, SpecInfo::deliv, DelivInfo::end, expandableTable_initialize(), no_slots(), and DelivInfo::start.

Referenced by bsp_begin().

Here is the call graph for this function:

static void* deliveryTable_push ExpandableTable *restrict  table,
const int  proc,
const DelivElement  element,
const ItemType  type
[inline, static]
 

Adds an element to the table and expands the table when necessary.

The payload may be copied to the address referenced by the returned pointer.

Parameters:
table Reference to a VarElSizeTable
proc Destination processor
element Element to be added
type Type of element
Returns:
pointer to memory location in which data can be copied

Definition at line 176 of file bsp_delivtable.h.

References ALIGNED_TYPE, deliveryTable_expand(), MAX, no_slots(), restrict, and DelivElement::size.

Referenced by bsp_pop_reg(), bsp_push_reg(), bsp_put(), bsp_send(), bsp_set_tagsize(), and requestTable_execute().

Here is the call graph for this function:

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

clears a DeliveryTable object

Parameters:
table Reference to a DeliveryTable

Definition at line 116 of file bsp_delivtable.h.

References ALIGNED_TYPE, expandableTable_reset(), and no_slots().

Referenced by bsp_sync().

Here is the call graph for this function:


Generated on Sat Apr 8 20:13:18 2006 for BSPonMPI by  doxygen 1.4.6