Hi,
I am having problems trying to parallelize a for loop and hoping to get some help. The code is as follow:
int main()
{
// some parameters declaration
ROOT::EnableThreadSafety();
int nthreads = 1;
ROOT::EnableImplicitMT(nthreads);
#pragma omp parallel for
for (uint64_t entry = 0; entry < nentries; entry++)
{
int event_status = processedEvent.findNextEvent(entry);
if (event_status == 0)
// do some stuff
}
}
where the findNextEvent() function belongs in another class and looks like this
int findNextEvent(uint64_t entry)
{
mytree->GetEntry(entry);
// check some variables associated with this event and return 0 or 1
}
With this current setup, I’m getting the following messages:
*** Break *** segmentation violation
*** Break *** segmentation violation
Error in <TTreeCache::FillBuffer>: Inconsistency: fCurrentClusterStart=2568916 fEntryCurrent=2568916 fNextClusterStart=2935904 but fEntryCurrent should not be in between the two
*** Break *** segmentation violation
*** Break *** segmentation violation
*** Break *** segmentation violation
*** Break *** segmentation violation
*** Break *** segmentation violation
*** Break *** segmentation violation
*** Break *** segmentation violation
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib][/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
At this point, I am confident that the main cause of this issue is the GetEntry() function as everything else is thread-safe.