sc::MemoryIter Class Reference

This iterates through data in a global array. More...

#include <util/group/memiter.h>

List of all members.

Public Member Functions

 MemoryIter (void *data, distsize_t *offsets, int n)
 Create the MemoryIter.
void begin (distsize_t offset, int size)
 Initialize the iterator to a block of the global array.
int ready ()
 Returns true if there is more data to process.
void next ()
 Advance to the next subblock.
void * data ()
 The local offset for the current block within the data array given to the constructor.
int node ()
 The node on which the current subblock resides.
int offset ()
 The local offset of the current subblock on the node.
int size ()
 The size of the current subblock.
int local (distsize_t offset, int size, int node)
 Returns true if all data is local to node.


Detailed Description

This iterates through data in a global array.

Given an offset and size for data in a globally distributed array, this iterates through the nodes that store the block, giving the size and location of the subblocks resident on each of these nodes.


Constructor & Destructor Documentation

sc::MemoryIter::MemoryIter ( void *  data,
distsize_t *  offsets,
int  n 
)

Create the MemoryIter.

Parameters:
data an array with n bytes. It is up to the programmer to read/write this array, MemoryIter only maintains the current pointer within this array (see the data() member).
offsets the global offset for part stored on each node. This has one entry for each node.
n the number of nodes


Member Function Documentation

void sc::MemoryIter::begin ( distsize_t  offset,
int  size 
)

Initialize the iterator to a block of the global array.

Parameters:
offset the offset for the block.
size the number of bytes in the block.

void* sc::MemoryIter::data (  )  [inline]

The local offset for the current block within the data array given to the constructor.


The documentation for this class was generated from the following file:

Generated at Sun Feb 22 10:13:03 2009 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.5.6.
These pages are hosted on SourceForge.net