Skip to content

A Leap of Faith

← Back to blog | ADMIN | 27-08-2012

I’ve written a lot about the various approaches to multiprocessing and the potential benefits. What I haven’t talked much about are the risks and commitment.

Hexagon pattern 1

In earlier posts I’ve written a lot about the various approaches to multiprocessing and the potential benefits. What I haven’t talked much about is the risk and commitment one must accept when embracing these technologies. The efforts go well beyond the initial investigation and implementation phases, to ongoing testing and maintenance. It is a continual obligation to assure correctness throughout the life-cycle of a multithreaded product.

What is the risk?  In a nutshell I would say non-deterministic behavior, which can exhibit itself either subtly - as a slightly different result from an operation - or drastically as in an application crash - to just about anything in between. Whether caused by operations being performed in different order or by obscure race-conditions, this behavior is unacceptable.

There is little more frustrating than trying to reproduce a critical customer issue that occurs randomly and only when multithreading is enabled. This is also a double whammy in that it not only takes a lot of effort to report such issues, but also to diagnose and correct them. Fortunately there are ways to significantly reduce the potential for these sorts of issues with a modicum of commitment.

What is the commitment? It is a gradual increase in checks and balances that ultimately lead to a high level of confidence. This ranges from increased awareness and understanding in the development organization to a rigorous testing infrastructure. Investments made here will certainly pay off in the long run.

Spatial has accepted the risks associated with making ACIS thread-safe and has firmly committed to assuring correctness.  Although this was a difficult decision, with an ongoing burden, we knew it was necessary to allow our customers to take advantage of the multi-core revolution. We wanted to make sure that ACIS wasn’t the bottleneck.

To understand what it took for us to fully support our decision, consider the major areas we focused on:

Spreading the knowledge

In my experience, good developers are willing to tackle just about anything; from porting code to AIX, to writing unit tests, to authoring documentation. The same holds true for multiprocessing. Given the opportunity, I bet most developers would welcome the opportunity to learn about developing thread-safe code.  We took this a step further and put a group of developers in a room and let them learn how to add multiprocessing to ACIS functionality. The result of this exercise is our multithreaded entity-point-distance functionality, which scales near linearly to the number of available processors.

Developing test suites

A good test is worth a thousand … somethings? The truth is that we rely on our tests, so it behooves us to invest in good ones. We’ve not only developed a fair number of tests to make sure things work correctly, but also to make sure the results remain identical, with and without multithreading.

Employing dedicated hardware

Having machines with varying configurations is an important aspect of commercial testing environments. In the multiprocessing case, it is paramount. For example, dual core machines may never exhibit a problem that routinely occurs on 8 or 16 core machines.  Spatial has made investments in systems that contain anywhere from two to 48 cores. Additionally, most of our developers have at least eight cores in their primary systems.

Developing tools

Trust is a good thing, but apparently proof is better. Developing in-house tools to enforce coding guidelines is a common practice. For instance, we’ve developed a tool that routinely checks our code base for newly added global and static variables. After all, these are the root of the problem for thread-safety. The tool is another safety net to help us address issues efficiently.

Utilizing commercial tools

In my opinion, a commercial grade race detector is an absolute necessity when developing multithreaded code. I’ve been especially vocal about this to the folks at Microsoft. However, Intel beat them to the punch with their Parallel Studio toolset. Specifically, Parallel Inspector is worth its weight in platinum. I use it regularly and we are now in the process of integrating it into our automated testing system to help discover data races.

Our commitment to multiprocessing has involved cross-team projects to spread knowledge, purchasing dedicated multi-core hardware, developing specialized test suites, developing in-house tools to analyze code, and making commercial tools such as race-detectors and performance analyzers available to our development staff.  It may sound like a lot, but it has become a part of our DNA.

I think it’s fair to say that most rewards involve taking risks and making commitments. Improving your applications performance by factors that go well beyond what is possible with even the best serial code is well worth the investment.  What’s keeping you from taking the leap?

You might also like...

5 Min read
3D Modeling
What is digital manufacturing? Here’s a simple digital manufacturing definition: the process of using computer systems...
5 Min read
3D Modeling
Software components are like the stage crew at a big concert performance: the audience doesn’t see them, but their...
Application Lifecycle Management Flow
4 Min read
3D Modeling
When you hear the term, Application Lifecycle Management (ALM), you likely think about the process that a software...
8 Min read
3D Modeling
What is Computer Aided Manufacturing The CAM Market Who Uses CAM Software? Trends in CAM What do CAM Software...
9 Min read
3D Modeling
SLS in Additive Manufacturing is used to convert 3D CAD designs into physical parts, in a matter of hours.
8 Min read
3D Modeling
There’s a lot of confusion around what the terms additive manufacturing and 3D printing mean.
4 Min read
3D Modeling
Additive manufacturing, often referred to as 3D printing, is a computer-controlled process for creating 3D objects.
5 Min read
3D Modeling
Take a fresh, new sheet of paper, and fold it in half, like you’re making a paper airplane. Place the folded paper on...
6 Min read
3D Modeling
Table of Contents Simulation in CAD Who Uses Simulation Modeling? Key Benefits of Simulation Modeling Challenges in...
8 Min read
3D Modeling
What do you do? What Exactly is FEM? What You Need to Know About Choosing a FEM Modeler FEM and Partial Differential...
5 Min read
3D Modeling
Computational Fluid Dynamics (CFD) is a type of analysis that provides insight into solving complex problems, and...
2 Min read
3D Modeling
WRL files are an extension of the Virtual Reality Modeling Language (VRML) format . VRML file types enable browser...
Voxel model example
3 Min read
3D Modeling
Voxels are to 3D what pixels are to 2D. Firstly -- let’s examine what pixels actually are. Everything you see on your...
Point_cloud_torus
2 Min read
3D Modeling
Point-cloud modeling is typically used in the process of 3D scanning objects. Rather than defining surfaces through...
Polygonal Modeling
2 Min read
3D Modeling
Polygonal (or polyhedral) modeling is the most common type of modeling for video games and animation studios. This type...
aerodynamics-CFD
9 Min read
3D Modeling
Computational fluid dynamics (CFD) is a science that uses data structures to solve issues of fluid flow -- like...
BREP Model example
2 Min read
3D Modeling
BRep modeling, or Boundary Representation modeling, is, in CAD applications, the most common type of modeling. BRep is...
Feature Recognition Zoomed
5 Min read
3D Modeling
IN THIS ARTICLE: What is FEA (Finite Element Analysis) Principles of Finite Element Analysis and Simulation Software A...