I am writing C ++ software that requires fast calculations of the Minkowski sum . A dual-based implementation is sufficient.
I appreciated some geometric libraries such as
but in the end I used another third-party library that works very fast compared to the previous ones and uses the FIST library for triangulation.
My code works more or less as follows:
- I read my polygons
- I calculate the Minkowski sums I need
- For n times
- I decide which polygons to use in the following calculations.
- I do some things based on Minkowski sums
- I evaluate the result
- I take the result with the best value as the end result
Since the calculations inside the loop are independent from loop to loop, I parallelized the loop and everything worked fine.
Then I decided to move the calculation of the Minkowski sum in each parallel round:
- I read my polygons
- For number_of_threads (= n) times
- I decide which polygons to use in the following calculations.
- I calculate the Minkowski sums I need in this round
- I do some things based on Minkowski sums
- I evaluate the result
- I take the result with the best value as the end result
but the third-party library no longer worked.
I get number_of_threads - 1 error message saying
Approval failed.
The files that cause the assertion error vary from run to run and from thread to thread, but they are all files with the same name as the FIST headers (although I have the source code of a third-party library, I only have a. Lib and FIST library headers)
As indicated earlier, I tried to calculate all the Minkowski sums I needed outside the parallelized code and use the results obtained in it. That was good. So I'm pretty sure the problems come from FIST.
I have two questions:
Do you know if the FIST library is thread - oriented ?
If not, could you please offer me a thread-safe (C or better) C ++ triangulation library to replace FIST (possibly with comparable characteristics)?
edit:
Actually, I don’t know if the “thread safe” is exactly what I want: I only need a trimming library that can calculate many independent triangulations at the same time.
I think that if there were no global variables in the library and if it had a class without static variables
class triangulation {
that may be enough. Therefore, I could use different instances of this class and run their method in parallel.
source share