AspectFORTRAN Weaver based on the GenAWeave Framework
The metamodel and various examples (including ATL specifications, intermediate models, generated RSL code) of the AspectFORTRAN Weaver is organized as follows:
One may notice the similarity between the AspectFORTRAN and AspectPascal metamodel by comparing the two.
The metamodel for the AspectFORTRAN Weaver is presented below. The metamodel is extended from the generic aspect metamodel (GAspect) and captures the commonalities that individual aspect weavers share among themselves.The part beneath the dotted rectangle shows the shared features.
AspectFORTRAN Metamodel
The complete KM3 and TCS specification for AspectFORTRAN is hyperlinked below.
[AspectFORTRAN KM3 spec]   
[AspectFORTRAN TCS spec]   
Subroutine / Function call pointcut
|
The first example presented here shows a simple aspect to capture function call join point within a subroutine body.
Aspect to capture a function call join point
The corresponding aspect model, the ATL specification for translating the Aspect model to RSL model and generated RSL code are all listed below for the above example.
|
Multiple pointcuts (call, exec, withincode) and advice demo
|
This example presents a simple aspect written for FORTRAN to capture multiple join points.
Specifically it demonstrates pointcuts like call,exec,withincode and advice like before, after and around.
Aspect to capture several join points and weave different kind of advice
The corresponding aspect model for the above aspect is shown below:
Corresponding Aspect Model for the above Aspect Specification
|
Loop Example
|
According to our definition, the join point for a loop has the following signature:
(init::[val], exit::[val], stride::[val]).
Init specifies the loop initialization value, exit specifies the loop termination value and stride specifies the loop increment counter.
The following listing shows an implementation of MPI_GATHER written in FORTRAN. In MPI, messages can be forwarded by intermediate nodes where they are split (for scatter) or concatenated (for gather). Often it is required to measure timing statistics around critical parts of program execution. One such case is shown here. Lines 9-14 shows the execution of the outer do loop which has initial value as 1, exit value as 10 and a default stride as 1. In a manual approach, it is required to invasively add the timer and change the source program at every place whenever the program runs into the execution of a loop join point.
Adding timer around do loops in FORTRAN
An aspect for adding timing information around do loops in FORTRAN is shown below.The join point for loops matches any loop expression in the base program that satisfies the loop initialization value, the loop finalization value (exit) and the loop stride value. The wildcard * may be interpreted as any. Currently both integer and string value types are supported, but future extensions can support other value types.
Adding timer around do loops in FORTRAN
The aspect model, the ATL specification for translating the Aspect model to RSL model and generated RSL code are all listed below for the above example.
|
General Information
@Copyright 2008 - All Rights Reserved
Any information provided in this web page is copyright by the persons mentioned above, also
any source available for download is provided "as is" and any express or implied warranties are disclaimed
|