Anda di halaman 1dari 1

Eclipse plug-in to aid generating OpenMP and Pthreads code through Visual Programming

Javier Gonzlez-Snchez and Mara Elena Chavez-Echeagaray

The use of a traditional language to develop parallel programs is not that simple. This Eclipse plug-in is focused on facilitating teaching/learning techniques and implications of parallel, concurrent and multicore computing. How to improve the way in which we develop parallel computing?. How can we make this process easier?. Using a development environment which generate parallel textual code having as base a visual model of the system. Event though it cant warranty the best parallel solution it can warranty a functional solution.
The visual model is generated and simulated by the user, is formally expressed within a Modular Petri Net to be analysed and optimized. From MPN we obtained textual pseudo code, which is finally converted into source code for a particular platform.

Computer Science Department, Tecnolgico de Monterrey Campus Guadalajara, Mxico Results

Sequences Reduction. Sequence reduction of the model makes its analysis easier and generates a reduction in the final code. It is viable to transform a MPN keeping all is properties of liveness, reachability and safeness. To sequence reduction we use place fusion and transitions fusion. Fission and Fusion of parallel places. For those nodes to which it was establish a replication factor, N nodes with the same action as the original have to be created. For those parallel heterogeneous sentences: the sequence of transition nodes is converted in a structure of parallel dependent nodes with one transition. This process is related with dependency data mention above.
MPN structure with all its data in places and transitions is converted into a plain text (pseudo-code file), this file is distributed in scenarios and each scenario is divided in five code zones: global data, modules, actors and control and execution flow specifications.

Visual model is transformed into a Modular Petri Net. This net allows us to represent execution (concurrent as well as sequential) and control flow (synchronization barriers, semaphore, lock, etc). Modular Petri Net define a formal model for the system.

We propose to use a visual language, in which a program is built by icons, pipelines and textual elements to create multidimensional expressions. Each node in the graph, an actor, represents a different entity: flow control structures, data, attributes. Two types of pipelines define two types of flows: execution and control flow. Validation The execution flow is analyzed while the interconnection between elements is performed. Using an incremental analysis method it is possible to warranty that the elements correctness and its interconnection in execution flow is correct at any time. For control flow, conformed by control actors (semaphores, locks, et al) and pipelines we applied the reachability tree method to the MPN in order to warranty its correctness. This method is performed at the beginning of the conversion process from visual model to code. Fusion techniques are also applied before de conversion process in order to minimize the model.
Actors grouped by functionality: sequence, conditional, loops, and control flow.

If the MPN achieve all the characteristics of reachalility and liveness, the formal model can be validated and certificated.

Data driven threads relocation. When a data dependency exist in concurrent threads it is no possible to warranty the accurate results this generate the relocation of the trajectories already defined.

A parser will take the text of the validated model and will transform the descriptive language of the base code (pseudocode) into a selected programming language. The system has been loaded with the corresponding semantic of the API to be used. Successful testing has being achieve with OpenMPI and SGI SEQUent, as well as with PThreads. This transformation model allows a progressive structure with acceptable qualities.

Zones distribution at the file of the resultant source code..

Optimization Besides validation, the formal model allows us to optimize the model. This optimization includes: Analysis of data dependency. The model has to assure data viability in each node as well as the concurrent access to shared data. In this part of the process the MPN is not required it is enough with the subjacent graph (transitions and nodes are considered as simple nodes of the subjacent graph). Add control elements. Analysis of data dependency allows identifying the need of control elements: locks for global variables used in replicated (by threads) modules and semaphores: for global variables in parallel trajectories.

For a N value given in a node, it is establish a parallel cyclic structure that allows to chunk a task.

This visual plug-in allows: An easiest design and a better way to check for grammatical errors. To validate your system through a formal tool. To generate standard, ordered and reliable code. Parallelism optimization. Even though this parallelism optimization could be limited by semantics, it is a good approach which will increase the systems performance according with Amdahl law.

Code generation Once we have the Petri net and wed optimized that net, we could transform it into a base code. Using this base code we would obtain the final code. Base code or pseudo code consists on a textual expression of the MPN of the system. Model projection: the textual representation of actors and trajectories are mapped to a programming language using parallel and multicore libraries to a pre-established architecture: distributed system, parallel system or multicore system.

These elements are added into the model automatically where they are needed.
Data driven sequence reduction. A predefined target architecture profile, established the maximum number of execution threads to be generated.

{javiergs, mechavez}