Multi-threaded General Fuse/Partition

Hello! I'm trying to perform a general fuse operation involving thousands of shapes. I did this through Salome, whose latest version uses OCCT 7.5.x but I got the wrong result so I decided to compile the latest OCCT, 7.8.x and try via C++, using something like

BOPAlgo_Builder aBuilder;

for (...)
{
    aBuilder.AddArgument(shape[i]);
}
aBuilder.Perform();

What I noticed is that, when performing the operation in Salome, where it is called a "Partitio", it is threaded and therefore runs much faster than in my simple C++ test which only uses one thread.

I compiled OCCT without TBB but, according to this forum post https://dev.opencascade.org/node/81502#comment-21537 , it shouldn't matter.

Do I have to enable multithreading in any ways? How can I get the general fuse to run multithreaded?

Thanks for any help!

Massimiliano

Dmitrii Pasukhin's picture

Hello, please take a look into parent's methods: SetParallelMode() and SetRunParallel().

TBB has the same functionality with threads. As for me I recommend to use threads (especially with jemalloc memory manager)

Best regards, Dmitrii.

Dmitrii Pasukhin's picture

If it will not helps, I will share a code to tests that your OCCT env support multi threading.

Massimiliano Leoni's picture

Thank you very much Dmitrii, that fixed it and my code is now running in parallel as I was expecting. Such an easy fix!

All the best :)
Massimiliano