Re:[ROOT]defragmenting a TFile after a job crash

From: Susan Kasahara (schubert@physics.umn.edu)
Date: Thu Oct 12 2000 - 19:39:57 MEST


Hi Matthew,
I don't know if this is the cause of what you observe in the increase of
your file size or not, but one thing that comes to mind is that the TTree
will dump baskets along the way if they become full to the file even before you
write the TTree out at the end of the run. (The baskets which are dumped
will not be written out again during the final TTree write, but instead
the TBranch headers maintain lists of where the basket dumps are stored
on file).  These basket dumps won't appear in your directory listing.
  A way to view the basket dumps as they are written is to set the
debug flag:
  gDebug = TTabCom::kDebug;
in the TTree producing program.  A statement is printed every time a new
basket is written to file.
Good luck,
Sue Kasahara

Matthew D. Langston wrote:

I have a job which opens a TFile in "UPDATE" mode and tries to write a new
TTree to it.  The job crashes before TFile::Write is called, so the TTree is
not written to the TFile (as evidenced by looking at the output from
TFile::ls).  However, although the TFile's contents appear to be the same
both before and after the job crashes, the TFile's size is much larger after
the job crash (the TFile size is increased by over a factor of 2).  So,
there is definitely something in the TFile that wasn't there before the job
crashed.

Is this normal behavior for a TTree/TFile after a job crash?  If so, is
there a way to "defragment" a TFile after a job crash to reduce the TFile
back to its original size?

Here is the contents of the TFile before AND after running the job that
crashes:

root [0] TFile f( "tests/testAnalysis.root", "READ" );
root [1] f.ls()
TFile**         tests/testAnalysis.root
 TFile*         tests/testAnalysis.root
  KEY: TDirectory       year_1993;1     Analyzed WAB for year 1993
  KEY: TDirectory       year_1994;1     Analyzed WAB for year 1994
  KEY: TDirectory       year_1995;1     Analyzed WAB for year 1995
  KEY: TDirectory       year_1996;1     Analyzed WAB for year 1996
  KEY: TDirectory       year_1997;1     Analyzed WAB for year 1997

Finally, here are the file sizes of the TFile both before and after the job
crashes:

$ ls -la
-rw-r--r--   1 langston langston 22831040 Oct  9 14:48
testAnalysis_before.root
-rw-r--r--   1 langston langston 49614833 Oct 10 11:53
testAnalysis_after.root

Thank you for any assistance you can provide.

Regards, Matt

--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET