Intel Threads Its Way to Parallel Programming

By Michael Feldman

September 1, 2006

As computer systems with multiple CPUs become spread across the IT landscape, programmers will need a new set of development tools to take advantage of this new hardware model. This week, Intel announced a new high-level threading library aimed at software developers who are looking to exploit the parallelism of multi-core and multi-processor SMP systems. The new product, called Threading Building Blocks (TBB), extends C++ to provide thread-level parallelism for shared memory platforms based on x86 and Itanium processors. Intel also announced upgraded versions of its Thread Checker and Thread Profiler products, which will work in conjunction the new TBB product.

Intel's threading software products are part of the company's overall strategy to keep software applications in sync with the multi-core processors that are becoming mainstream in the marketplace. The chipmaker is highly motivated to make it easier for software developers to program those new chips since Intel is predicting that nearly all of the microprocessors it ships will be multi-core by the end of 2007. It's worth noting that AMD processors will get a free ride with TBB, since the x86 targeted code will work transparently with AMD's x86 offerings.

According to James Reinders, Intel marketing director for the company's Developer Products Division, his group has a fair amount of experience with multi-core and multi-processor software development, at both the very high end in high performance computing — with some of their tools for MPI — and in the workstation and server environments.

“That experience gives us an understanding of the challenges that the industry and we face when you look at the problem of exploiting parallelism,” says Reinders. “I have no doubt that this transformation is going to happen. In fact, I'm very confident that ten years from now, virtually every programmer is going to say that they understand and think about parallelism.”

But Reinders also understands there are very significant challenges that need to be understood. One of them is scalability: Can you get an 8X performance increase when you go from two threads to sixteen? Another has to do with a new set of problems that threading introduces, specifically, deadlocks and race conditions.

“The third big challenge is ease of programming,” says Reinders. “Right now, some of the ways of introducing threading add a lot of complexity to a program. And we don't believe that's necessary. But it's just a fact of life when you're dealing with programming languages that haven't been extended or that don't comprehend parallelism.”

C++ is one such language. TBB extends C++ via a run-time library that uses the language's template feature to abstract parallel programming constructs. The run-time library invokes the low-level thread and mutex capabilities of the target operating system to provide high-level thread management. This allows C++ developers to perform parallel programming without having to be concerned with native thread management or the maintenance of critical regions. The thread library API is portable across Linux, Windows, or Mac OS platforms (although, in version 1.0, support for 64-bit x86 is missing for Mac OS and Itanium is only supported on Linux). The TBB run-time library is royalty free, so with a single unit price of $299, ISVs can ship as many applications as they want without having to give Intel a piece of the action.

Using TBB to implement parallelism results in a much smaller amount of source code as compared to a native thread implementation. In the latter case, the application-specific algorithms can get lost in all the code devoted to thread management and breaking up the problem.

“At the end of the day, you may have over three quarters of your code devoted to managing threads,” observes Reinders. “That's overwhelming. I do not believe we will succeed if we tell people that they need to write all this [code] to take advantage of threading.”

The template library supplies a broad set of generic parallel algorithms — simple ones, like fors and reduces, and more complex ones, like whiles and pipelines. The library also provides an abstraction for thread-safe containers — data structures (e.g., hash maps, vectors and queues) that are protected from mutual access by multiple threads. This frees the developer from having to explicitly create them and then enforce their protection with mutexes. Interfaces to low-level features like atomic operations, scalable memory allocation, locks and mutexes are also supplied in the library.

“We're really able to do some incredibly sophisticated things under the hood,” says Reinders. “And if you really want to get a scalable threaded application, you need to do these things. But I would not want to try to educate everyone how to write these; or even if I educated them, I wouldn't want to suggest that everyone should spend their time writing wonderful core threading capabilities like task queuing and stack management.”

While the superiority of TBB as compared to programming with low-level Windows or Linux (POSIX) threads is fairly obvious, its advantages over OpenMP, an open standard that supports shared-memory parallelism, are more subtle. Both TBB and OpenMP provide high-level parallel programming constructs, but the latter does so via language pragmas and environment variables. Therefore OpenMP requires special compiler support. Microsoft has added support for OpenMP within the last year, but as of today, GCC still has still not implemented it in its compilers — although the GNU community is reportedly working on it.

In contrast, the language-based approach of the TBB template library avoids the problem of third-party compiler support. That means developers can theoretically use the product with anyone's standard C++ implementation, although it has mainly been tested with the Microsoft and GNU compilers.

And there's an additional advantage to the template library model. For a variety of reasons, users often cling to older versions of compilers, upgrading only sporadically. Since TBB uses only standard C++, it can be used regardless of compiler version.

“The beauty of using templates is that they will work with all C++ compilers,” says Reinders. “We're not adding a language feature that requires you to add a specific compiler. This is much easier to slip in.”

And unlike standard OpenMP, TBB provides a generalized abstraction for task parallelism (task queueing). Intel has incorporated task queueing into the OpenMP implementation for its compilers, but this is not yet supported in the standard. With Intel's encouragement, this feature is being considered for OpenMP 3.0 (see the related article in this issue, “The Future of User-Directed SMP Parallel Programming“).

According to Reinders, Threading Building Blocks was created to help fill in some of these weaknesses in other parallel programming models. But he doesn't envision it replacing OpenMP or even native threading programming. In fact, TBB was designed to work easily in a mixed threading model.

“We've seen some applications that use OpenMP and native threading in different parts of the application,” says Reinders. “That's been something we've been careful to support. Based on that experience, we've made Threading Building Blocks so that it can coexist with these other models. To have that flexibility seems really important.”

The encapsulation of all this functionality into a library offers another advantage. As processors get more cores and add enhanced hardware threading capabilities, the thread library can be retuned and optimized for the more advanced hardware. Reinders says the TBB software is designed to evolve with the hardware innovation that will occur, while providing the same level of abstraction and supporting the ability to work on older processors.

One might infer that this level of abstraction is going to exact a performance penalty. According to Reinders, this is not the case. In the example of a 2D ray tracing implementation he showed me, the high-level TBB code outperformed the native threading version, while scaling from two through eight processors. Also, it's worth noting that the TBB code maintained linear scalability through this range; the native implementation did not. Reinders surmises that the lower performing native implementation example is the result of an inefficient task queue algorithm, although optimizing it would probably increase the size and complexity of the code even more.

According to Reinders, the initial implementation of TBB will be practical for no more than 16 to 32 threads. He believes that could be extended today with additional software refinements, but hardware innovations will probably be needed to scale it beyond 128 threads.

“We think Threading Building Blocks is the right abstraction to move people into this space,” says Reinders. “The proof will be a few years as we refine Threading Building Blocks and come out with new versions.”

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!

Supercomputer Modeling Shows How COVID-19 Spreads Through Populations

May 30, 2020

As many states begin to loosen the lockdowns and stay-at-home orders that have forced most Americans inside for the past two months, researchers are poring over the data, looking for signs of the dreaded second peak of t Read more…

By Oliver Peckham

SODALITE: Towards Automated Optimization of HPC Application Deployment

May 29, 2020

Developing and deploying applications across heterogeneous infrastructures like HPC or Cloud with diverse hardware is a complex problem. Enabling developers to describe the application deployment and optimising runtime p Read more…

By the SODALITE Team

What’s New in HPC Research: Astronomy, Weather, Security & More

May 29, 2020

In this bimonthly feature, HPCwire highlights newly published research in the high-performance computing community and related domains. From parallel programming to exascale to quantum computing, the details are here. Read more…

By Oliver Peckham

DARPA Looks to Automate Secure Silicon Designs

May 28, 2020

The U.S. military is ramping up efforts to secure semiconductors and its electronics supply chain by embedding defenses during the chip design phase. The automation effort also addresses the high cost and complexity of s Read more…

By George Leopold

COVID-19 HPC Consortium Expands to Europe, Reports on Research Projects

May 28, 2020

The COVID-19 HPC Consortium, a public-private effort delivering free access to HPC processing for scientists pursuing coronavirus research – some utilizing AI-based techniques – has expanded to more than 56 research Read more…

By Doug Black

AWS Solution Channel

Computational Fluid Dynamics on AWS

Over the past 30 years Computational Fluid Dynamics (CFD) has grown to become a key part of many engineering design processes. From aircraft design to modelling the blood flow in our bodies, the ability to understand the behaviour of fluids has enabled countless innovations and improved the time to market for many products. Read more…

What’s New in Computing vs. COVID-19: IceCube, TACC, Watson & More

May 28, 2020

Supercomputing, big data and artificial intelligence are crucial tools in the fight against the coronavirus pandemic. Around the world, researchers, corporations and governments are urgently devoting their computing reso Read more…

By Oliver Peckham

COVID-19 HPC Consortium Expands to Europe, Reports on Research Projects

May 28, 2020

The COVID-19 HPC Consortium, a public-private effort delivering free access to HPC processing for scientists pursuing coronavirus research – some utilizing AI Read more…

By Doug Black

$100B Plan Submitted for Massive Remake and Expansion of NSF

May 27, 2020

Legislation to reshape, expand - and rename - the National Science Foundation has been submitted in both the U.S. House and Senate. The proposal, which seems to Read more…

By John Russell

IBM Boosts Deep Learning Accuracy on Memristive Chips

May 27, 2020

IBM researchers have taken another step towards making in-memory computing based on phase change (PCM) memory devices a reality. Papers in Nature and Frontiers Read more…

By John Russell

Hats Over Hearts: Remembering Rich Brueckner

May 26, 2020

HPCwire and all of the Tabor Communications family are saddened by last week’s passing of Rich Brueckner. He was the ever-optimistic man in the Red Hat presiding over the InsideHPC media portfolio for the past decade and a constant presence at HPC’s most important events. Read more…

Nvidia Q1 Earnings Top Expectations, Datacenter Revenue Breaks $1B

May 22, 2020

Nvidia’s seemingly endless roll continued in the first quarter with the company announcing blockbuster earnings that exceeded Wall Street expectations. Nvidia Read more…

By Doug Black

Microsoft’s Massive AI Supercomputer on Azure: 285k CPU Cores, 10k GPUs

May 20, 2020

Microsoft has unveiled a supercomputing monster – among the world’s five most powerful, according to the company – aimed at what is known in scientific an Read more…

By Doug Black

HPC in Life Sciences 2020 Part 1: Rise of AMD, Data Management’s Wild West, More 

May 20, 2020

Given the disruption caused by the COVID-19 pandemic and the massive enlistment of major HPC resources to fight the pandemic, it is especially appropriate to re Read more…

By John Russell

AMD Epyc Rome Picked for New Nvidia DGX, but HGX Preserves Intel Option

May 19, 2020

AMD continues to make inroads into the datacenter with its second-generation Epyc "Rome" processor, which last week scored a win with Nvidia's announcement that Read more…

By Tiffany Trader

Supercomputer Modeling Tests How COVID-19 Spreads in Grocery Stores

April 8, 2020

In the COVID-19 era, many people are treating simple activities like getting gas or groceries with caution as they try to heed social distancing mandates and protect their own health. Still, significant uncertainty surrounds the relative risk of different activities, and conflicting information is prevalent. A team of Finnish researchers set out to address some of these uncertainties by... Read more…

By Oliver Peckham

[email protected] Turns Its Massive Crowdsourced Computer Network Against COVID-19

March 16, 2020

For gamers, fighting against a global crisis is usually pure fantasy – but now, it’s looking more like a reality. As supercomputers around the world spin up Read more…

By Oliver Peckham

[email protected] Rallies a Legion of Computers Against the Coronavirus

March 24, 2020

Last week, we highlighted [email protected], a massive, crowdsourced computer network that has turned its resources against the coronavirus pandemic sweeping the globe – but [email protected] isn’t the only game in town. The internet is buzzing with crowdsourced computing... Read more…

By Oliver Peckham

Global Supercomputing Is Mobilizing Against COVID-19

March 12, 2020

Tech has been taking some heavy losses from the coronavirus pandemic. Global supply chains have been disrupted, virtually every major tech conference taking place over the next few months has been canceled... Read more…

By Oliver Peckham

Supercomputer Simulations Reveal the Fate of the Neanderthals

May 25, 2020

For hundreds of thousands of years, neanderthals roamed the planet, eventually (almost 50,000 years ago) giving way to homo sapiens, which quickly became the do Read more…

By Oliver Peckham

DoE Expands on Role of COVID-19 Supercomputing Consortium

March 25, 2020

After announcing the launch of the COVID-19 High Performance Computing Consortium on Sunday, the Department of Energy yesterday provided more details on its sco Read more…

By John Russell

Steve Scott Lays Out HPE-Cray Blended Product Roadmap

March 11, 2020

Last week, the day before the El Capitan processor disclosures were made at HPE's new headquarters in San Jose, Steve Scott (CTO for HPC & AI at HPE, and former Cray CTO) was on-hand at the Rice Oil & Gas HPC conference in Houston. He was there to discuss the HPE-Cray transition and blended roadmap, as well as his favorite topic, Cray's eighth-gen networking technology, Slingshot. Read more…

By Tiffany Trader

Honeywell’s Big Bet on Trapped Ion Quantum Computing

April 7, 2020

Honeywell doesn’t spring to mind when thinking of quantum computing pioneers, but a decade ago the high-tech conglomerate better known for its control systems waded deliberately into the then calmer quantum computing (QC) waters. Fast forward to March when Honeywell announced plans to introduce an ion trap-based quantum computer whose ‘performance’ would... Read more…

By John Russell

Leading Solution Providers

SC 2019 Virtual Booth Video Tour

AMD
AMD
ASROCK RACK
ASROCK RACK
AWS
AWS
CEJN
CJEN
CRAY
CRAY
DDN
DDN
DELL EMC
DELL EMC
IBM
IBM
MELLANOX
MELLANOX
ONE STOP SYSTEMS
ONE STOP SYSTEMS
PANASAS
PANASAS
SIX NINES IT
SIX NINES IT
VERNE GLOBAL
VERNE GLOBAL
WEKAIO
WEKAIO

Contributors

Fujitsu A64FX Supercomputer to Be Deployed at Nagoya University This Summer

February 3, 2020

Japanese tech giant Fujitsu announced today that it will supply Nagoya University Information Technology Center with the first commercial supercomputer powered Read more…

By Tiffany Trader

Tech Conferences Are Being Canceled Due to Coronavirus

March 3, 2020

Several conferences scheduled to take place in the coming weeks, including Nvidia’s GPU Technology Conference (GTC) and the Strata Data + AI conference, have Read more…

By Alex Woodie

Exascale Watch: El Capitan Will Use AMD CPUs & GPUs to Reach 2 Exaflops

March 4, 2020

HPE and its collaborators reported today that El Capitan, the forthcoming exascale supercomputer to be sited at Lawrence Livermore National Laboratory and serve Read more…

By John Russell

Cray to Provide NOAA with Two AMD-Powered Supercomputers

February 24, 2020

The United States’ National Oceanic and Atmospheric Administration (NOAA) last week announced plans for a major refresh of its operational weather forecasting supercomputers, part of a 10-year, $505.2 million program, which will secure two HPE-Cray systems for NOAA’s National Weather Service to be fielded later this year and put into production in early 2022. Read more…

By Tiffany Trader

‘Billion Molecules Against COVID-19’ Challenge to Launch with Massive Supercomputing Support

April 22, 2020

Around the world, supercomputing centers have spun up and opened their doors for COVID-19 research in what may be the most unified supercomputing effort in hist Read more…

By Oliver Peckham

Summit Supercomputer is Already Making its Mark on Science

September 20, 2018

Summit, now the fastest supercomputer in the world, is quickly making its mark in science – five of the six finalists just announced for the prestigious 2018 Read more…

By John Russell

15 Slides on Programming Aurora and Exascale Systems

May 7, 2020

Sometime in 2021, Aurora, the first planned U.S. exascale system, is scheduled to be fired up at Argonne National Laboratory. Cray (now HPE) and Intel are the k Read more…

By John Russell

TACC Supercomputers Run Simulations Illuminating COVID-19, DNA Replication

March 19, 2020

As supercomputers around the world spin up to combat the coronavirus, the Texas Advanced Computing Center (TACC) is announcing results that may help to illumina Read more…

By Staff report

  • arrow
  • Click Here for More Headlines
  • arrow
Do NOT follow this link or you will be banned from the site!
Share This