appl.parallel.spmd.split
Interface SplitMap

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractSplitMap, SplitMap1DHorizontal, SplitMap1DVertical, SplitMap2D

public interface SplitMap
extends Serializable

Defines a split map over a SplittableResource. A split map is a layout of an actual partitioning. Each partition is associated with a number, ranging from 0 to noOfPartitions-1.
The partitions are layouted as rectangles, where each rectangle represents a partition or a neighborhood around a partition. Every partition or neighborhood can be queried. IP-Addresses can be associated with partitions to identify the server on which a partition is located.
The interface is largely implementation independent. Multiple implementations exist. You can query the SplitMap for neighbors of a partition.

Author:
Dominik Appl
See Also:
SplitMap1DHorizontal, SplitMap1DVertical, SplitMap2D, AbstractSplitMap

Method Summary
 int getCount()
           
 String getDescription()
           
 Rectangle getGlobalBounds()
           
 Rectangle getGlobalCalculationBounds()
           
 String getIP(int pos)
           
 Rectangle getLocalBounds(int pos)
          Gets the whole partition bounds (including available neighborhood)
 Rectangle getLocalCalculationBounds(int pos)
           
 Rectangle getLocalNeighborhoodBounds(int pos)
           
 int getNeighborhoodRange()
           
 int[] getNeighborsForPosition(int pos)
          returns an Array of neighbors for that position in the splitmap.
 Rectangle getPartitionBounds(int pos)
           
 Rectangle getPartitionCalculationBounds(int pos)
           
 Rectangle getPartitionNeighborhoodBounds(int pos)
           
 void makeMap()
          Creates the map
 void setIPs(String[] IPs)
           
 void setParameters(SplittableResource splittable, int neighborhoodRange, int noOfPartitions, AbstractSplitMap.NeighborhoodBoxingMode boxingMode)
          Sets the given values.
 void setWeights(double... weights)
          With this setter, you can assign each partition a weight, so that the data you split is not splitted equally, but arcording to these values.
 

Method Detail

getNeighborsForPosition

int[] getNeighborsForPosition(int pos)
returns an Array of neighbors for that position in the splitmap.

Parameters:
pos - position in splitmap
Returns:
the array

setWeights

void setWeights(double... weights)
With this setter, you can assign each partition a weight, so that the data you split is not splitted equally, but arcording to these values. A value of weights specifies how big the share of the partition with this position is. The sum of all values should be 1 or near to 1.

Parameters:
weights -
Throws:
UnsupportedOperationException - if the number of weights does not match the number of partitions

getDescription

String getDescription()
Returns:
a short description of the type of the Splitting

getPartitionCalculationBounds

Rectangle getPartitionCalculationBounds(int pos)
Parameters:
pos - the partition number
Returns:
the bounds of the partiton calculation area in global coordinates

getPartitionNeighborhoodBounds

Rectangle getPartitionNeighborhoodBounds(int pos)
Parameters:
pos - the partition number
Returns:
the bounds of the partiton neighborhood area in global coordinates

getPartitionBounds

Rectangle getPartitionBounds(int pos)
Parameters:
pos - the partition number
Returns:
the bounds of the partiton in global coordinates, which should be the same as getPartitionNeighborhoodBounds(int)

getGlobalCalculationBounds

Rectangle getGlobalCalculationBounds()
Returns:
getGlobalBounds()

getGlobalBounds

Rectangle getGlobalBounds()
Returns:
the bounds of the whole area starting with 0,0 in the topleft corner

getLocalBounds

Rectangle getLocalBounds(int pos)
Gets the whole partition bounds (including available neighborhood)

Parameters:
pos - the partition number
Returns:
the bounds of the partition using local coordinates. (0,0) is the topleft corner.

getLocalCalculationBounds

Rectangle getLocalCalculationBounds(int pos)
Parameters:
pos - the partition number
Returns:
the calculation bounds of the partition using local coordinates.

getLocalNeighborhoodBounds

Rectangle getLocalNeighborhoodBounds(int pos)
Parameters:
pos - the partition number
Returns:
the bounds of the partition using local coordinates. (0,0) is the topleft corner.

setParameters

void setParameters(SplittableResource splittable,
                   int neighborhoodRange,
                   int noOfPartitions,
                   AbstractSplitMap.NeighborhoodBoxingMode boxingMode)
Sets the given values. Call makeMap() for this changes to take effekt.

Parameters:
splittable - the resource on which the splitmap is calculated
neighborhoodRange - the neighborhoodrange
noOfPartitions - the number of partitions to be generated
boxingMode - the boxing mode

setIPs

void setIPs(String[] IPs)
Parameters:
IPs - a String Array of IPs which are mapped to the partition in the given order.

getIP

String getIP(int pos)
Parameters:
pos - position for this splitmap
Returns:
the IP associated with this position

getNeighborhoodRange

int getNeighborhoodRange()
Returns:
the neighborhoodRange

makeMap

void makeMap()
Creates the map


getCount

int getCount()
Returns:
the number of partitions