bsp_exptable.h File Reference

Defines struct's, prototypes and inlined functions of the ExpandableTable, FixedElSizeTable and VarElSizeTable 'classes' and some struct's of DeliveryTable, RequestTable, MemoryRegister and MessageQueue. More...

#include <stdlib.h>
#include <memory.h>
#include "bsp_alloc.h"
#include <mpi.h>
#include <config.h>

Include dependency graph for bsp_exptable.h:

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

Go to the source code of this file.

Data Structures

struct  MesgQInfo
 Additional data needed by a MessageQueue object. More...
struct  MemRegInfo
 Additional data needed by a MemoryRegister object. More...
struct  ReqElement
 Data element stored in a RequestTable object. More...
struct  PutObject
 additional info for a bsp_put() More...
struct  SendObject
 additional info for a bsp_send() More...
struct  PushRegObject
 Additional info for a bsp_push_reg(). More...
struct  PopRegObject
 Additional info for a bsp_pop_Reg(). More...
struct  SetTagObject
 Additional info for a bsp_set_tagsize(). More...
union  _VarSzInfo
 Data structure for additional info in a VarSizeElement. More...
struct  VarSizeElement
 Data element stored in a VarElSizeTable (e.g. More...
struct  DelivInfo
 Additional data for a DeliveryTable. More...
union  SpecInfo
 Datastructure storing specific info. More...
struct  _ExpandableTable
 a table with nprocs number columns and rows number of rows, where each row has a height of slot_size bytes. More...

MemoryRegister data structures

typedef char * MemRegElement
 Data element stored in a MemoryRegister.

VarElSizeTable data structures

typedef enum _ItemType ItemType
enum  _ItemType {
  popreg, pushreg, put, get,
  send, settag
}

ExpandableTable

typedef _ExpandableTable ExpandableTable
 a table with nprocs number columns and rows number of rows, where each row has a height of slot_size bytes.
void expandableTable_comm (const ExpandableTable *restrict send, ExpandableTable *restrict recv, MPI_Comm communicator)
 communicates the table to the other processor.
static void expandableTable_initialize (ExpandableTable *restrict table, const int nprocs, const int rows, const int elsize, const union SpecInfo info)
static void expandableTable_reset (ExpandableTable *restrict table)
 clears contents of the table
static void expandableTable_destruct (ExpandableTable *restrict table)
 frees memory taken by an ExpandableTable object
static void expandableTable_expand (ExpandableTable *restrict table, const int rows, const union SpecInfo newinfo)
 Add some additional rows to the table.

FixedElSizeTable member functions

A table which contains elements of fixed size. Descendants are MemoryRegister

static void fixedElSizeTable_initialize (ExpandableTable *restrict table, const int nprocs, const int rows, const int elsize, const union SpecInfo info)
 initializes an FixedElSizeTable
static void fixedElSizeTable_push (ExpandableTable *restrict table, const int proc, void(*changeinfo)(union SpecInfo *restrict, int, int), const void *restrict element)
 adds an element for a specific processor to the table and expands the table when necessary.

VarElSizeTable member functions

a table with variable-length elements

static void varElSizeTable_initialize (ExpandableTable *restrict table, const int nprocs, const int rows, const union SpecInfo info)
 Initializes a VarElSizeTable.
static int varElSizeTable_push (ExpandableTable *restrict table, const int proc, void(*changeinfo)(union SpecInfo *restrict, int, int), VarSizeElement elem)
 Adds an element to the table and expands the table when necessary.

Defines

#define MAX(x, y)   ( ((x) > (y))?(x):(y))
 gives the maximum of x and y
#define MIN(x, y)   ( ((x) < (y))?(x):(y))
 gives the minimum of x and y

Functions

static int no_slots (const int bytes, const int slot_size)
 calculate how many slots are necessary to contain a number of bytes


Detailed Description

Defines struct's, prototypes and inlined functions of the ExpandableTable, FixedElSizeTable and VarElSizeTable 'classes' and some struct's of DeliveryTable, RequestTable, MemoryRegister and MessageQueue.

See also:
Implementation in the Architecture description
Author:
Wijnand Suijlen

Definition in file bsp_exptable.h.


Define Documentation

#define MAX x,
 )     ( ((x) > (y))?(x):(y))
 

gives the maximum of x and y

Definition at line 39 of file bsp_exptable.h.

Referenced by deliveryTable_pushPut(), deliveryTable_pushSend(), messageQueue_push(), and varElSizeTable_push().

#define MIN x,
 )     ( ((x) < (y))?(x):(y))
 

gives the minimum of x and y

Definition at line 42 of file bsp_exptable.h.

Referenced by bsp_begin(), and messageQueue_dequeue().


Typedef Documentation

typedef struct _ExpandableTable ExpandableTable
 

a table with nprocs number columns and rows number of rows, where each row has a height of slot_size bytes.

This table can be communicated to the other processors by means of expandableTable_comm(): each columns is send to processors with rank equal to the column number

typedef enum _ItemType ItemType
 

typedef char* MemRegElement
 

Data element stored in a MemoryRegister.

It is a pointer to a registered memory area

Definition at line 88 of file bsp_exptable.h.


Enumeration Type Documentation

enum _ItemType
 

Enumerator:
popreg 
pushreg 
put 
get 
send 
settag 

Definition at line 120 of file bsp_exptable.h.


Function Documentation

void expandableTable_comm const ExpandableTable *restrict  send,
ExpandableTable *restrict  recv,
MPI_Comm  communicator
 

communicates the table to the other processor.

Each column of the table corresponds to a chunk of data which is to be send to the processor with rank equal to the column number. The received data is equally ordered, i.e.: each column corresponds to the data received from the processor with rank equal to the column number.

Parameters:
send Reference to a table which should be send to the other processors
recv Reference to a table which could contain the data received. This table is expanded if necessary
communicator MPI Communicator group which exchange the tables.

Definition at line 47 of file bsp_exptable.c.

Referenced by bsp_sync().

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

frees memory taken by an ExpandableTable object

Parameters:
table Reference to an ExpandableTable object

Definition at line 264 of file bsp_exptable.h.

References bsp_free().

Referenced by deliveryTable_destruct(), memoryRegister_destruct(), messageQueue_destruct(), and requestTable_destruct().

Here is the call graph for this function:

static void expandableTable_expand ExpandableTable *restrict  table,
const int  rows,
const union SpecInfo  newinfo
[inline, static]
 

Add some additional rows to the table.

Parameters:
table Reference to an ExpandableTable object
rows Number of rows to add
newinfo The object specific information may have to be changed. This can be supplied via this parameter

Definition at line 278 of file bsp_exptable.h.

References bsp_free(), and bsp_malloc.

Referenced by fixedElSizeTable_push(), memoryRegister_expand(), messageQueue_expand(), requestTable_expand(), and varElSizeTable_push().

Here is the call graph for this function:

static void expandableTable_initialize ExpandableTable *restrict  table,
const int  nprocs,
const int  rows,
const int  elsize,
const union SpecInfo  info
[inline, static]
 

Definition at line 236 of file bsp_exptable.h.

References bsp_calloc, and bsp_malloc.

Referenced by fixedElSizeTable_initialize(), and varElSizeTable_initialize().

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

clears contents of the table

Parameters:
table Reference to an ExpandableTable object

Definition at line 254 of file bsp_exptable.h.

Referenced by bsp_sync(), deliveryTable_reset(), and messageQueue_reset().

static void fixedElSizeTable_initialize ExpandableTable *restrict  table,
const int  nprocs,
const int  rows,
const int  elsize,
const union SpecInfo  info
[inline, static]
 

initializes an FixedElSizeTable

Parameters:
table Reference to an ExpandableTable
nprocs Number of processors
rows Number of rows
elsize Size of an element
info addation info

Definition at line 310 of file bsp_exptable.h.

References expandableTable_initialize().

Referenced by memoryRegister_initialize(), and requestTable_initialize().

Here is the call graph for this function:

static void fixedElSizeTable_push ExpandableTable *restrict  table,
const int  proc,
void(*)(union SpecInfo *restrict, int, int)  changeinfo,
const void *restrict  element
[inline, static]
 

adds an element for a specific processor to the table and expands the table when necessary.

Parameters:
table Reference to a FixedSizeElement
proc Destination processor
changeinfo Reference to the function which changes the table info in case of table expansion
element pointer to data element

Definition at line 326 of file bsp_exptable.h.

References expandableTable_expand().

Referenced by memoryRegister_push(), and requestTable_push().

Here is the call graph for this function:

static int no_slots const int  bytes,
const int  slot_size
[inline, static]
 

calculate how many slots are necessary to contain a number of bytes

Parameters:
bytes Number of bytes
slot_size Size of the slots in bytes

Definition at line 60 of file bsp_exptable.h.

Referenced by deliveryTable_pushPut(), deliveryTable_pushSend(), messageQueue_dequeue(), messageQueue_hpdequeue(), messageQueue_push(), and varElSizeTable_push().

static void varElSizeTable_initialize ExpandableTable *restrict  table,
const int  nprocs,
const int  rows,
const union SpecInfo  info
[inline, static]
 

Initializes a VarElSizeTable.

Parameters:
table Reference to a VarElSizeTable object
nprocs Number of processors
rows Number of rows
info additional info

Definition at line 363 of file bsp_exptable.h.

References expandableTable_initialize().

Referenced by deliveryTable_initialize(), and messageQueue_initialize().

Here is the call graph for this function:

static int varElSizeTable_push ExpandableTable *restrict  table,
const int  proc,
void(*)(union SpecInfo *restrict, int, int)  changeinfo,
VarSizeElement  elem
[inline, static]
 

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

Parameters:
table Reference to a VarElSizeTable
proc Destination processor
changeinfo Reference to a function which changes table info in case of table expansion
elem Element to be added

Definition at line 377 of file bsp_exptable.h.

References VarSizeElement::data, expandableTable_expand(), MAX, no_slots(), and VarSizeElement::size.

Here is the call graph for this function:


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