I am trying to fit a series of vectors with a function utilizing multithreading. Based on previous discussions I have dug up I am using the ROOT::Fit:Fitter methodology to directly fit a vector rather than transforming it into a TH1 and useing the TH1::Fit as I understand that not to be threadsafe. However, I seem to be running into non-threadsafe behavior. Namely if I set the tthreadexecutor to use only one thread the code runs without issue however if I allow it to use two or more threads it seg faults with a common error message of:
“FitConfiguration and Minimizer result are not consistent
Number of free parameters from FitConfig = 5
Number of free parameters from Minimizer = 3”
though other error messages arise at other times.
This is my first venture into multithreaded operations within root and I am clearly doing something wrong, I suspect within the memory management), any recommendations would be greatly appreciated! I have converted my code to run over a locally generated list of vectors (normally I use a ttree input to read the vectors from) so that it may be portable for others to run if they are interested.
test_portable.C (3.3 KB)
Thank you very much!
_ROOT Version: 6
_Platform: ubuntu