Multi-threading with OpenMP


I want to parallelize my app that is dealing with many shapes at once (Ubuntu 20, OCC7.4). For example, I want to use separate instances of the BOPAlgo_Builder within an omp parallel for loop (Builders don't share variables). Unfortunately, I encounter a massive overhead for the builder.Perform() function, that is taking at least three times longer than in a serial perform. E.g. the code below takes 18s instead of 4s in serial. Compiler options are already optimized. Is there a reason, it takes so long?

#pragma omp parallel default(none) num_threads(1)
        BOPAlgo_Builder L;
        ... create quiet some boxes