CCLib goes parallel

Any question about the database & algorithms library 'CCLib'
Post Reply
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

CCLib goes parallel

Post by daniel »

CCLib now depends on Qt (via the QtCore lib).

We have done this in order to integrate the 'QtConcurrent' framework for parallel octree-based computation. The 'executeFunctionForAllCellsAtLevel' and 'executeFunctionForAllCellsAtStartingLevel' methods of the DgmOctree structure have now their equivalent '_MT' (multi-threaded) versions: thanks to the QtConcurrent::map mechanism, octree-cell based computations are automatically dispatched on all available processor cores.

This results in almost linear division of computing time (X2 faster on dual-cores and X3.8 on quad-cores for our first tests). The only constraint is to make sure that the cellular function provided by the user is not doing concurrent reading/writing on the same memory block (while reading/writing different values of the same array is ok).

Note: this feature is automatically disabled in 'debug' mode for the moment (but one can simply force it with the ENABLE_MT_OCTREE macro at the begining of the "DgmOctree.h" file.

Daniel
Daniel, CloudCompare admin
seiband
Posts: 4
Joined: Tue Sep 08, 2020 8:27 am

Re: CCLib goes parallel

Post by seiband »

Are there any other macros that have to be enabled/disabled? I would really like this to also work in Debug mode (Release works well).
Enabling ENABLE_MT_OCTREE in the DgmOctree.h doesn't seem to have any impact for me when calling:
GeometricalAnalysisTools::ComputeCharactersitic(...)
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: CCLib goes parallel

Post by daniel »

I would have assumed that enabling this ENABLE_MT_OCTREE macro would be sufficient. But debug mode is so slow I'm not sure parallelism would help that much in terms of performances. Moreover it gets really hard to debug (with breakpoints, etc.) a parallel code.
Daniel, CloudCompare admin
Post Reply