Bruno Harbulot – POOSC 2005 – Glasgow, UK
1/26
Using and Extending AspectJ for Separating Concerns in Parallel - - PowerPoint PPT Presentation
Using and Extending AspectJ for Separating Concerns in Parallel Java Code Bruno Harbulot POOSC 2005 Glasgow, UK Bruno Harbulot and John Gurd The University of Manchester POOSC 2005 Glasgow, July 2005 1/26 Presentation Outline
Bruno Harbulot – POOSC 2005 – Glasgow, UK
1/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
2/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
3/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
4/26
JGF benchmark suite (Raytracer, MPJ implementation)
JGFRayTracerBenchSizeA.java raytracer/RayTracer.java raytracer/JGFRayTracerBench.java JGFRayTracerBenchSizeB.java
Bruno Harbulot – POOSC 2005 – Glasgow, UK
5/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
6/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
7/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
8/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
9/26
/* Java code */ class MyClass { public static final int MAX_VALUE = 2000 ; int a ; /* ... */ } /* AspectJ code */ aspect MyAspect { void around(int val): set (int MyClass.a) && args (val) { if (newval > MyClass.MAX_VALUE) proceed(MAX_VALUE) ; } }
Bruno Harbulot – POOSC 2005 – Glasgow, UK
10/26
– “parallelise all the loops iterating from 0 to the
– or “parallelise all the loops iterating over a
Bruno Harbulot – POOSC 2005 – Glasgow, UK
11/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
12/26
for (int i=iMin ; i<iMax ; i++) {...} }
call(void *.myMethod(..)) && args(.., min, max) { // int t_min, t_max new Runnable() { public void run() { proceed(t_min, t_max) ; } } // execute each instance concurrently }
Bruno Harbulot – POOSC 2005 – Glasgow, UK
13/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
14/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
15/26
<<Interface>> Runnable2DLoopBody run(i: int,j: int) : void RectangleLoopA loopBody : Runnable2DLoopBody minI : int maxI : int minJ : int maxJ : int run() : void void run () { for (int i = minI; i<=maxI; i++) for (int j = minJ; j<=maxJ; j++) loopBody.run (i,j) ; } RectangleLoopB minI : int maxI : int minJ : int maxJ : int run() : void loopBody(i: int,j: int) : void void run () { for (int i = minI; i<=maxI; i++) for (int j = minJ; j<=maxJ; j++) loopBody (i,j) ; }
Bruno Harbulot – POOSC 2005 – Glasgow, UK
16/26
IBM 142 SUN 142C SUN 142S SUN 150C SUN 150S 10 20 30 40
BasicA BasicB RectangleLoopA RectangleLoopB RectangleLoopC MTRectangleLoopA MTRectangleLoopB MTRectangleLoopC
Time (nanosec) (for size 100)
Bruno Harbulot – POOSC 2005 – Glasgow, UK
17/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
18/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
19/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
20/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
21/26
– args(min, max, stride)
– args(min, max, stride, array)
– args(it)
– args(iterator, collec)
Bruno Harbulot – POOSC 2005 – Glasgow, UK
22/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
23/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
24/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
25/26
Bruno Harbulot – POOSC 2005 – Glasgow, UK
26/26
quantification and obliviousness.