![]() |
Multi-Processing Support |
<<< Writing Parasolid Applications | Chapters | Index >>> |
Parasolid provides several separate mechanisms to help applications benefit from multiple processors on the host machine.
Parasolid provides multi-processor support via its Symmetric Multi-Processing (SMP) mechanism.SMP allows key algorithms beneath the Parasolid API to make use of multiple processors if they are present on a host machine.
A number of functional areas within Parasolid have been adapted for SMP, making it possible to reduce the execution time of certain operations, thereby improving the performance of Parasolid when running on multi-processor systems. For example, if your application needs to calculate the mass of a model. Parasolid will perform this calculation face-by-face and if it uses SMP then calculations on the different faces may be calculated on different processors.
For a list of areas that are SMP-enabled, see Section 17.2.3, “Functional areas that are SMP-enabled”.
Parasolid SMP is enabled on the most widely used Parasolid platforms - Windows, Linux and MacOS.
Currently, Parasolid can create a maximum of 8 threads for SMP work.
The SMP mechanism facilitates a shorter execution time for key Parasolid algorithms. Significant improvements in execution time can be achieved, though since the improvement depends on the nature of the operations being performed, it is not possible to quote a figure for the general performance improvement achieved by using SMP.
SMP is implemented beneath the API level, typically in low-level internal algorithms. These algorithms typically only form part of the code path called by a given API function and may be invoked to different degrees depending on the nature of the received arguments passed by the application to the function. The reduction in execution time is affected accordingly. For these reasons, you should not expect an automatic 50% speed up at the function level when enabling SMP on a two processor machine.
Similarly, due to the nature of SMP, the scaling of performance with an increased number of processors is not expected to be linear. For example, if you see a 20% performance improvement for a particular function call on a 2 processor machine, this does not automatically mean that you would see a 40% performance improvement on a 4 processor machine.
The overhead of thread locking can mean that isolated function calls on some platforms will actually run slightly slower with SMP enabled than with SMP disabled. We strive to minimise this in our implementation and work in collaboration with hardware vendors to do the same. If you do find functions that run excessively slowly, the Parasolid team is happy to investigate these on a case by case basis.
The following table shows the main functional areas and/or functions that can benefit from Parasolid SMP being enabled.
Implemented at the body level during initial processing and at an intersection level during line/line intersection. |
|
Parasolid is thread-safe, in that it can be called simultaneously from multiple threads within an application safely. Threads that an application sends into Parasolid are called application threads. They are not the same thing as the internal worker threads that are created by Parasolid SMP. If Parasolid SMP is enabled, calling an SMP-enabled function in an application thread causes Parasolid to create and use worker threads.
The Parasolid APIs manage multiple application threads to ensure safety. Parasolid functions can behave as one or more of the following types:
Parasolid can be called from multiple application threads on all available platforms.
Enabling internal algorithms to benefit from SMP or allowing Parasolid APIs to be called concurrently is not a substitute for general performance optimisation of our algorithms. Our philosophy is to ensure that all algorithms, are written in a performance optimal manner with minimum redundancy
This is an area of active development; Parasolid support for multiprocessors is continually evolving to meet the exacting requirements of a sophisticated and diverse customer-base.
When calling Parasolid from multiple threads, it is possible to lock one or more partitions to a given thread. With this mechanism, the thread can only operate on the data in the partition(s) that it controls and no other thread can operate on the data in the locked partitions. The advantage of this is that it allows an application to execute exclusive API calls in parallel so long as each one is called on data from locked partitions.
<<< Writing Parasolid Applications | Chapters | Index >>> |