bsp_exptable.h File Reference

Defines struct's, prototypes and inlined functions of the ExpandableTable and FixedElSizeTable 'classes' and some struct's of DeliveryTable, RequestTable and MemoryRegister. 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  MemRegInfo
 Additional data needed by a MemoryRegister object. More...
struct  ReqInfo
 Additional data needed by a RequestTable. 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  _DInfo
 Data structure for additional info in a VarSizeElement. More...
struct  DelivElement
 Data element stored in a DeliveryTable. 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
 type of action
enum  _ItemType {
  popreg, pushreg, put, get,
  send, settag
}
 type of action More...

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 unsigned int nprocs, const unsigned int rows, const int unsigned 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 unsigned 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 unsigned int nprocs, const unsigned int rows, const unsigned int elsize, const union SpecInfo info)
 initializes an FixedElSizeTable
static void fixedElSizeTable_push (ExpandableTable *restrict table, const unsigned int proc, void(*changeinfo)(union SpecInfo *restrict, unsigned int, unsigned int), const void *restrict element)
 adds an element for a specific processor to the table and expands the table when necessary.

Defines

#define ALIGNED_TYPE   double
#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
static unsigned int max (const unsigned int *restrict array, const int n, const int stride)
 calculates the maximum value of array[0], array[stride], array[2*stride], .


Detailed Description

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

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

Definition in file bsp_exptable.h.


Define Documentation

#define ALIGNED_TYPE   double
 

Definition at line 38 of file bsp_exptable.h.

Referenced by bsp_get_tag(), bsp_hpmove(), bsp_move(), deliveryTable_execute(), deliveryTable_expand(), deliveryTable_initialize(), deliveryTable_push(), and deliveryTable_reset().

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

gives the maximum of x and y

Definition at line 41 of file bsp_exptable.h.

Referenced by deliveryTable_push(), and max().

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

gives the minimum of x and y

Definition at line 44 of file bsp_exptable.h.

Referenced by bsp_begin(), and bsp_move().


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
 

type of action

typedef char* MemRegElement
 

Data element stored in a MemoryRegister.

It is a pointer to a registered memory area

Definition at line 89 of file bsp_exptable.h.


Enumeration Type Documentation

enum _ItemType
 

type of action

Enumerator:
popreg 
pushreg 
put 
get 
send 
settag 

Definition at line 132 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.

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 275 of file bsp_exptable.h.

References bsp_free().

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

Here is the call graph for this function:

static void expandableTable_expand ExpandableTable *restrict  table,
const unsigned 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 288 of file bsp_exptable.h.

References bsp_free(), and bsp_malloc.

Referenced by deliveryTable_expand(), fixedElSizeTable_push(), memoryRegister_expand(), and requestTable_expand().

Here is the call graph for this function:

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

Definition at line 249 of file bsp_exptable.h.

References bsp_calloc, and bsp_malloc.

Referenced by deliveryTable_initialize(), and fixedElSizeTable_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 266 of file bsp_exptable.h.

Referenced by deliveryTable_reset(), and requestTable_reset().

static void fixedElSizeTable_initialize ExpandableTable *restrict  table,
const unsigned int  nprocs,
const unsigned int  rows,
const unsigned 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 321 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 unsigned int  proc,
void(*)(union SpecInfo *restrict, unsigned int, unsigned 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 338 of file bsp_exptable.h.

References expandableTable_expand().

Referenced by memoryRegister_push(), and requestTable_push().

Here is the call graph for this function:

static unsigned int max const unsigned int *restrict  array,
const int  n,
const int  stride
[inline, static]
 

calculates the maximum value of array[0], array[stride], array[2*stride], .

.., array[n].

Parameters:
array Reference to array
n Size of array
stride Stride.
Returns:
maximum value

Definition at line 75 of file bsp_exptable.h.

References MAX.

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 62 of file bsp_exptable.h.

Referenced by bsp_get_tag(), bsp_hpmove(), bsp_move(), deliveryTable_execute(), deliveryTable_initialize(), deliveryTable_push(), and deliveryTable_reset().


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