# How to add root files when the target root file is larger than 100 GB

**URL:** <https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932>\
**Category:** ROOT\
**Tags:** tree\
**Created:** [February 11, 2020, 2:11pm UTC](https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932 "2020-02-11T14:11:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arkasantra](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/arkasantra/32/37646_2.png) [@arkasantra](https://root-forum.cern.ch/u/arkasantra)\
**Post date:** [February 11, 2020, 2:11pm UTC](https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932/1 "2020-02-11T14:11:02Z")

</div>

Hello experts,  
I am trying to add many root files having the same tree name. I am simply using the “hadd” option to add all of them. When the target root file is less than 100 GB, I see no problem. But when the target root file is more than 100 GB, I see that the root is crashing. For example, this is one such crash message:

```auto
Fill: Switching to new file: ./user.jmaurer.ABp102_364250.Sherpa_222_NNPDF30NNLO_llll.e5894_s3126_r10724_p3990_output_merged_1.root
Fatal in <TFileMerger::RecursiveRemove>: Output file of the TFile Merger (targeting ./user.jmaurer.ABp102_364250.Sherpa_222_NNPDF30NNLO_llll.e5894_s3126_r10724_p3990_output_merged.root) has been deleted (likely due to a TTree larger than 100Gb)
aborting
#0 0x00007f1872e4941c in waitpid () from /lib64/libc.so.6
#1 0x00007f1872dc6f12 in do_system () from /lib64/libc.so.6
#2 0x00007f1873f5f64d in TUnixSystem::StackTrace() () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libCore.so
#3 0x00007f1873e377b9 in DefaultErrorHandler(int, bool, char const*, char const*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libCore.so
#4 0x00007f1873e3723a in ErrorHandler () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libCore.so
#5 0x00007f1873e4df91 in TObject::Fatal(char const*, char const*, ...) const () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libCore.so
#6 0x00007f1873ebc1fb in THashList::RecursiveRemove(TObject*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libCore.so
#7 0x00007f1873d87f33 in TROOT::RecursiveRemove(TObject*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libCore.so
#8 0x00007f1873e4c2fb in TNamed::~TNamed() () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libCore.so
#9 0x00007f1874663859 in TFile::~TFile() [clone .localalias.196] () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libRIO.so
#10 0x00007f187662260e in TTree::ChangeFile(TFile*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libTree.so
#11 0x00007f1876629540 in TTree::CopyEntries(TTree*, long long, char const*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libTree.so
#12 0x00007f1876628a40 in TTree::Merge(TCollection*, TFileMergeInfo*) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libTree.so
#13 0x00007f187464fd5b in TFileMerger::MergeRecursive(TDirectory*, TList*, int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libRIO.so
#14 0x00007f187464e970 in TFileMerger::PartialMerge(int) () from /cvmfs/sft.cern.ch/lcg/releases/LCG_95/ROOT/6.16.00/x86_64-slc6-gcc62-opt/lib/libRIO.so
#15 0x0000000000407a63 in main::{lambda(TFileMerger&, int, int)#2}::operator()(TFileMerger&, int, int) const [clone .constprop.171] ()
#16 0x0000000000405338 in main ()

```

What is the best practice to add root files when the target root file is so large in size? Is there a way to increase the max limit in hadd?

Cheers,  
Arka

\_ROOT Version: root 6.16.00  
\_Platform: Centos7  
\_Compiler: x86\_64-slc6-gcc62-opt

* * *

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [February 11, 2020, 3:25pm UTC](https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932/2 "2020-02-11T15:25:37Z")

</div>

Hello Arka,  
[TTree::SetMaxTreeSize](https://root.cern.ch/doc/master/classTTree.html#a3ab4006402ddbc3950e1ddab5e3aadd6) should help you with that. Take a look at [Root 6.04.14 hadd 100Gb and rootlogon](https://root-forum.cern.ch/t/root-6-04-14-hadd-100gb-and-rootlogon/24581/3) and [Hadd: 100Gb TTree Limit/compression levels](https://root-forum.cern.ch/t/hadd-100gb-ttree-limit-compression-levels/16519) for extra context and let me know if it helps.  
Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![arkasantra](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/arkasantra/32/37646_2.png) [@arkasantra](https://root-forum.cern.ch/u/arkasantra)\
**Post date:** [February 11, 2020, 4:00pm UTC](https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932/3 "2020-02-11T16:00:53Z")

</div>

Hi Vincenzo,  
I tried the solution mentioned by you in the first link,  
but I am getting this error [1] while using the command:

```auto
LD_PRELOAD=startup_C.so hadd output.root input_*

```

May I know what I am doing wrong here?  
Cheers,  
Arka

[1]

```auto
ERROR: ld.so: object 'startup_C.so' from LD_PRELOAD cannot be preloaded: ignored.

```

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [February 11, 2020, 8:06pm UTC](https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932/4 "2020-02-11T20:06:50Z")

</div>

For the record, this is reported as [Loading...](https://sft.its.cern.ch/jira/browse/ROOT-9851).

> but I am getting this error [1] while using the command:

You need to create the file startup.C and compile it and the result (startup\_C.so need to be in a directory listed in your LD\_LIBRARY\_PATH)

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [February 25, 2020, 8:20pm UTC](https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932/5 "2020-02-25T20:20:45Z")

</div>

Closed on February 25, 2020, 8:20pm UTC

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