Table Of ContentTeaching Archetypal Design
with an Electronic Textbook
Last Revised(cid:2) November (cid:3)(cid:2) (cid:4)(cid:3)(cid:3)(cid:5)
The eText Group
Department of Computer Science
California Institute of Technology
Mail Stop (cid:2)(cid:3)(cid:4)(cid:5)(cid:6)(cid:7)(cid:8) Pasadena(cid:8) CA (cid:9)(cid:10)(cid:10)(cid:2)(cid:3)
adam(cid:11)cs(cid:12)caltech(cid:12)edu
The primary author and contact for this paper is Adam Rifkin(cid:2) The ideas presented
in this paper were developed by the eText team at Caltech in group discussions(cid:2)
nd
A modi(cid:3)ed version of this paper will be presented at the (cid:4)(cid:4) ACM CSC Conference
in Phoenix(cid:5) March (cid:6)(cid:7)(cid:8)(cid:4)(cid:5) (cid:8)(cid:9)(cid:9)(cid:10)(cid:2)
Keywords(cid:2) Education(cid:5) Libraries(cid:5)
Multimedia(cid:5) Parallel Programming(cid:5) Software Engineering
Teaching Archetypal Design
with an Electronic Textbook
Abstract
How can parallel programmingbe made tractable for students in high schools
and community colleges(cid:2) to programmers in four(cid:3)year colleges(cid:2) to commercial
and government employees(cid:2) to interested independent users learning on their
own(cid:2) and as CASE tools for professional software designers(cid:4) The computer
science community must address this question if the ability of programmers to
harness the power of parallel systems is to maintain pace with technology ad(cid:2)
vancesforthcominginparallelsystems(cid:3) Thispaperaddressessomeof theissues
of bringing parallel programming to the people(cid:4) ranging from newly developing
programmers with little experience on any computer to seasoned programmers
of single(cid:2)processor machines(cid:3)
We aim not only to enable people to use more powerful computers(cid:4) but
also to enable people to use computers more powerfully(cid:4) by nurturing the tech(cid:2)
niques that enable them to develop e(cid:5)cient(cid:4) correct code with relative ease(cid:3)
This paper brie(cid:6)y presents the concept of an Archetype(cid:4) a software engineer(cid:2)
ing methodology developed at the Caltech for patterns of problem solving(cid:4) and
for providing media for quick reference and natural software reuse(cid:3) We then
describe eText(cid:4) an interactive multimedia electronic textbook that facilitates
the teaching of(cid:4) navigating through(cid:4) and referring to Archetypes(cid:3) Initial expe(cid:2)
riencewithArchetypesandtheelectronictextbooksuggeststhat thisapproach
to teaching parallel programming can aid computer users in the immediate
future(cid:3)
(cid:0) Background
Archetypes provide a general purpose design methodology which supports both se(cid:2)
quential and parallel source code development(cid:3) enabling a uni(cid:4)cation of these two
computing models(cid:5) This paper demonstrates that Archetypes collected in an interac(cid:2)
Teaching Archetypal Design (cid:6) Printed November (cid:2)(cid:3) (cid:4)(cid:2)(cid:2)(cid:5)
tive electronic textbook can be used by a student (cid:2)rst to learn parallel programming(cid:3)
presented as a form of algorithm development similar to sequential algorithm de(cid:4)
velopment(cid:3) and later to consult as a reference guide for continued use of parallel
programming techniques and reuse of parallel code libraries(cid:5) In addition(cid:3) we note
that Archetypes provide a means by which not only code(cid:3) but also design solutions(cid:3)
can be scavenged and reused(cid:5)
(cid:0)(cid:2)(cid:0) Motivation(cid:3) The Problem
In the past decade(cid:3) the United States has committed many billion dollars to high per(cid:4)
formance computing(cid:5) High performance architectures provide the ability to achieve
performance simply unattainable with the standard sequential architectures(cid:5) Compu(cid:4)
tational demands have been steadily rising(cid:3) also(cid:6) fortunately(cid:3) technology continually
improves to match it within the track of Moore(cid:7)s Law(cid:5) As a result(cid:3) reasonably priced
multiprocessor machines(cid:3) as well as networks of workstations and(cid:8)or PCs(cid:3) have re(cid:4)
cently made high performance parallel and distributed computing a(cid:9)ordable to cur(cid:4)
rent sequential programmers(cid:5) The central dilemma arising with the rapid growth of
parallel technology is the issue of training people to perform parallel programming in
the very near future(cid:5)
The rise of high performance computing in the (cid:10)(cid:11)(cid:12)(cid:13)sand (cid:10)(cid:11)(cid:11)(cid:13)shas led to an interest(cid:4)
ing paradox(cid:5) Problems that were once impractically slow with sequential machines
can now be solved on parallel and distributed machines(cid:5) However(cid:3) although high
performance architectures provide extensive computing power(cid:3) the source of their
strength is also the source of their greatest weakness(cid:14) the handicap called parallel
programming(cid:5) For many reasons(cid:3) from architecture(cid:4)speci(cid:2)c quirks to the perceived
di(cid:15)culty of distributed debugging(cid:3) parallel programming has emerged as one of the
primary obstacles in reaping the bene(cid:2)ts of high performance computing(cid:5) How can
the development of correct(cid:3) e(cid:15)cient parallel code be made more tractable(cid:16)
We isolate three desirable characteristics for a parallel programming learning and
reference system(cid:14)
Teaching Archetypal Design (cid:17) Printed November (cid:2)(cid:3) (cid:4)(cid:2)(cid:2)(cid:5)
(cid:0) Interactive(cid:2) A learning environment should make use of instruments such
multimedia as audio(cid:2) personalized slide shows(cid:2) and custom animations(cid:2) and
such hypermedia as document links and hypernotes(cid:2) in e(cid:3)ect teaching using the
range of tools an online system a(cid:3)ords(cid:4)
(cid:0) Systematic(cid:2) A productive and methodological approach should enable a good
parallel programmer to solve computing problems more e(cid:5)ciently(cid:4)
(cid:0) Extensible(cid:2) A constructive system should be developed for adding to(cid:2) mod(cid:6)
ifying(cid:2) and extracting from parallel libraries of source code modules that are
used in the system(cid:4) It should also encourage design scavenging(cid:2) as opposed to
the mere reuse of source code alone(cid:4) Design scavenging enables a programmer
to borrow from and modify many aspects of the algorithm(cid:7)s design along with
source code(cid:2) such as reliability and performance components(cid:4)
(cid:0)(cid:2)(cid:3) Proposed Solution
The main thrust ofour solutionrelies on the development(cid:2) maintenance(cid:2) and teaching
ofparallelandsequentialArchetypelibraries(cid:4) Archetypes(cid:8)CR(cid:9)(cid:10)(cid:11)impartstructureto
knowledge acquisition by enforcing self(cid:6)similarity between many levels of abstraction(cid:4)
For parallel programming(cid:2) Archetypes suggest a consistent solution methodology for
meta(cid:6)algorithms(cid:2) applications(cid:2) and implementations(cid:4) The eText group plans to use
Archetypes to provide an an evolutionary approach for students to learn parallel
programming(cid:2) based on three tenets(cid:4)
(cid:0) Familiarity(cid:2) Archetypesareatalevel ofabstractionabovelanguage(cid:2)butin the
hierarchy described later(cid:2) we show how they provide libraries and extensions of
languagescurrently used by programmers (cid:12) languages such as C(cid:2) Pascal(cid:2) C(cid:13)(cid:13)
and FORTRAN(cid:4) Beginners should be able to move gradually from their present
programming styles to parallel programming(cid:4)
(cid:0) Ubiquity(cid:2) Parallel programs should run on platforms that are the most widely
used (cid:12) namely(cid:2) workstation networks and PC networks (cid:12) in addition to su(cid:6)
Teaching Archetypal Design (cid:10) Printed November (cid:2)(cid:3) (cid:4)(cid:2)(cid:2)(cid:5)
percomputers(cid:2) Again(cid:3) Archetypes emphasize an evolutionary path that requires
neither massive expenditures nor massive retraining to begin experimenting
with and bene(cid:4)ting from parallel computing(cid:2)
(cid:0)
Interactivity(cid:2) Archetypes employ tools available on the PC(cid:3) including multi(cid:5)
media tools and program development utilities(cid:3) to develop an environment on
the PC that encourages people to experiment with parallel computing(cid:2) This
drives knowledge acquisition past passive and even active education towards
the realm of interactive learning(cid:2)
The electronic textbook (cid:6)abbreviated eText (cid:7)KR(cid:8)(cid:9)(cid:10)(cid:11) is an interactive multimedia
manuscript with a multidimensional navigation system that executes on PCs and is
designed to help people learn about parallel programming via Archetypes(cid:2) Through
the use of eText(cid:3) a programmer can(cid:12)
(cid:0)
Navigate (cid:13) by browsing through a library of paradigm Archetypes(cid:3)
(cid:0)
Learn (cid:13) by selecting and understanding an Archetype through the extensive
documentation and provided teaching facilities(cid:3)
(cid:0)
Experience(cid:13)bylookingatseveralapplicationsthatusetheArchetype(cid:3)empha(cid:5)
sizinghow the algorithmfor each applicationwasdeveloped from the Archetype
in a systematic fashion(cid:3) and
(cid:0)
Implement (cid:13) by observing sequential and parallel code for each application in
C(cid:3) Pascal(cid:3) Fortran and C(cid:14)(cid:14)(cid:3) again emphasizing the systematic development of
the code from the Archetype(cid:2) The programmer can also
(cid:0)
Scavenge (cid:13) source codes(cid:3) problem(cid:5)solving designs(cid:3) correctness proofs(cid:3) and per(cid:5)
formance analysis techniques(cid:3) by using and modifying components from the
electronic textbook(cid:15)s repository(cid:2)
The three(cid:5)tiered hierarchy (cid:6)as discussed in x(cid:16)(cid:2)(cid:16) and illustrated in (cid:4)gure (cid:9)(cid:11) (cid:17) many
Archetypes(cid:3) many applications for a given Archetype(cid:3) and many implementations
Teaching Archetypal Design (cid:18) Printed November (cid:2)(cid:3) (cid:4)(cid:2)(cid:2)(cid:5)
for a given application (cid:2) is designed to help students learn and experiment with
parallel programming(cid:3) Moreover(cid:4) each level of the hierarchy maintains the same
basic structure(cid:4) a(cid:5)ording an intuitive feel for ease of use(cid:3) Programmers can also
browse the text in other ways(cid:6) for example they can look at the given application
and identify di(cid:5)erent Archetypes used to solve that class of problems (cid:7)e(cid:3)g(cid:3)(cid:4) Sorting(cid:8)(cid:3)
They can also browse using keywords(cid:3) eText is interactive(cid:4) uses animation to help
explain parallel algorithms(cid:4) and uses voice narration to allow programmers to focus
on animations while listening to an explanation(cid:3) Since the book is being deployed
on Unix(cid:9)based PCs and workstations(cid:4) the programs can be executed directly on the
same system(cid:3)
We brie(cid:10)y elaborate on the new ideas that make parallel Archetype libraries and the
eText project unique in their approach(cid:3) Sequential template programming method(cid:9)
ologies (cid:11)VK(cid:12)(cid:13)(cid:14)(cid:4) multimedia presentations (cid:11)BD(cid:13)(cid:15)(cid:4) Shn(cid:13)(cid:15)(cid:4) vW(cid:13)(cid:16)(cid:14)(cid:4) electronic textbooks
and hypertext systems (cid:11)Nel(cid:12)(cid:17)(cid:4) BD(cid:13)(cid:18)(cid:4) Rad(cid:13)(cid:16)(cid:14)(cid:4) and algorithm methodologies (cid:11)CM(cid:12)(cid:13)(cid:4)
MS(cid:13)(cid:18)(cid:4) vdS(cid:13)(cid:16)(cid:14) have been explored previously(cid:6) the following ideas are original issues
being addressed(cid:19)
(cid:0)
Archetypes(cid:2) These provide a medium for the transfer of parallel processing
technology(cid:4) and the encapsulation of the knowledge held by experienced par(cid:9)
allel programmers(cid:3) In addition(cid:4) Archetypes allow for design scavenging(cid:4) which
provides a system for reuse at a higher level than mere source code reuse(cid:3)
(cid:0)
Programming Style(cid:2) Mostpeopleprogramoperationally(cid:3) Sometheoretically(cid:9)
oriented people program assertionally(cid:3) We seek to bridge the gap between these
two groups(cid:4) relatingassertionsto operations(cid:4) notonly asa method ofinformally
proving program correctness but also as a debugging technique(cid:3) Archetypes
incorporate both correctness veri(cid:20)cation outlines(cid:4) and a history of archetypal
bugs and errors to aid testing and debugging(cid:3) Archetypes are a means to this
hybrid programming style(cid:3)
(cid:0)
Parallel Program Libraries(cid:2) These extensive application source code exam(cid:9)
ples(cid:3) allow for cross referencing and querying(cid:3)
Teaching Archetypal Design (cid:21) Printed November (cid:2)(cid:3) (cid:4)(cid:2)(cid:2)(cid:5)
(cid:0)
Interactively Teaching Issues Speci(cid:2)c to Parallelism(cid:3) These issues in(cid:2)
clude(cid:3) but are not limited to(cid:4) granularity(cid:3) parallel structuring(cid:3) process mapping
orthogonal to a given problem structure(cid:3) relations between machines and pro(cid:2)
grams(cid:3) and data (cid:5)ow issues(cid:6)
(cid:0)(cid:2)(cid:3) Justi(cid:4)cation
Manycomputersciencecurriculaareincorporatingavarietyofclassestoteachparallel
computing (cid:7)Mil(cid:8)(cid:9)(cid:10)(cid:6) Our approach to teaching parallel programming (cid:11) to be used to
supplement the Computer Algorithms class at Caltech this fall (cid:11) is unique from the
approaches o(cid:12)ered elsewhere in four main aspects(cid:4)
(cid:0)
The use of Archetypes(cid:3) Central to our instruction is the belief that the
systematic approach to problem solving a(cid:12)orded by Archetypes (cid:7)CR(cid:8)(cid:9)(cid:10) encour(cid:2)
ages more e(cid:13)cient code development(cid:6) The resulting program designs are more
rapidly implemented(cid:3) and amass properties that can be used to prove correct(cid:2)
ness of implementation (cid:7)Cha(cid:8)(cid:9)b(cid:10)(cid:6)
(cid:0)
The presentation of both parallel and sequential algorithm develop(cid:4)
ment together(cid:3) Many good textbook introductions to parallel programming
have been recently published (cid:7)J(cid:14)(cid:8)(cid:15)(cid:3) Les(cid:8)(cid:9)(cid:10)(cid:3) but they rarely present algorithms in
a manner that uni(cid:16)es the parallel and sequential mind sets(cid:6) A notable excep(cid:2)
tion is compositional programming (cid:7)CT(cid:8)(cid:15)(cid:10)(cid:3) and this presentation of material
has been used to teach a freshman class at Caltech(cid:6) Perhaps the uni(cid:16)ed teach(cid:2)
ing of parallel and sequential issues can ultimately lead to better programmers
(cid:7)Rif(cid:8)(cid:9)(cid:10)(cid:6)
(cid:0)
The use of many programming notations(cid:3) In the last ten years a wealth
of parallel languages have been developed (cid:7)Che(cid:8)(cid:9)(cid:10)(cid:6) eText is not bound to any
single language(cid:3) o(cid:12)ering the opportunity to learn parallel programming us(cid:2)
ing whichever languages are most comfortable for the student(cid:6) Furthermore(cid:3)
authoring tools provided by eText allow di(cid:12)erent language developers to add
Teaching Archetypal Design (cid:17) Printed November (cid:2)(cid:3) (cid:4)(cid:2)(cid:2)(cid:5)
source code in their preferred notations to the Archetype libraries easily(cid:2) To
a(cid:3)ord a more comfortable transition for programmers to the universe of parallel
computation(cid:4) eText includes popular sequential languages with simple(cid:4) small
extensions and(cid:5)or libraries(cid:2) In this manner(cid:4) users can progress at a reasonable(cid:4)
individualized pace(cid:2)
(cid:0) The use of an electronic textbook(cid:2)
Special issues must be addressed when
dealing with such a medium(cid:2) Richard Bergman claims (cid:6)BG(cid:7)(cid:8)(cid:9)(cid:4) (cid:10)The driving
force has to be the content(cid:4) and not the media(cid:2)(cid:2)(cid:2) Electronic books have two
main advantages(cid:11) ease of access with a search engine and the fact that you can
have a collection of books on a subject in one spot for easy cross(cid:12)reference(cid:2)(cid:13)
We opted for the electronic book metaphor not only for ease of navigation and
access to a potentially exhaustive information content(cid:4) but also for the interac(cid:12)
tive simulations and lessons(cid:4) and for the ability to maintain parallel Archetype
libraries online for ease of cut(cid:12)and(cid:12)paste(cid:4) modi(cid:14)cation(cid:4) compilation and dis(cid:12)
tributed debugging of altered code(cid:4) all in a run(cid:12)time environment provided with
the electronic book(cid:2)
content
The primary driving force behind the electronic book is its (cid:4) speci(cid:14)cally
Archetypes(cid:15) in Applications(cid:2) Implications (cid:6)Ada(cid:7)(cid:8)(cid:9)(cid:4) John Adam maintains that
multimedia systems are a(cid:3)ordable by schools(cid:4) government agencies(cid:4) and busi(cid:12)
nesses(cid:4) but that (cid:10)content(cid:4) not technology(cid:4) will determine success(cid:2)(cid:13) We alsokeep
in mind the words of David Guenette (cid:6)BG(cid:7)(cid:8)(cid:9)(cid:11) (cid:10)What electronic books need is
what all books need(cid:11) to be edited well(cid:2)(cid:13) To this end(cid:4) Archetypes undergo a
rigorous revision and amendment process(cid:4) allowing them to dynamically and
continually improve over time(cid:2)
The remainder of this paper is organized as follows(cid:2) Archetypes are described and
discussed in x(cid:16)(cid:2) The interactive electronic textbook is explained(cid:4) and its relation to
teaching Archetypes is detailed(cid:4) in x(cid:8)(cid:2) We follow with a few examples of Archetypes
being implemented using the electronic textbook in x(cid:17)(cid:2) Finally(cid:4) we conclude with a
small evaluation of this work thus far in x(cid:18)(cid:2)
Teaching Archetypal Design (cid:19) Printed November (cid:3)(cid:2) (cid:4)(cid:3)(cid:3)(cid:5)
(cid:0) Archetypes
Archetypes represent a systematic(cid:2) taxonomic and patterned way of grouping similar
problems and their respective solutions(cid:3) Their usefulness resides in the facility for an
ableprogrammertoinstantiateanArchetype(cid:2) foranewproblemthatariseswithclues
indicating that it follows the same pattern as other applications for that Archetype(cid:3)
Representation of Archetypes
Documentation
Program Code
Explanation of Correctness
Efficiency and Hints for Parallelizing
Test Suite Design and Debugging Hints
Figure (cid:4)(cid:5) The components included in the representation of Archetypes(cid:2)
AnArchetypeconsistsprimarilyof(cid:6)vecomponents(cid:5) documentation(cid:2)programoutline(cid:2)
semantic correctness proof outline(cid:2) e(cid:7)ciency abstraction with performance modeling
outline(cid:2) and test suite design and debugging tips outline(cid:3) These outlines are further
discussedinx(cid:8)(cid:3)(cid:9)(cid:2)afterwhich wedescribewhy Archetypes areusefulandhowwe make
use of them in x(cid:8)(cid:3)(cid:10) and x(cid:8)(cid:3)(cid:11)(cid:2) respectively(cid:3) But (cid:6)rst(cid:2) we describe why Archetypes are
needed and our approach to designing and maintaining them(cid:3)
Teaching Archetypal Design (cid:12) Printed November (cid:3)(cid:4) (cid:5)(cid:3)(cid:3)(cid:6)
(cid:0)(cid:2)(cid:3) How Archetypes Improve Skill
In determining a good way to teach parallel programming(cid:2) we isolate operational
issues necessary to develop pro(cid:3)cient users(cid:4) Archetypes a(cid:5)orded a unique learning
environment because of their systematic approach to presenting algorithm design(cid:4)
Brie(cid:6)y(cid:2) the parallel programmer skill levels and the issues associated with each are(cid:7)
(cid:0)
Beginner to Intermediate(cid:2) A learning environment should include many
source code examples(cid:2) so students can learn by observing working code and
modifying it(cid:4) Furthermore(cid:2) examining the code can reveal that parallel and
sequentialprogrammingconformtosimilarprinciples(cid:4) Finally(cid:2) whenthestudent
tries to write custom code(cid:2) he or she will be able to construct a solution by
analogy to the library code(cid:4)
(cid:0)
Intermediate to Advanced(cid:2) A uni(cid:3)ed and methodical approach should be
taught concurrently(cid:2) during these learning sessions(cid:2) so students could learn to
design code(cid:2) develop test suites(cid:2) and perform correctness proofs(cid:2) e(cid:8)ciency anal(cid:9)
ysis(cid:2) and performance evaluation(cid:4)
(cid:0)
Advanced to Expert(cid:2) A system should be designed that encourages software
reuse(cid:4) Such a system has been explored for sequential algorithms (cid:10)VK(cid:11)(cid:12)(cid:13)(cid:2) but
none to date has been developed for parallel algorithms(cid:4) Archetypes lend them(cid:9)
selves nicely to many software engineering principles including software reuse(cid:2)
leading to a paradigm bridging between sequential and parallel algorithms pre(cid:9)
viously unachieved(cid:4)
We believe Archetypes represent a manner by which programmers can progress(cid:4)
Further(cid:2) by being useful to parallel programmers at every level(cid:2) Archetypes bridge
the gap between di(cid:5)erent skills of programmers(cid:2) providing a means by which all
programmers can learn and refer to principles at many levels(cid:4)
Teaching Archetypal Design (cid:12) Printed November (cid:2)(cid:3) (cid:4)(cid:2)(cid:2)(cid:5)
Description:Nov 9, 1993 How can parallel programming be made tractable for students in high schools
and community colleges, to programmers in four-year colleges,