[email protected]: When to Say No to Parallelism

By Sanjiv Shah

January 14, 2009

As a software developer, you are faced with a range of options as you decide whether and how to modify your applications for parallel architectures. What approach should you adopt? How significantly should you alter applications? When should you say “no” to parallelism? Answering these questions requires not only technical expertise but also strategic thinking that evaluates the business benefits and costs. As you weigh your options, consider the suggestions below, which we’ve derived from our experiences at Intel working with software developers to optimize code.

Don’t Parallelize Un-Optimized Serial Code

There is no doubt that parallelization is an important means of upgrading application performance for current and future generations of hardware. Still, threading should not be the first course of action in optimizing an application. Identify whether you can meet your performance targets using serial and vector optimizations. In some cases, you might gain greater performance improvements by optimizing the serial version than by creating a parallel one.

Don’t Parallelize If the Serial Code Is Running Fast Enough Already

Although you can and should position your code for future architectures, it might not be time- and cost-effective to work to meet requirements that have not yet been created. Developing code with a higher degree of parallelism than current architectures can support is rarely the best use of resources. And of course, if your code is I/O- or memory-bound, parallelizing the code will not help.

Don’t spend time trying to parallelize all your past work immediately. Think parallel when building new code or rebuilding sections of existing code. Rather than solving problems in sequential steps, consider how those problems can be broken into separate pieces that can be performed simultaneously.

As you consider how much parallelism is needed for the longer term, try to determine how quickly the application workload will scale and how that scaling will affect computational requirements. The amount of computation might rise linearly with the size of the data set, or it might rise at a geometrically faster or slower rate. (If the workload scales linearly with the data, beware that the code will run into an I/O bottleneck at some point.)

Take for example an audio processing application that can already handle a sufficient number of channels at a good sampling rate. This application might be a poor candidate for parallelization. On the other hand, a physical modeling application might be a good candidate. With higher computational power available, the modeling application could deliver finer modeling and more accurate algorithms.

Overall, make sure the gains from parallelizing an application are not offset by delays in shipping the next version of your product.

Don’t Parallelize by Rewriting Code from Scratch

Don’t throw the baby out with the bathwater. Resist the temptation to discard an entire working code base because it is ugly, convoluted, or just plain old. The story of Netscape provides a cautionary tale. According to software developer and blogger Joel Spolsky, Netscape rewrote the entire code base of its browser between 1997 and 2000. While the company shipped no new versions, Microsoft took over the browser market, and Netscape never recovered.

As Spolsky notes, most programmers strive to write more elegant code. Through the development process, clumps of code are added and refined. The result might appear ugly. But if you rewrite the code, you lose the knowledge that those clumps represent. And in any case, ugliness is in the eye of the beholder. Computer code that appears ugly to a human trying to read it might work just fine.

There will always be some occasions that demand a fresh start. Still, ripping up a class or subroutine to introduce parallelism can be much more efficient than starting with a completely blank page.

Don’t Parallelize If Someone Has Already Done the Work for You

Before you tear into any of your code and try to parallelize it yourself, see if off-the-shelf or open-source solutions can provide what you need. If you are working on scientific or technical applications, for example, you might find standard routines in popular math libraries that can save you valuable time.

Consider using Intel® Software Tools. For example, Intel® Threading Building Blocks, a C++ template-based runtime library of parallel structures and algorithms, can dramatically simplify your efforts. Using these constructs enables your code to scale automatically as the number of execution cores increases. The constructs are also designed explicitly to be compatible with other threading techniques, including other parallel libraries, such as the Intel® Integrated Performance Primitives and Intel® Math Kernel Library. Using compilers or OpenMP* offers additional ways to add parallelism easily.

Don’t Rush In

The advent of multi-core architectures constitutes a revolution in computer technology, but capitalizing on the benefits of multi-core demands measured steps. Multi-threading and other means of parallelizing software are complex undertakings that can require substantial resources. Parallelization should be regarded as an investment like any other — one that should be undertaken when necessary, but only after due consideration of costs and benefits.

Visit Intel online for the latest news and more information about High Performance Computing and Parallel Programming for Intel Multi-Core Processors.

Subscribe to HPCwire's Weekly Update!

Be the most informed person in the room! Stay ahead of the tech trends with industy updates delivered to you every week!

Pegasus ‘Big Memory’ Supercomputer Now Deployed at the University of Tsukuba

March 25, 2023

In the bevy of news from Nvidia's GPU Technology Conference this week, another new system has come to light: Pegasus, which entered operations at the University of Tsukuba’s Center for Computational Sciences in January Read more…

EuroHPC Summit: Tackling Exascale, Energy, Industry & Sovereignty

March 24, 2023

As the 2023 EuroHPC Summit opened in Gothenburg on Monday, Herbert Zeisel – chair of EuroHPC’s Governing Board – commented that the undertaking had “left its teenage years behind.” Indeed, a sense of general ma Read more…

Is Fortran the Best Programming Language? Asking ChatGPT

March 23, 2023

I recently wrote about my experience with interviewing ChatGPT here. As promised, in this follow-on and conclusion of my interview, I focus on Fortran and other languages. All in good fun. I hope you enjoy the conclusion of my interview. After my programming language questions, I conclude with a few notes... Read more…

Nvidia Doubling Down on China Market in the Face of Tightened US Export Controls

March 23, 2023

Chipmakers are tightlipped on China activities following a U.S. crackdown on hardware exports to the country. But Nvidia remains unfazed, and is doubling down on China being an important country for its computing hardwar Read more…

Intel’s Sapphire Rapids Comes to Australia’s Gadi Supercomputer

March 22, 2023

Until the launch of Pawsey’s Setonix system last year, NCI’s Gadi system – launched in 2020 – was Australia’s most powerful publicly ranked supercomputer. Now, the system has received a major boost powered by I Read more…

AWS Solution Channel

Shutterstock_2206622211

Install optimized software with Spack configs for AWS ParallelCluster

With AWS ParallelCluster, you can choose a computing architecture that best matches your HPC application. But, HPC applications are complex. That means they can be challenging to get working well. Read more…

 

Get the latest on AI innovation at NVIDIA GTC

Join Microsoft at NVIDIA GTC, a free online global technology conference, March 20 – 23 to learn how organizations of any size can power AI innovation with purpose-built cloud infrastructure from Microsoft. Read more…

Nvidia Announces BlueField-3 GA, Oracle Cloud Is Early User

March 21, 2023

Nvidia today announced general availability for its BlueField-3 data processing unit (DPU) along with impressive early deployments including Oracle Cloud Infrastructure. First described in 2021 and now being delivered, B Read more…

Pegasus ‘Big Memory’ Supercomputer Now Deployed at the University of Tsukuba

March 25, 2023

In the bevy of news from Nvidia's GPU Technology Conference this week, another new system has come to light: Pegasus, which entered operations at the University Read more…

EuroHPC Summit: Tackling Exascale, Energy, Industry & Sovereignty

March 24, 2023

As the 2023 EuroHPC Summit opened in Gothenburg on Monday, Herbert Zeisel – chair of EuroHPC’s Governing Board – commented that the undertaking had “lef Read more…

Nvidia Doubling Down on China Market in the Face of Tightened US Export Controls

March 23, 2023

Chipmakers are tightlipped on China activities following a U.S. crackdown on hardware exports to the country. But Nvidia remains unfazed, and is doubling down o Read more…

Nvidia Announces BlueField-3 GA, Oracle Cloud Is Early User

March 21, 2023

Nvidia today announced general availability for its BlueField-3 data processing unit (DPU) along with impressive early deployments including Oracle Cloud Infras Read more…

Nvidia Announces ‘Tokyo-1’ Generative AI Supercomputer Amid Gradual H100 Rollout

March 21, 2023

Nvidia’s Hopper-generation H100 GPU is continuing its slow march toward “current-generation.” After Nvidia announced that the H100 was in “full producti Read more…

DGX Cloud Is Here: Nvidia’s AI Factory Services Start at $37,000

March 21, 2023

If you are a die-hard Nvidia loyalist, be ready to pay a fortune to use its AI factories in the cloud. Renting the GPU company's DGX Cloud, which is an all-inclusive AI supercomputer in the cloud, starts at $36,999 per instance for a month. The rental includes access to a cloud computer with eight Nvidia H100 or A100 GPUs and 640GB... Read more…

Quantum Bits: IBM-Cleveland Clinic Launch; D-Wave Adds Solver; DOE/AWS Offer QICK

March 20, 2023

IBM today launched the first installation of an IBM Quantum System One at a collaborator site in the U.S. – this one is at the Cleveland Clinic where IBM’s Read more…

SCA23: Pawsey’s Mark Stickells on Sustainable Australian Supercomputing

March 17, 2023

“While the need for supercomputing is great, we have, in my view, reached a tipping point,” said Mark Stickells, executive director of Australia’s Pawsey Read more…

CORNELL I-WAY DEMONSTRATION PITS PARASITE AGAINST VICTIM

October 6, 1995

Ithaca, NY --Visitors to this year's Supercomputing '95 (SC'95) conference will witness a life-and-death struggle between parasite and victim, using virtual Read more…

SGI POWERS VIRTUAL OPERATING ROOM USED IN SURGEON TRAINING

October 6, 1995

Surgery simulations to date have largely been created through the development of dedicated applications requiring considerable programming and computer graphi Read more…

U.S. Will Relax Export Restrictions on Supercomputers

October 6, 1995

New York, NY -- U.S. President Bill Clinton has announced that he will definitely relax restrictions on exports of high-performance computers, giving a boost Read more…

Dutch HPC Center Will Have 20 GFlop, 76-Node SP2 Online by 1996

October 6, 1995

Amsterdam, the Netherlands -- SARA, (Stichting Academisch Rekencentrum Amsterdam), Academic Computing Services of Amsterdam recently announced that it has pur Read more…

Cray Delivers J916 Compact Supercomputer to Solvay Chemical

October 6, 1995

Eagan, Minn. -- Cray Research Inc. has delivered a Cray J916 low-cost compact supercomputer and Cray's UniChem client/server computational chemistry software Read more…

NEC Laboratory Reviews First Year of Cooperative Projects

October 6, 1995

Sankt Augustin, Germany -- NEC C&C (Computers and Communication) Research Laboratory at the GMD Technopark has wrapped up its first year of operation. Read more…

Sun and Sybase Say SQL Server 11 Benchmarks at 4544.60 tpmC

October 6, 1995

Mountain View, Calif. -- Sun Microsystems, Inc. and Sybase, Inc. recently announced the first benchmark results for SQL Server 11. The result represents a n Read more…

New Study Says Parallel Processing Market Will Reach $14B in 1999

October 6, 1995

Mountain View, Calif. -- A study by the Palo Alto Management Group (PAMG) indicates the market for parallel processing systems will increase at more than 4 Read more…

Leading Solution Providers

Contributors

CORNELL I-WAY DEMONSTRATION PITS PARASITE AGAINST VICTIM

October 6, 1995

Ithaca, NY --Visitors to this year's Supercomputing '95 (SC'95) conference will witness a life-and-death struggle between parasite and victim, using virtual Read more…

SGI POWERS VIRTUAL OPERATING ROOM USED IN SURGEON TRAINING

October 6, 1995

Surgery simulations to date have largely been created through the development of dedicated applications requiring considerable programming and computer graphi Read more…

U.S. Will Relax Export Restrictions on Supercomputers

October 6, 1995

New York, NY -- U.S. President Bill Clinton has announced that he will definitely relax restrictions on exports of high-performance computers, giving a boost Read more…

Dutch HPC Center Will Have 20 GFlop, 76-Node SP2 Online by 1996

October 6, 1995

Amsterdam, the Netherlands -- SARA, (Stichting Academisch Rekencentrum Amsterdam), Academic Computing Services of Amsterdam recently announced that it has pur Read more…

Cray Delivers J916 Compact Supercomputer to Solvay Chemical

October 6, 1995

Eagan, Minn. -- Cray Research Inc. has delivered a Cray J916 low-cost compact supercomputer and Cray's UniChem client/server computational chemistry software Read more…

NEC Laboratory Reviews First Year of Cooperative Projects

October 6, 1995

Sankt Augustin, Germany -- NEC C&C (Computers and Communication) Research Laboratory at the GMD Technopark has wrapped up its first year of operation. Read more…

Sun and Sybase Say SQL Server 11 Benchmarks at 4544.60 tpmC

October 6, 1995

Mountain View, Calif. -- Sun Microsystems, Inc. and Sybase, Inc. recently announced the first benchmark results for SQL Server 11. The result represents a n Read more…

New Study Says Parallel Processing Market Will Reach $14B in 1999

October 6, 1995

Mountain View, Calif. -- A study by the Palo Alto Management Group (PAMG) indicates the market for parallel processing systems will increase at more than 4 Read more…

SC22 Booth Videos

AMD @ SC22
Altair @ SC22
AWS @ SC22
Ayar Labs @ SC22
CoolIT @ SC22
Cornelis Networks @ SC22
DDN @ SC22
Dell Technologies @ SC22
HPE @ SC22
Intel @ SC22
Intelligent Light @ SC22
Lancium @ SC22
Lenovo @ SC22
Microsoft and NVIDIA @ SC22
One Stop Systems @ SC22
Penguin Solutions @ SC22
QCT @ SC22
Supermicro @ SC22
Tuxera @ SC22
Tyan Computer @ SC22
  • arrow
  • Click Here for More Headlines
  • arrow
HPCwire