HelpDraw graphical environment

2 downloads 0 Views 132KB Size Report
produce a full or partial copy of the source DPO; (2) shake primitives (e.g.: Shift wrap): ... To nd or select a DPO, HelpDraw provides a list (DPO List) in which is.
HelpDraw graphical environment: A step beyond data parallel programming languages  Akram-Djellal Benalia, Jean-Luc Dekeyser and Philippe Marqueta Laboratoire d'Informatique Fondamentale de Lille 1, B^atiment M3, Cite Scienti que, 59655 Villeneuve d'Ascq cedex, France. e-mail: [email protected] a

Abstract

In this paper we describe the data parallel programming environment \HelpDraw" which, through some interactive and graphical manipulations, allows to express (or translate) the user data parallel thought in a data parallel code without compelling him to learn a particular language. HelpDraw also provides the dual part of the code generation: the code visualization, by visualizing the graphical e ect of each action of a given data parallel code.

1. Introduction Several interactive and graphical environments have been carried out these last years. They are devoted to user assistance in several phases of the parallel application development cycle; for example: (a) [1, 2] task ow graph editors that allow, at the design level, task partitionning and mapping tasks; (b) [3, 4] code visualizations to analyze and debug programs, this allows users to better understand the program, to detect deadlocks, bottlenecks, etc; (c) [5] visualization during code transformation phase (parallelization and optimization): graph of dependences and codes transformations. This allows users to interact with the system and to better understand the transformations; (d) [6] visualization (graph, bargraph, etc) of simulation and performance analysis results such as rooting load, communication load, etc. The work facility provided by these development environments to assist the user is not minor. Almost none of there allow the user to develop his code without being compelled to learn a particular language (without syntax constraint). This lack justi es the interest of the graphical environment \HelpDraw". Through some interactive and graphical manipulations, HelpDraw allows to express (or translate) the user data parallel thought in a data parallel code. HelpDraw also provides the dual part of the code generation: the code visualization. This part allows the user to analyze step by step his data parallel program, since it visualizes the graphical e ect of each action in the code. This project is supported by Digital Equipment Corporation in the frame of a Data-Parallel Research Initiative. 

1

The HelpDraw environment is based on the data parallel programming model \ " [7]. The model is characterized by the hyper-space notion. A program de nes one or several hyper-spaces. The programmer-handled data parallel objects ( ) are positionned in these hyper-spaces. In the model, applications of operators are clearly distinguished from data transfers because of the two levels of programming: computational operations on objects are executed along a subset of hyperspace points, while communications are realized in the form of intra hyper-space migration. An hyper-space is de ned as a cartesian reference of positive coordinate points. The are multi-dimensional arrays allocated on compact sets of hyper-space points. Two s allocated on the same hyper-space point set are said to be conform. The microscopic level re ects the data parallel model through the parallel execution of a same arithmetic or logical expressions on conform elements. In order to execute microscopic processings on non-conform , programmer has to ensure their conformity by the application of previous macroscopic primitives: transformation or migration inside the hyper-space. At this macroscopic level, the programmer globally handles objects, without accessing their element values. Di erent macroscopic operation classes coexist: (1) copy primitives (e.g.: Extract): produce a full or partial copy of the source ; (2) shake primitives (e.g.: Shift wrap): produce a result that contains the interchanged source elements; (3) migration and reshape primitives (e.g.: Move, Rotate, Expand, Replicate): produce a result which is the reshaped or moved source. The model provides a geometrical support for the data parallel programming, and thereby allows to graphically visualize the hyper-spaces (1D, 2D, and 3D), the data parallel objects ( s) which are a geometrical shapes, and also the macroscopic operations de ned in (ie, migration and reshape). HelpDraw is a data parallel instruction generator. The generated instructions are either a composition of macro and microscopic functions (e.g: Vect=Vect1.macro1 op Vect2.macro2.macro3) or a control structures which may include instruction block (eg: Loop or Where-Else Where). HELP

HELP

HELP

DPO

HELP

DPO

DPO

DPO

HELP

DPO

DPO

DPO

DPO

DPO

DPO

DPO

DPO

HELP

DPO

HELP

DPO

2. Instruction Generation The user might be able to develop his data parallel code without having to know the language, but only through an interactive manipulation of HelpDraw. The HelpDraw environment consists in two editors: textual and graphical. The rst is a standard text editor. In the graphical editor ( g. 1), the user de nes an hyper-space in which he allocates and manipulates s. It is dicult to distinguish these s when they are numerous or allocated on the same area. So, HelpDraw provides the possibility to associate a color to each . To nd or select a , HelpDraw provides a list ( List) in which is visualized the name and the associated color. In the aim of an improved visibility, the user is allowed to hide temporarily some reperesentations. In order to build an instruction, the user applies on the s the micro and macroscopic functions de ned in . These functions are activated either through the pulldown menus or, especially for the macroscopic ones, by direct manipulation. HelpDraw DPO

DPO

DPO

DPO

DPO

DPO

DPO

DPO

HELP

2

Figure 1. HelpDraw Interface is a direct manipulation interface [8, 9] in which the user points to s and executes macroscopic functions. Some concrete examples are the \Move" and the \Extract" functions: to apply the \Move", the user moves using the mouse the pointed where he wants to, even in 3D hyper-space; and to extract a sub- , the user points to the suborigin then by moving the mouse he traces out and visualizes the part to be extracted. Although the hyper-space is graduated in data (not in pixels), the interface allows the user to move the mouse in the (3D) hyper-space with the necessay accuracy (even by a step of one data). In the aim to generate an instruction that corresponds to the user executed operations, HelpDraw has to memorize all the operations trace, and also to visualize the graphical e ect of each operation (e.g: in the Move operation, show the movement in the hyper-space). Indeed, when the user applies a function on s, HelpDraw automatically generates a temporary (TMP) which represents the intermediary result. This TMP is a data parallel object represented with its own color. But since it has no name (as the user s) and in order to distinguish it, HelpDraw inserts it in a list (TMP List) di erent from the rst one ( List). Moreover, this TMP has as feature an historic which indicates the chronological actions that have led to its creation. For instance, if the user applies the macroscopic operation \macro1" on a \Vect1", the generated TMP DPO

DPO

DPO

DPO

DPO

DPO

DPO

DPO

DPO

DPO

3

will have the historic: \Vect1.macro1". If, after that, the user applies another operation \macro2" on the same TMP, this will be consumed and HelpDraw generates a new TMP that will have as historic: \Vect1.macro1.macro2". The whole instruction is generated from the creation historic of eaach TMP involved in this instruction. These instructions are generated in a Bu er (or instructions window); and it is up to the user to decide to copy them to the text editor in order to build functions or a complete program. The microscopic operations (arithmetic, logic) are not executed only if there is s conformity (same shape and same origin); and unlike the geometrical operations, they are not executed by direct manipulation but through pulldown menus. This prevents the user from producing directly an expression (e.g.: dpo1+dpo2*dpo3-dpo4) and forces him to use temporaries which have not an important visual signi cance at this level. To palliate this, the user has to introduce textually an expression, for example: \A+B*C-D", the arguments are formal parameters. HelpDraw translates the expression in a diagram [10], thus the user may associate (directly by the mouse) each to the correspondent argument. These diagrams may be reused, modi ed, and also built by assembling the necessary components. Concerning the hyper-spaces, it is important to notice that the user may de ne as many hyper-spaces as he wants, and may easily navigate from one to another. However, in the HelpDraw environment, only three dimensions hyper-spaces are visualized. Nevertheless, the user may choice to represent the dimensions he wants (e.g.: for the 4 dimentions hyperspace x,y,z,t , the user may choice to represent x,y,z or x,z,t or another combination). DPO

DPO

3. HelpDraw: Demonstrational Interface The previous section has shown how HelpDraw succeeds in keeping the user operations trace until the instruction generation. Now, we face other problems, especially the repetitive task (operations) execution. For example, the user wants to reexecute the same operations sequence on other s without being obliged to perform it step by step once more; or to generate the Loop code (i.e.: FOR). This would be possible by using \demonstrational interfaces" or \programming by example" principle [11]. We remind the Brad Myers de nition [12]: \Demonstartional interfaces let the user perform actions on concrete example objects (often by direct manipulation), while constructiong an abstract program. The term demonstrational is used because the user demonstrates the desired result using example values". As a matter of fact, to reexecute the same user operation sequence (\Again") on other s, HelpDraw, while the user is performing the operations on the rst , records the trace of each action with the necessary parameters; thus the user has only to replay the recording (e.g.: to perform Expand(z,100), the interface records the operation type as well as the parameters: dimension=z and length=100). Concerning the Loop development, ex: DPO

DPO

DPO

for (i=0; i