[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!

Nvidia Touts Strong Results on Financial Services Inference Benchmark

February 3, 2023

The next-gen Hopper family may be on its way, but that isn’t stopping Nvidia’s popular A100 GPU from leading another benchmark on its way out. This time, it’s the STAC-ML inference benchmark, produced by the Securi Read more…

Quantum Computing Firm Rigetti Faces Delisting

February 3, 2023

Quantum computing companies are seeing their market caps crumble as investors patiently await out the winner-take-all approach to technology development. Quantum computing firms such as Rigetti Computing, IonQ and D-Wave went public through mergers with blank-check companies in the last two years, with valuations at the time of well over $1 billion. Now the market capitalization of these companies are less than half... Read more…

US and India Strengthen HPC, Quantum Ties Amid Tech Tension with China

February 2, 2023

Last May, the United States and India announced the “Initiative on Critical and Emerging Technology” (iCET), aimed at expanding the countries’ partnerships in strategic technologies and defense industries across th Read more…

Pittsburgh Supercomputing Enables Transparent Medicare Outcome AI

February 2, 2023

Medical applications of AI are replete with promise, but stymied by opacity: with lives on the line, concerns over AI models’ often-inscrutable reasoning – and as a result, possible biases embedded in those models Read more…

Europe’s LUMI Supercomputer Has Officially Been Accepted

February 1, 2023

“LUMI is officially here!” proclaimed the headline of a blog post written by Pekka Manninen, director of science and technology for CSC, Finland’s state-owned IT center. The EuroHPC-organized supercomputer’s most Read more…

AWS Solution Channel

Shutterstock 2069893598

Cost-effective and accurate genomics analysis with Sentieon on AWS

This blog post was contributed by Don Freed, Senior Bioinformatics Scientist, and Brendan Gallagher, Head of Business Development at Sentieon; and Olivia Choudhury, PhD, Senior Partner Solutions Architect, Sujaya Srinivasan, Genomics Solutions Architect, and Aniket Deshpande, Senior Specialist, HPC HCLS at AWS. Read more…

Microsoft/NVIDIA Solution Channel

Shutterstock 1453953692

Microsoft and NVIDIA Experts Talk AI Infrastructure

As AI emerges as a crucial tool in so many sectors, it’s clear that the need for optimized AI infrastructure is growing. Going beyond just GPU-based clusters, cloud infrastructure that provides low-latency, high-bandwidth interconnects and high-performance storage can help organizations handle AI workloads more efficiently and produce faster results. Read more…

Intel’s Gaudi3 AI Chip Survives Axe, Successor May Combine with GPUs

February 1, 2023

Intel's paring projects and products amid financial struggles, but AI products are taking on a major role as the company tweaks its chip roadmap to account for more computing specifically targeted at artificial intellige Read more…

Quantum Computing Firm Rigetti Faces Delisting

February 3, 2023

Quantum computing companies are seeing their market caps crumble as investors patiently await out the winner-take-all approach to technology development. Quantum computing firms such as Rigetti Computing, IonQ and D-Wave went public through mergers with blank-check companies in the last two years, with valuations at the time of well over $1 billion. Now the market capitalization of these companies are less than half... Read more…

US and India Strengthen HPC, Quantum Ties Amid Tech Tension with China

February 2, 2023

Last May, the United States and India announced the “Initiative on Critical and Emerging Technology” (iCET), aimed at expanding the countries’ partnership Read more…

Intel’s Gaudi3 AI Chip Survives Axe, Successor May Combine with GPUs

February 1, 2023

Intel's paring projects and products amid financial struggles, but AI products are taking on a major role as the company tweaks its chip roadmap to account for Read more…

Roadmap for Building a US National AI Research Resource Released

January 31, 2023

Last week the National AI Research Resource (NAIRR) Task Force released its final report and roadmap for building a national AI infrastructure to include comput Read more…

PFAS Regulations, 3M Exit to Impact Two-Phase Cooling in HPC

January 27, 2023

Per- and polyfluoroalkyl substances (PFAS), known as “forever chemicals,” pose a number of health risks to humans, with more suspected but not yet confirmed Read more…

Multiverse, Pasqal, and Crédit Agricole Tout Progress Using Quantum Computing in FS

January 26, 2023

Europe-based quantum computing pioneers Multiverse Computing and Pasqal, and global bank Crédit Agricole CIB today announced successful conclusion of a 1.5-yea Read more…

Critics Don’t Want Politicians Deciding the Future of Semiconductors

January 26, 2023

The future of the semiconductor industry was partially being decided last week by a mix of politicians, policy hawks and chip industry executives jockeying for Read more…

Riken Plans ‘Virtual Fugaku’ on AWS

January 26, 2023

The development of a national flagship supercomputer aimed at exascale computing continues to be a heated competition, especially in the United States, the Euro Read more…

Leading Solution Providers

Contributors

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