PyRoot hangs on TFile.Close() method again

Hi,

I seem to be having a problem that I used to have before but the offered solution no longer works. These are the details: Pyroot hangs on TFile.Close() method

I’m using this (CMSSW) release of root: https://github.com/cms-sw/root/tree/cms/v6-12-00-patches/3f31cef

I should also add that the number of histograms in the files are in the order of ten thousands.

Perhaps there were some recent changes that could have caused this issue?


ROOT Version: 6.12/07
Platform: SLC 7
Compiler: gcc700


The code that i’m experiencing the issue with:

Would have added it in the main message but I can only add two links.

It could be that you also need:

ROOT.gROOT.GetListOfFiles().Remove(result_file)

Cheers,
Philippe.

Hi Philippe,

That’s exactly what I tried but it still takes significantly longer to close the files. This problem used to occur only on files opened for reading and the workaround still works perfectly for that. But now I only experience this issue with files open for writing, and the workaround doesn’t work anymore. It still takes huge amount of time to close the files.
This is the updated code that I’m using:

Hi Andrius,

I see the problem. The pr_file is Closed while the other two files (and their many histograms) are still (indirectly) on the list of cleanups.

To solve the problem, just move the GetListOfFiles().Remove right after the TFile creations.

Cheers,
Philippe.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.