Skip to content

Seven Years of Thread Safe 3D ACIS Modeler

← Back to blog | ADMIN | 27-04-2016

3D ACIS Modeler is thread safe, i.e, able to operate on disjoint data concurrently and correctly.

Hexagon pattern 1

We are moving things around in the office here at Spatial to accommodate some new people.  As a result, our marketing closet is being cleaned out.  I walked by and noticed t-shirts from the summer of 2009, when Spatial released R20 of the 3D ACIS Modeler.  Since that release, the 3D ACIS Modeler has been thread safe, i.e, able to operate on disjoint data concurrently and correctly. The t-shirt in question made some predictions about the future of processor evolution. Some predictions came true, some did not. So while the thread-safe 3D ACIS Modeler has delivered enhanced performance for our customers, the number of cores on consumer-grade computers has not grown as fast as predicted.

Thread-Safe ACIS Front T Shirt Thread-Safe ACIS Back T Shirt

Challenges with Multithreading


What has stunted the growth in the number of processor cores is software. If there are no applications which can make use of 64-core processors, there isn’t much incentive to design them.  Rather than selling more cores, we can have processors, which use less power, or have a larger cache. The other issue with folks selling bigger and badder PCs, is that the market is shrinking.  Most computers sold now are actually (in) phones, TVs, cars, watches, or even toasters. However, for engineering purposes PCs and workstations are still the most common way to go.
Let us discuss a few mathematical models for multithreading to unpack some of the limitations. 

  • Utopian scaling – all steps in the algorithm may occur in any order; time required is inversely proportional to the number of threads.
  • Amdahl’s-law scaling – there is some fixed amount of the algorithm which must be serialized.
  • Linear overhead – there is contention that grows with the number of threads used, so the time may initially get better, but eventually adding more threads slows things down.
  • Serial time (No threading) – the process takes the full time no matter how many threads you add.

Thread-Safe Time Vs Threads

 

Measuring success with a multithreaded algorithm is complex. One should not expect an application to run N-times faster just because N threads are being used. Like other abstraction mechanisms, threads have overhead.  If the overhead is large relative to the work being done, threading will not make the application run faster. It is even possible that an application with sufficiently large linear overhead with different coefficients could have a multithreaded version that always runs slower.


As an engineer, we strive to achieve optimal scaling (in time vs number of threads, time vs size of the problem, memory vs problem size, etc.). Using development time responsibly also requires us to take maintenance and development costs in to account.

Speedups with Thread-Safe 3D ACIS Modeler and Thread Hot APIs

Rather than spend years trying to achieve perfect multithreaded performance, Spatial has taken the incremental approach, achieving performance improvements while not ever compromising the underlying algorithms or integrity of the model. Over time gradual improvements compound, providing a better and faster modeler

Even though the scaling in number of threads is not currently ideal, the multithreaded and thread-safe features in 3D ACIS Modeler have been a significant success. Customers can write their own multithreaded workflows, provided some limitations are met. 3D ACIS Modeler must be initialized on each thread used. The ENTITYs modified must be on different history streams. By staying within these limitations, our customers have seen substantial speedups. There are also several APIs which can make use of multiple threads without requiring much special effort from the customer—just turn on the thread pool, and things get faster. Spatia'sl 3D InterOp has also taken advantage of the 3D ACIS Modeler entities on import concurrently.

There were several keys to this success. First, the 3D ACIS Modeler makes extensive use of thread-local storage allowing the context to be maintained within a thread without requiring locks/mutexes everywhere.  Second, the algorithms used in the 3D ACIS Modeler are battle tested.  The core 3D ACIS Modeler algorithms have been used by customers for more than 20 years.  Multithreading an algorithm that doesn’t work, or works prohibitively slowly, does not provide much benefit. Building on well proven algorithms delivers both speed and correctness.

For the initial implementations in the 3D ACIS Modeler, conservative refactorings were made. We preserved the behavior of the serial versions of algorithms as much as possible and accepting success if we got speedups through multithreading.  For example, using api_facet_entity with six threads on one BODY results in a 2× speedup with the results nearly indistinguishable from the serial algorithm. Concurrently faceting multiple bodies provides a 6 or 7× speedup when using many-core processors. To refactor api_stitch, a new algorithm was devised which is 10% faster (serially) than the original serial algorithm.

Rather than starting over from scratch, development on the 3D ACIS Modeler has taken a pragmatic approach by growing multithreading functionality incrementally. This approach avoids regressions in features, but sometimes it also means worse thread scaling. APIs in the 3D ACIS Modeler show speedups, but some show linear overhead scaling. We grow with our customers, with the 3D ACIS Modeler improving as the requirements placed on it grow. I still expect to see huge numbers of cores in engineering desktop computers solving ever larger geometry problems, but it has not happened as fast as we initially hoped.
 

 

eBook: 5 Essential Functions of 3D ACIS Modeler




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...