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