appl.parallel.spmd
Interface AdvancedSPMDServerInterface

All Superinterfaces:
SPMDServerInterface
All Known Implementing Classes:
AdvancedSPMDServerController

public interface AdvancedSPMDServerInterface
extends SPMDServerInterface

Performance optimizations can be made with this type of controller. It allows heavy multithreading. Also allows preloading of partitions using SyncPoints.

Author:
Dominik Appl

Method Summary
 void clearSyncData()
          You should call this method from time to time to clear all syncpoints and the associated threads out of the memory
 boolean isMasterThread()
          If there are multiple processors on the machine and the current task supports supports multithreading there are several threads created.
 void preloadMultiPartition(String partition, int idx, SyncPoint s)
          The partition is loaded in a separate thread into the local PartitionDataManager You must specify the partitionname and a SyncPoint.
 void preloadPartition(String partition, SyncPoint s)
          The partition is loaded in a separate thread into the local PartitionDataManager You must specify the partitionname and a SyncPoint.
 void synchronizeToSyncPoint(SyncPoint s)
          Waits until the Thread with the specified SyncPoint finishes.
 
Methods inherited from interface appl.parallel.spmd.SPMDServerInterface
destroyMultiPartition, destroyPartition, getBaseParameter, getGlobalBounds, getLocalBounds, getLocalBounds, getLocalCalcMaxX, getLocalCalcMaxY, getLocalCalcMinX, getLocalCalcMinY, getLocalCalculationBounds, getLocalCalculationBounds, getMultiData, getMultiPartition, getMultiPartition, getPartition
 

Method Detail

preloadPartition

void preloadPartition(String partition,
                      SyncPoint s)
The partition is loaded in a separate thread into the local PartitionDataManager You must specify the partitionname and a SyncPoint. You can specifiy a priority for the thread in the SyncPoint

Parameters:
partition - the name of the partition for identification
s - the associated SyncPoint
See Also:
AdvancedSPMDClientInterface.mergePartition(java.lang.Object, appl.parallel.spmd.SyncPoint), SPMDServerController.getPartition(String)

preloadMultiPartition

void preloadMultiPartition(String partition,
                           int idx,
                           SyncPoint s)
The partition is loaded in a separate thread into the local PartitionDataManager You must specify the partitionname and a SyncPoint. You can specifiy a priority for the thread in the SyncPoint

Parameters:
partition - the name of the partition for identification
idx - the index of the partition in the multidata object
s - the associated SyncPoint
See Also:
AdvancedSPMDClientInterface.mergePartition(java.lang.Object, appl.parallel.spmd.SyncPoint), SPMDServerController.getPartition(String)

synchronizeToSyncPoint

void synchronizeToSyncPoint(SyncPoint s)
Waits until the Thread with the specified SyncPoint finishes. After that the Thread is removed. A second call will cause a exeception.

Parameters:
s - the SyncPoint
Throws:
UnsupportedOperationException - if a thread with the specified SyncPoint was not found or was already synchronized!

isMasterThread

boolean isMasterThread()
If there are multiple processors on the machine and the current task supports supports multithreading there are several threads created. Each thread uses a different calculation area. Now there might be parts of the taskcode were multithreading is undesired, e.g. when operations affect the whole partition. In this case you should use this method to guarantee that only one thread has access to a code block.

Returns:
whether this thread is the "master" thread, which means whether this thread refers to the first task created.

clearSyncData

void clearSyncData()
You should call this method from time to time to clear all syncpoints and the associated threads out of the memory