+ All Categories
Home > Documents > There Is Parallel Life for Java Scientific Programmers! [reviews of "Building Parallel Programs:...

There Is Parallel Life for Java Scientific Programmers! [reviews of "Building Parallel Programs:...

Date post: 23-Sep-2016
Category:
Upload: francisco
View: 212 times
Download: 0 times
Share this document with a friend
5
6 Copublished by the IEEE CS and the AIP 1521-9615/11/$26.00 © 2011 IEEE COMPUTING IN SCIENCE & ENGINEERING B OOKS Editors: Larry Engelhardt, [email protected] Stephen P. Weppner, [email protected] T his book is an excel- lent text on parallel programming in Java, especially for computa- tional science students and faculty. If you’re short of time, simply reread the previous sentence and you’ll get the gist of this review; the rest of the following is devoted to the state- ment’s subtleties (including its use of italics). As an experienced Java program- mer of science and engineering ap- plications who has authored and used many Java scientific simulations for pedagogical purposes (some of them computationally intensive), I’ve fre- quently asked myself the following question: “Since I have a quadcore computer, and all of my programs are sequential, do the other three cores get bored while my program runs?!” In other words, wouldn’t there be a way to parallelize my Java programs to make better use of even modestly powerful hardware? In principle, if you create a Java pro- gram with several threads and your computer has several processors, the Java virtual machine can distribute the workload by assigning the execu- tion of a different thread to each avail- able processor. Concurrency utilities that can accomplish this have been included in the language since Java 5, and Java 7 takes this paradigm further by introducing a fork-join framework of thread concurrency. However, try- ing to build a full-fledged scientific application on these principles is sim- ply too difficult; most scientifically- oriented programmers need a more straightforward approach. In search of a solution, I joined a course on parallel programming that happened to be on Fortran or C programming using OpenMP and message-passing interface (MPI), and I also attended the Supercomputing 2010 conference. The main message? “If you want to do scientific parallel- ism, forget about Java and join us in C.” Because Java didn’t seem to be the right programming language, it looked like I’d have to revert to good old C. Then came this book! What It Covers The author of this book, Alan Kaminsky, is an associate professor in the Department of Computer Science at New York’s Rochester Institute of Technology (RIT). A highly expe- rienced programmer, Kaminsky has recently designed, implemented, and tested the Parallel Java (PJ) library, which • provides an API and middleware for creating parallel programs in pure Java; • works on shared-memory multi- processor (SMP) parallel comput- ers, clusters of parallel computers, and hybrid SMP clusters of parallel computers; and • is freely available in the public domain. My quadcore desktop is an SMP, for example, and you can build a cluster of parallel computers by assembling multiple desktop PCs and connecting them with a reasonably fast Ether- net network. If the computers in the cluster are multicore themselves, then you’ve built a hybrid cluster. This book is heavily dependent on the PJ library and uses it to guide the reader step by step into writing parallel programs that exploit SMP, cluster, and hybrid configurations. (Neither the book nor the library ad- dress GPU programming.) Kaminsky has used his programming and teach- ing expertise and the object-oriented design of both Java and his library to create a highly readable and informa- tive book. The book is divided into five parts that cover • the basics that everyone interested in parallel computing needs to know, • parallel programming on SMP machines, • cluster programming, • programming hybrid clusters, and • as a final bonus, three complete, fairly involved real-life examples. These five parts span 35 short chap- ters, and the book ends with four appendices (the first two of which are must-reads). At the end of most chap- ters, the author provides references for further information, and each section is followed by a series of exercises that T HERE I S P ARALLEL LIFE FOR JAVA SCIENTIFIC PROGRAMMERS! By Francisco Esquembre A. Kaminsky, Building Parallel Programs: SMPs, Clusters, and Java, Cengage Course Technology, 2010, ISBN: 1-4239-0198-3, 896 pp.
Transcript

6 Copublished by the IEEE CS and the AIP 1521-9615/11/$26.00 © 2011 IEEE Computing in SCienCe & engineering

B o o k S

Editors: Larry Engelhardt, [email protected]

Stephen P. Weppner, [email protected]

T his book is an excel-lent text on parallel programming in Java,

especially for computa-tional science students and faculty. If you’re short of time, simply reread the previous sentence and you’ll get the gist of this review; the rest of the following is devoted to the state-ment’s subtleties (including its use of italics).

As an experienced Java program-mer of science and engineering ap-plications who has authored and used many Java scientific simulations for pedagogical purposes (some of them computationally intensive), I’ve fre-quently asked myself the following question: “Since I have a quadcore computer, and all of my programs are sequential, do the other three cores get bored while my program runs?!” In other words, wouldn’t there be a way to parallelize my Java programs to make better use of even modestly powerful hardware?

In principle, if you create a Java pro-gram with several threads and your computer has several processors, the Java virtual machine can distribute the workload by assigning the execu-tion of a different thread to each avail-able processor. Concurrency utilities that can accomplish this have been included in the language since Java 5, and Java 7 takes this paradigm further by introducing a fork-join framework of thread concurrency. However, try-ing to build a full-fledged scientific

application on these principles is sim-ply too difficult; most scientifically-oriented programmers need a more straightforward approach.

In search of a solution, I joined a course on parallel programming that happened to be on Fortran or C programming using OpenMP and message-passing interface (MPI), and I also attended the Supercomputing 2010 conference. The main message? “If you want to do scientific parallel-ism, forget about Java and join us in C.” Because Java didn’t seem to be the right programming language, it looked like I’d have to revert to good old C. Then came this book!

What It CoversThe author of this book, Alan Kaminsky, is an associate professor in the Department of Computer Science at New York’s Rochester Institute of Technology (RIT). A highly expe-rienced programmer, Kaminsky has recently designed, implemented, and tested the Parallel Java (PJ) library, which

• provides an API and middleware for creating parallel programs in pure Java;

• works on shared-memory multi-processor (SMP) parallel comput-ers, clusters of parallel computers, and hybrid SMP clusters of parallel computers; and

• is freely available in the public domain.

My quadcore desktop is an SMP, for example, and you can build a cluster of parallel computers by assembling multiple desktop PCs and connecting them with a reasonably fast Ether-net network. If the computers in the cluster are multicore themselves, then you’ve built a hybrid cluster.

This book is heavily dependent on the PJ library and uses it to guide the reader step by step into writing parallel programs that exploit SMP, cluster, and hybrid configurations. (Neither the book nor the library ad-dress GPU programming.) Kaminsky has used his programming and teach-ing expertise and the object-oriented design of both Java and his library to create a highly readable and informa-tive book.

The book is divided into five parts that cover

• the basics that everyone interested in parallel computing needs to know,

• parallel programming on SMP machines,

• cluster programming,• programming hybrid clusters, and• as a final bonus, three complete,

fairly involved real-life examples.

These five parts span 35 short chap-ters, and the book ends with four appendices (the first two of which are must-reads). At the end of most chap-ters, the author provides references for further information, and each section is followed by a series of exercises that

There Is Parallel lIfe for Java scIenTIfIc Programmers!By Francisco Esquembre

A. kaminsky, Building Parallel Programs: SMPs, Clusters, and Java, Cengage Course Technology, 2010, ISBN: 1-4239-0198-3, 896 pp.

CISE-13-4-Book.indd 6 09/06/11 1:20 PM

July/AuguSt 2011 7

you can use to reinforce the teaching or assign small student projects.

Highs and LowsThis book is very informative, and Kaminsky’s writing style is highly readable. Having programmed a library that implements parallelism clearly gives him deep insight into the subject. Kaminsky leads readers through a progressive process of turn-ing sequential programs into effective and efficient parallel programs that address a variety of problems. He does this repeatedly and consistently (thus achieving persistence in students’ minds), introducing complexity as needed whenever simpler prototypes prove insufficient.

There are two especially valuable features of his approach:

• He always includes complete pro-gram listings, interspersed with comments as needed.

• He uses computational examples that hold real scientific interest for students, yet are simple enough to be easily understandable. (In my experience with parallel computing courses, this use of interesting ex-amples is not commonplace!)

Although perhaps a bit biased toward computer science students—due most likely to his own teaching—the examples are also interesting to the scientific community: cryp-tography, fractal sets, Monte Carlo simulations, graph theory, cellular au-tomata, partial differential equations, and N-body problems. These problems introduce situations that necessitate the use of various features of a par-allel programming library, including patterns of parallelism, load balanc-ing, synchronized access to shared variables, types of message-passing

communications, and so on. He also covers some of the examples repeat-edly in the different parts of the book to show how the same problem can be addressed using SMP, cluster, or hybrid parallelism, which is a very in-formative approach.

Another highlight is that, early on, Kaminsky introduces the use of metrics (and later, time models for clusters) to measure parallel program speed-up and size-up—that is, how par-allelism can make your program run faster on a given problem, or success-fully deal with larger problems, re-spectively. He then uses these metrics and time models for the various pro-grams to show whether a given imple-mentation of an idea will lead to the

expected parallel improvement. This subsequently leads to deeper insight and better solutions.

My biggest criticism of the book stems from the same writing style I praised earlier. As I read the chap-ters, I frequently found the following reasoning sequence:

• A given scientific problem is stated. • Parallel solutions are proposed and

implemented.• The solution is tested and shown

not to work as expected. • The next chapter introduces a new

topic whose implementation fixes the problem.

After going through this sequence several times, I sometimes won-dered: “What will be the next trick?”

Inexperienced students might get the impression that learning parallel pro-gramming consists of learning a few tricks. Also, coming to the end of the SMP part, for example, you might feel that there are more tricks that haven’t been covered. To remedy this, an in-structor could provide supplemental material from a more theoretical book on parallel computing.

A second possible criticism is of a more technical nature and goes in two directions. The first points toward PJ’s C-language relatives, OpenMP and MPI. Kaminski says that the PJ library is inspired by OpenMP and MPI, but he doesn’t discuss their par-allels (pun included) until the appendi-ces. Because many readers might have

previous knowledge of these well-established standards of parallelism, they could benefit from this compari-son while studying the PJ approach. The second direction points toward Java itself. I was often curious to learn how the PJ library implements certain utilities (such as barriers or safe access to shared variables). You could delve into the freely available source code, but a couple of in-site explanations would have enriched the text.

T his book has quickly become one of the Java programming jewels

in my library. It communicates which issues are important for parallel com-puting, and it does so in a clear and in-teresting manner. It also demonstrates the elegant and natural way in which

Kaminsky leads readers through a progressive process of

turning sequential programs into effective and efficient

parallel programs that address a variety of problems.

CISE-13-4-Book.indd 7 09/06/11 1:20 PM

B o o k S

8 Computing in SCienCe & engineering

PJ matches Java’s object-oriented na-ture. In fact, I recommend that all serious, scientifically oriented Java programmers and students read this book as soon as possible. Given the already ubiquitous presence of desktop computers with multiple processors— and the growing availability of clusters and supercomputing facilities—this

book will no doubt aid these program-mers and students in building success-ful, multifaceted careers.

Francisco (Paco) Esquembre is an associate

professor and Dean of the Faculty of Mathe-

matics at the University of Murcia, Spain. His

research interests include numerical analysis

and computational methods, and the use

of computer simulations and modeling for

teaching science and engineering. He is an

experienced (albeit sequential) programmer

of computer simulations in several languages,

a member of the openSourcePhysics pro-

ject, and author of the Easy Java Simulations

authoring and modeling tool. Esquembre has

a PhD in mathematics from the University of

Murcia. Contact him at [email protected].

a Breeezy look aT BIoPhysIcsBy Peter Jung

J. Claycomb and J.Q.P. Tran, Introductory Biophysics: Perspectives on the Living State, Jones & Bartlett Publishers, 2010, ISBN: 978-0763779986, 368 pp.

While the 20th cent u r y wa s dubbed t he

century of physics, the 21st century will likely be the

century of biology. With the advent of novel imaging tools with unprec-edented resolutions in space and time, researchers now have direct access to cellular processes like never before, re-sulting in great leaps in our understand-ing of living-cell processes. Another important yet less visible development is biology’s transition from a descrip-tive to a quantitative science actively recruiting other disciplines—including physics, engineering, and computer sci-ence—in the process. In a research en-vironment where physicists, biologists, and engineers are working jointly to understand the living state, one of the most pressing issues is how to educate students in the 21st century of biology. An increasing number of textbooks are thus published every year, one of which is Perspectives on the Living State by James Claycomb and Jonathan Quoc P. Tran.

the biophysics genome included in this book are introductory sections on equilibrium thermodynamics, chemical reaction, reaction rates, energy landscapes, heat transport, diffusion, and Brownian motion.

So, what distinguishes this book from the others? At first glance, the obvious answer is weight. This book is lighter than most other books; it has approximately 270 pages, ex-cluding appendices. This compares to 550 pages of Philip Nelson’s Bio-logical Physics1 and the almost 800 pages of Physical Biology of the Cell by Rob Phillips, Jane Kondev, and Julie Theriot.2 Comparing Nelson’s book with this one on the next finer scale of organization, the table of contents, you can see that—apart from how it’s organized—the material is quite simi-lar. Actually, this textbook has small sections on nonlinear dynamics, chaos, fractals, and pattern formation, which Nelson is lacking.

So why the difference in weight? The answer is detail and depth. For example, the “Nerve Conduction” chapter in the Claycomb and Tran book is approximately 15 pages; in Nelson’s book, a similar chapter is 50 pages. Comparisons of other top-ics yield similar results. However, this lack of detail and depth shouldn’t be seen as a detriment. Instead, this brevity of content fills a market niche,

When I was asked to review this book, I had two questions: How is this book different from other currently available books? What kind of stu-dent or course would best benefit from it? Before I discuss how it’s different, I want to first examine the material common to most biophysics textbooks (including this one).

The “genome” of biophysics—that is, the history of active research topics—is at the core of most text-books. In the beginning was the nerve cell, or neuron. Nerve cells are electri-cally active and transmit information to other nerve cells, muscles, and so on through electric action poten-tials. One of the first successful and predictive biophysical models was the Hodgkin Huxley model for the generation and conduction of action potentials. Most books, including this one, contain a section on this land-mark model from the 1950s, which still forms the basis of modern com-putational neuroscience, with some underpinning from electrochemistry and thermodynamics. Other parts of

CISE-13-4-Book.indd 8 09/06/11 1:20 PM

July/AuguSt 2011 9

providing a text for a light course in biophysics.

In fact, this book covers a wide range of biophysics topics, with a level of detail (including mathematical derivations) that make it well suited to a junior or senior undergraduate stu-dent, without the intimidation of 800 pages in US-letter format as in the pre-viously mentioned book. On the other hand, the Claycomb and Tran book is no replacement for the more thorough textbooks; it’s simply too light for more inquisitive students who want a deeper understanding of the material and more detail. Furthermore, this book assumes that the reader has already taken a course in calculus-based introductory physics; in that respect, it’s unlike Russell K. Hobbie and Bradley J. Roth’s Intermediate Physics for Medicine and Biology,3

which assumes no knowledge of basic physics.

T his is a highly suitable under-graduate textbook for a one-

semester teaser course—that is, a course that gives a student a rough overview of what biophysics is all about. The text is written lucidly and provides ample problems suit-able for homework assignments. I do have one suggestion for future edi-tions: they should offer additional references to further readings. For example, chaos in the heart rhythm is covered in just a few lines, so additional references should be given for interested readers.

References1. P. Nelson, Biological Physics, W.H.

Freeman and Co., 2004.

2. R. Phillips, J. kondev, and J. Theriot,

Physical Biology of the Cell, Garland

Science, 2009.

3. R.k. Hobbie and B.J. Roth, Intermedi-

ate Physics for Medicine and Biology,

Springer, 2007.

Peter Jung is a distinguished professor in

the Department of Physics and Astronomy

at ohio University’s Quantitative Biology

Institute. His research interests are in com-

putational cell biology and neuroscience.

Jung has a PhD in physics from University

of Ulm, Germany. Contact him at jungp@

ohio.edu.

Selected articles and columns from IEEE Computer Society publica-

tions are also available for free at http://ComputingNow.computer.org.

The American Institute of Physics (AIP) is a not-for-pro t membership corporation chartered in New York State in 1931 for the purpose of promoting the advancement and diffusion of the knowledge of physics and its application to human welfare. Leading societies in the elds of physics, astronomy, and related sciences are its members.

In order to achieve its purpose, AIP serves physics and related elds of science and technology by serving its member societies, individual scientists, educators, students, R&D leaders, and the general public with programs, services, and publications—information that matters.

The Institute publishes its own scienti c journals as well as those of its member societies; provides abstracting and indexing services; provides online database services; disseminates reliable information on physics to the public; collects and analyzes statistics on the profession and on physics education; encourages and assists in the documentation and study of the history and philosophy of physics; cooperates with other organizations on educational projects at all levels; and collects and analyzes information on federal programs and budgets.

The scientists represented by the Institute through its member societies number more than 134 000. In addition, approximately 6000 students in more than 700 colleges and universities are members of the Institute’s Society of Physics Students, which includes the honor society Sigma Pi Sigma. Industry is represented through the membership of 37 Corporate Associates.

Governing Board: Louis J. Lanzerotti* (chair), David E. Aspnes, Anthony Atchley,* Barry Barish,G. Fritz Benedict, J. Daniel Bourland, Curtis G. Callan, Charles W. Carter Jr, Timothy A. Cohn,David M. Cook, William J. Cook, Bruce H. Curran,* Morton M. Denn,* Alexander Dickison,Michael D. Duncan, H. Frederick Dylla* (ex of�cio), Janet Fender,* Judith Flippen-Anderson,*Brian J. Fraser,* Jaime Fucugauchi, Timothy Grove, Mark Hamilton, Warren W. Hein,* JamesHollenhorst, Paul L. Kelley, Angela R. Keyser, Kate Kirby, Rudolf Ludeke,* Kevin B. Marvel,*Christine McEntee, Michael McPhaden, Patricia Mooney, Cherry Murray, Elizabeth A. Rogan,Charles E. Schmid, Joseph Serene,* Benjamin B. Snavely* (ex of�cio), David Sokoloff, Gene Sprouse,Hervey (Peter) Stockman, Quinton L. Williams. *Executive Committee member.

Management Committee: H. Frederick Dylla, Executive Director and CEO; Richard Baccante, Treasurer and CFO; Theresa C. Braun, Vice President, Human Resources; John S. Haynes, Vice President, Publishing; Catherine O’Riordan, Vice President, Physics Resources; Benjamin B. Snavely, Secretary.

ww

w.a

ip.o

rg

CISE-13-4-Book.indd 9 09/06/11 1:20 PM

B o o k S

PURPOSE: The IEEE Computer Society is the world’s largest association of computing professionals and is the leading provider of technical information in the field.MEMBERSHIP: Members receive the monthly magazine Computer, discounts, and opportunities to serve (all activities are led by volunteer members). Membership is open to all IEEE members, affiliate society members, and others interested in the computer field.COMPUTER SOCIETY WEBSITE: www.computer.orgOMBUDSMAN: To check membership status or report a change of address, call the IEEE Member Services toll-free number, +1 800 678 4333 (US) or +1 732 981 0060 (international). Direct all other Computer Society-related questions—magazine delivery or unresolved complaints—to [email protected]: Regular and student chapters worldwide provide the opportunity to interact with colleagues, hear technical experts, and serve the local professional community.AVAILABLE INFORMATION: To obtain more information on anyof the following, contact Customer Service at +1 714 821 8380 or+1 800 272 6657:

• Membership applications• Publications catalog• Draft standards and order forms• Technical committee list• Technical committee application• Chapter start-up procedures• Student scholarship information• Volunteer leaders/staff directory• IEEE senior member grade application (requires 10 years• practice and significant performance in five of those 10)

PUBLICATIONS AND ACTIVITIESComputer: The flagship publication of the IEEE Computer Society, Computer, publishes peer-reviewed technical content that covers all aspects of computer science, computer engineering, technology, and applications.Periodicals: The society publishes 13 magazines, 18 transactions, and one letters. Refer to membership application or request information as noted above.Conference Proceedings & Books: Conference Publishing Services publishes more than 175 titles every year. CS Press publishes books in partnership with John Wiley & Sons.Standards Working Groups: More than 150 groups produce IEEE standards used throughout the world.Technical Committees: TCs provide professional interaction in more than 45 technical areas and directly influence computer engineering conferences and publications.Conferences/Education: The society holds about 200 conferences each year and sponsors many educational activities, including computing science accreditation.Certifications: The society offers two software developer credentials. For more information, visit www.computer.org/certification.

NExT BOARD MEETING23–27 May 2011, Albuquerque, NM, USA

ExECUTIVE COMMITTEEPresident: Sorel Reisman*President-Elect: John W. Walz*Past President: James D. Isaak*VP, Standards Activities: Roger U. Fujii†

Secretary: Jon Rokne (2nd VP)*VP, Educational Activities: Elizabeth L. Burd*VP, Member & Geographic Activities: Rangachar Kasturi†

VP, Publications: David Alan Grier (1st VP)*VP, Professional Activities: Paul K. Joannou*VP, Technical & Conference Activities: Paul R. Croll†

Treasurer: James W. Moore, CSDP*2011–2012 IEEE Division VIII Director: Susan K. (Kathy) Land, CSDP†

2010–2011 IEEE Division V Director: Michael R. Williams†

2011 IEEE Division Director V Director-Elect: James W. Moore, CSDP* *voting member of the Board of Governors †nonvoting member of the Board of Governors

BOARD OF GOVERNORSTerm Expiring 2011: Elisa Bertino, Jose Castillo-Velázquez, George V. Cybenko, Ann DeMarle, David S. Ebert, Hironori Kasahara, Steven L. TanimotoTerm Expiring 2012: Elizabeth L. Burd, Thomas M. Conte, Frank E. Ferrante, Jean-Luc Gaudiot, Paul K. Joannou, Luis Kun, James W. MooreTerm Expiring 2013: Pierre Bourque, Dennis J. Frailey, Atsuhiro Goto, André Ivanov, Dejan S. Milojicic, Jane Chu Prey, Charlene (Chuck) Walrad

ExECUTIVE STAFFExecutive Director: Angela R. BurgessAssociate Executive Director; Director, Governance: Anne Marie KellyDirector, Finance & Accounting: John MillerDirector, Information Technology & Services: Ray KahnDirector, Membership Development: Violet S. DoanDirector, Products & Services: Evan ButterfieldDirector, Sales & Marketing: Dick Price

COMPUTER SOCIETY OFFICESWashington, D.C.: 2001 L St., Ste. 700, Washington, D.C. 20036-4928Phone:+12023710101•Fax: +1 202 728 9614Email: [email protected] Alamitos: 10662 Los Vaqueros Circle, Los Alamitos, CA 90720-1314Phone: +1 714 821 8380Email: [email protected]

MEMBERSHIP & PUBLICATION ORDERSPhone:+18002726657•Fax:+17148214641•Email:[email protected]/Pacific: Watanabe Building, 1-4-2 Minami-Aoyama, Minato-ku, Tokyo 107-0062, JapanPhone:+81334083118•Fax: +81 3 3408 3553Email: [email protected]

IEEE OFFICERSPresident: Moshe KamPresident-Elect: Gordon W. DayPast President: Pedro A. RaySecretary: Roger D. PollardTreasurer: Harold L. FlescherPresident, Standards Association Board of Governors: Steven M. MillsVP, Educational Activities: Tariq S. DurraniVP, Membership & Geographic Activities: Howard E. MichelVP, Publication Services & Products: David A. HodgesVP, Technical Activities: Donna L. HudsonIEEE Division V Director: Michael R. WilliamsIEEE Division VIII Director: Susan K. (Kathy) Land, CSDPPresident, IEEE-USA: Ronald G. Jensen

revised 5 May 2011

CISE-13-4-Book.indd 10 09/06/11 1:20 PM


Recommended