I have a bunch of minimizations to do, so my plan was to start up some pthreads and let them do the minimizations… Everything works with one thread.
Unfortunately, I am getting a Segmentation violation for more then one thread somewhere in minimizer->Minimize().
The threads share the data, but each of them works only on a small subset.
Is there something wrong with my approach? Is it possible to use the ROOT’s minimizer (Minuit) like this?
NOTE: I discovered that to create a minimizer (ROOT::Math::CreateMinimizer) the call has to be mutexed.
Hi,
which minimizer are you using ? TMinuit is not thread safe and it will not work. You should try using Minuit2. If you have separate minimizer instance for each thread, you should also have separate function objects.
I have been using Minuit2 with multiple threads (using OpenMP) where each thread computes a different function derivative.