|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappl.parallel.spmd.SPMDClientController
public class SPMDClientController
This class controls all the parallelization action on the client side and is
the counterpart to SPMDServerController
. It is accessed by the model
developer by retrieving the SPMDClientInterface
from the
AbstractParallelStepModel
.
Nested Class Summary | |
---|---|
static class |
SPMDClientController.STATE
There are two states: STATE.INIT is the initializing state. |
Field Summary | |
---|---|
protected int |
referenceResourceID
Local calculation bounds on server side are calculated using the reference resource This is the ID of that resource |
Constructor Summary | |
---|---|
SPMDClientController(Vector<ComputingResourceContainer> computingResources,
double[] weights,
ClientDataServer spmdClient,
CommEventSink eventProxy)
Creates a new Client controller. |
Method Summary | |
---|---|
void |
addBaseParameter(Object parameter,
String parameterName)
Base Parameters are Objects which are used during the
execution of multiple SPMD-Tasks . |
void |
addBaseParameters(Object[] parameters,
String[] parameterNames)
Adds multiple Base-parameters at once. |
MultiDataObject |
addToMultiDataSplitControl(MultiGrid multiGrid,
String name)
This method is specialized on handling MultiGrids. |
MultiDataObject |
addToMultiDataSplitControl(Object[] splittableResources,
String name)
All resources of the array are submitted to split-control. |
void |
addToSplitControl(Object splittableResource,
String name)
The resource is submitted to splitControl. |
protected SplittableResource |
checkSplittable(Object splittableResource)
Checks if the given object is an instance of SplittableResource
and gives it back as splittable. |
protected SplittableResource[] |
checkSplittableArray(Object[] splittableResources)
checks if every object of the array is an instance of SplittableResource and gives it back as splittable |
void |
close()
disconnects from all servers |
SPMDClientController.STATE |
getState()
|
void |
mergeAllPartitions()
Merges all the partitions from the server into the sources, from which the objects were loaded (which may be the Xulu-Client, but may also be a database or an other location if this feature is implemented). |
void |
mergeMultiData(MultiDataObject multidata)
Merges all elements of the specified multidata object |
void |
mergeMultiData(MultiDataObject multidata,
int idx)
Merges the element at the specified index |
void |
mergePartition(int rootID)
The counterpart of SPMDClientInterface.addToSplitControl(Object, String) . |
void |
mergePartition(Object splittableResource)
The counterpart of SPMDClientInterface.addToSplitControl(Object, String) . |
Object[] |
runSPMDModelTask(SPMDTask task,
Object... parameters)
Run the given task on with the given parameters. |
void |
setBoxingMode(AbstractSplitMap.NeighborhoodBoxingMode boxingMode)
Here you can set the boxing mode. |
void |
setNeighborhoodRange(int neighborhoodRange)
Sets the neighborhood range. |
void |
setReferenceResource(Object splittableResource)
All local bounds are calculated on server side using the reference resource. |
void |
updateNeighborhood(MultiDataObject multiDataObject,
int index)
Signals to all participating servers to update the neighborhood and waits until the update is finished. |
void |
updateNeighborhood(Object splittableResource)
Signals to all participating servers to update the neighborhood and waits until the update is finished. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int referenceResourceID
Constructor Detail |
---|
public SPMDClientController(Vector<ComputingResourceContainer> computingResources, double[] weights, ClientDataServer spmdClient, CommEventSink eventProxy)
computingResources
- the resources which are used by this controllerspmdClient
- the spmd client responsible for the data retrievalweights
- the weights for the distribution over the computing resources
(values with a sum of 1) or null (distribution will be
average)eventProxy
- a RemoteEventHandler
for eventHandlingMethod Detail |
---|
public void addBaseParameter(Object parameter, String parameterName)
SPMDClientInterface
Base Parameters
are Objects which are used during the
execution of multiple SPMD-Tasks
. They are transfered
to each of the participating
computing resources
but are not synchronized
with the client and of course in no way splitted. SPMDClientInterface.addBaseParameters(Object[], String[])
method.
addBaseParameter
in interface SPMDClientInterface
SPMDServerController
public void addBaseParameters(Object[] parameters, String[] parameterNames)
SPMDClientInterface
SPMDClientInterface.addBaseParameter(Object, String)
.
addBaseParameters
in interface SPMDClientInterface
parameters
- an array of parametersparameterNames
- an array of names. The indexes of parameters and parameter
names must of course matchpublic MultiDataObject addToMultiDataSplitControl(Object[] splittableResources, String name)
SPMDClientInterface
SPMDServerController.getMultiData(String)
method. It is assumed,
that all resources have the same Dimension. The same SplitMap
and
splitmap Position is used for all elements. used for every element.
addToMultiDataSplitControl
in interface SPMDClientInterface
splittableResources
- the resource to be splittedname
- the name of the resource
SPMDServerController
public MultiDataObject addToMultiDataSplitControl(MultiGrid multiGrid, String name)
SPMDClientInterface
SPMDClientInterface.addToMultiDataSplitControl(Object[], String)
could be used, but
using this method won't handle updates to the MultiGrid required for
correct display in the XuluModellingPlatform.
The elements of the Multigrid are split and send to the participating
computing units. The partitions can be requested on server side using the
SPMDServerController.getMultiData(String)
method. It is assumed,
that all resources have the same Dimension. The same SplitMap
and
splitmap position is used for all elements.
addToMultiDataSplitControl
in interface SPMDClientInterface
name
- the name of the resource
SPMDServerController
public void addToSplitControl(Object splittableResource, String name)
SPMDClientInterface
SPMDServerController.getPartition(String)
method. runSPMDModelTask
is run
next time, the metadata (and all
base Parameters
btw.) are
Transfered to the servers.
addToSplitControl
in interface SPMDClientInterface
splittableResource
- the resource to be splittedname
- a name for the resource (you will be able to request the
resource on server side using this name)SPMDServerController
protected SplittableResource checkSplittable(Object splittableResource)
SplittableResource
and gives it back as splittable.
splittableResource
-
SplittableResource
UnsupportedOperationException
- if not instance of SplittableResource
protected SplittableResource[] checkSplittableArray(Object[] splittableResources)
SplittableResource
and gives it back as splittable
splittableResources
- an array of (hopefully)
SplittableResources
SplittableResource
array
UnsupportedOperationException
- if not all elements are instances of
SplittableResource
or if the splitHeights or
SplitWidths do not matchpublic void close()
public SPMDClientController.STATE getState()
public void mergeAllPartitions()
SPMDClientInterface
mergeAllPartitions
in interface SPMDClientInterface
SPMDClientInterface.mergeAllPartitions()
,
SPMDClientInterface.addToSplitControl(Object, String)
public void mergeMultiData(MultiDataObject multidata)
SPMDClientInterface
mergeMultiData
in interface SPMDClientInterface
multidata
- the multidata to mergepublic void mergeMultiData(MultiDataObject multidata, int idx)
SPMDClientInterface
mergeMultiData
in interface SPMDClientInterface
multidata
- the multidata object containing the element to mergeidx
- the position of the element to mergepublic void mergePartition(int rootID)
SPMDClientInterface
SPMDClientInterface.addToSplitControl(Object, String)
.
Merges the partitions from the server into the sources, from which the
objects were loaded (which will be the Xulu-Client in most cases, but may
also be a database at an other location if this feature is implemented).
Uses multithreading.
mergePartition
in interface SPMDClientInterface
rootID
- the ID of the source to be merged.SPMDClientInterface.mergeAllPartitions()
,
SPMDClientInterface.addToSplitControl(Object, String)
public void mergePartition(Object splittableResource)
SPMDClientInterface
SPMDClientInterface.addToSplitControl(Object, String)
.
Merges the partitions from the server into the sources, from which the
objects were loaded (which will be the Xulu-Client in most cases, but may
also be a database at an other location if this feature is implemented).
Use SPMDClientInterface.mergeAllPartitions()
to merge all partitions at once.
mergePartition
in interface SPMDClientInterface
splittableResource
- the resource to be merged. (must be an instance of
SplittableResource
SPMDClientInterface.mergeAllPartitions()
,
SPMDClientInterface.addToSplitControl(Object, String)
public Object[] runSPMDModelTask(SPMDTask task, Object... parameters) throws Throwable
SPMDClientInterface
runSPMDModelTask
in interface SPMDClientInterface
task
- the task to be submitted. There may be certain restrictions of
the task to be submitted.
null
values inside the array.
Throwable
- the Exceptions thrown on serverside!public void setBoxingMode(AbstractSplitMap.NeighborhoodBoxingMode boxingMode)
SPMDClientInterface
AbstractSplitMap.NeighborhoodBoxingMode
setBoxingMode
in interface SPMDClientInterface
boxingMode
- the boxing modepublic void setNeighborhoodRange(int neighborhoodRange)
SPMDClientInterface
setNeighborhoodRange
in interface SPMDClientInterface
neighborhoodRange
- the width of the neighborhood range (in cells)public void setReferenceResource(Object splittableResource)
SPMDClientInterface
splittable resources
of different
sizes or with different SplitMaps
are used, it is
possible to get the local bounds of an special resource using the
SPMDServerController.getLocalCalculationBounds(appl.parallel.spmd.split.DataPartition)
method of the SPMDServerController. SPMDClientInterface.addToSplitControl(Object, String)
will set the reference.
setReferenceResource
in interface SPMDClientInterface
splittableResource
- the new reference resource (must be an instance of
SplittableResource
)public void updateNeighborhood(Object splittableResource)
SPMDClientInterface
updateNeighborhood
in interface SPMDClientInterface
splittableResource
- (must be an instance of SplittableResource
public void updateNeighborhood(MultiDataObject multiDataObject, int index)
SPMDClientInterface
updateNeighborhood
in interface SPMDClientInterface
multiDataObject
- the MultiDataObject
to be updatedindex
- the index of the partition to be updated
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |