Programming the Connection Machine by Using the Metaobject

Programming the Connection Machine by Using the Metaobject

Programming the Connection Machine by using the Metaob ject Proto col Lothar Hotz Gerd Kamp Universitat Hamburg Fachb ereich Informatik Bo denstedtstrasse Hamburg Germany email hotzinformatikunihamburgde In this pap er we demonstrate how the Metaob ject Proto col of the Common Lisp Ob ject System can b e used to program the Connection Machine In this approach metaob ject classes which are resp onsible for internal representations of instances map instances to pro cessors in various ways With these classes parallel structures are implemented to form a language which allows an easy usage of a parallel machine INTRODUCTION A widely used approach to join ob jectoriented OO programming and parallel com puters consists in identifying an ob ject as a main source of parallelism or concurrency Ob jects or actors guardians communicate by messaging ie sending messages to each other Such active ob jects may run concurrently if they reside on dierent pro cessors Examples for systems following this approach are describ ed in Besides ob jects and messages OO programming supplies additional features that may b e used for program ming parallel computers These features eg found in the Common Lisp Ob ject System CLOS are generic functions multiple inheritance metho d combination and the metaob ject proto col In this pap er we showhow CLOS can b e used to program massively parallel computers MPCs esp ecially the Connection Machine CM Our goal is to hide anykindof explicit parallel syntax to the user by extending an already wellknown language with less change of its syntax If we can dene a set of appropriate data structures whose op erations are internally parallelized and whose userinterface is within the scop e of the language the user is not puzzled ab out explicitly thinking or programming in parallel terms These data structures are manifested in a set of large ie numerous elements complex structures such as matrices lists sets relations and graphs with appropriate op erations on them us our goal is to design eg multiplication graph traversion transitivehull union Th a language of complex data structures called DisGraL distributed graph language and join these structures that are problemoriented machineindep endent commonly usable and parallelizable with appropriate op erations In a rst approach we concentrate on data parallel machines like the CM b ecause they have a nature dierent from controloriented languages detailed knowledge of the machines architecture are necessary to program them Thus complex structures and their op erations are realized by data parallel algorithms The interface b etween such abstract data structures and their data parallel realization is implemented via the metaob ject proto col This is a way to op en languages up allowing users to adjust the design and implementation of a programming language to suit their particular needs In particular in a subset of CLOS is dened and extended with facets dynamic slots etc by using the metaob ject proto col of CLOS MOP In a similar waywe extend PCL Portable CommonLo ops a p ortable version of CLOS to supply data mappings to the CM ie known distributions of ob jects eg are supp orted by our extensions Thus we showhow the MOP can b e used to implementaninterface b etween CLOS and the CM This interface is given by language features which smo othly t in the syntax of CLOS Thus no additional explizit parallel constructs must b e known to a user of these extensions In this sense the pap er describ es how to bridge the gap between low level machinedep endent more or less ecient parallel algorithms and high level abstract applications We are not concerned with improving sp ecic algorithms or solving a sp ecic problem on a parallel machine in an ecientway Thus neither eciency results are presented nor parallel algorithms are describ ed However we assume that there exist ecient parallel algorithms and that there are applications that should b e solved with parallel machines We rst give a short overview of terms used Section After a short description of levels of abstraction for a more detailed view of them we refer to we present the develop ed metaob ject classes for handling massively parallel constructs These classes are used to implement complex structures as describ ed and illustrated with a short example in Section Finally in Section we discuss some other approaches THE CM OO PROGRAMMING AND THE MOP ely parallel single instruction multiple data The connection machine CM is a massiv SIMD computer consisting of up to K pro cessors To the user the parallel pro cessing unit app ears as an extension of the normal environment of a standard sequential computer such as a Sun Lisp is a data parallel extension of Common Lisp for the CM The data parallel extensions of Lisp include a large numb er of functions and macros and one imp ortant abstraction the parallel variable or pvar A pvar is a variable that has a separate value for each pro cessor in the CM Besides widely used OO features like classes slots data elds of classes inheritance and instances the data stores of slot values of a sp ecic class we fo cus on metaob ject classes and proto cols Classes whichcontrol representation of instances of classes are called metaob ject classes With them a programmer gets access to the internal repre sentation of language constructs The sp ecication of interacting ob jects is manifested in a collection of generic functions called proto col Proto cols are sp ecializable mo diable interfaces b etween ob jects CLOS is implemented in CLOS ie all features of CLOS eg classes generic functions are represented as instances of predened classes named standard metaob ject classes These instances are called metaob jects The b ehavior of these metaob jects and thus of CLOS is describ ed with proto cols These proto cols describ e sp ecic p oints of the CLOS implementation to b e changed by a programmer For example the instance allo cation proto col sp ecies that al locateinstance is called when an instance is allo cated Because these functions are generic functions they can b e sp e cialized as in an ordinary OO program The language implementation itself is structured as an OO program Thus extensions can b e made by sub classing standard metaob ject classes to sp ecialized metaob ject classes These classes extend or override predened language b ehavior eg to access a pro cessor element and not an element of an array when a slot value is refered to In Section we describ e the mo dication of the instance allo cation proto col Changing the implementation of a programming language mightlook ugly and susp ect but it is not when doing it in a p ortable way Because the proto cols are summarized in the quasi standard of the MOP see all implementations of CLOS using it will understand changes of CLOS To the user programmer of a such mo died CLOS the extensions are part of the language and clearly integrated in the syntax and semantics of the language LEVELS OF ABSTRACTION To clarify our view of parallel languages we describ e levels of abstraction and languages see also The usefulness of separating lowlevel parallel constructs from high level problem oriented constructs is also discussed in other pap ers like We extend Lisp with PCL to get an OO interface to the data parallel CM Furthermore we de ne classes and metaob ject classes to map data to parallel machines This level is called CLOS With this extension classes and op erations for regular structures like vector ma trix set and irregular structures are dened Irregular structures suchas relation graph tree and list change dynamically and are not constant in size or are arbitrarily distributed Thus it is not p ossible to map these structures onetoone to regular internal constructs However it is p ossible to implementsuch structures on the CM Op erations on irregular structures are dened on the entire structure not on single ob jects Our approachintegrates these structures and op erations in a set of classes and metho ds that aL The main issue with DisGraL is the need to dene problems in terms is called DisGr of complex structures and op erations ie the programmer do es not think in parallel or sequential structures but in complex ones DisGraL is the basis for a to ol for implement ing various Articial Intelligence AI applications such as vision neural nets and the selection problem on parallel computers In Section wegive one example which gives a short insight of the to ol CLASSES AND METAOBJECT CLASSES FOR THE CM In this section we present one class and three sp ecialized metaob ject classes one of them is used to implement the complex structure relationclass see Section These classes describ e distinct mappings of instances ie data holding structures of OO lan guages to pro cessors reecting our data parallel approach They are part of CLOS As mentioned ab ove the instance allo cation proto col is sp ecialized by these classes The standard proto col sp ecies that al locateinstance results in an array for storing slot values By indicating slots to b e not CLOS slots but parallel ones the standard proto col do es no longer allo cate storage on the sequential machine Instead storage is allo cated on the CM by a sp ecialized metho d for al locateinstancewhich uses LISP functions The distribution can b e done in various ways dep ending on the desired data distribution pvarp erinstanceclass This class is an ordinary CLOS class Each instance of this class represents one pvar The pvar is allo cated during initialization of a new in a) pvar-per-instance-classb)

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us