org.objectweb.proactive.calcium.skeletons
Class DaC<T>

java.lang.Object
  extended by org.objectweb.proactive.calcium.skeletons.DaC<T>
Type Parameters:
T -
All Implemented Interfaces:
java.io.Serializable, Instruction<T>, Skeleton<T>
Direct Known Subclasses:
Map

public class DaC<T>
extends java.lang.Object
implements Skeleton<T>, Instruction<T>

This skeleton represents Divide and Conquer parallelism (data parallelism). To function, a Divide, Condition, and Conquer objects must be passed as parameter. If the Condition is met, a Task will be divided using the Divide object. If the Condition is not met, the child skeleton will be executed. If the task has subchilds, then the Conquer object will be used to conquer the child tasks into the parent task.

Author:
The ProActive Team (mleyton)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.objectweb.proactive.calcium.interfaces.Skeleton
logger
 
Constructor Summary
DaC(Divide<T> div, Condition<T> cond, Skeleton<T> child, Conquer<T> conq)
          Creates a Divide and Conquer skeleton structure
 
Method Summary
 Task<T> compute(Task<T> t)
           
protected  Task<T> conquer(Task<T> parent)
           
protected  Task<T> divide(Task<T> parent)
           
protected  Task<T> execute(Task<T> t)
           
 java.util.Vector<Instruction<T>> getInstructionStack()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DaC

public DaC(Divide<T> div,
           Condition<T> cond,
           Skeleton<T> child,
           Conquer<T> conq)
Creates a Divide and Conquer skeleton structure

Parameters:
div - Divides a task into subtasks
cond - True if divide should be applied to the task. False if it should be solved.
child - The skeleton that should be applied to the subtasks.
conq - Conqueres the computed subtasks into a single task.
Method Detail

getInstructionStack

public java.util.Vector<Instruction<T>> getInstructionStack()
Specified by:
getInstructionStack in interface Skeleton<T>

compute

public Task<T> compute(Task<T> t)
                throws EnvironmentException
Specified by:
compute in interface Instruction<T>
Throws:
EnvironmentException

execute

protected Task<T> execute(Task<T> t)

divide

protected Task<T> divide(Task<T> parent)
                  throws EnvironmentException
Throws:
EnvironmentException

conquer

protected Task<T> conquer(Task<T> parent)
                   throws EnvironmentException
Throws:
EnvironmentException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2001-2007 INRIA All Rights Reserved.