Parallel Programming: Soon the Only Game in Town

Jan. 1, 2010
The news is not that parallel programming is here—it has been here for a long time. 
The news is that parallel programming will shortly be pervasive, from embedded systems, to computer aided design/computer assisted manufacturing (CAD/CAM) workstations, to supervisory systems, to high-performance computing clusters.“We’re seeing more and more complex control algorithms,” says Casey Weltzin, product manager for LabView Real‑Time at test and automation supplier National Instruments Corp. (www.ni.com), in Austin, Texas. “Automation systems will need to be more reliable to incorporate more features. This will require greater processing speed. But we won’t get that performance by relying on faster clock rates to run traditional sequential programs faster. We’re not likely to move much above the current 3 gigahertz (GHz) because of fundamental power consumption and dissipation issues. Instead, we’ll get the performance by distributing the tasks that together solve a single problem across multi-core processors. The only way to realize the potential of these newer processors is with parallel programming strategies.”“Parallel programming will be ubiquitous. Let there be no doubt about it,” said Sanjiv Shah in a 2007 interview for Thinking Parallel (www.thinkingparallel.com). Shah is a senior principal engineer at Intel Corp. (www.intel.com), the Santa Clara, Calif.-based supplier of multi-core microprocessors, and an architect of OpenMP, the most widely adopted parallel programming standard using compiler directives. “Fast movers will use parallelism as a competitive advantage, and sequential applications may survive due to installed user base and features. But, over time, as more and more cores become available, sequential applications will be at a bigger disadvantage. They will be ignoring too much computing power to compete and survive.”How it’s done“Parallel programming means mapping the code into ‘threads,’ ” says Weltzin. “A thread is just a piece of code that tells the operating system that it can run in parallel with other pieces of code. Each thread can then run on a different processor core.”Parallel development begins with discovering parallelism in the problem that the program is intended to solve. For example, “Update all pixels in an image” exhibits data parallelism. The same task, “update,” is performed on each pixel datum. On the other hand, “Evaluate multiple properties within a chemical reaction system” exhibits task parallelism. Both the task (“evaluate”) and the data vary. Consultation with domain experts can reveal parallelism that is far less apparent.Parallelism discovered in the problem is then used to develop an algorithm and data structures that can be expressed in a programming language. Parallel programming has such broad relevance that it can be profitably implemented at different levels: at a low level, closer to the computer, it offers great control and the last ounce of performance; at a higher level, closer to the physical problem, it offers convenience and domain focus.In a typical architecture, the output of the previous step in a program is a sequential instruction that could execute in a parallel fashion but won’t yet. At this point, the programmer adds explicit parallel constructs in a notation that will allow the program to execute in parallel if multiple cores are available. The ways to do this include compiler directives, message passing, calls to thread libraries and custom‑programmed control of individual threads. Debugging parallel programs is critical—and difficult, especially when parallel threads share and modify the same memory. Tuning will almost certainly be necessary because small changes in a parallel program can significantly alter overall performance.Weltzin advises, “If I were to make one recommendation to programmers who want to get into parallel programming, I’d say, ‘Look at the tools that are out there.’ ” But parallel programming will probably never be easy. “Parallel programming is simply a different way of thinking,” Weltzin concludes.Marty Weil, [email protected], is an Automation World Contributing Writer.National Instruments Corp.www.ni.comThinking Parallelwww.thinkingparallel.comIntel Corp.www.intel.com

Subscribe to Automation World's RSS Feeds for Columns & Departments

Sponsored Recommendations

1 Pole B-Trip DLS8 Series: Manual Motor Controller

Tailored to meet various requirements, this series offers B Trip Characteristics for two distinct rated current ranges - 1A to 10A and 13A to 60A. This ensures reliable and customized...

Versatile 2-Pole Solution for Precise Automation

Altech Corp proudly presents the 2 Pole B-Trip DLS8 Series - UL508 Manual Motor Controller, a robust and reliable solution for precise motor control in your automation and control...

Advanced 4 Pole B-Trip Manual Motor Controller by Altech Corp

Discover superior motor control with the DLS8 Series - UL508 Manual Motor Controller, now available in a 4 Pole B-Trip configuration. As your trusted source for automation and...

Reliable and Efficient 1 Pole B-Trip Supplementary Protector by Altech Corp

Introducing the cutting-edge DLS7 Series - UL1077 Supplementary Protector with B Trip Characteristics, engineered for precise protection in diverse industrial applications. Altech...