Multi-Processing Support   

<<< Writing Parasolid Applications Chapters Index >>>

Contents

[back to top]


17.1 Support for multi-processing in Parasolid

Parasolid provides several separate mechanisms to help applications benefit from multiple processors on the host machine.

[back to top]


17.2 Symmetric multi-processing in Parasolid

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.

[back to top]

17.2.1 Expectations from Parasolid SMP

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.

[back to top]

17.2.2 Thread locking

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.

[back to top]

17.2.3 Functional areas that are SMP-enabled

The following table shows the main functional areas and/or functions that can benefit from Parasolid SMP being enabled.

 

Functional area

Notes

Validity checking

Implemented at the face level.

Boolean operations

Implemented for face-face clashing portion of algorithm.

Wireframe rendering

Implemented at the body occurrence level.

Hidden line rendering

Implemented at the body level during initial processing and at an intersection level during line/line intersection.

Closest approach

Multiple points must be supplied.

Faceting

Implemented at the body level.

Mass properties

 

Spline creation

 

Isocline generation

 

[back to top]


17.3 Calling Parasolid from multiple threads

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.

[back to top]


17.4 Locking partitions to threads

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.

[back to top]

<<< Writing Parasolid Applications Chapters Index >>>