19.10.2016

C3D Labs Works with Intel to Improve Its 3D Software

C3D Technologies Are Aligned for Multicore Architecture

Moscow, Russia: 19 October, 2016 – C3D Labs is pleased to announce that after a year of development its C3D kernel has received multi-threading capability. In particular, the upgraded C3D software has the ability to select multi-threaded mode when performing mathematical calculations. It provides optimal performance through extended use of the computational capabilities of Intel’s multicore processors.

C3D Labs and Intel began collaborating a year ago to analyze which parts of the C3D kernel’s code could be separated to run in parallel. Alexey Goryachih, a developer from Nizhny Novgorod, prepared a report, The History of Success of Using Intel Program Tools, which presented the results C3D Labs obtained in accelerating multicore processor calculations using OpenMP technology.

Following up from Mr Goryachih’s report, C3D Labs implemented multi-threaded mode in its C3D Toolkit modules in two areas:


Calculations of mapping solids being accelerating in multi-threaded mode
Calculations of mapping solids being accelerating in multi-threaded mode

C3D Labs presented the updated C3D Toolkit 2016 for engineering software developers at the recently-held Intel Software Conference 2016.

INFORMATION FOR DEVELOPERS

The new 2016 version of the C3D Toolkit switches multi-thread mode on and off just using Boolean flags (see table below), adjusting multi-threaded mode for an entire group of tasks.

And so the new MbeMultithreadedMode variable has been introduced for the following purposes:

Mode

Multi-threading Activity

mtm_Off

Deactivated

mtm_Base

Used by basic algorithms (activated in all other modes)

mtm_Converters

Used by converters

mtm_Sections

Used by section calculations

mtm_Items

Used to access to geometric objects

mtm_Solids

Used to access to solids (including mtm_Items)

mtm_Standard

Used by mtm_Base, mtm_Converters,mtm_Sections (compatible with C3D V16)

mtm_Max

Used by all processes

By default, the C3D kernel is set to mtm_Standard mode. Switching between mtm_Standard and mtm_Base modes corresponds to switching multi-threaded mode on and off in previous C3D kernel versions.

To switch between multi-threaded modes, the following methods are added:

Method

Description

Previous versions

bool Math::Multithreaded()

Checks that mtm_Standard mode is activated

Checks that multi-threaded is activated

void Math::SetMultithreaded(bool b)

If b is false, then multi-threaded mode is deactivated (mtm_Off).

If b is true, then the mtm_Standard mode is set

Sets multi-threaded mode according to b

MbeMultithreadedMode Math::MultithreadedMode()

Requests multi-threaded mode

bool Math::CheckMultithreadedMode(MbeMultithreadedMode mode)

Checks multi-threaded mode

void Math::SetMultithreadedMode(MbeMultithreadedMode mode)

Activates multi-threaded mode

USER MULTI-THREADING SUPPORT

Thanks to the code optimized in C3D Toolkit 2016, multi-threading is extended to working with geometric objects, such a curves and surfaces. In addition, thread-safe use is enabled for any constant methods, as well as methods accepting a constant parameter for all classes -- except topologic objects and classes containing similar objects (MbFaceShell, MbFace, MbOrientedEdge, MbCurveEdge, MbSolid...). For these categories, a separate function is available as thread-safe, such as ::GetVestiges (…) mapping.

To use internal multi-threading, set maximal multithreaded mode mtm_Max.

Here is an further example that shows the parameters that same objects may assume in different threads, using the example of ::GetVestiges (…) multithreaded mapping:

MATH_FUNC (void) GetVestiges ( const MbPlacement3D & place, 
                             double znear, 
                             const RPArray & lumps, 
                             const MbProjectionsObjects & objects, 
                             MbVEFVestiges & result
                             const MbMapVisibilityMode & visMode, 
                             VERSION version = Math::DefaultMathVersion(), 
                             bool merge = true );

In this case, the maximum multi-threaded mode ascertains that the transfer of the same objects through a constant link will be realized in different threads.

This means that is possible to provide thread-safe mapping for the same set of lumps in different directions:

  1. void BetaMultithreaded0()
  2. {
  3. <>
  4. < Collecting lump array >
  5. < Setting placements to define mapping direction, or places (in test application -- plan view, front view, left view, and isometry) >
  6. < Setting mapping parameters: perspective ‘znear’ and visuality ‘visMode’ >
  7.  
  8. /// Creating 4 trace arrays by the number of mapping directions, like in ::GetVestiges (...)
  9. ::GetVestiges (...)
  10. int count = (int)places.Count();
  11. PArray<MbVEFVestiges>vestigesArray(count,1);
  12. for( int m = 0; m < count; m++ )
  13. vestigesArray.Add( new MbVEFVestiges() );
  14.  
  15. /// Setting the maximal multithreading level
  16. MbeMultithreadedMode mode = Math::MultithreadedMode();
  17. Math::SetMultithreadedMode( mtm_Max );
  18.  
  19. /// Performing multithreaded mapping
  20. # pragma omp parallel for shared( znear, places, lumps, vestigesArray, visMode ) num_threads (count) if( Math::CheckMultithreadedMode(mtm_Max) )
  21. for( int m = 0; m < count; m++ )
  22. {
  23. MbProjectionsObjects prObjects;
  24. ::GetVestiges( places[m], znear, lumps, prObjects, *vestigesArray[m], visMode, Math::DefaultMathVersion() );
  25. }
  26.  
  27. /// Restoring multitheading level
  28. Math::SetMultithreadedMode( mode );
  29.  
  30. < Using obtained traces >
  31. }

Read more about our C3D Toolkit at //c3dlabs.com/en/products/c3d-kernel/

Request an Evaluation

About C3D Labs

C3D Labs specializes in the technology-intensive market of PLM components. The company develops and markets the C3D Toolkit used by developers of CAD systems and educational institutions worldwide. In 2013, C3D Labs became a resident of Skolkovo, Russia’s state development office park.

Computer-aided design systems are the most widely known software in which components, like C3D, are typically used. As a critical software development tool, C3D is today the only modeling kit that incorporates all four modules crucial to CAD -- 2D/3D modeling, 2D/3D constraint solving, 3D visualization, and 2D/3D file conversion.

About the Intel Software Conference 2016

Intel Software Conference 2016 is an annual event dedicated to innovative programming models and tools that implement them, all developed by Intel. The conference is designed for professional software developers, testers, architects, development team leaders, leading trainers, research professors, and IT experts and managers.

The conference agenda features reports by Intel experts and partners on achieving maximal application efficiency in the latest Intel architectures, including the newest Intel Xeon and Xeon Phi, as well as on the efficient use of Intel tools on high-performance Intel multicore and cluster systems.


Google+