HPCwire

The Leading Source for Global News and Information Covering the Ecosystem of High Productivity Computing

HPCwire >> Features

Parallel Programming: Some Fundamental Concepts


Page:  1  of  4
1 | 2 | 3 | 4   All  »  

Parallel programming uses threads to enable multiple operations to proceed simultaneously. The entire concept of parallel programming centers on the design, development and deployment of threads within an application and the coordination between threads and their respective operations. This article examines how to break up programming tasks into chunks that are suitable for threading.

In traditional programming models, such as object oriented programming (OOP), a program begins at a defined point (the main() function usually) and works through a series of tasks in succession. If the program relies on user interaction, the main processing instrument is a loop in which user events are handled; the program performs an established sequence of actions that ultimately ends with a wait for the next user action.

When designing such programs, developers enjoy a relatively simple programming world because only one thing is happening at any given moment. At any point in the process, one step generally flows into the next, leading up to a predictable conclusion, based on predetermined parameters.

To move from this linear model to a parallel programming model, designers must rethink the idea of process flow and design for threads. Rather than being constrained by a sequential execution sequence, programmers should identify those activities that can be executed in parallel. To do so, they must see their programs as a set of tasks with dependencies between them. Breaking programs down into these individual tasks and identifying dependencies is known as decomposition. A problem may be decomposed in several ways: by task, by data, or by data flow. Table 1 summarizes these forms of decomposition.

Table 1    Summary of the Major Forms of Decomposition
Table 1
Decomposing a program by the functions that it performs is called task decomposition. It is one of the simplest ways to achieve parallel execution. Using this approach, individual tasks are cataloged. If two of them can run concurrently, they are scheduled to do so by the developer. Running tasks in parallel this way usually requires slight modifications to the individual functions to avoid conflicts and to indicate that these tasks are no longer sequential.

If we were discussing gardening, task decomposition would suggest that gardeners be assigned tasks based on the nature of the activity: if two gardeners arrived at a client's home, one might mow the lawn while the other weeded. Mowing and weeding are separate functions broken out as such. To accomplish them, the gardeners would make sure to have some coordination between them, so that the weeder is not sitting in the middle of a lawn that needs to be mowed.

Data decomposition, also known as data-level parallelism, breaks down tasks by the data they work on rather than by the nature of the task. Programs that are broken down via data decomposition generally have many threads performing the same work, just on different data items. For example, consider recalculating the values in a large spreadsheet. Rather than have one thread perform all the calculations, data decomposition would suggest having two threads, each performing half the calculations, or n threads performing 1/nth the work.

If the gardeners used the principle of data decomposition to divide their work, they would both mow half the property and then both weed half the flower beds. As in computing, determining which form of decomposition is more effective depends a lot on the constraints of the system. For example, if the area to mow is so small that it does not need two mowers, that task would be better done by just one gardener -- that is, task decomposition is the best choice -- and data decomposition could be applied to other task sequences, such as when the mowing is done and both gardeners begin weeding in parallel.

As the number of processor cores increases, data decomposition allows the problem size to be increased. This allows for more work to be done in the same amount of time. To illustrate, consider the gardening example. Two more gardeners are added to the work crew. Rather than assigning all four gardeners to one yard, we can we can assign the two new gardeners to another yard, effectively increasing our total problem size. Assuming that the two new gardeners can perform the same amount of work as the original two, and that the two yard sizes are the same, we've doubled the amount of work done in the same amount of time.

Many times, when decomposing a problem, the critical issue isn't what tasks should do the work, but how the data flows between the different tasks. In these cases, data flow decomposition breaks up a problem by how data flows between tasks.

Page:  1  of  4
1 | 2 | 3 | 4   All  »  

HPCwire on Twitter

Article Tools

  • Print This Page
  • Bookmark This Article

Share Options

(Digg, Technorati, more)


Subscribe

Discussion

There are 0 discussion items posted.  

HPC in the Cloud Part 2
People to Watch 2010

Sponsored Links

SDSC and Appro Next-Generation Supercomputer: SC09 Video Interview
Learn how SDSC and Appro are pushing the envelope and have come up with a supercomputer design that delivers 32 "supernodes".

Appro Ready-To-Go-Clusters – Quickly deploy ANSYS & Intel Cluster Ready Solutions
Offering a fully integrated Ready-To-Go Cluster based on the Appro GreenBlade System supporting up to 28 blade nodes in a half-size standard rack cabinet, including master nodes and switches.



Top Headlines

IBM Releases Energy Efficient Power7 System

Feb 09 | eWeek Europe | Company says new high-end servers will deliver "intelligent performance." Read more...

Inductive Coupling Packs Flash Drive in a Chip

Feb 09 | EE Times | Wireless technology promises energy-efficient chip-to-chip communication. Read more...

IBM, Microsoft Help Create Montana Supercomputer

Feb 08 | eWeek | A new kind of Rocky Mountain high. Read more...

AMD Aims for GPUs in Mainstream Servers Starting 2012

Feb 08 | Computerworld | Chip maker hopes to bring CPU-GPU processors to servers in two years. Read more...

Graphene Transistors That Work at Blistering Speeds

Feb 05 | Technology Review | IBM has created graphene transistors that leave silicon ones in the dust. Read more...

Featured Whitepapers

Virtualization for Aggregation And The vSMP Architecture™

Jan 12 | | In-depth look at vSMP Foundation server virtualization technology, technical implementation, use cases and capabilities. The technical whitepaper provides an architectural overview and details on the three vSMP Foundation products: vSMP Foundation for SMP, vSMP Foundation for Cluster and vSMP Foundation for Cloud.

Copper Cable Technologies for High Performance Computing

Jan 18 | | This white paper discusses Gore’s copper cable assemblies, and how they continue to exceed the standards for providing reliable, cost-effective solutions for high-performance computer applications.

Appro Assists LLNL with Cluster Designed for Extreme Scale Visualization

Jan 11 | | LLNL is home to some of the fastest computers in the world. In 2012, LLNL expects to have the Sequoia supercomputing cluster operational with a projected performance of over 20 PFLOP/s. These systems will focus on strengthening the foundations of predictive simulation through running large suites of complex simulations and then comparing model predictions with experimental data. To visualize this project’s large amount of data, LLNL requested an Appro Supercomputing Cluster specifically designed to support interactive data analysis.

Multimedia

Webcast: Virtualized Data Center Roundtable

Join this online panel discussion for live Q&A with leading industry experts, analysts, and end-users to discuss the latest innovations, best practices, barriers to implementation, and measurable benefits of server virtualization with a particular focus on today's real world solutions.

Webcast: Watch SC09 Birds of a Feather Video: Scalable Fault-Tolerant HPC Supercomputers

Learn about scalable fault-tolerant architectures and examples of energy efficient and scalable supercomputing clusters using dual QDR InfiniBand to combine capacity computing with network failover capabilities with the help of programming languages such as MPI and a robust Linux cluster management package.

Webcast: High Performance Computing for a Smarter Planet

LIVE@SCO9: The IBM team discusses new innovations in hardware, software and services that help clients better understand their workloads and get insight from their R&D efforts. Technology demonstrations include the soon-to-be-released Power7 HPC processor, the DCS990 system with 2.4 petabytes of storage, the xCAT management tool, secure HPC cloud computing and more. Winners of two HPCwire Readers' and Editors’ Choice Awards! Take the IBM virtual tour at SC09 or more information go online to: http://www-03.ibm.com/systems/deepcomputing/sc09.html

SC09 HPC in the Cloud

Newsletters

Stay informed! Subscribe to HPCwire email Newsletters.






HPC Job Bank


Featured Events

BrightTALK
HPCC
HPC User Forum DICE
Cloud Slam
Cloud Computing Expo
DEISA PRACE Symposium