TFile.AsynchPrefetching does not appear to be working


I am trying to experiment with the TFile.AsynchPrefetching inside of compiled C++ code.
I am not creating any files in the my Cache directory.

My code uses ROOT version -

ROOTBRANCH =‘branches/v5-34-00-patches’

As determined by variables ROOT_SVN_VERSION and


I am using TTreeCache and have a learning phase. The input files
are stored on xrootd storage.

Here is the code snippet I use to invoke the AsynchPrefetching.
// bit need for TFile.AsynchPrefetch
gEnv->SetValue(“TFile.AsynchPrefetching”, 1);
TString cachedir=“file:/ssd1/users/dbenjamin/test/cachedir/”;
// or using xrootd on port 2000
// TString cachedir=“root://localhost:2000//tmp/xrdcache1/”;
gEnv->SetValue(“Cache.Directory”, cachedir.Data());

std::cout << gEnv->WriteFile(“myenvironment.log”) << endl;

Here is the what my environment looks like -

Unix..Root.DynamicPath: .:/cvmfs/
.Root.DynamicPath: .;/cvmfs/;
Unix..Root.MacroPath: .:/cvmfs/
.Root.MacroPath: .;/cvmfs/;
Unix..Root.PluginPath: :/cvmfs/
.Root.PluginPath: ;/cvmfs/;
Unix..Root.UseTTFonts: true
..Root.TTFontPath: /cvmfs/
WinNT.UseNetAPI: true
.Root.UseThreads: false
Root.ZipMode: 1
Root.ShowPath: false
Root.TMemStat: 0
Root.TMemStat.buffersize: 100000
Root.TMemStat.maxcalls: 5000000
Root.MemStat: 0
Root.MemStat.size: -1
Root.MemStat.cnt: -1
Root.ObjectStat: 0
Root.MemCheck: 0
Root.MemCheckFile: memcheck.out
Root.Debug: 0
Root.ErrorHandlers: 1
Root.Stacktrace: yes
Root.ErrorIgnoreLevel: Print
X11.Sync: no
X11.FindBestVisual: yes
X11.UseXft: no
X11.XInitThread: yes
Win32.UseSysPointers: no
Unix..Editor: vi
.Editor: notepad
Root.Fitter: Minuit
Canvas.MoveOpaque: false
Canvas.ResizeOpaque: false
Canvas.UseScreenFactor: false
Canvas.HighLightColor: 2
Canvas.ShowEventStatus: false
Canvas.ShowToolTips: false
Canvas.ShowToolBar: false
Canvas.ShowEditor: false
Canvas.AutoExec: true
Canvas.PrintDirectory: .
Canvas.SavePrecision: 7
Canvas.Style: Modern
Hist.Binning.1D.x: 100
Hist.Binning.2D.x: 40
Hist.Binning.2D.y: 40
Hist.Binning.2D.Prof: 100
Hist.Binning.3D.x: 20
Hist.Binning.3D.y: 20
Hist.Binning.3D.z: 20
Hist.Binning.3D.Profx: 100
Hist.Binning.3D.Profy: 100
Hist.Stats.Entries: Entries
Hist.Stats.Mean: Mean
Hist.Stats.MeanX: Mean x
Hist.Stats.MeanY: Mean y
Hist.Stats.MeanZ: Mean z
Hist.Stats.RMS: RMS
Hist.Stats.RMSX: RMS x
Hist.Stats.RMSY: RMS y
Hist.Stats.RMSZ: RMS z
Hist.Stats.Underflow: Underflow
Hist.Stats.Overflow: Overflow
Hist.Stats.Integral: Integral
Hist.Stats.Skewness: Skewness
Hist.Stats.SkewnessX: Skewness x
Hist.Stats.SkewnessY: Skewness y
Hist.Stats.SkewnessZ: Skewness z
Hist.Stats.Kurtosis: Kurtosis
Hist.Stats.KurtosisX: Kurtosis x
Hist.Stats.KurtosisY: Kurtosis y
Hist.Stats.KurtosisZ: Kurtosis z
Root.Html.SourceDir: .
Gui.Backend: native
Gui.Factory: native
Gui.Style: Modern
Gui.DefaultFont: --helvetica-medium-r---12------iso8859-1
Gui.MenuFont: --helvetica-medium-r---12------iso8859-1
Gui.MenuHiFont: --helvetica-bold-r---12------iso8859-1
Gui.DocFixedFont: --courier-medium-r---12------iso8859-1
Gui.DocPropFont: --helvetica-medium-r---12------iso8859-1
Gui.IconFont: --helvetica-medium-r---10------iso8859-1
Gui.StatusFont: --helvetica-medium-r---10------iso8859-1
Gui.BackgroundColor: #e0e0e0
Gui.ForegroundColor: black
Gui.HighLightColor: #d0d0d0
Gui.SelectBackgroundColor: #86abd9
Gui.SelectForegroundColor: white
Gui.DocumentBackgroundColor: white
Gui.DocumentForegroundColor: black
Gui.TooltipBackgroundColor: LightYellow
Gui.TooltipForegroundColor: black
Gui.IconPath: /users/dbenjamin/icons:/cvmfs/
Gui.MimeTypeFile: /users/dbenjamin/.root.mimes
Browser.Name: TRootBrowser
Browser.Options: FCEI
Browser.IconStyle: small
Browser.SortBy: name
Browser.GroupView: 10000
Browser.ShowHidden: no
Browser.AutoThumbnail: yes
Rint.Load: rootalias.C
Rint.Logon: rootlogon.C
Rint.Logoff: rootlogoff.C
Rint.History: /users/dbenjamin/.root_hist
Rint.Includes: 1
ACLiC.Linkdef: _linkdef
Rootd.Authentication: 0
Proofd.Authentication: 0
Proofd.SendSRPPwd: 0
ProofServ.UseSSH: 0
UsrPwd.ReUse: yes
SRP.ReUse: no
Krb5.ReUse: no
Globus.ReUse: yes
SSH.ReUse: yes
UsrPwd.Crypt: yes
Globus.ProxyDuration: default
Globus.ProxyKeyBits: 1024
SSH.ErrorRetry: "Connection closed by remote host"
SSH.MaxRetry: 100
RSA.KeyType: 1
Url.Special: file: rfio: hpss: castor: gfal: dcache: /alien/- /castor/
XNet.ReadAheadSize: 0
XNet.ReadCacheSize: 10000000
XNet.ParStreamsPerPhyConn: 0
Rint.Canvas.HighLightColor: 5
TFile.AsynchPrefetching: 1
Cache.Directory: file:/ssd1/users/dbenjamin/test/cachedir/


Doug Benjamin

Hi Doug,

Can you confirm that there is actually a transfer going on? Can you also make sure that you enable the async prefetching and set the cache directory before opening the file?

Otherwise, if this still doesn’t work you could try out the test in roottest. You can get it from here:
svn co

Inside there is the following test: roottest/root/io/prefetching/runPrefetchReading.C
Try running this test with prefetching and caching enabled to the directory you want to use. You can run it by just doing make in the test directory.
Let me know if at least this works for you …