edu.unh.sdb.datasource
Class DSPartitionedStencil

java.lang.Object
  extended by edu.unh.sdb.datasource.DSStencil
      extended by edu.unh.sdb.datasource.DSPartitionedStencil
Direct Known Subclasses:
DSArrayStencil, DSBlockStencil, DSListStencil

public abstract class DSPartitionedStencil
extends DSStencil


Field Summary
protected  int headerLength
           
protected  RegularISPartitioning partitioning
           
protected  int[] partitioningDimensionsArray
           
protected  int partitionListBytesLength
           
 
Fields inherited from class edu.unh.sdb.datasource.DSStencil
dimensionality, space
 
Constructor Summary
DSPartitionedStencil(RegularISPartitioning partitioning)
           
 
Method Summary
protected  byte chooseBytesPerValue()
          determine how many bytes to use per offset when representing the stencil as an array of bytes.
abstract  void clear()
          Clear this stencil of all elements.
protected abstract  long getIndexedOffset(int index)
          Return the partition offset corresponding to the given index.
 IndexSpaceID getPartitionDimensions()
          Returns the dimensions of an element as an IndexSpaceID.
 int[] getPartitionDimensionsArray()
          Returns the dimensions of an element as an int array.
 int[] getPartitioningDimensions()
          Return an array of integers indicating the dimensions of the partitioning.
 byte[] getPartitionListBytes(byte[] bytes)
          Fill the given array with a representation of the partition list.
 int getPartitionListBytesLength()
          Return the number of bytes used by the last call to getPartitionListBytes().
 boolean inPartitioningBounds(IndexSpaceID pid)
          Return true if the argument represents a partition coordinate that is within the bounds of the stencil partitioning.
 boolean inPartitioningBounds(int[] coords)
          Return true if the argument represents a partition coordinate that is within the bounds of the stencil partitioning.
 long partitionVolume()
          Return the volume of a single element in the stencil partitioning.
protected abstract  void setElementFromOffset(int offset)
          Set the element corresponding to the 1D offset to be active.
 byte[] setPartitionListFromBytes(byte[] bytes)
          Set the partition list according to the data found in the given array of bytes.
 java.lang.String toString()
          Return a String representing the object.
 java.lang.String toString(java.lang.String indent)
           
 long volume()
          Computes the volume of the stencil partitioning space.
 
Methods inherited from class edu.unh.sdb.datasource.DSStencil
dim, get, getIndexedBounds, getIndexedBounds, getSpaceBounds, set, setElement, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partitioningDimensionsArray

protected int[] partitioningDimensionsArray

partitioning

protected RegularISPartitioning partitioning

partitionListBytesLength

protected int partitionListBytesLength

headerLength

protected int headerLength
Constructor Detail

DSPartitionedStencil

public DSPartitionedStencil(RegularISPartitioning partitioning)
Method Detail

getPartitionListBytes

public byte[] getPartitionListBytes(byte[] bytes)
Fill the given array with a representation of the partition list. This representation is meant to be parsed by setPartitionListFromBytes(). If the array argument is null or refers to an array of insufficient length, a new byte array will be allocated and a reference returned. After this method returns, the number of bytes consumed by the representation can be retrieved by a call to getPartitionListBytesLength().


setPartitionListFromBytes

public byte[] setPartitionListFromBytes(byte[] bytes)
Set the partition list according to the data found in the given array of bytes.


getPartitionListBytesLength

public int getPartitionListBytesLength()
Return the number of bytes used by the last call to getPartitionListBytes().


chooseBytesPerValue

protected byte chooseBytesPerValue()
determine how many bytes to use per offset when representing the stencil as an array of bytes.


getIndexedOffset

protected abstract long getIndexedOffset(int index)
Return the partition offset corresponding to the given index.


setElementFromOffset

protected abstract void setElementFromOffset(int offset)
Set the element corresponding to the 1D offset to be active.


clear

public abstract void clear()
Clear this stencil of all elements.


getPartitionDimensions

public IndexSpaceID getPartitionDimensions()
Returns the dimensions of an element as an IndexSpaceID.


getPartitionDimensionsArray

public int[] getPartitionDimensionsArray()
Returns the dimensions of an element as an int array.


getPartitioningDimensions

public int[] getPartitioningDimensions()
Return an array of integers indicating the dimensions of the partitioning. This represents the number of divisions per dimension of the space.


inPartitioningBounds

public final boolean inPartitioningBounds(IndexSpaceID pid)
Return true if the argument represents a partition coordinate that is within the bounds of the stencil partitioning. This is a partitioning space operation, not an index space operation.


inPartitioningBounds

public final boolean inPartitioningBounds(int[] coords)
Return true if the argument represents a partition coordinate that is within the bounds of the stencil partitioning. This is a partitioning space operation, not an index space operation.


volume

public long volume()
Computes the volume of the stencil partitioning space. i.e. the total number of elements.


partitionVolume

public long partitionVolume()
Return the volume of a single element in the stencil partitioning.


toString

public java.lang.String toString()
Return a String representing the object.

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String indent)