1 |
package appl.parallel.model; |
2 |
|
3 |
import appl.parallel.spmd.AdvancedSPMDClientController; |
4 |
import appl.parallel.spmd.AdvancedSPMDClientInterface; |
5 |
import appl.parallel.spmd.SPMDClientInterface; |
6 |
import edu.bonn.xulu.model.AbstractStepModel; |
7 |
import edu.bonn.xulu.model.ModelContentManager; |
8 |
|
9 |
/** |
10 |
* This class is used instead of the {@link AbstractStepModel} for implementation |
11 |
* of parallel algorithms. It provides access to the {@link SPMDClientInterface}. |
12 |
* |
13 |
* @author Dominik Appl |
14 |
*/ |
15 |
public abstract class AbstractParallelStepModel extends AbstractStepModel |
16 |
implements ParallelStepModel { |
17 |
|
18 |
SPMDClientInterface SPMDController; |
19 |
|
20 |
/* (non-Javadoc) |
21 |
* @see appl.parallel.model.ParallelStepModel#getSPMDController() |
22 |
*/ |
23 |
public SPMDClientInterface getSPMDController() { |
24 |
if (SPMDController == null) { |
25 |
throw new UnsupportedOperationException( |
26 |
"SPMDController is null!" |
27 |
+ "You cannot use the SPMDController before the performInit-method"); |
28 |
} |
29 |
return SPMDController; |
30 |
} |
31 |
|
32 |
/** |
33 |
* @return the Advanced SPMD controller which provides access to advanced parallel functionality |
34 |
* like preloading or multithreading |
35 |
*/ |
36 |
public AdvancedSPMDClientInterface getAdvancedSPMDController() { |
37 |
return (AdvancedSPMDClientController) getSPMDController(); |
38 |
} |
39 |
|
40 |
/** |
41 |
* A new instance. See {@link AbstractStepModel#AbstractStepModel(ModelContentManager)} for details |
42 |
* |
43 |
*/ |
44 |
public AbstractParallelStepModel(ModelContentManager contentManager) { |
45 |
super(contentManager); |
46 |
} |
47 |
|
48 |
/* (non-Javadoc) |
49 |
* @see appl.parallel.model.ParallelStepModel#setSPMDController(appl.parallel.spmd.SPMDClientController) |
50 |
*/ |
51 |
public void setSPMDController(SPMDClientInterface controller) { |
52 |
this.SPMDController = controller; |
53 |
} |
54 |
|
55 |
} |