Re: TTree::AutoSave

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Oct 29 1999 - 18:00:16 MEST


Hi Volker,

The TTree::AutoSave function saves the Tree header in memory including:
  - the branches/leaves data structure
  - the branch buffers in memory

Depending the number of branches in your tree and the branch buffer size
the space occupied by the Tree header may be non negligible. It must be
bigger than the size of one single event. It does not make sense to call
this function after each Fill. The intented use is to save at regular
intervals depending on;
  - how much data has been written so far on disk
  - how many cpu/rt seconds used since the last autosave
such that in case of a job crash, you loose only the buffers currently
in memory. After an Autosave, the information on disk is coherent.
If you read the Tree at this point, you will find the same number of
entries
in all the branches.
The interval between two Autosaves must be such that the overhead (space
& time)
is small compared to the overall job processing time and Tree size.
The default is to Autosave every time you have written 100 Mbytes in the
Tree.

Currently AutoSave does not delete the Tree headers on disk generated
by previous Autosave. If you have too many Autosave, you will get (what
you found) many Tree headers and the space can be much bigger than the
useful
data.
I could implement an automatic delete of the previous AutoSave once
the current Autosave has successfully completed.

Rene Brun


Volker B"orchers wrote:
> 
> Hi,
> 
> when I use TTree::AutoSave() after each Tree::fill() the resulting
> rootfile is many times larger than in the case when I only save once at
> the end of the run. For example the Program `Event' in the `test'
> directory writes a 14.7MB Event.root per default. If I add
> `tree->AutoSave();' after each event the file is 156MB.
> 
> It seems as if the "older versions" are not overwritten by subsequent
> AutoSaves. (There is also one additional tree in the rootfile for every
> save, as stated in the TTree description.)
> 
> I played with the maxvirtsize arg of TTree:TTree() also, but the resulting
> intermediate dumps didn't allow a key recovery.
> 
> How can I make the AutoSave procedure more effective? I don't want to
> loose to much data in case of a crash but i also don't want the program to
> crash because of a lack of disk space.
> 
> Thanks in advance
>  Volker
> 
> ------
> Volker B"orchers, Uni Bremen, NW1, Raum 03160, Tel. +49-421-218-4522
>  mailto:boercher@physik.uni-bremen.de
>  http://hix.physik.uni-bremen.de/~boercher



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:41 MET