TBB and Parallel Processing

Hi,

I want to activate OCC's multi-threading in my non-parallel C++ code. I built OCC using cmake in Linux and set USE_TBB and INSTALL_TBB as ON in ccmake.

Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/share/doc/opencascade/LICENSE_LGPL_21.txt
-- Up-to-date: /usr/local/share/doc/opencascade/OCCT_LGPL_EXCEPTION.txt
-- Installing: /usr/local/lib/tbb.2
-- Installing: /usr/local/lib/tbbmalloc.2
[...]

Unfortunately, only one processor is running with the following implementation, populated with multiple thousand TopoDS_Faces:

BOPAlgo_Builder builder;
[...]
builder.SetRunParallel(true);
builder.Perform();

Did I miss some setting, I have to make? Can I check the correct installation of TBB? Do I need to specify something, when compiling the code (I already include -ltbb)?

Thanks for your help

Kind regards

Kirill Gavrilov's picture

Just to clarify one point - you do not need TBB to activate multi-threading, there is a built-in alternative thread-pool which is used by default in OCCT algorithms with a few exceptions.
Builtding with TBB just switches algorithms to use another thread-pool implementation

By the way, what is an overall duration of the algorithm on tested input data?
And how the data looks alike (which Boolean operation on which operands)?

E W's picture

Hi,

it's an operation of multiple thousand planar simple TopoDS_Faces, that I added into the above mentioned builder object. Each face intersects some other faces, they are not intersecting in a tiny bbox.

builder.AddArgument(face)

It's running on one core only, for an undefined amount of time (I cancelled), but at least multiple hours.

According to the documentation, it would be a General Fuse for the following operations

  • Vertex/Vertex,
  • Vertex/Edge,
  • Edge/Edge,
  • Vertex/Face,
  • Edge/Face,
  • Face/Face,

Is there a way to enable parallelism? Is there a workaround regarding that it's face only?

Best