# PROOF sub-merging bug?

**URL:** <https://root-forum.cern.ch/t/proof-sub-merging-bug/12292>\
**Category:** ROOT\
**Created:** [April 21, 2011, 11:35pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292 "2011-04-21T23:35:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [April 21, 2011, 11:35pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/1 "2011-04-21T23:35:13Z")

</div>

Hi Rooters (PROOFers?),

```
   Here at SLAC we have a small PROOF cluster (8 machines, 98 cores), and in limit of high numbers of histograms I have been dealing with semi-random worker crashes as well as crashes during a very slow merging process. On the theory that maybe the slow merging was part of the issue, Shuwei from BNL suggested trying sub-merging enabled. Sub-merging seems to work fine with histograms/objects in the top-level directory of the ROOT file, but as soon as I add a TDirectoryFile object to the output file (I am using TProofOutputFile for output) the merging with sub-merging on seg-faults with this type of error:

```

# =========================================================== #5 0x00002ab15eb6fa43 in TDirectoryFile::Get(char const\*) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libRIO.so #6 0x00002ab15eb6acf1 in TDirectoryFile::GetDirectory(char const\*, bool, char const\*) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libRIO.so #7 0x00002ab16053d8e4 in TFileMerger::MergeRecursive(TDirectory\*, TList\*) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libProofPlayer.so #8 0x00002ab16053e27f in TFileMerger::MergeRecursive(TDirectory\*, TList\*) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libProofPlayer.so #9 0x00002ab16053d042 in TFileMerger::Merge(bool) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libProofPlayer.so #10 0x00002ab160569fd8 in TProofPlayerRemote::MergeOutputFiles() () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libProofPlayer.so #11 0x00002ab16056f287 in TProofPlayerLite::Finalize(bool, bool) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libProofPlayer.so #12 0x00002ab160570195 in TProofPlayerLite::Process(TDSet\*, char const\*, char const\*, long long, long long) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libProofPlayer.so #13 0x00002ab15f6dc437 in TProofLite::Process(TDSet\*, char const\*, char const\*, long long, long long) () from /afs/slac.stanford.edu/g/atlas/packages/root/root\_v5.28.00a.Linux-slc5\_amd64-gcc4.3/lib/libProof.so

Am I doing something wrong, or is this a bug? We are using ROOT 5.28a.

Thanks,

Bart

---

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [April 21, 2011, 11:39pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/2 "2011-04-21T23:39:00Z")

</div>

I should probably note that the merging with TDirectoryFile objects works fine with sub-merging off, and it does not matter if the TDirectoryFile is empty or not, it always crashes.

---

<div class="post-metadata">

**Author:** ![ganis](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ganis/32/12484_2.png) [@ganis](https://root-forum.cern.ch/u/ganis)\
**Post date:** [April 23, 2011, 7:14am UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/3 "2011-04-23T07:14:09Z")

</div>

Hi,

No, it is not a known problem, but sub-merging is still somewhat experimental.  
Unfortunately I am not currently at work, but I will have a look as soon as I am  
back middle of next week.

G. Ganis

---

<div class="post-metadata">

**Author:** ![ganis](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ganis/32/12484_2.png) [@ganis](https://root-forum.cern.ch/u/ganis)\
**Post date:** [April 29, 2011, 4:26pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/4 "2011-04-29T16:26:57Z")

</div>

Hi,

Update:  
I think I managed to reproduce the problem, but I have not yet understood what goes wrong.  
I hope to have more news soon.

G. Ganis

---

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [April 29, 2011, 11:51pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/5 "2011-04-29T23:51:21Z")

</div>

Excellent, thanks for looking into this.

---

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [May 11, 2011, 12:12pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/6 "2011-05-11T12:12:11Z")

</div>

Hello,

Any updates on this?

-Bart

---

<div class="post-metadata">

**Author:** ![ganis](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ganis/32/12484_2.png) [@ganis](https://root-forum.cern.ch/u/ganis)\
**Post date:** [May 12, 2011, 10:34am UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/7 "2011-05-12T10:34:56Z")

</div>

Hi,

I am sorry for the delay, I had some other things to follow and could not work much on this last week.  
The solution is a bit tricky and has to do with the fact that for submergers we need a temporary set of intermediate files and this was not correctly handled (even when there was no crash).  
I think I am close to have the fix and I am confident to be able to commit it later this afternoon (CET).

G. Ganis

---

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [May 12, 2011, 3:43pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/8 "2011-05-12T15:43:45Z")

</div>

Awesome. Is there any potential to have a 5.28a patch for this or would we just have to use the trunk/wait for the next tag?

---

<div class="post-metadata">

**Author:** ![ganis](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ganis/32/12484_2.png) [@ganis](https://root-forum.cern.ch/u/ganis)\
**Post date:** [May 12, 2011, 4:41pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/9 "2011-05-12T16:41:39Z")

</div>

Hi,

I have just uploaded a fix into the trunk and 5-28-00-patches. I hope you will be able to try it.

> [@bbutler](#):
>
> Is there any potential to have a 5.28a patch for this or would we just have to use the trunk/wait for the next tag?

Since it is in 5-28-00-patches it will appear in the next tag on the branch, i.e. 5-28-00e, which will probably appear in the coming weeks. But we do not modify existing tags.

G. Ganis

---

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [May 12, 2011, 11:23pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/10 "2011-05-12T23:23:00Z")

</div>

Understood, that is great. Thanks a lot, and we will certainly try out the 5.28e.

---

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [July 15, 2011, 9:36pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/11 "2011-07-15T21:36:54Z")

</div>

The problem is certainly resolved for 5-30, thanks.

---

<div class="post-metadata">

**Author:** ![bbutler](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/a5b964/32.png) [@bbutler](https://root-forum.cern.ch/u/bbutler)\
**Post date:** [July 15, 2011, 9:53pm UTC](https://root-forum.cern.ch/t/proof-sub-merging-bug/12292/12 "2011-07-15T21:53:34Z")

</div>

Looking at the code, using the option “ML” for merging with sub-mergers, no check is performed to see if the files are already local, right? I’m thinking of situations with multiple worker cores sharing a disk array, in those cases one would want not to perform a useless local copy operation for an already local file, but still copy the partially-merged files to the master for final merging. Maybe such a check could be added?
