openMP with ROOT

Hi Rooter,

I was trying to use openMP (to make for loop parallel execution) with root (compiled with g++ -fopenmp), but crashed when code was trying to draw the histogram from TChain:

chain->Draw("Px", cut);

The error is:

 *** Break *** segmentation violation
Error: Function P010_TTreePlayer() is not defined in current scope  :0:
*** Interpreter error recovered ***
Error: Function P010_TWebFile() is not defined in current scope  :0:
*** Interpreter error recovered ***
*** glibc detected *** ./plot.exe: free(): invalid next size (fast): 0xb382e8a0 ***
Error: Undeclared variable P020_TRFIOFile :0:
Error: Function P020_TRFIOFile() is not defined in current scope  :0:
*** Interpreter error recovered ***
*** Interpreter error recovered ***
Error in <TPluginManager::FindHandler>: Cannot find plugin handler for TVirtualStreamerInfo! Does $ROOTSYS/etc/plugins/TVirtualStreamerInfo exist?

Can openMP be used with Root?

Thanks.

[quote]Can openMP be used with Root?[/quote]Possibly but you will either need to add your own locking mechanism around the ‘shared/global’ part of ROOT or enable the thread safety mechanism in ROOT by creating at least one TThread object.

Cheers,
Philippe.

Sorry for late reply. Ok, I will try.

Thanks.

After applying the above mentioned changes, were you able to use Open MP?