Page 1 of 1

CCLib goes parallel

Posted: Wed Feb 02, 2011 11:06 pm
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

Re: CCLib goes parallel

Posted: Thu Sep 10, 2020 1:25 pm
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(...)

Re: CCLib goes parallel

Posted: Sat Sep 12, 2020 9:24 pm
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.